这篇教程C++ GlobalSceneGraph函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GlobalSceneGraph函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalSceneGraph函数的具体用法?C++ GlobalSceneGraph怎么用?C++ GlobalSceneGraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GlobalSceneGraph函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: Node_getMapFilevoid Map::onResourceRealise() { if (m_resource == NULL) { return; } if (isUnnamed() || !m_resource->load()) { // Map is unnamed or load failed, reset map resource node to empty m_resource->setNode(NewMapRoot("")); MapFilePtr map = Node_getMapFile(m_resource->getNode()); if (map != NULL) { map->save(); } // Rename the map to "unnamed" in any case to avoid overwriting the failed map setMapName(_(MAP_UNNAMED_STRING)); } // Take the new node and insert it as map root GlobalSceneGraph().setRoot(m_resource->getNode()); // Associate the Scenegaph with the global RenderSystem // This usually takes a while since all editor textures are loaded - display a dialog to inform the user { ui::ScreenUpdateBlocker blocker(_("Processing..."), _("Loading textures..."), true); // force display GlobalSceneGraph().root()->setRenderSystem(boost::dynamic_pointer_cast<RenderSystem>( module::GlobalModuleRegistry().getModule(MODULE_RENDERSYSTEM))); } AutoSaver().clearChanges(); setValid(true);}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:34,
示例2: redo void redo() { if (_redoStack.empty()) { rMessage() << "Redo: no redo available" << std::endl; } else { Operation* operation = _redoStack.back(); rMessage() << "Redo: " << operation->_command << std::endl; startUndo(); trackersRedo(); operation->_snapshot.restore(); finishUndo(operation->_command); _redoStack.pop_back(); for (Observers::iterator i = _observers.begin(); i != _observers.end(); /* in-loop */) { Observer* observer = *(i++); observer->postRedo(); } // Trigger the onPostUndo event on all scene nodes PostRedoWalker walker; GlobalSceneGraph().root()->traverse(walker); GlobalSceneGraph().sceneChanged(); } }
开发者ID:stiffsen,项目名称:DarkRadiant,代码行数:26,
示例3: Node_traverseSubgraphvoid RadiantSelectionSystem::cancelMove() { // Unselect any currently selected manipulators to be sure _manipulator->setSelected(false); // Tell all the scene objects to revert their transformations RevertTransformForSelected walker; Node_traverseSubgraph(GlobalSceneGraph().root(), walker); _pivotMoving = false; pivotChanged(); // greebo: Deselect all faces if we are in brush and drag mode if (Mode() == ePrimitive && ManipulatorMode() == eDrag) { SelectAllComponentWalker faceSelector(false, SelectionSystem::eFace); Node_traverseSubgraph(GlobalSceneGraph().root(), faceSelector); } if (_undoBegun) { // Cancel the undo operation, if one has been begun GlobalUndoSystem().cancel(); _undoBegun = false; } // Update the views SceneChangeNotify();}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:28,
示例4: Select_SetShadervoid Select_SetShader (const std::string& shader){ if (GlobalSelectionSystem().Mode() != SelectionSystem::eComponent) { Scene_BrushSetShader_Selected(GlobalSceneGraph(), shader); } Scene_BrushSetShader_Component_Selected(GlobalSceneGraph(), shader);}
开发者ID:chrisglass,项目名称:ufoai,代码行数:7,
示例5: GlobalEntityClassManager// Add a new conversations entity buttonvoid ConversationDialog::onAddEntity(){ // Obtain the entity class object IEntityClassPtr eclass = GlobalEntityClassManager().findClass(CONVERSATION_ENTITY_CLASS); if (eclass) { // Construct a Node of this entity type IEntityNodePtr node(GlobalEntityCreator().createEntity(eclass)); // Create a random offset node->getEntity().setKeyValue( "origin", RandomOrigin::generate(128) ); // Insert the node into the scene graph assert(GlobalSceneGraph().root()); GlobalSceneGraph().root()->addChildNode(node); // Refresh the widgets populateWidgets(); } else { // conversation entityclass was not found gtkutil::MessageBox::ShowError( (boost::format(_("Unable to create conversation Entity: class '%s' not found.")) % CONVERSATION_ENTITY_CLASS).str(), GlobalMainFrame().getTopLevelWindow() ); }}
开发者ID:OpenTechEngine,项目名称:DarkRadiant,代码行数:34,
示例6: GlobalSceneGraph// Deselect or select all the component instances in the scenegraph and notify the manipulator class as wellvoid RadiantSelectionSystem::setSelectedAllComponents(bool selected) { // Select all components in the scene, be it vertices, edges or faces GlobalSceneGraph().traverse(SelectAllComponentWalker(selected, SelectionSystem::eVertex)); GlobalSceneGraph().traverse(SelectAllComponentWalker(selected, SelectionSystem::eEdge)); GlobalSceneGraph().traverse(SelectAllComponentWalker(selected, SelectionSystem::eFace)); _manipulator->setSelected(selected);}
开发者ID:AresAndy,项目名称:ufoai,代码行数:9,
示例7: GlobalSelectionSystem void TextureOverviewDialog::onSelectionChanged (GtkWidget* widget, TextureOverviewDialog* self) { self->_selectedTexture = gtkutil::TreeModel::getSelectedString(self->_selection, TEXTUREOVERVIEW_NAME); GlobalSelectionSystem().setSelectedAllComponents(false); GlobalSelectionSystem().setSelectedAll(false); if (GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) { Scene_BrushSelectByShader_Component(GlobalSceneGraph(), self->_selectedTexture); } else { Scene_BrushSelectByShader(GlobalSceneGraph(), self->_selectedTexture); } }
开发者ID:AresAndy,项目名称:ufoai,代码行数:11,
示例8: Selection_SnapToGridvoid Selection_SnapToGrid (void){ StringOutputStream command; command << "snapSelected -grid " << GlobalGrid().getGridSize(); UndoableCommand undo(command.toString()); if (GlobalSelectionSystem().Mode() == SelectionSystem::eComponent) { GlobalSceneGraph().traverse(ComponentSnappableSnapToGridSelected(GlobalGrid().getGridSize())); } else { GlobalSceneGraph().traverse(SnappableSnapToGridSelected(GlobalGrid().getGridSize())); }}
开发者ID:ptitSeb,项目名称:UFO--AI-OpenPandora,代码行数:12,
示例9: getFormatvoid Map::exportSelected(std::ostream& out){ MapFormatPtr format = getFormat(); IMapWriterPtr writer = format->getMapWriter(); // Create our main MapExporter walker for traversal MapExporter exporter(*writer, GlobalSceneGraph().root(), out); // Pass the traverseSelected function and start writing selected nodes exporter.exportMap(GlobalSceneGraph().root(), traverseSelected);}
开发者ID:Zbyl,项目名称:DarkRadiant,代码行数:12,
示例10: vertexSelector// Deselect or select all the component instances in the scenegraph and notify the manipulator class as wellvoid RadiantSelectionSystem::setSelectedAllComponents(bool selected) { // Select all components in the scene, be it vertices, edges or faces SelectAllComponentWalker vertexSelector(selected, SelectionSystem::eVertex); Node_traverseSubgraph(GlobalSceneGraph().root(), vertexSelector); SelectAllComponentWalker edgeSelector(selected, SelectionSystem::eEdge); Node_traverseSubgraph(GlobalSceneGraph().root(), edgeSelector); SelectAllComponentWalker faceSelector(selected, SelectionSystem::eFace); Node_traverseSubgraph(GlobalSceneGraph().root(), faceSelector); _manipulator->setSelected(selected);}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:14,
示例11: rMessagevoid RadiantSelectionSystem::initialiseModule(const ApplicationContext& ctx) { rMessage() << "RadiantSelectionSystem::initialiseModule called./n"; constructStatic(); SetManipulatorMode(eTranslate); pivotChanged(); _sigSelectionChanged.connect( sigc::mem_fun(this, &RadiantSelectionSystem::pivotChangedSelection) ); GlobalGrid().signal_gridChanged().connect( sigc::mem_fun(this, &RadiantSelectionSystem::pivotChanged) ); GlobalRegistry().signalForKey(RKEY_ROTATION_PIVOT).connect( sigc::mem_fun(this, &RadiantSelectionSystem::keyChanged) ); // Pass a reference to self to the global event manager GlobalEventManager().connectSelectionSystem(this); // Connect the bounds changed caller GlobalSceneGraph().signal_boundsChanged().connect( sigc::mem_fun(this, &RadiantSelectionSystem::onSceneBoundsChanged) ); GlobalRenderSystem().attachRenderable(*this);}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:31,
示例12: walker// Deselect or select all the instances in the scenegraph and notify the manipulator class as wellvoid RadiantSelectionSystem::setSelectedAll(bool selected){ SelectAllWalker walker(selected); Node_traverseSubgraph(GlobalSceneGraph().root(), walker); _manipulator->setSelected(selected);}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,
示例13: populatorvoid GraphTreeModel::refresh(){ // Instantiate a scenegraph walker and visit every node in the graph // The walker also clears the graph in its constructor GraphTreeModelPopulator populator(*this, _visibleNodesOnly); Node_traverseSubgraph(GlobalSceneGraph().root(), populator);}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:7,
示例14: strcmpvoid DEntity::BuildInRadiant( bool allowDestruction ){ bool makeEntity = strcmp( m_Classname, "worldspawn" ) ? true : false; if ( makeEntity ) { NodeSmartReference node( GlobalEntityCreator().createEntity( GlobalEntityClassManager().findOrInsert( m_Classname.GetBuffer(), !brushList.empty() || !patchList.empty() ) ) ); for ( std::list<DEPair* >::const_iterator buildEPair = epairList.begin(); buildEPair != epairList.end(); buildEPair++ ) { Node_getEntity( node )->setKeyValue( ( *buildEPair )->key, ( *buildEPair )->value ); } Node_getTraversable( GlobalSceneGraph().root() )->insert( node ); for ( std::list<DBrush *>::const_iterator buildBrush = brushList.begin(); buildBrush != brushList.end(); buildBrush++ ) ( *buildBrush )->BuildInRadiant( allowDestruction, NULL, node.get_pointer() ); for ( std::list<DPatch *>::const_iterator buildPatch = patchList.begin(); buildPatch != patchList.end(); buildPatch++ ) ( *buildPatch )->BuildInRadiant( node.get_pointer() ); QER_Entity = node.get_pointer(); } else { for ( std::list<DBrush *>::const_iterator buildBrush = brushList.begin(); buildBrush != brushList.end(); buildBrush++ ) ( *buildBrush )->BuildInRadiant( allowDestruction, NULL ); for ( std::list<DPatch *>::const_iterator buildPatch = patchList.begin(); buildPatch != patchList.end(); buildPatch++ ) ( *buildPatch )->BuildInRadiant(); }}
开发者ID:xonotic,项目名称:netradient,代码行数:30,
示例15: Entity_ungroupSelectedvoid Entity_ungroupSelected(){ if ( GlobalSelectionSystem().countSelected() < 1 ) { return; } UndoableCommand undo( "ungroupSelectedEntities" ); scene::Path world_path( makeReference( GlobalSceneGraph().root() ) ); world_path.push( makeReference( Map_FindOrInsertWorldspawn( g_map ) ) ); scene::Instance &instance = GlobalSelectionSystem().ultimateSelected(); scene::Path path = instance.path(); if ( !Node_isEntity( path.top() ) ) { path.pop(); } if ( Node_getEntity( path.top() ) != 0 && node_is_group( path.top() ) ) { if ( world_path.top().get_pointer() != path.top().get_pointer() ) { parentBrushes( path.top(), world_path.top() ); Path_deleteTop( path ); } }}
开发者ID:xonotic,项目名称:netradient,代码行数:25,
示例16: testvoid DragManipulator::testSelect(const View& view, const Matrix4& pivot2world) { SelectionPool selector; SelectionVolume test(view); if (GlobalSelectionSystem().Mode() == SelectionSystem::ePrimitive) { BooleanSelector booleanSelector; Scene_TestSelect_Primitive(booleanSelector, test, view); if (booleanSelector.isSelected()) { selector.addSelectable(SelectionIntersection(0, 0), &_dragSelectable); _selected = false; } else { _selected = Scene_forEachPlaneSelectable_selectPlanes(GlobalSceneGraph(), selector, test); } } // Check for entities that can be selected else if (GlobalSelectionSystem().Mode() == SelectionSystem::eEntity) { // Create a boolean selection pool (can have exactly one selectable or none) BooleanSelector booleanSelector; // Find the visible entities Scene_forEachVisible(GlobalSceneGraph(), view, testselect_entity_visible(booleanSelector, test)); // Check, if an entity could be found if (booleanSelector.isSelected()) { selector.addSelectable(SelectionIntersection(0, 0), &_dragSelectable); _selected = false; } } else { BestSelector bestSelector; Scene_TestSelect_Component_Selected(bestSelector, test, view, GlobalSelectionSystem().ComponentMode()); for (std::list<Selectable*>::iterator i = bestSelector.best().begin(); i != bestSelector.best().end(); ++i) { if (!(*i)->isSelected()) { GlobalSelectionSystem().setSelectedAllComponents(false); } _selected = false; selector.addSelectable(SelectionIntersection(0, 0), (*i)); _dragSelectable.setSelected(true); } } for (SelectionPool::iterator i = selector.begin(); i != selector.end(); ++i) { (*i).second->setSelected(true); }}
开发者ID:AresAndy,项目名称:ufoai,代码行数:47,
示例17: ReloadSkinsvoid ReloadSkins(const cmd::ArgumentList& args) { GlobalModelSkinCache().refresh(); RefreshSkinWalker walker; Node_traverseSubgraph(GlobalSceneGraph().root(), walker); // Refresh the ModelSelector too ui::ModelSelector::refresh();}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,
示例18: Scene_copyClosestFaceTexturevoid Scene_copyClosestFaceTexture(SelectionTest& test){ CopiedString shader; if(Scene_BrushGetClosestFaceTexture(GlobalSceneGraph(), test, shader, g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags)) { TextureBrowser_SetSelectedShader(g_TextureBrowser, shader.c_str()); }}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:8,
示例19: Scene_applyClosestFaceTexturevoid Scene_applyClosestFaceTexture(SelectionTest& test){ UndoableCommand command("facePaintTexture"); Scene_BrushSetClosestFaceTexture(GlobalSceneGraph(), test, TextureBrowser_GetSelectedShader(g_TextureBrowser), g_faceTextureClipboard.m_projection, g_faceTextureClipboard.m_flags); SceneChangeNotify();}
开发者ID:ChunHungLiu,项目名称:GtkRadiant,代码行数:8,
示例20: pre bool pre( scene::Node& node ) const { scene::Path path( NodeReference( GlobalSceneGraph().root() ) ); path.push( NodeReference( *m_entity->QER_Entity ) ); path.push( NodeReference( node ) ); scene::Instance* instance = GlobalSceneGraph().find( path ); ASSERT_MESSAGE( instance != 0, "" ); if ( Node_isPatch( node ) ) { DPatch* loadPatch = m_entity->NewPatch(); loadPatch->LoadFromPatch( *instance ); } else if ( Node_isBrush( node ) ) { DBrush* loadBrush = m_entity->NewBrush( m_count++ ); loadBrush->LoadFromBrush( *instance, true ); } return false; }
开发者ID:xonotic,项目名称:netradient,代码行数:17,
示例21: replacervoid FixupMap::replaceShader(const std::string& oldShader, const std::string& newShader){ // Instantiate a walker ShaderReplacer replacer(oldShader, newShader); GlobalSceneGraph().root()->traverse(replacer); _result.replacedShaders += replacer.getReplaceCount();}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,
示例22: GlobalSceneGraph// Delete the entity's world nodevoid ObjectiveEntity::deleteWorldNode() { // Try to convert the weak_ptr reference to a shared_ptr scene::INodePtr node = _entityNode.lock(); if (node != NULL) { GlobalSceneGraph().root()->removeChildNode(node); }}
开发者ID:nbohr1more,项目名称:DarkRadiant,代码行数:9,
示例23: installRenderervoid SpacePartitionRenderer::installRenderer(){ _renderableSP.setSpacePartition(GlobalSceneGraph().getSpacePartition()); _renderableSP.setRenderSystem(boost::dynamic_pointer_cast<RenderSystem>( module::GlobalModuleRegistry().getModule(MODULE_RENDERSYSTEM))); GlobalRenderSystem().attachRenderable(_renderableSP);}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,
示例24: updateSensitivityvoid OverlayDialog::toggleUseImage(){ registry::setValue(RKEY_OVERLAY_VISIBLE, _useImageBtn->get_active()); updateSensitivity(); // Refresh GlobalSceneGraph().sceneChanged();}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,
示例25: GlobalSceneGraphvoid DifficultySettingsManager::saveSettings(){ // Locates all difficulty entities DifficultyEntityFinder finder; GlobalSceneGraph().root()->traverse(finder); // Copy the list from the finder to a local list DifficultyEntityFinder::EntityList entities = finder.getEntities(); if (entities.empty()) { // Create a new difficulty entity std::string eclassName = game::current::getValue<std::string>(GKEY_DIFFICULTY_ENTITYDEF_MAP); IEntityClassPtr diffEclass = GlobalEntityClassManager().findClass(eclassName); if (diffEclass == NULL) { rError() << "[Diff]: Cannot create difficulty entity!/n"; return; } // Create and insert a new entity node into the scenegraph root IEntityNodePtr entNode = GlobalEntityCreator().createEntity(diffEclass); GlobalSceneGraph().root()->addChildNode(entNode); // Add the entity to the list entities.push_back(&entNode->getEntity()); } // Clear all difficulty-spawnargs from existing entities for (DifficultyEntityFinder::EntityList::const_iterator i = entities.begin(); i != entities.end(); i++) { // Construct a difficulty entity using the raw Entity* pointer DifficultyEntity diffEnt(*i); // Clear the difficulty-related spawnargs from the entity diffEnt.clear(); } // Take the first entity DifficultyEntity diffEnt(*entities.begin()); // Cycle through all settings objects and issue save call for (std::size_t i = 0; i < _settings.size(); i++) { _settings[i]->saveToEntity(diffEnt); }}
开发者ID:BielBdeLuna,项目名称:DarkRadiant,代码行数:46,
注:本文中的GlobalSceneGraph函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GlobalSelectionSystem函数代码示例 C++ GlobalRegistry函数代码示例 |