本文整理汇总了C++中GlobalSceneGraph函数的典型用法代码示例。如果您正苦于以下问题:C++ GlobalSceneGraph函数的具体用法?C++ GlobalSceneGraph怎么用?C++ GlobalSceneGraph使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GlobalSceneGraph函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: test
void 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,代码来源:Manipulators.cpp
示例17: ReloadSkins
void 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,代码来源:entity.cpp
示例18: Scene_copyClosestFaceTexture
void 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,代码来源:brushmanip.cpp
示例19: Scene_applyClosestFaceTexture
void 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,代码来源:brushmanip.cpp
示例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,代码来源:DEntity.cpp
注:本文中的GlobalSceneGraph函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论