ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
|
Identify an object or 3D path in the scene. More...
#include <path.h>
Public Types | |
typedef std::vector< PathSegment > | Segments |
typedef PathSegment::Components | Components |
Public Member Functions | |
Path ()=default | |
Default constructor. Creates an empty path. More... | |
Path (const Segments &segments) | |
Path (Segments &&segments) noexcept | |
Path (const PathSegment &segment) | |
Path (PathSegment &&segment) noexcept | |
Move constructor. More... | |
Path (const Path &)=default | |
Default copy constructor. More... | |
~Path () | |
Path & | operator= (const Path &)=default |
Default assignment operator. More... | |
Path (Path &&) noexcept | |
Move construction. Right hand side becomes empty. More... | |
Path & | operator= (Path &&rhs) noexcept |
Move assignment. Right hand side becomes empty. More... | |
Components::size_type | size () const |
bool | empty () const |
bool | operator== (const Path &rhs) const |
Unfortunately no compiler-generated default equality operators. More... | |
bool | operator!= (const Path &rhs) const |
Path | operator+ (const PathSegment &rhs) const |
Path | operator+ (const PathComponent &rhs) const |
Path | operator+ (const std::string &rhs) const |
Path | pop () const |
Path | popSegment () const |
Path | popHead () const |
Path | head (int nbComponents) const |
PathComponent | back () const |
Path | sibling (const PathComponent &newTail) const |
bool | startsWith (const Path &prefix) const |
Path | replaceComponent (int index, const PathComponent &replacement) const |
Path | reparent (const Path &originalPrefix, const Path &newPrefix) const |
Components::const_iterator | cbegin () const |
Iteration interface on PathComponents. More... | |
Components::const_iterator | begin () const |
Components::const_iterator | cend () const |
Components::const_iterator | end () const |
Components::iterator | begin () |
Components::iterator | end () |
Rtid | runTimeId () const |
const Segments & | getSegments () const |
Segments::size_type | nbSegments () const |
std::string | string () const |
std::int32_t | hash () const |
Private Attributes | |
Segments | fSegments |
Components | fComponents |
std::int32_t | fHashValue {-1} |
Identify an object or 3D path in the scene.
A path consists of one or more path segments that identify an object in the scene. The objects are identified by name.
A path can represent containment, through compound nodes that recursively contain other nodes, or a 3D hierarchy, through parent nodes down to a child.
The runtime of a path is defined to be the runtime of its node, which is the runtime of the final segment.
The following examples show how to create a path.
typedef std::vector<PathSegment> Ufe::Path::Segments |
|
default |
Default constructor. Creates an empty path.
Ufe::Path::Path | ( | const Segments & | segments | ) |
Create a Path by copying a vector of PathSegment.
segments | PathSegments vector of PathSegment. |
|
noexcept |
Create a Path by moving a vector of PathSegment.
segments | PathSegments vector of PathSegment. |
Ufe::Path::Path | ( | const PathSegment & | segment | ) |
Convenience to create a Path from a single PathSegment.
segment | PathSegment. |
|
noexcept |
Move constructor.
|
default |
Default copy constructor.
Ufe::Path::~Path | ( | ) |
Out of line destructor. Avoids duplicate symbols generated on certain platforms (e.g. Windows clang) with inline default destructor.
|
noexcept |
Move construction. Right hand side becomes empty.
PathComponent Ufe::Path::back | ( | ) | const |
InvalidOperationOnPath | If Path is empty. |
Referenced by Ufe::Trie< T >::move().
Components::iterator Ufe::Path::begin | ( | ) |
Components::const_iterator Ufe::Path::begin | ( | ) | const |
Components::const_iterator Ufe::Path::cbegin | ( | ) | const |
Iteration interface on PathComponents.
Referenced by Ufe::Trie< T >::containsAncestorHelper().
Components::const_iterator Ufe::Path::cend | ( | ) | const |
bool Ufe::Path::empty | ( | ) | const |
Convenience method for size() == 0.
Referenced by Ufe::Trie< T >::containsAncestorHelper(), and Ufe::Trie< T >::containsDescendantHelper().
Components::iterator Ufe::Path::end | ( | ) |
Components::const_iterator Ufe::Path::end | ( | ) | const |
std::int32_t Ufe::Path::hash | ( | ) | const |
Referenced by std::hash< Ufe_v5 ::Path >::operator()().
Path Ufe::Path::head | ( | int | nbComponents | ) | const |
nbComponents | The first n PathComponent to retrieve. |
InvalidOperationOnPath | If argument is 0, > size(), <= -size(). |
Segments::size_type Ufe::Path::nbSegments | ( | ) | const |
bool Ufe::Path::operator!= | ( | const Path & | rhs | ) | const |
Path Ufe::Path::operator+ | ( | const PathComponent & | rhs | ) | const |
Path Ufe::Path::operator+ | ( | const PathSegment & | rhs | ) | const |
Return a copy of the path with the argument appended. Versions with a path component or string argument throw InvalidOperationOnPath if the path is empty, as adding a component must be done to a segment with a valid runtime ID.
Path Ufe::Path::operator+ | ( | const std::string & | rhs | ) | const |
bool Ufe::Path::operator== | ( | const Path & | rhs | ) | const |
Unfortunately no compiler-generated default equality operators.
Path Ufe::Path::pop | ( | ) | const |
InvalidOperationOnPath | If Path is empty. |
Referenced by Ufe::Trie< T >::move().
Path Ufe::Path::popHead | ( | ) | const |
InvalidOperationOnPath | If Path is empty. |
Path Ufe::Path::popSegment | ( | ) | const |
InvalidOperationOnPath | If Path is empty. |
Create a copy of the path, with the originalPrefix replaced by newPrefix. If the last PathSegment of newPrefix and the first PathSegment of *this which follows originalPrefix share a runTimeId and separator then those PathSegments will be merged into a single segment. If originalPrefix is empty then reparent appends *this to newPrefix.
originalPrefix | Path of *this to be replaced. startsWith(originalPrefix) must return true or originalPrefix must be empty. |
newPrefix | Path which replaces originalPrefix. |
InvalidOperationOnPath | If originalPrefix is not empty and *this does not begin with originalPrefix. |
Path Ufe::Path::replaceComponent | ( | int | index, |
const PathComponent & | replacement | ||
) | const |
Create a copy of the path, with the path component at index replaced with the argument.
index | Index of component to replace. |
replacement | New component. |
InvalidOperationOnPath | If index is < 0 or >= size(). |
Rtid Ufe::Path::runTimeId | ( | ) | const |
Path Ufe::Path::sibling | ( | const PathComponent & | newTail | ) | const |
newTail | The tail component of the sibling path. |
InvalidOperationOnPath | If Path is empty. |
Components::size_type Ufe::Path::size | ( | ) | const |
bool Ufe::Path::startsWith | ( | const Path & | prefix | ) | const |
Checks if the path begins with the given prefix. Will return true if the two paths are equal.
std::string Ufe::Path::string | ( | ) | const |
|
private |