FormIt C++ API  v23.0.0 (2023.0.0)
WSM::GroupInstancePath Class Reference

Description

Private member m_aPaths in GroupInstancePath is not exported and causes a warning that can be safely ignored.

The GroupInstancePath class contains a vector of ObjectHistoryIDs, representing a path through the group and instance hierarchy starting from a given history and ending at a given object.

The last element in the vector is the selected object, and the ones before that are the group instances through which it was selected.

#include <ObjectHistoryID.h>

Public Member Functions

 GroupInstancePath ()
 clang will give this error if =default is used here: default initialization of an object of const type requires a user-provided default constructor. More...
 
 GroupInstancePath (size_t nTopHistory, size_t nObjectID)
 This constructs a path from a single object in the same history where the selection was done. More...
 
 GroupInstancePath (ObjectHistoryID const &id)
 This constructs a path from a single object in the same history where the selection was done. More...
 
 GroupInstancePath (WSM::GroupInstancePath const &path, size_t id)
 This constructs a path from an existing path and a new object ID value in that same path. More...
 
 GroupInstancePath (1::vector< ObjectHistoryID > const &aIDs)
 These construct a path with the group selected objects. More...
 
 GroupInstancePath (1::vector< ObjectHistoryID > &&aIDs)
 
 operator bool () const
 
bool operator< (WSM::GroupInstancePath const &r) const
 Primarily for putting the objects in std::map collections. More...
 
bool operator== (WSM::GroupInstancePath const &r) const
 
bool operator!= (WSM::GroupInstancePath const &r) const
 
bool IsValid () const
 Check to see if there are enough IDs in the path and they're not invalid. More...
 
bool IsAlive () const
 Check to see if everything in the path is alive. More...
 
void clear ()
 Set this to an invalid path. More...
 
ObjectHistoryID GetFinalObjectHistoryID () const
 Get the final ObjectHistoryID from the path. More...
 
size_t GetFinalHistoryID () const
 Get the history in which the final object is held. More...
 
size_t GetFinalObjectID () const
 Get the ID of the final object. More...
 
ObjectHistoryID GetTopObjectHistoryID () const
 Get the top ObjectHistoryID from the path. More...
 
size_t GetTopHistoryID () const
 Get the ID of the history from which this path is referenced. More...
 
size_t GetTopObjectID () const
 Get the ID of the first instance from which this path is referenced. More...
 
void ReplaceFinalObjectID (size_t id)
 Change the ID of the object this is referencing. More...
 
void AppendObjectHistoryID (ObjectHistoryID const &id)
 Combine the object with the existing path, used for combining an in-context editing path with a selected object. More...
 
size_t GetEditingObjectID (GroupInstancePath const &editing) const
 Get the ID of the object in this path which is in the in context editing path. More...
 
void SetToEditingObjectPath (GroupInstancePath const &editing)
 Set this GroupInstancePath to the path of the object in this GroupInstancePath which is in the in context editing path. More...
 
void SetToTopObjectHistoryID ()
 Strip off all but the top level object in this path. More...
 
Result GetObjectTransform (Transf3d &trans) const
 Get a transform that accounts for the instance transforms, if any. More...
 
Result GetObjectTransform (Transf3d &trans, Transf3d const &additional, GroupInstancePath const &after) const
 Get a transform that accounts for the instance transforms, if any while additionally applying an additional transform in the start/middle specified by supplying an "after" path. More...
 
template<typename T >
bool LocalToWorld (T &val, const WSM::Transf3d *pPreLocalTransf3d=nullptr) const
 Converts the given object through the transform returned by GetObjectTransform. More...
 
template<typename T >
bool WorldToLocal (T &val, const WSM::Transf3d *pPreLocalTransf3d=nullptr) const
 Converts the given object through the inverse transform returned by GetObjectTransform. More...
 
const ::vector< ObjectHistoryID > & GetObjectHistoryIDs () const
 Allow read-only access to the vector of object history IDs that make up the path. More...
 
bool IsPrefixOf (GroupInstancePath const &right) const
 Returns true if this path is a strict prefix of another path. More...
 
bool IsFullPathOf (GroupInstancePath const &right) const
 Returns true if this path is exactly the same as all but the last entry from another path. More...
 
void pop_back ()
 This removes the last component from the path, effectively selecting the instance that referenced the final component. More...
 
void swap (GroupInstancePath &right)
 
auto begin () const
 
auto end () const
 
auto rbegin () const
 
auto rend () const
 
void UpdateHistoryIDs (size_t nTopHistory)
 This function is used after reading in a journalized GroupInstancePath to handle history IDs that may be different than when the path was journaled. More...
 

Constructor & Destructor Documentation

WSM::GroupInstancePath::GroupInstancePath ( )
inline

clang will give this error if =default is used here: default initialization of an object of const type requires a user-provided default constructor.

This requirement is a standard defect (DR 253) in that it does not consider that a compiler generated default constructor fully initializes a class where all sub-objects are fully initialized by their default constructors. GCC and MSVC behave as if this DR has already been resolved.

WSM::GroupInstancePath::GroupInstancePath ( size_t  nTopHistory,
size_t  nObjectID 
)
inline

This constructs a path from a single object in the same history where the selection was done.

WSM::GroupInstancePath::GroupInstancePath ( ObjectHistoryID const &  id)
inline

This constructs a path from a single object in the same history where the selection was done.

WSM::GroupInstancePath::GroupInstancePath ( WSM::GroupInstancePath const &  path,
size_t  id 
)
inline

This constructs a path from an existing path and a new object ID value in that same path.

WSM::GroupInstancePath::GroupInstancePath ( 1::vector< ObjectHistoryID > const &  aIDs)
inline

These construct a path with the group selected objects.

WSM::GroupInstancePath::GroupInstancePath ( 1::vector< ObjectHistoryID > &&  aIDs)
inline

Member Function Documentation

void WSM::GroupInstancePath::AppendObjectHistoryID ( ObjectHistoryID const &  id)
inline

Combine the object with the existing path, used for combining an in-context editing path with a selected object.

auto WSM::GroupInstancePath::begin ( ) const
inline
void WSM::GroupInstancePath::clear ( )
inline

Set this to an invalid path.

auto WSM::GroupInstancePath::end ( ) const
inline
size_t WSM::GroupInstancePath::GetEditingObjectID ( GroupInstancePath const &  editing) const

Get the ID of the object in this path which is in the in context editing path.

size_t WSM::GroupInstancePath::GetFinalHistoryID ( ) const
inline

Get the history in which the final object is held.

ObjectHistoryID WSM::GroupInstancePath::GetFinalObjectHistoryID ( ) const
inline

Get the final ObjectHistoryID from the path.

If there aren't any IDs, return a default constructed (invalid) ID

size_t WSM::GroupInstancePath::GetFinalObjectID ( ) const
inline

Get the ID of the final object.

const ::vector<ObjectHistoryID>& WSM::GroupInstancePath::GetObjectHistoryIDs ( ) const
inline

Allow read-only access to the vector of object history IDs that make up the path.

Result WSM::GroupInstancePath::GetObjectTransform ( Transf3d trans) const

Get a transform that accounts for the instance transforms, if any.

If the final object is also an instance, this also includes the transform of that instance.

Result WSM::GroupInstancePath::GetObjectTransform ( Transf3d trans,
Transf3d const &  additional,
GroupInstancePath const &  after 
) const

Get a transform that accounts for the instance transforms, if any while additionally applying an additional transform in the start/middle specified by supplying an "after" path.

size_t WSM::GroupInstancePath::GetTopHistoryID ( ) const
inline

Get the ID of the history from which this path is referenced.

ObjectHistoryID WSM::GroupInstancePath::GetTopObjectHistoryID ( ) const
inline

Get the top ObjectHistoryID from the path.

If there aren't any IDs, return a default constructed (invalid) ID

size_t WSM::GroupInstancePath::GetTopObjectID ( ) const
inline

Get the ID of the first instance from which this path is referenced.

bool WSM::GroupInstancePath::IsAlive ( ) const

Check to see if everything in the path is alive.

bool WSM::GroupInstancePath::IsFullPathOf ( GroupInstancePath const &  right) const
inline

Returns true if this path is exactly the same as all but the last entry from another path.

bool WSM::GroupInstancePath::IsPrefixOf ( GroupInstancePath const &  right) const
inline

Returns true if this path is a strict prefix of another path.

bool WSM::GroupInstancePath::IsValid ( ) const
inline

Check to see if there are enough IDs in the path and they're not invalid.

template<typename T >
bool WSM::GroupInstancePath::LocalToWorld ( T &  val,
const WSM::Transf3d pPreLocalTransf3d = nullptr 
) const
inline

Converts the given object through the transform returned by GetObjectTransform.

It returns true or false to indicate whether or not a change was made. This can be called with any type for which operator*=(T, WSM::Transf3d) is available. If pPreLocalTransf3d is given, it is applied first.

WSM::GroupInstancePath::operator bool ( ) const
inlineexplicit
bool WSM::GroupInstancePath::operator!= ( WSM::GroupInstancePath const &  r) const
inline
bool WSM::GroupInstancePath::operator< ( WSM::GroupInstancePath const &  r) const
inline

Primarily for putting the objects in std::map collections.

bool WSM::GroupInstancePath::operator== ( WSM::GroupInstancePath const &  r) const
inline
void WSM::GroupInstancePath::pop_back ( )
inline

This removes the last component from the path, effectively selecting the instance that referenced the final component.

auto WSM::GroupInstancePath::rbegin ( ) const
inline
auto WSM::GroupInstancePath::rend ( ) const
inline
void WSM::GroupInstancePath::ReplaceFinalObjectID ( size_t  id)
inline

Change the ID of the object this is referencing.

void WSM::GroupInstancePath::SetToEditingObjectPath ( GroupInstancePath const &  editing)

Set this GroupInstancePath to the path of the object in this GroupInstancePath which is in the in context editing path.

void WSM::GroupInstancePath::SetToTopObjectHistoryID ( )
inline

Strip off all but the top level object in this path.

void WSM::GroupInstancePath::swap ( GroupInstancePath right)
inline
void WSM::GroupInstancePath::UpdateHistoryIDs ( size_t  nTopHistory)

This function is used after reading in a journalized GroupInstancePath to handle history IDs that may be different than when the path was journaled.

The parameter is the current top history.

template<typename T >
bool WSM::GroupInstancePath::WorldToLocal ( T &  val,
const WSM::Transf3d pPreLocalTransf3d = nullptr 
) const
inline

Converts the given object through the inverse transform returned by GetObjectTransform.

It returns true or false to indicate whether or not a change was made. This can be called with any type for which operator*=(T, WSM::Transf3d) is available. If pPreLocalTransf3d is given, it's inverse is applied last.


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