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


C++ GlobalSceneGraph函数代码示例

本文整理汇总了C++中GlobalSceneGraph函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalSceneGraph函数的具体用法?C++ GlobalSceneGraph怎么用?C++ GlobalSceneGraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GlobalSceneGraph函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Node_getMapFile

void 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,代码来源:Map.cpp

示例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,代码来源:UndoSystem.cpp

示例3: Node_traverseSubgraph

void 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,代码来源:RadiantSelectionSystem.cpp

示例4: Select_SetShader

void 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,代码来源:select.cpp

示例5: GlobalEntityClassManager

// Add a new conversations entity button
void 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,代码来源:ConversationDialog.cpp

示例6: GlobalSceneGraph

// Deselect or select all the component instances in the scenegraph and notify the manipulator class as well
void 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,代码来源:RadiantSelectionSystem.cpp

示例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,代码来源:TextureOverviewDialog.cpp

示例8: Selection_SnapToGrid

void 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,代码来源:commands.cpp

示例9: getFormat

void 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,代码来源:Map.cpp

示例10: vertexSelector

// Deselect or select all the component instances in the scenegraph and notify the manipulator class as well
void 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,代码来源:RadiantSelectionSystem.cpp

示例11: rMessage

void 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,代码来源:RadiantSelectionSystem.cpp

示例12: walker

// Deselect or select all the instances in the scenegraph and notify the manipulator class as well
void RadiantSelectionSystem::setSelectedAll(bool selected)
{
    SelectAllWalker walker(selected);
    Node_traverseSubgraph(GlobalSceneGraph().root(), walker);

    _manipulator->setSelected(selected);
}
开发者ID:DerSaidin,项目名称:DarkRadiant,代码行数:8,代码来源:RadiantSelectionSystem.cpp

示例13: populator

void 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,代码来源:GraphTreeModel.cpp

示例14: strcmp

void 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,代码来源:DEntity.cpp

示例15: Entity_ungroupSelected

void 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,代码来源:entity.cpp


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