SCENE C++ API  2.0.22
Public Types | Public Member Functions | List of all members
LSAppContext Class Reference

Interface to general information and functionality of the application environment. More...

#include <lsappcontext.h>

+ Inheritance diagram for LSAppContext:

Public Types

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...
 

Public Member Functions

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 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< LSEvent > > onClose
 Dispatched when the app context is being destroyed. More...
 

Additional Inherited Members

- 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

Interface to general information and functionality of the application environment.

Version
SCENE API Version 2.0.0.

Member Enumeration Documentation

◆ LengthUnit

enum LengthUnit : unsigned int
strong

Unit of measurement of length.

Enumerator
Meter 

Meter (m), base metric unit for length.

Centimeter 

Centimeter (cm), metric unit for length, 1/100 of a Meter (m)

Millimeter 

Millimeter (mm), metric unit for length, 1/10 of a Centimeter (cm)

Yard 

Yard (yd), imperial base unit of length.

Feet 

Feet (ft), imperial unit of length, 1/3 of a Yard (yd)

Inch 

Inch (in), imperial unit of length, 1/12 of a Feet (yd)

YardUS 

YardUS, (yd US), US surveyor unit of length, 3 FeetUS (ft US)

FeetUS 

FeetUS, (ft US), US surveyor base unit of length.

InchUS 

InchUS, (in US), US surveyor unit of length, 1/12 of a InchUS (yd US)

◆ AngleUnit

enum AngleUnit : unsigned int
strong

Unit of measurement of an angle.

Enumerator
Degree 

Defined by full rotation of 360 degrees.

Radian 

Arc of a circle with the same length as the radius of that circle subtends an angle of 1 radian.

Gon 

Defined as one hundredth of the right angle.

Member Function Documentation

◆ getAppName()

LSString getAppName ( ) const

Gets the name of the calling app.

Returns
The name of the calling app.
Version
SCENE API Version 2.0.0.

◆ getAppVersion()

LSString getAppVersion ( ) const

Gets the version of the calling app.

Returns
The version of the calling app.
Version
SCENE API Version 2.0.14.

◆ getApiVersion()

LSString getApiVersion ( ) const

Gets the api version.

Returns
The api version.
Version
SCENE API Version 2.0.14.

◆ getRegisteredTasks()

LSPod<std::map<LSString, ref_ptr<LSTask> > > getRegisteredTasks ( ) const

Gets the tasks that are currently registered with this app context.

Returns
A map containing all registered tasks and their associated IDs.
Version
SCENE API Version 2.0.0.

◆ registerTask()

LSString registerTask ( LSString  name,
ref_ptr< LSTask task 
)

Registers a task.

Parameters
nameThe name of the task to be registered. Each task of an app has to be unique within the scope of the app.
taskThe task to be registered.
Returns
The ID of the task if it could be registered, if the task could not be registered an empty string is returned instead.
Version
SCENE API Version 2.0.0.

◆ disableTask()

bool disableTask ( LSString  taskID)

Disables a task.

Parameters
taskIDThe ID of the task to be disabled.
Returns
true if the task could be disabled, false otherwise.
Version
SCENE API Version 2.0.0.

◆ isModuleAvailable()

bool isModuleAvailable ( LSString  moduleName) const

Checks if the queried module is available in the host application (SCENE, ...).

Parameters
moduleNameName of the module to check.
Returns
True if available, false otherwise.
Version
SCENE API Version 2.0.16.

◆ getUnitsExportLength()

LengthUnit getUnitsExportLength ( ) const

Gets the units for length used in export.

Returns
The UnitsExportLength unit.
Version
SCENE API Version 2.0.22.

◆ getUnitsDisplayLength()

LengthUnit getUnitsDisplayLength ( ) const

Gets the units for length used in display setting.

Returns
The UnitsDisplayLength unit.
Version
SCENE API Version 2.0.22.

◆ getUnitsDisplayAngle()

AngleUnit getUnitsDisplayAngle ( ) const

Gets the units for angle used in display setting.

Returns
The UnitsDisplayAngle unit.
Version
SCENE API Version 2.0.22.

◆ getUnitsDisplaySmallsizes()

LengthUnit getUnitsDisplaySmallsizes ( ) const

Gets the units for length used for small sizes display settings.

Returns
The UnitsDisplaySmallsizes unit.
Version
SCENE API Version 2.0.22.

Member Data Documentation

◆ onClose

LSSignal<ref_ptr<LSEvent> > onClose

Dispatched when the app context is being destroyed.

Version
SCENE API Version 2.0.0.