本文整理汇总了C++中ogre::StringVector::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ StringVector::push_back方法的具体用法?C++ StringVector::push_back怎么用?C++ StringVector::push_back使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::StringVector
的用法示例。
在下文中一共展示了StringVector::push_back方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: listFunctions
//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::listFunctions(std::string §ion)
{
Ogre::StringVector ret;
asUINT n;
// List the application registered functions
for( n = 0; n < (asUINT)mEngine->GetGlobalFunctionCount(); n++ )
{
asIScriptFunction *func = mEngine->GetGlobalFunctionByIndex(n);
// Skip the functions that start with _ as these are not meant to be called explicitly by the user
if( func->GetName()[0] != '_' )
ret.push_back(" " + std::string(func->GetDeclaration()));
}
ret.push_back("I am listing functions:");
// List the user functions in the module
asIScriptModule *mod = mEngine->GetModule(section.c_str());
if( mod )
{
ret.push_back("");
ret.push_back("User functions:");
for( n = 0; n < mod->GetFunctionCount(); n++ )
{
asIScriptFunction *func = mod->GetFunctionByIndex(n);
ret.push_back(func->GetDeclaration());
}
}
return ret;
}
示例2: buildGUI
void darkMainSinglePlayer::buildGUI()
{
Ogre::StringVector items2;
items2.push_back("Find the 3 chests.");
items2.push_back("Then the wall will dissapear");
items2.push_back("Finaly go home!");
m_pDetailsPanel2 = OgreFramework::getSingletonPtr()->m_pTrayMgr->createParamsPanel(OgreBites::TL_BOTTOMRIGHT, "DetailsPanel2", 300, items2);
m_pDetailsPanel2->show();
Ogre::StringVector items;
items.push_back("Objectives:");
items.push_back("1. First Chests Picked");
items.push_back("2. Second Chests Picked");
items.push_back("3. Third Chests Picked");
items.push_back("4. Gate Opened");
items.push_back("Distance");
items.push_back("First Chest");
items.push_back("Second Chest");
items.push_back("Third Chest");
items.push_back("Finish");
OgreFramework::getSingletonPtr()->m_pTrayMgr->createLabel(OgreBites::TL_BOTTOMRIGHT, "GameLevel1Lb12", "Objectives", 300);
m_pDetailsPanel = OgreFramework::getSingletonPtr()->m_pTrayMgr->createParamsPanel(OgreBites::TL_BOTTOMLEFT, "DetailsPanel", 300, items);
m_pDetailsPanel->show();
pickup = OgreFramework::getSingletonPtr()->m_pTrayMgr->createLabel(OgreBites::TL_CENTER, "Pickuplabel", "Pickup", 250);
pickup->hide();
}
示例3: setupActiveModeSelection
void SimulationState::setupActiveModeSelection()
{
Ogre::StringVector items;
items.push_back("Realtime");
items.push_back("Record");
m_pActiveModeSelectMenu = (m_pTrayMgr->createThickSelectMenu(
TL_TOPRIGHT, "ActiveModeSelectionSimulation", "Simulations Mode", 200, 3, items));
// Set active in Menu
m_pActiveModeSelectMenu->selectItem((int)m_eSimulationActiveMode);
}
示例4:
AppFileExplorer::AppFileExplorer(const std::string &initialPath,const std::string &filter,FileExplorerListerner *listener)
{
std::string name = "AppFileExplorer : " + Ogre::StringConverter::toString(AppFileExplorer::numExplorer);
mExplorerName = name;
AppFileExplorer::numExplorer++;
mTrayMgr = new OgreBites::SdkTrayManager(name,AppDemo::getSingletonPtr()->mRenderWnd,AppDemo::getSingletonPtr()->mMouse,this);
Ogre::StringVector sv;
sv.push_back("C:\\");
sv.push_back("D:\\");
sv.push_back("E:\\");
OgreBites::TrayLocation tLoc = OgreBites::TL_CENTER;
mTrayMgr->createSeparator(tLoc,name + "Line_Two",500);
mTrayMgr->createLabel(tLoc,name + "LB_Title","File Explorer",150);
mTrayMgr->createSeparator(tLoc,name + "Line_Four",600);
mTrayMgr->createLongSelectMenu(tLoc,name + "DiskMenu","Disk",450,3,sv);
mTrayMgr->createSeparator(tLoc,name + "Line_Five",600);
mTrayMgr->createLongSelectMenu(tLoc,name + "PathMenu","Path",450,10);
mTrayMgr->createButton(tLoc,name + "BT_ok","ok",100);
mTrayMgr->createButton(tLoc,name + "BT_cancel","cancel",100);
mTrayMgr->createSeparator(tLoc,name + "Line_Six",600);
mTrayMgr->hideAll();
mCurrentFilePath.resize(3);
if(initialPath[0] == 'C' || initialPath[0] == 'c')
mCurrentFilePath[0] = initialPath;
else
mCurrentFilePath[0] = "C:\\";
if(initialPath[0] == 'D' || initialPath[0] == 'd')
mCurrentFilePath[1] = initialPath;
else
mCurrentFilePath[1] = "D:\\";
if(initialPath[0] == 'E' || initialPath[0] == 'e')
mCurrentFilePath[2] = initialPath;
else
mCurrentFilePath[2] = "E:\\";
mInitialFilePath = initialPath;
mExplorerListener = listener;
mOldMouseListener = NULL;
mFilter = filter;
//updateItems(initialPath);
}
示例5: createFrameListener
//-------------------------------------------------------------------------------------
void BaseApplication::createFrameListener(void)
{
Ogre::LogManager::getSingletonPtr()->logMessage("*** Initializing OIS ***");
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
mWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
mInputManager = OIS::InputManager::createInputSystem( pl );
mKeyboard = static_cast<OIS::Keyboard*>(mInputManager->createInputObject( OIS::OISKeyboard, true ));
mMouse = static_cast<OIS::Mouse*>(mInputManager->createInputObject( OIS::OISMouse, true ));
mMouse->setEventCallback(this);
mKeyboard->setEventCallback(this);
//Set initial mouse clipping size
windowResized(mWindow);
//Register as a Window listener
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
mTrayMgr = new OgreBites::SdkTrayManager("InterfaceName", mWindow, mMouse, this);
mTrayMgr->showFrameStats(OgreBites::TL_BOTTOMLEFT);
mTrayMgr->showLogo(OgreBites::TL_BOTTOMRIGHT);
mTrayMgr->showCursor();
// create a params panel for displaying sample details
Ogre::StringVector items;
items.push_back("CAMERA POSITION");
items.push_back("X");
items.push_back("Y");
items.push_back("Z");
items.push_back("");
items.push_back("CAMERA ORIENTATION");
items.push_back("W");
items.push_back("X");
items.push_back("Y");
items.push_back("Z");
items.push_back("");
items.push_back("Filtering");
items.push_back("Poly Mode");
mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items);
mDetailsPanel->setParamValue(11, "Bilinear");
mDetailsPanel->setParamValue(12, "Solid");
mDetailsPanel->hide();
mRoot->addFrameListener(this);
}
示例6: createFrameListener
void RacquetApp::createFrameListener(void) {
BaseApplication::createFrameListener();
Ogre::StringVector items;
items.push_back("Highscore");
items.push_back("");
items.push_back("Last Score");
items.push_back("Current Score");
items.push_back("Gravity");
mDetailsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_NONE, "DetailsPanel", 200, items);
mDetailsPanel->setParamValue(DETAILS_HIGHSCORE, "0");
mDetailsPanel->setParamValue(DETAILS_LASTSCORE, "0");
mDetailsPanel->setParamValue(DETAILS_SCORE, "0");
mDetailsPanel->setParamValue(DETAILS_GRAVITY, "Downwards");
}
示例7: compileModule
//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::compileModule(std::string §ion, const char *source)
{
Ogre::StringVector ret;
int r = mBuilder->StartNewModule(mEngine, section.c_str());
if( r < 0 )
{
return ret;
}
r = mBuilder->AddSectionFromMemory(source, "memory");
if( r < 0 )
{
return ret;
}
int errpos;
{
OGRE_LOCK_AUTO_MUTEX;
errpos = mBuffer.size();
}
r = mBuilder->BuildModule();
if( r < 0 )
{
// An error occurred. Instruct the script writer to fix the
// compilation errors that were listed in the output stream.
ret.push_back("Please correct the errors in the script and try again.");
ret.push_back("Following errors found in script:");
OGRE_LOCK_AUTO_MUTEX;
for(unsigned int i = errpos;i < mBuffer.size();i++)
{
char buf[1000];
sprintf(buf,"Row: %d, Col: %d :: %s", mBuffer[i].mRow, mBuffer[i].mCol, mBuffer[i].mMessage.c_str());
ret.push_back(Ogre::String(buf));
}
return ret;
}
ret.push_back("Compilation successful!!");
return ret;
}
示例8: mCamera
AdvancedRenderControls::AdvancedRenderControls(TrayManager* trayMgr, Ogre::Camera* cam)
: mCamera(cam), mTrayMgr(trayMgr) {
mRoot = Ogre::Root::getSingletonPtr();
// create a params panel for displaying sample details
Ogre::StringVector items;
items.push_back("cam.pX");
items.push_back("cam.pY");
items.push_back("cam.pZ");
items.push_back("");
items.push_back("cam.oW");
items.push_back("cam.oX");
items.push_back("cam.oY");
items.push_back("cam.oZ");
items.push_back("");
items.push_back("Filtering");
items.push_back("Poly Mode");
#ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
mShaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
items.push_back("RT Shaders");
items.push_back("Lighting Model");
items.push_back("Compact Policy");
items.push_back("Generated VS");
items.push_back("Generated FS");
#endif
mDetailsPanel = mTrayMgr->createParamsPanel(TL_NONE, "DetailsPanel", 200, items);
mDetailsPanel->hide();
mDetailsPanel->setParamValue(9, "Bilinear");
mDetailsPanel->setParamValue(10, "Solid");
#ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
mDetailsPanel->setParamValue(11, "Off");
if (!mRoot->getRenderSystem()->getCapabilities()->hasCapability(Ogre::RSC_FIXED_FUNCTION)) {
mDetailsPanel->setParamValue(11, "On");
}
mDetailsPanel->setParamValue(12, "Vertex");
mDetailsPanel->setParamValue(13, "Low");
mDetailsPanel->setParamValue(14, "0");
mDetailsPanel->setParamValue(15, "0");
#endif
}
示例9: createGUI
void GameApplication::createGUI(void)
{
if (mTrayMgr == NULL) return;
using namespace OgreBites;
Button* b = mTrayMgr->createButton(TL_TOPRIGHT, "MyButton", "Last position", 120.0);
b->show();
//sliders to control velocities and speed
Slider* xVelocitySlider = mTrayMgr->createThickSlider(TL_BOTTOMRIGHT, "xVelocitySlider", "X Velocity", 250, 80, 0, 0, 0);
xVelocitySlider->setRange(-10,10,21);
xVelocitySlider->setValue(0);
mTrayMgr->sliderMoved(xVelocitySlider);
Slider* zVelocitySlider = mTrayMgr->createThickSlider(TL_BOTTOMRIGHT, "zVelocitySlider", "Z Velocity", 250, 80, 0, 0, 0);
zVelocitySlider->setRange(-20,0,21);
zVelocitySlider->setValue(-10);
mTrayMgr->sliderMoved(zVelocitySlider);
Slider* yVelocitySlider = mTrayMgr->createThickSlider(TL_BOTTOMRIGHT, "yVelocitySlider", "Y Velocity", 250, 80, 0, 0, 0);
yVelocitySlider->setRange(0,15,16);
yVelocitySlider->setValue(10);
mTrayMgr->sliderMoved(yVelocitySlider);
Slider* speedSlider= mTrayMgr->createThickSlider(TL_BOTTOMRIGHT, "speedSlider", "Speeeed", 250, 80, 0, 0, 0);
speedSlider->setRange(0,10,11);
speedSlider->setValue(5);
mTrayMgr->sliderMoved(speedSlider);
// Lecture 16: Setup parameter panel: Updated in addTime
Ogre::StringVector items;
items.push_back("V:");
mParamsPanel = mTrayMgr->createParamsPanel(OgreBites::TL_BOTTOMLEFT,"Trajectory Velocity",250,items);
mParamsPanel->setParamValue(0, Ogre::StringConverter::toString(Ogre::Vector3::ZERO));
// score panel with number of shots fired
items.clear();
items.push_back("Score");
items.push_back("Shots fired");
items.push_back("Targets remaining");
mScorePanel = mTrayMgr->createParamsPanel(OgreBites::TL_TOP, "Stats", 250, items);
//mTrayMgr->create
mTrayMgr->showAll();
}
示例10: compressStream
//-----------------------------------------------------------------------------
void Ogitors::COFSSceneSerializer::_upgradeOgsceneFileFrom3To4(TiXmlNode* ogsceneRootNode)
{
TiXmlElement* element = ogsceneRootNode->FirstChildElement();
OFS::OfsPtr& mFile = OgitorsRoot::getSingletonPtr()->GetProjectFile();
OgitorsSystem *mSystem = OgitorsSystem::getSingletonPtr();
OFS::FileList list;
mFile->listFilesRecursive("/", list);
Ogre::StringVector terFiles;
for( unsigned int i = 0;i < list.size(); i++ )
{
if(list[i].flags && OFS::OFS_FILE)
{
if(list[i].name.substr(list[i].name.size() - 4, 4) == ".ogt")
{
terFiles.push_back( list[i].name );
}
}
}
if( terFiles.size() > 0 )
{
Ogre::SceneManager *pUpgSM = Ogre::Root::getSingletonPtr()->createSceneManager("OctreeSceneManager", "UpgradeSCM");
for( unsigned int i = 0;i < terFiles.size(); i++ )
{
Ogre::String filenameorig = terFiles[i];
Ogre::String filenamebackup = filenameorig + ".backup";
mFile->renameFile( filenameorig.c_str(), filenamebackup.c_str() );
OFS::OFSHANDLE *filebackup = new OFS::OFSHANDLE();
OFS::OFSHANDLE *fileorig = new OFS::OFSHANDLE();
mFile->createFile(*fileorig, filenameorig.c_str());
mFile->openFile(*filebackup, filenamebackup.c_str(), OFS::OFS_READ);
{
OgreTerrainConverter conv;
Ogre::DataStreamPtr stream_in = Ogre::DataStreamPtr(OGRE_NEW OfsDataStream(mFile, filebackup));
Ogre::DataStreamPtr stream_out = Ogre::DataStreamPtr(OGRE_NEW OfsDataStream(mFile, fileorig));
Ogre::DataStreamPtr compressStream(OGRE_NEW Ogre::DeflateStream(filenameorig, stream_in));
Ogre::StreamSerialiser ser_in(compressStream);
Ogre::StreamSerialiser ser_out(stream_out);
conv.Upgrade( ser_in, ser_out );
}
}
Ogre::Root::getSingletonPtr()->destroySceneManager(pUpgSM);
}
}
示例11: createFrameListener
//-------------------------------------------------------------------------------------
void Game::createFrameListener()
{
BaseApplication::createFrameListener();
Ogre::StringVector items;
items.push_back("Spieler am Zug");
items.push_back("Spielstatus");
items.push_back("Info");
mDebugPanel = mTrayMgr->createParamsPanel(OgreBites::TL_TOPLEFT, "DebugPanel", 820, items);
mDebugPanel->setParamValue(0, "Spieler 1");
mInfo = "Willkommen zum Muehlespiel";
mDebugPanel->show();
#ifdef DEBUG_GENERAL
qDebug() << "--------Start move" << mMoveCount << "--------";
qDebug() << "Current player is White";
#endif
}
示例12: getOutput
// Retrieves the current output from the interpreter.
unsigned int OgitorsScriptConsole::getOutput(unsigned int start, Ogre::StringVector& list)
{
list.clear();
OGRE_LOCK_AUTO_MUTEX
for(unsigned int i = start;i < mOutput.size();i++)
{
list.push_back(mOutput[i]);
}
return mOutput.size();
}
示例13: execString
//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::execString(std::string §ion, std::string &arg)
{
Ogre::StringVector ret;
// Wrap the expression in with a call to _grab, which allow us to print the resulting value
std::string script = arg;//"_grab(" + arg + ")";
// TODO: Add a time out to the script, so that never ending scripts doesn't freeze the application
asIScriptContext *ctx = mEngine->CreateContext();
ctx->SetExceptionCallback(asFUNCTION(ExceptionCallback), this, asCALL_CDECL);
int r = ExecuteString(mEngine, script.c_str(), mEngine->GetModule(section.c_str()), ctx);
if( r < 0 )
{
ret.push_back("Invalid script statement.");
}
else if( r == asEXECUTION_EXCEPTION )
{
ret.push_back("A script exception was raised.");
}
return ret;
}
示例14: addFunction
//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::addFunction(std::string §ion, std::string &arg)
{
Ogre::StringVector ret;
asIScriptModule *mod = mEngine->GetModule(section.c_str(), asGM_CREATE_IF_NOT_EXISTS);
asIScriptFunction *func = 0;
int r = mod->CompileFunction("addfunc", arg.c_str(), 0, asCOMP_ADD_TO_MODULE, &func);
if( r < 0 )
{
// TODO: Add better description of error (invalid declaration, name conflict, etc)
ret.push_back("Failed to add function.");
}
else
{
ret.push_back("Function added.");
}
// We must release the function object
if( func )
func->Release();
return ret;
}
示例15: buildString
Ogre::StringVector AngelScriptInterpreter::buildString(std::string §ion, std::string &arg)
{
Ogre::StringVector ret;
mBuilder->StartNewModule(mEngine, section.c_str());
mBuilder->AddSectionFromMemory(arg.c_str(), section.c_str());
int r = mBuilder->BuildModule();
if( r < 0 )
{
// An error occurred. Instruct the script writer to fix the
// compilation errors that were listed in the output stream.
ret.push_back("Please correct the errors in the script and try again.");
return ret;
}
return ret;
}