当前位置: 首页>>代码示例>>C++>>正文


C++ StringVector::push_back方法代码示例

本文整理汇总了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 &section)
{
    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;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:33,代码来源:AngelScriptInterpreter.cpp

示例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();
	
}
开发者ID:DarkKitarist,项目名称:Dark-World,代码行数:29,代码来源:darkMainSinglePlayer.cpp

示例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);
}
开发者ID:gabyx,项目名称:GRSFramework,代码行数:10,代码来源:SimulationState.cpp

示例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);
	
}
开发者ID:dtbinh,项目名称:AncelApp,代码行数:52,代码来源:AppFileExplorer.cpp

示例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);
}
开发者ID:andyhebear,项目名称:ogre-toon-shading,代码行数:54,代码来源:BaseApplication.cpp

示例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");
}
开发者ID:kyeah,项目名称:Game-Technology,代码行数:16,代码来源:RacquetApp.cpp

示例7: compileModule

//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::compileModule(std::string &section, 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;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:47,代码来源:AngelScriptInterpreter.cpp

示例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
}
开发者ID:litianqi,项目名称:ogre,代码行数:45,代码来源:OgreAdvancedRenderControls.cpp

示例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();

}
开发者ID:bshea5,项目名称:CS425_Physics_Repo,代码行数:45,代码来源:GameApplication.cpp

示例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);
    }
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:57,代码来源:OFSSceneSerializer.cpp

示例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
}
开发者ID:lhoyer,项目名称:Muehlespiel,代码行数:21,代码来源:game.cpp

示例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();
    }
开发者ID:EternalWind,项目名称:Ogitor-Facade,代码行数:14,代码来源:OgitorsScriptConsole.cpp

示例13: execString

//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::execString(std::string &section, 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;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:24,代码来源:AngelScriptInterpreter.cpp

示例14: addFunction

//----------------------------------------------------------------------------
Ogre::StringVector AngelScriptInterpreter::addFunction(std::string &section, 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;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:25,代码来源:AngelScriptInterpreter.cpp

示例15: buildString

Ogre::StringVector AngelScriptInterpreter::buildString(std::string &section, 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;
}
开发者ID:jacmoe,项目名称:ogitor,代码行数:17,代码来源:AngelScriptInterpreter.cpp


注:本文中的ogre::StringVector::push_back方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。