void CommandRemoveSceneNode::Execute()
{
	SceneData* activeScene = SceneDataManager::Instance()->SceneGetActive();
	Entity *node = activeScene->GetSelectedNode();

	CommandsManager::Instance()->ExecuteAndRelease(new CommandInternalRemoveSceneNode(node, false));
}
CommandRemoveSceneNode::CommandRemoveSceneNode()
:   MultiCommand(Command::COMMAND_UNDO_REDO, CommandList::ID_COMMAND_REMOVE_SCENE_NODE)
{
	commandName = "Remove Object";

	SceneData* activeScene = SceneDataManager::Instance()->SceneGetActive();
	Entity *node = activeScene->GetSelectedNode();

	removeCmd = new CommandInternalRemoveSceneNode(node, false);
}
CommandRemoveRootNodes::CommandRemoveRootNodes()
    :   MultiCommand(Command::COMMAND_UNDO_REDO, CommandList::ID_COMMAND_REMOVE_ROOT_NODES)
	,	removeCmd(0)
{
	commandName = "Remove Root Nodes";

	SceneData* activeScene = SceneDataManager::Instance()->SceneGetActive();
	Entity *node = activeScene->GetSelectedNode();

	removeCmd = new CommandInternalRemoveSceneNode(node, true);
}
void CommandLockAtObject::Execute()
{
    SceneData * activeScene = SceneDataManager::Instance()->SceneGetActive();
    Entity *node = activeScene->GetSelectedNode();
    if(node)
    {
        activeScene->LockAtSelectedNode();
    }
    else
    {
        SetState(STATE_INVALID);
    }
}
void CommandDebugFlags::Execute()
{
    SceneData * activeScene = SceneDataManager::Instance()->SceneGetActive();
    Entity *node = activeScene->GetSelectedNode();
    if(node)
    {
        if ((node->GetDebugFlags() & DebugRenderComponent::DEBUG_DRAW_ALL) == DebugRenderComponent::DEBUG_DRAW_ALL)
        {
            node->SetDebugFlags(0, true);
            if(activeScene->GetSelectedNode() == node)
            {
                node->SetDebugFlags(DebugRenderComponent::DEBUG_DRAW_AABOX_CORNERS);
            }
        }
        else
        {
            node->SetDebugFlags(DebugRenderComponent::DEBUG_DRAW_ALL, true);
        }
    }
    else
    {
        SetState(STATE_INVALID);
    }
}
Exemplo n.º 6
0
void GraphBase::NodesPropertyChanged(const String &forKey)
{
	SceneData *activeScene = SceneDataManager::Instance()->SceneGetActive();

	// For some properties rebuilding of selected node only is enough. For other ones,
	// the whole Scene Graph refresh is needed.
	if (IsRebuildSelectedNodeEnough(forKey))
	{
		Entity* selectedNode = activeScene->GetSelectedNode();
		activeScene->RebuildSceneGraphNode(selectedNode);
	}
	else
	{
		activeScene->RebuildSceneGraph();
	}
}