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

Interface to access information and functionality of layout plans. More...

#include <lslayoutplan.h>

+ Inheritance diagram for LSLayoutPlan:

Public Member Functions

LSResult::Result setImagePath (const LSString &imgPath)
 Sets and loads the image associated with the layout plan. More...
 
LSResult::Result setCenterPosition (const Eigen::Vector3d &centerGlobal)
 Sets the center point of the layout plan in the global coordinate system. More...
 
LSResult::Result setSize (const double width, const double length)
 Sets the size of the layout plan so that its width and length are equal to the provided values. More...
 
LSResult::Result setRotation (const double rotXGlobal, const double rotYGlobal, const double rotZGlobal)
 Sets the rotation of the layout plan in the global coordinate system. More...
 
- Public Member Functions inherited from LSObject
Eigen::Matrix4d getTransformationToGlobal () const
 Calculates the transformation matrix which transforms local object coordinates to global coordinates. More...
 
void select ()
 Selects this object. More...
 
LSIterator< ref_ptr< LSObject > > getChildIterator () const
 Gets an iterator which can be used for a breadth-first iteration over all objects below the object in the object hierarchy. More...
 
ref_ptr< LSObjectgetParent () const
 Returns the parent of this object. More...
 
unsigned int getNumChildren () const
 Returns the number of children of this object. More...
 
ref_ptr< LSObjectgetChild (unsigned int n) const
 Returns the n-th child of this object. More...
 
ref_ptr< LSObjectgetChild (LSString name) const
 Returns the child of this object with a given name. More...
 
bool rmChild (unsigned int n)
 Removes a child from this object. More...
 
bool rmChild (LSString name)
 Removes a child from this object. More...
 
LSResult::Result addChild (LSString name, LSString typeName, ref_ptr< LSObject > &childOut)
 Creates a new child of the given type. More...
 
LSResult::Result generateUniqueChildName (const LSString &baseName, LSString &nameOut) const
 Generates a valid and unique name for a new child of this object based on the provided base name. More...
 
LSResult::Result setParent (ref_ptr< LSObject > newParent)
 Changes the parent of this object. 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...
 

Static Public Member Functions

static LSResult::Result create (const LSString &baseName, const ref_ptr< LSObject > &root, ref_ptr< LSLayoutPlan > &layoutPlanOut)
 Creates a new instance of the implementation class. 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 access information and functionality of layout plans.

Version
SCENE API version 2.0.19.

Member Function Documentation

◆ create()

static LSResult::Result create ( const LSString baseName,
const ref_ptr< LSObject > &  root,
ref_ptr< LSLayoutPlan > &  layoutPlanOut 
)
static

Creates a new instance of the implementation class.

The constructor can't be called directly. The created LayoutPlan object is also added to the SCENE object tree as child of the "LayoutPlans" folder.

Parameters
baseNameDesired name for the new LayoutPlan object in the workspace tree. Is automatically adjusted if necessary to make it valid and unique.
rootSCENE workspace root.
[out]layoutPlanOutCreated layout plan object.
Returns
An LSResult result code. In case of an error, layoutPlanOut is null.
Version
SCENE API Version 2.0.19.

◆ setImagePath()

LSResult::Result setImagePath ( const LSString imgPath)

Sets and loads the image associated with the layout plan.

Parameters
imgPathFile path to the image.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.19.

◆ setCenterPosition()

LSResult::Result setCenterPosition ( const Eigen::Vector3d &  centerGlobal)

Sets the center point of the layout plan in the global coordinate system.

Parameters
centerGlobalCenter point in global coordinates. Unit = meter.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.19.

◆ setSize()

LSResult::Result setSize ( const double  width,
const double  length 
)

Sets the size of the layout plan so that its width and length are equal to the provided values.

Parameters
widthNew width (length in x direction) of the layout plan. Unit = meter.
lengthNew length (length in y direction) of the layout plan. Unit = meter.
Returns
An LSResult result code.
Version
SCENE API Version 2.0.19.

◆ setRotation()

LSResult::Result setRotation ( const double  rotXGlobal,
const double  rotYGlobal,
const double  rotZGlobal 
)

Sets the rotation of the layout plan in the global coordinate system.

The Rotation is defined in radians in the global coordinate system. The rotation direction for positive angles from a top view perspective on the layout plan is:
x: Top edge rotates towards the camera.
y: Left edge rotates towards the camera.
z: Top edge rotates to the left (counter-clockwise).
This corresponds to the rotation direction of the rotation input fields in SCENE's property dialog. If multiple angles are given, the rotation order is the same as given: first x, then y, then z. Usually, one only wants to rotate around the Z axis, e.g. 90 degree counter-clockwise: [0., 0., PI/2].

Parameters
rotXGlobalRotation around X axis
rotYGlobalRotation around Y axis
rotZGlobalRotation around Z axis
Returns
An LSResult result code.
Version
SCENE API Version 2.0.19.