SUAPI-CppWrapper
C++WrapperforSketchUpCAPI
Public Member Functions
CW::InstancePath Class Reference

Public Member Functions

 InstancePath ()
 
 InstancePath (SUInstancePathRef instance_path)
 
 InstancePath (const InstancePath &other)
 
 ~InstancePath ()
 
InstancePathoperator= (const InstancePath &other)
 
SUInstancePathRef ref () const
 
 operator SUInstancePathRef () const
 
 operator SUInstancePathRef * ()
 
InstancePathpush (const ComponentInstance &instance)
 
InstancePathpop ()
 
InstancePathset_leaf (const Entity &entity)
 
size_t depth () const
 
size_t full_depth () const
 
Transformation total_transformation () const
 
Transformation transformation_at_depth (size_t depth) const
 
ComponentInstance instance_at_depth (size_t depth) const
 
Entity leaf_entity () const
 
DrawingElement leaf () const
 
bool valid () const
 
bool empty () const
 
bool contains (const Entity &entity) const
 
String persistent_id () const
 
String persistent_id_at_depth (size_t depth) const
 

Detailed Description

Definition at line 48 of file InstancePath.hpp.

Constructor & Destructor Documentation

CW::InstancePath::InstancePath ( )

Constructor for empty InstancePath value

Definition at line 58 of file InstancePath.cpp.

CW::InstancePath::InstancePath ( const InstancePath other)

Copy constructor

Definition at line 68 of file InstancePath.cpp.

CW::InstancePath::~InstancePath ( )

Destructor

Definition at line 73 of file InstancePath.cpp.

Member Function Documentation

bool CW::InstancePath::contains ( const Entity entity) const

Checks if instance path contains a particular entity.

Parameters
entity- The entity object.
Returns
Whether the instance path contains the entity or not. TODO: This method should be const, but the C API has an error where SUInstancePathContains is not const

Definition at line 196 of file InstancePath.cpp.

size_t CW::InstancePath::depth ( ) const

Gets a path depth for InstancePath. It only counts the component instances in the path, so the leaf node is not counted.

Returns
The depth of instance path object. TODO: This method should be const, but the C API has an error where SUInstancePathGetPathDepth is not const

Definition at line 123 of file InstancePath.cpp.

bool CW::InstancePath::empty ( ) const

Checks if an instance path is empty.

Returns
Whether the instance path is empty or not. TODO: This method should be const, but the C API has an error where SUInstancePathIsEmpty is not const

Definition at line 188 of file InstancePath.cpp.

size_t CW::InstancePath::full_depth ( ) const

Gets the full path depth (including the leaf) for InstancePath.

Returns
The full depth of instance path object. TODO: This method should be const, but the C API has an error where SUInstancePathGetFullDepth is not const

Definition at line 131 of file InstancePath.cpp.

ComponentInstance CW::InstancePath::instance_at_depth ( size_t  depth) const

Gets a component instance up to path depth level.

Parameters
depth- The depth for getting drawing element up to.
Returns
The component instance on the instance path at that depth. TODO: This method should be const, but the C API has an error where SUInstancePathGetInstanceAtDepth is not const

Definition at line 155 of file InstancePath.cpp.

DrawingElement CW::InstancePath::leaf ( ) const

Gets a leaf from an entity path as a drawing element object.

Returns
The leaf DrawingElement from an instance path. TODO: This method should be const, but the C API has an error where SUInstancePathGetLeaf is not const

Definition at line 172 of file InstancePath.cpp.

Entity CW::InstancePath::leaf_entity ( ) const

Gets a leaf from an instance path as an entity object.

Returns
The leaf entity from an instance path. TODO: This method should be const, but the C API has an error where SUInstancePathGetLeafAsEntity is not const

Definition at line 164 of file InstancePath.cpp.

InstancePath & CW::InstancePath::operator= ( const InstancePath other)

Copy assignment operator

Definition at line 79 of file InstancePath.cpp.

String CW::InstancePath::persistent_id ( ) const

Retrieves the full persistent id for a given instance path.

Returns
A String of the persistent id (or its full depth?). TODO: This method should be const, but the C API has an error where SUInstancePathGetPersistentID is not const

Definition at line 204 of file InstancePath.cpp.

String CW::InstancePath::persistent_id_at_depth ( size_t  depth) const

Retrieves the persistent id of an entity up to depth level in a given instance path.

Parameters
depth- The depth for getting persistent id up to.
Returns
The persistent id. TODO: This method should be const, but the C API has an error where SUInstancePathGetPersistentIDAtDepth is not const

Definition at line 214 of file InstancePath.cpp.

InstancePath & CW::InstancePath::pop ( )

Pops the last ComponentInstance from an InstancePath.

Returns
reference to this InstancePath

Definition at line 109 of file InstancePath.cpp.

InstancePath & CW::InstancePath::push ( const ComponentInstance instance)

Pushes a ComponentInstance to an InstancePath.

Parameters
instanceThe component instance object.
Returns
reference to this InstancePath

Definition at line 102 of file InstancePath.cpp.

InstancePath & CW::InstancePath::set_leaf ( const Entity entity)

Sets an Entity to an InstancePath.

Parameters
entity- The entity to be set as a leaf in instance path.
Returns
reference to this InstancePath

Definition at line 116 of file InstancePath.cpp.

Transformation CW::InstancePath::total_transformation ( ) const

Gets the transform for InstancePath.

Returns
The transform from instance path TODO: This method should be const, but the C API has an error where SUInstancePathGetTransform is not const

Definition at line 139 of file InstancePath.cpp.

Transformation CW::InstancePath::transformation_at_depth ( size_t  depth) const

Gets the transform up to depth level for InstancePath.

Parameters
depth- The depth for getting transforms up to.
Returns
The transform from instance path. TODO: This method should be const, but the C API has an error where SUInstancePathGetTransformAtDepth is not const

Definition at line 147 of file InstancePath.cpp.

bool CW::InstancePath::valid ( ) const

Validates an instance path.

Returns
Whether the instance path is valid or not. TODO: This method should be const, but the C API has an error where SUInstancePathIsValid is not const

Definition at line 180 of file InstancePath.cpp.


The documentation for this class was generated from the following files: