SCENE C++ API  2.0.27
Public Member Functions | List of all members
LSSceneContext Class Reference

The application interface which provides plugin apps with access to the hosting SCENE instance. More...

#include <lsscenecontext.h>

+ Inheritance diagram for LSSceneContext:

Public Member Functions

ref_ptr< LSWorkspacegetSceneWorkspace () const
 Gets the workspace that is currently opened in SCENE. More...
 
LSResult::Result openSceneWorkspace ()
 Opens a new, empty workspace within SCENE. More...
 
LSResult::Result openSceneWorkspace (LSString path)
 Opens the specified workspace within SCENE. More...
 
ref_ptr< LSViewgetActiveViewer () const
 Queries the active view in SCENE. More...
 
LSPod< std::vector< ref_ptr< LSView > > > getViews () const
 Gets a list of the views that are currently opened within SCENE. More...
 
LSResult::Result createView (LSView::ViewType type, ref_ptr< LSObject > object, ref_ptr< LSView > &viewOut)
 Creates a new view within SCENE. More...
 
LSResult::Result createOffscreenView (LSView::ViewType type, ref_ptr< LSObject > object, unsigned int sizeX, unsigned int sizeY, ref_ptr< LSView > &viewOut)
 Creates a new offscreen (invisible) view within SCENE. More...
 
void closeView (LSView &view)
 Closes a view within SCENE. More...
 
bool bindTask (int resourceID, LSString taskID)
 Binds the specified task to the given UI element so that the task is executed when the UI element is triggered. More...
 
HANDLE registerToolbar (int resourceID, LSString toolbarName)
 Registers a toolbar with SCENE. More...
 
LSString getGUILanguage () const
 Queries the SCENE GUI language locale. More...
 
- Public Member Functions inherited from LSAppContext
LSString getAppName () const
 Gets the name of the calling app. More...
 
LSString getAppVersion () const
 Gets the version of the calling app. More...
 
LSString getApiVersion () const
 Gets the API runtime version. More...
 
LSPod< std::map< LSString, ref_ptr< LSTask > > > getRegisteredTasks () const
 Gets the tasks that are currently registered with this app context. More...
 
LSString registerTask (LSString name, ref_ptr< LSTask > task)
 Registers a task. More...
 
bool disableTask (LSString taskID)
 Disables a task. More...
 
bool isModuleAvailable (LSString moduleName) const
 Checks if the queried module is available in the host application (SCENE, ...). More...
 
LengthUnit getUnitsExportLength () const
 Gets the units for length used in export. More...
 
LengthUnit getUnitsDisplayLength () const
 Gets the units for length used in display setting. More...
 
AngleUnit getUnitsDisplayAngle () const
 Gets the units for angle used in display setting. More...
 
LengthUnit getUnitsDisplaySmallsizes () const
 Gets the units for length used for small sizes display settings. More...
 
- Public Member Functions inherited from LSAttributeContainer
LSString getTypeName () const
 Gets the type name of this instance. More...
 
LSString getName () const
 Gets the name of the container. More...
 
LSResult::Result setName (LSString name)
 Sets the name of the container. More...
 
LSString getUuid () const
 Returns the unique id of the container. More...
 
LSString assignUuid ()
 Assigns a unique id to the container if the container does not not yet have a unique id. More...
 
unsigned int getNumAttributes () const
 Get the number of attributes in the container. More...
 
LSString getAttributeName (unsigned int index) const
 Get the name of an attribute in the container. More...
 
unsigned int getAttributeIndex (LSString name) const
 Get the index of an attribute in the container. More...
 
LSAttribute getAttribute (unsigned int index) const
 Get an attribute based on its index. More...
 
LSAttribute getAttribute (LSString name) const
 Get an attribute based on its name. More...
 
LSResult::Result setAttribute (unsigned int index, const LSAttribute &attribute)
 Set an attribute based on its index. More...
 
LSResult::Result setAttribute (LSString name, const LSAttribute &attribute)
 Set an attribute based on its name. More...
 
LSResult::Result addCustomAttribute (LSString name, const LSAttribute &attribute)
 Add a new custom attribute to the container. More...
 
bool removeCustomAttribute (LSString name)
 Remove a custom attribute from the container. More...
 
unsigned int getNumFields () const
 Returns the number of fields in the container. More...
 
ref_ptr< LSAttributeContainergetField (unsigned int index) const
 Returns the field at position n in the container. More...
 
ref_ptr< LSAttributeContainergetField (const LSString &name) const
 Returns the field with the given name. More...
 
LSResult::Result addField (const LSString &name, const LSString &typeName, ref_ptr< LSAttributeContainer > &fieldOut)
 Add a field to the container. More...
 
bool rmField (const LSString &name)
 Removes the field with a given name from the container. More...
 

Public Attributes

Signals
LSSignal< ref_ptr< LSViewEvent > > onViewCreated
 Dispatched when a new view is created. More...
 
LSSignal< ref_ptr< LSViewEvent > > onViewClosed
 Dispatched when a view has been closed. More...
 
LSSignal< ref_ptr< LSViewEvent > > onViewActivated
 Dispatched when a view has been activated. More...
 
LSSignal< ref_ptr< LSWorkspaceEvent > > onSceneWorkspaceOpened
 Dispatched when a SCENE workspace has been opened. More...
 
LSSignal< ref_ptr< LSWorkspaceEvent > > onSceneWorkspaceClosed
 Dispatched when the SCENE workspace has been closed. More...
 
- Public Attributes inherited from LSAppContext
LSSignal< ref_ptr< LSEvent > > onClose
 Dispatched when the app context is being destroyed. More...
 

Additional Inherited Members

- Public Types inherited from LSAppContext
enum  LengthUnit : unsigned int {
  Meter = 0, Centimeter = 1, Millimeter = 2,
  Yard = 3, Feet = 4, Inch = 5,
  YardUS = 6, FeetUS = 7, InchUS = 8
}
 Unit of measurement of length. More...
 
enum  AngleUnit : unsigned int { Degree = 0, Radian = 1, Gon = 2 }
 Unit of measurement of an angle. More...
 
- Protected Member Functions inherited from LSRefType
void ref () const
 Increments the internal reference counter. More...
 
void unref () const
 Decrements the internal reference counter. More...
 

Detailed Description

The application interface which provides plugin apps with access to the hosting SCENE instance.

Version
SCENE API Version 2.0.0.

Member Function Documentation

◆ getSceneWorkspace()

ref_ptr<LSWorkspace> getSceneWorkspace ( ) const

Gets the workspace that is currently opened in SCENE.

The returned pointer may be casted to LSProject or LSLocalWorkspace using a dynamic_pointer_cast. Depending on what is currently opened in SCENE either the cast to LSProject or LSLocalWorkspace will fail.

Returns
The SCENE workspace.
Version
SCENE API Version 2.0.0.

◆ openSceneWorkspace() [1/2]

LSResult::Result openSceneWorkspace ( )

Opens a new, empty workspace within SCENE.

Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ openSceneWorkspace() [2/2]

LSResult::Result openSceneWorkspace ( LSString  path)

Opens the specified workspace within SCENE.

Parameters
pathThe file system path to the workspace file to be opened.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ getActiveViewer()

ref_ptr<LSView> getActiveViewer ( ) const

Queries the active view in SCENE.

Returns
The active view.
Version
SCENE API Version 2.0.0.

◆ getViews()

LSPod<std::vector<ref_ptr<LSView> > > getViews ( ) const

Gets a list of the views that are currently opened within SCENE.

Returns
A list of the views that are currently opened within SCENE.
Version
SCENE API Version 2.0.0.

◆ createView()

LSResult::Result createView ( LSView::ViewType  type,
ref_ptr< LSObject object,
ref_ptr< LSView > &  viewOut 
)

Creates a new view within SCENE.

Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ createOffscreenView()

LSResult::Result createOffscreenView ( LSView::ViewType  type,
ref_ptr< LSObject object,
unsigned int  sizeX,
unsigned int  sizeY,
ref_ptr< LSView > &  viewOut 
)

Creates a new offscreen (invisible) view within SCENE.

Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ closeView()

void closeView ( LSView view)

Closes a view within SCENE.

Returns
An LSResult result code.
Version
SCENE API Version 2.0.0.

◆ bindTask()

bool bindTask ( int  resourceID,
LSString  taskID 
)

Binds the specified task to the given UI element so that the task is executed when the UI element is triggered.

Returns
true if the task could be bound to the UI element, false otherwise.
Version
SCENE API Version 2.0.0.

◆ registerToolbar()

HANDLE registerToolbar ( int  resourceID,
LSString  toolbarName 
)

Registers a toolbar with SCENE.

Version
SCENE API Version 2.0.0.

◆ getGUILanguage()

LSString getGUILanguage ( ) const

Queries the SCENE GUI language locale.

Returns
The GUI language locale.
Version
SCENE API Version 2.0.22.

Member Data Documentation

◆ onViewCreated

LSSignal<ref_ptr<LSViewEvent> > onViewCreated

Dispatched when a new view is created.

Version
SCENE API Version 2.0.0.

◆ onViewClosed

LSSignal<ref_ptr<LSViewEvent> > onViewClosed

Dispatched when a view has been closed.

Version
SCENE API Version 2.0.0.

◆ onViewActivated

LSSignal<ref_ptr<LSViewEvent> > onViewActivated

Dispatched when a view has been activated.

Version
SCENE API Version 2.0.0.

◆ onSceneWorkspaceOpened

LSSignal<ref_ptr<LSWorkspaceEvent> > onSceneWorkspaceOpened

Dispatched when a SCENE workspace has been opened.

Version
SCENE API Version 2.0.0.

◆ onSceneWorkspaceClosed

LSSignal<ref_ptr<LSWorkspaceEvent> > onSceneWorkspaceClosed

Dispatched when the SCENE workspace has been closed.

Version
SCENE API Version 2.0.0.