Editor API
UnigineEditor public API
UnigineEditor::ViewportManager Class Reference

Viewport manager class. This class is used to create, manage, and remove all viewports in the Editor. More...

Static Public Member Functions

static Unigine::Ptr< ViewportWindowcreateViewportWindow (const char *name)
 Creates a new viewport window with the specified name. More...
 
static bool removeViewportWindow (const char *name)
 Removes the viewport window with the specified name. More...
 
static void getViewports (Unigine::Vector< Unigine::Ptr< ViewportWindow >> &viewports)
 Collects all existing viewport windows and puts them to the specified output vector. More...
 
static Unigine::Ptr< ViewportWindowgetViewportWindow (const char *name)
 Returns the viewport window with the specified name if it exists; otherwise nullptr. More...
 
static Unigine::Ptr< ViewportWindowgetLastHoveredViewportWindow ()
 Returns the last viewport window hovered by the mouse cursor. Can be used for implementation of Drag&Drop operations More...
 
static Unigine::Ptr< ViewportWindowgetActiveViewportWindow ()
 Returns the viewport window that is currently active. More...
 
static void setEnabledRectangleSelection (bool enable)
 Sets a value indicating if rectangular selection for viewport windows is enabled. More...
 
static bool isEnabledRectangleSelection ()
 Returns a value indicating if rectangular selection for viewport windows is enabled. More...
 
static void forceWireframeWarming ()
 Renders an effect of wireframe warming, a temporary wireframe fading in and out for the current selection (such effect can be seen when selecting a node or a group of nodes in the Editor). More...
 
static void placeNode (const Unigine::Ptr< Unigine::Node > &node)
 Activates placement mode for the specified node. The node is to be placed at the location within the viewport where the left mouse button is clicked. If the Esc key is pressed before clicking within the viewport the current node placement operation will be cancelled. This behavior can be observed in the Editor, when the user creates a node via the Create menu. This function will automatically create all necessary Undo Actions (for adding nodes to the world and for selecting them). More...
 
static void placeNodeList (const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &nodes)
 Activates placement mode for the specified nodes. The nodes are to be placed at the location within the viewport where the left mouse button is clicked. If the Esc key is pressed before clicking within the viewport the current node placement operation will be cancelled. This behavior can be observed in the Editor, when the user creates a node via the Create menu. This function will automatically create all necessary Undo Actions (for adding nodes to the world and for selecting them). More...
 
static bool isNodeTypeSelectable (Unigine::Node::TYPE node_type)
 Returns a value indicating if selection is enabled for the specified node type. More...
 

Detailed Description

Viewport manager class. This class is used to create, manage, and remove all viewports in the Editor.

Member Function Documentation

◆ createViewportWindow()

static Unigine::Ptr<ViewportWindow> UnigineEditor::ViewportManager::createViewportWindow ( const char *  name)
static

Creates a new viewport window with the specified name.

Parameters
nameTitle of the viewport window.
Returns
Created viewport.

◆ forceWireframeWarming()

static void UnigineEditor::ViewportManager::forceWireframeWarming ( )
static

Renders an effect of wireframe warming, a temporary wireframe fading in and out for the current selection (such effect can be seen when selecting a node or a group of nodes in the Editor).

◆ getActiveViewportWindow()

static Unigine::Ptr<ViewportWindow> UnigineEditor::ViewportManager::getActiveViewportWindow ( )
static

Returns the viewport window that is currently active.

◆ getLastHoveredViewportWindow()

static Unigine::Ptr<ViewportWindow> UnigineEditor::ViewportManager::getLastHoveredViewportWindow ( )
static

Returns the last viewport window hovered by the mouse cursor. Can be used for implementation of Drag&Drop operations

◆ getViewports()

static void UnigineEditor::ViewportManager::getViewports ( Unigine::Vector< Unigine::Ptr< ViewportWindow >> &  viewports)
static

Collects all existing viewport windows and puts them to the specified output vector.

Parameters
viewportsOutput vector to receive the list of viewport windows.

◆ getViewportWindow()

static Unigine::Ptr<ViewportWindow> UnigineEditor::ViewportManager::getViewportWindow ( const char *  name)
static

Returns the viewport window with the specified name if it exists; otherwise nullptr.

Parameters
nameName of the viewport window.

◆ isEnabledRectangleSelection()

static bool UnigineEditor::ViewportManager::isEnabledRectangleSelection ( )
static

Returns a value indicating if rectangular selection for viewport windows is enabled.

Returns
true if rectangular selection for viewport windows is enabled; otherwise, false.

◆ isNodeTypeSelectable()

static bool UnigineEditor::ViewportManager::isNodeTypeSelectable ( Unigine::Node::TYPE  node_type)
static

Returns a value indicating if selection is enabled for the specified node type.

Returns
true if selection for specified node type is enabled; otherwise, false.

◆ placeNode()

static void UnigineEditor::ViewportManager::placeNode ( const Unigine::Ptr< Unigine::Node > &  node)
static

Activates placement mode for the specified node. The node is to be placed at the location within the viewport where the left mouse button is clicked. If the Esc key is pressed before clicking within the viewport the current node placement operation will be cancelled. This behavior can be observed in the Editor, when the user creates a node via the Create menu. This function will automatically create all necessary Undo Actions (for adding nodes to the world and for selecting them).

Parameters
nodeThe node to be placed at the point within the viewport clicked by the user.

◆ placeNodeList()

static void UnigineEditor::ViewportManager::placeNodeList ( const Unigine::Vector< Unigine::Ptr< Unigine::Node >> &  nodes)
static

Activates placement mode for the specified nodes. The nodes are to be placed at the location within the viewport where the left mouse button is clicked. If the Esc key is pressed before clicking within the viewport the current node placement operation will be cancelled. This behavior can be observed in the Editor, when the user creates a node via the Create menu. This function will automatically create all necessary Undo Actions (for adding nodes to the world and for selecting them).

Parameters
nodesVector containing nodes to be placed at the point within the viewport clicked by the user.

◆ removeViewportWindow()

static bool UnigineEditor::ViewportManager::removeViewportWindow ( const char *  name)
static

Removes the viewport window with the specified name.

Parameters
nameName of the viewport window to be removed.
Returns
true if the viewport window with the specified name was successfully removed; otherwise, false.

◆ setEnabledRectangleSelection()

static void UnigineEditor::ViewportManager::setEnabledRectangleSelection ( bool  enable)
static

Sets a value indicating if rectangular selection for viewport windows is enabled.

Parameters
enabletrue to enable rectangular selection for viewport windows; false - to disable it.