本文整理汇总了C++中SelectionList::push_back方法的典型用法代码示例。如果您正苦于以下问题:C++ SelectionList::push_back方法的具体用法?C++ SelectionList::push_back怎么用?C++ SelectionList::push_back使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SelectionList
的用法示例。
在下文中一共展示了SelectionList::push_back方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnSelectionChanged
void WorkspacePanel::OnSelectionChanged(wxTreeEvent& event)
{
SelectionList list;
wxTreeItemId id = event.GetItem();
if(isProject(id)) list.push_back(getProject(id));
else if(isMaterial(id)) list.push_back(getMaterial(id));
else if(isTechnique(id)) list.push_back(getTechnique(id));
else if(isPass(id)) list.push_back(getPass(id));
// else its the workspace so just leave the list empty as if nothing were selected
SelectionService::getSingletonPtr()->setSelection(list);
}
示例2:
SelectionList
TrajectoryAnalysisModuleData::parallelSelections(const SelectionList &selections)
{
// TODO: Consider an implementation that does not allocate memory every time.
SelectionList newSelections;
newSelections.reserve(selections.size());
SelectionList::const_iterator i = selections.begin();
for (; i != selections.end(); ++i)
{
newSelections.push_back(parallelSelection(*i));
}
return newSelections;
}
示例3: main
int main(int argc,char** argv)
{
osgViewer::Viewer viewer;
osg::Camera* camera = createMasterCamera( 50, 50, 640, 480 );
viewer.setCamera(camera);
viewer.addEventHandler(new PickNode);
osg::ref_ptr<osg::Group> root = new osg::Group;
viewer.setSceneData(root.get());
osgDragger::ShowBound::Instence()->setNodeMask(~0x1);
root->addChild(osgDragger::ShowBound::Instence()->getRoot());
osg::ref_ptr<osg::MatrixTransform> scene = new osg::MatrixTransform;
root->addChild(scene.get());
scene->setNodeMask(0x1);
osg::ref_ptr<osg::Camera> hudCamera = 0;
osg::ref_ptr<osgDragger::HudCamera> _hudCamera;
osgViewer::Viewer::Windows windows;
viewer.getWindows(windows);
if (windows.size() != 0)
{
hudCamera = createHUD(windows[0]);
hudCamera->addChild(CustomDraggerManager::Instence()->getRoot());
viewer.addSlave(hudCamera.get(), false);
_hudCamera = new osgDragger::HudCamera(hudCamera.get(), 60, 60);//左下角坐标系
}
else
{
CustomDraggerManager::Instence()->getRoot()->getOrCreateStateSet()->setAttributeAndModes(new osgDragger::ClearDepth);
CustomDraggerManager::Instence()->getRoot()->getOrCreateStateSet()->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
CustomDraggerManager::Instence()->getRoot()->getOrCreateStateSet()->setMode(GL_NORMALIZE, osg::StateAttribute::ON);
root->addChild(CustomDraggerManager::Instence()->getRoot());
_hudCamera = new osgDragger::HudCamera(camera, 60, 60);//左下角坐标系
}
osgDragger::MoveDragger* move = new osgDragger::MoveDragger;
move->setName("move");
move->setIntersectionMask(0x2);
move->setIntersectionCamera(hudCamera.get());
move->setupDefaultGeometry();
move->setHandleEvents(true);
CustomDraggerManager::Instence()->addDragger(move, true);
CustomDraggerManager::Instence()->setIntersectionMask(0x2);
osgDragger::RotateDragger* rotate = new osgDragger::RotateDragger;
rotate->setName("rotate");
rotate->setIntersectionMask(0x2);
rotate->setIntersectionCamera(hudCamera.get());
rotate->setupDefaultGeometry();
rotate->setHandleEvents(true);
CustomDraggerManager::Instence()->addDragger(rotate, false);
CustomDraggerManager::Instence()->setIntersectionMask(0x2);
osg::ref_ptr<osg::Geode> geode = new osg::Geode;
geode->addDrawable(new osg::ShapeDrawable(new osg::Box(osg::Vec3(), 5.0f)));
SelectionList sl;
{
osg::ref_ptr<osg::MatrixTransform> mt = new osg::MatrixTransform;
mt->setName("mt");
mt->addChild(geode.get());
sl.push_back(mt.get());
scene->addChild(mt.get());
}
{
osg::ref_ptr<osg::MatrixTransform> mt = new osg::MatrixTransform;
mt->setName("mt");
mt->setMatrix(osg::Matrix::translate(osg::Vec3(20,0,0)));
mt->addChild(geode.get());
scene->addChild(mt.get());
}
CustomDraggerManager::Instence()->setSelections(sl);
viewer.setCameraManipulator(new osgGA::TrackballManipulator);
while (!viewer.done())
{
viewer.frame();
}
return 0;
}