Hoops Visualize HPS  version 2018-SP2
Hoops Visualize HPS 3D Rendering Engine
Looking for a senior C++ dev?
I'm looking for work. Hire me!
HPS::ComponentPath Class Reference

The ComponentPath contains an array of components, organized from leaf to root. More...

#include <sprk.h>

Inheritance diagram for HPS::ComponentPath:
Collaboration diagram for HPS::ComponentPath:

Public Member Functions

 ComponentPath ()
 Creates an uninitialized Component path that refers to no database objects. More...
 
 ComponentPath (ComponentArray const &in_components)
 Creates a new ComponentPath object based on the supplied path. More...
 
 ComponentPath (size_t in_count, Component const in_components[])
 Creates a new ComponentPath object based on the supplied path. More...
 
 ComponentPath (ComponentPath const &in_that)
 Copies in_that into this component path. More...
 
 ComponentPath (ComponentPath &&in_that)
 The move constructor creates a ComponentPath by transferring the underlying impl of the rvalue reference to this ComponentPath thereby avoiding a copy and allocation. More...
 
ComponentPathoperator= (ComponentPath &&in_that)
 The move assignment operator transfers the underlying impl of the rvalue reference to this ComponentPath thereby avoiding a copy. More...
 
virtual ~ComponentPath ()
 Releases a reference to the database object this object is tied to. More...
 
HPS::Type ObjectType () const
 
bool Empty () const
 Indicates whether this ComponentPath is empty. More...
 
ComponentPathoperator+= (Component const &in_component)
 Appends the supplied Component into this object. More...
 
ComponentPathoperator+= (ComponentPath const &in_path)
 Appends the supplied ComponentPath into this object. More...
 
ComponentPathoperator+= (ComponentArray const &in_components)
 Appends the supplied ComponentArray into this object. More...
 
ComponentPathAppend (Component const &in_component)
 Appends the supplied Component into this object. More...
 
ComponentPathAppend (ComponentPath const &in_path)
 Appends the supplied key into this object. More...
 
ComponentPathAppend (ComponentArray const &in_components)
 Appends the supplied key into this object. More...
 
ComponentPathoperator= (ComponentPath const &in_that)
 Copies the supplied path into this object. More...
 
ComponentPathoperator= (ComponentArray const &in_path)
 Copies an array of components into this object. More...
 
void Set (ComponentPath const &in_that)
 Copies the supplied path into this object. More...
 
bool Equals (ComponentPath const &in_that) const
 Check if the source ComponentPath is equivalent to this object. More...
 
bool operator!= (ComponentPath const &in_that) const
 Check if the source ComponentPath is not equivalent to this object. More...
 
bool operator== (ComponentPath const &in_that) const
 Check if the source ComponentPath is equivalent to this object. More...
 
ComponentPathSetComponents (ComponentArray const &in_components)
 Copies an array of components into this object. More...
 
ComponentPathSetComponents (size_t in_count, Component const in_components[])
 Copies an array of components into this object. More...
 
ComponentArray GetComponents () const
 Gets the components defining this ComponentPath. More...
 
KeyPathArray GetKeyPaths () const
 Gets the KeyPath objects corresponding to this ComponentPath. More...
 
KeyPathArray GetKeyPaths (Canvas const &in_canvas, size_t in_layer=0) const
 Gets the KeyPath objects corresponding to this ComponentPath which are included by the specified Canvas and layer. More...
 
void Highlight (Canvas const &in_canvas, HighlightOptionsKit const &in_options, bool in_remove_existing=true) const
 Highlights this ComponentPath with the provided options under the given Canvas in layer zero. More...
 
void Highlight (Canvas const &in_canvas, size_t in_layer, HighlightOptionsKit const &in_options, bool in_remove_existing=true) const
 Highlights this ComponentPath with the provided options under the given Canvas in the specified layer. More...
 
void Unhighlight (Canvas const &in_canvas, HighlightOptionsKit const &in_options=HighlightOptionsKit()) const
 Unhighlights this ComponentPath with the provided options under the given Canvas in layer zero. More...
 
void Unhighlight (Canvas const &in_canvas, size_t in_layer, HighlightOptionsKit const &in_options=HighlightOptionsKit()) const
 Unhighlights this ComponentPath with the provided options under the given Canvas in the specified layer. More...
 
void Hide (Canvas const &in_canvas, size_t in_layer=0)
 Hides this ComponentPath under the given Canvas in the specified layer. More...
 
void Show (Canvas const &in_canvas, size_t in_layer=0, Component::Visibility in_subtree_visibility=Component::Visibility::PreserveNone)
 Shows this ComponentPath under the given Canvas in the specified layer. More...
 
bool IsHidden (Canvas const &in_canvas, size_t in_layer=0)
 Indicates whether this ComponentPath under the given Canvas in the specified layer is hidden. More...
 
void Isolate (Canvas const &in_canvas, size_t in_layer=0, Component::Visibility in_subtree_visibility=Component::Visibility::PreserveNone)
 Shows only this ComponentPath and hides all other Component objects under the given Canvas in the specified layer. More...
 
virtual HPS::Type Type () const
 This function returns the true type of the underlying object. More...
 
virtual void Reset ()
 Resets this object to its initial, uninitialized state. More...
 
bool HasType (HPS::Type in_mask) const
 This function indicates whether this Object has the given Type mask. More...
 
intptr_t GetClassID () const
 Returns a unique identifier that is shared by all objects of the same class. More...
 
intptr_t GetInstanceID () const
 Returns an identifier that can be used to identify which instance of a class an object is. More...
 

Static Public Member Functions

static void Isolate (HPS::ComponentPathArray &in_components_to_be_isolated, Canvas const &in_canvas, size_t in_layer=0, Component::Visibility in_subtree_visibility=Component::Visibility::PreserveNone)
 Shows only the objects in the supplied ComponentPathArray and hides all other Component objects under the given Canvas in the specified layer. More...
 
template<typename T >
static intptr_t ClassID ()
 Unique identifier for this class. More...
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::ComponentPath
 

Detailed Description

The ComponentPath contains an array of components, organized from leaf to root.

It allows the user to perform queries and operations along that path.

Constructor & Destructor Documentation

◆ ComponentPath() [1/5]

HPS::ComponentPath::ComponentPath ( )

Creates an uninitialized Component path that refers to no database objects.

◆ ComponentPath() [2/5]

HPS::ComponentPath::ComponentPath ( ComponentArray const &  in_components)

Creates a new ComponentPath object based on the supplied path.

Parameters
in_componentsAn array of components arranged from leaf to root.

◆ ComponentPath() [3/5]

HPS::ComponentPath::ComponentPath ( size_t  in_count,
Component const  in_components[] 
)

Creates a new ComponentPath object based on the supplied path.

Parameters
in_countThe number of keys in the array.
in_componentsAn array of components arranged from leaf to root.

◆ ComponentPath() [4/5]

HPS::ComponentPath::ComponentPath ( ComponentPath const &  in_that)

Copies in_that into this component path.

◆ ComponentPath() [5/5]

HPS::ComponentPath::ComponentPath ( ComponentPath &&  in_that)

The move constructor creates a ComponentPath by transferring the underlying impl of the rvalue reference to this ComponentPath thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a ComponentPath to take the impl from.

◆ ~ComponentPath()

virtual HPS::ComponentPath::~ComponentPath ( )
virtual

Releases a reference to the database object this object is tied to.

Member Function Documentation

◆ Append() [1/3]

ComponentPath& HPS::ComponentPath::Append ( Component const &  in_component)

Appends the supplied Component into this object.

Same as operator+= function.

Parameters
in_componentThe Component to be appended to this.
Returns
A reference to this object.
Here is the caller graph for this function:

◆ Append() [2/3]

ComponentPath& HPS::ComponentPath::Append ( ComponentPath const &  in_path)

Appends the supplied key into this object.

Same as operator+= function.

Parameters
in_pathThe ComponentPath to be appended to this.
Returns
A reference to this object.

◆ Append() [3/3]

ComponentPath& HPS::ComponentPath::Append ( ComponentArray const &  in_components)

Appends the supplied key into this object.

Same as operator+= function.

Parameters
in_componentsThe ComponentArray to be appended to this.
Returns
A reference to this object.

◆ ClassID()

template<typename T >
static intptr_t HPS::Object::ClassID ( )
inlinestaticinherited

Unique identifier for this class.

Note: this method uses construction of static objects. If used in a constructor, it should be used in the body not the initializer list.

◆ Empty()

bool HPS::ComponentPath::Empty ( ) const
virtual

Indicates whether this ComponentPath is empty.

Returns
true if no components are set on the path, false otherwise.

Reimplemented from HPS::Object.

◆ Equals()

bool HPS::ComponentPath::Equals ( ComponentPath const &  in_that) const

Check if the source ComponentPath is equivalent to this object.

Parameters
in_thatThe source ComponentPath to compare to this object.
Returns
true if the objects are equivalent, false otherwise.

◆ GetClassID()

intptr_t HPS::Object::GetClassID ( ) const
inherited

Returns a unique identifier that is shared by all objects of the same class.

Returns
A unique value shared by all objects of the same class.

◆ GetComponents()

ComponentArray HPS::ComponentPath::GetComponents ( ) const

Gets the components defining this ComponentPath.

Returns
The components defining this ComponentPath.

◆ GetInstanceID()

intptr_t HPS::Object::GetInstanceID ( ) const
inherited

Returns an identifier that can be used to identify which instance of a class an object is.

Different keys and controls will return the same value if they are backed by the same database resource.

Returns
A value unique to an instance of an object and all objects that are backed by the same database resource.

◆ GetKeyPaths() [1/2]

KeyPathArray HPS::ComponentPath::GetKeyPaths ( ) const

Gets the KeyPath objects corresponding to this ComponentPath.

These key paths will include all possible paths which include the path components and all Canvas, Layout and View paths which include the Model which contains the path components.

Returns
All KeyPath objects for this component path.

◆ GetKeyPaths() [2/2]

KeyPathArray HPS::ComponentPath::GetKeyPaths ( Canvas const &  in_canvas,
size_t  in_layer = 0 
) const

Gets the KeyPath objects corresponding to this ComponentPath which are included by the specified Canvas and layer.

Returns
The KeyPath objects for this component path which are included by the specified Canvas and layer.
Parameters
in_canvasThe Canvas the returned KeyPath objects should reference.
in_layerThe layer under the provided Canvas the returned KeyPath objects should reference.

◆ HasType()

bool HPS::Object::HasType ( HPS::Type  in_mask) const
inherited

This function indicates whether this Object has the given Type mask.

Parameters
in_maskThe Type mask to check against this Object.
Returns
true if this Object has the given Type mask, false otherwise.

◆ Hide()

void HPS::ComponentPath::Hide ( Canvas const &  in_canvas,
size_t  in_layer = 0 
)

Hides this ComponentPath under the given Canvas in the specified layer.

Parameters
in_canvasThe Canvas in which to hide the ComponentPath.
in_layerThe layer under the provided Canvas in which to hide the ComponentPath.

◆ Highlight() [1/2]

void HPS::ComponentPath::Highlight ( Canvas const &  in_canvas,
HighlightOptionsKit const &  in_options,
bool  in_remove_existing = true 
) const

Highlights this ComponentPath with the provided options under the given Canvas in layer zero.

Parameters
in_canvasThe Canvas in which to perform the highlight.
in_optionsThe options to use to perform the highlight.
in_remove_existingIndicates whether this highlight should flush existing highlights at the specified path for the desired overlay type. If HPS::ComponentPath::Isolate(), HPS::ComponentPath::Hide(), or HPS::ComponentPath::Show() have been called on this ComponentPath, in_remove_existing should be set to false so that it doesn't override those visibility states.

◆ Highlight() [2/2]

void HPS::ComponentPath::Highlight ( Canvas const &  in_canvas,
size_t  in_layer,
HighlightOptionsKit const &  in_options,
bool  in_remove_existing = true 
) const

Highlights this ComponentPath with the provided options under the given Canvas in the specified layer.

Parameters
in_canvasThe Canvas in which to perform the highlight.
in_layerThe layer under the provided Canvas in which to perform the highlight.
in_optionsThe options to use to perform the highlight. If HPS::ComponentPath::Isolate(), HPS::ComponentPath::Hide(), or HPS::ComponentPath::Show() have been called on this ComponentPath, in_remove_existing should be set to false so that it doesn't override those visibility states.

◆ IsHidden()

bool HPS::ComponentPath::IsHidden ( Canvas const &  in_canvas,
size_t  in_layer = 0 
)

Indicates whether this ComponentPath under the given Canvas in the specified layer is hidden.

Note that even if a path is hidden, it's possible that paths descending from this path may not be hidden.

Parameters
in_canvasThe Canvas in which to check whether the specified path is hidden.
in_layerThe layer under the provided Canvas in which to check whether the specified path is hidden.
Returns
true if this path is hidden, false otherwise.

◆ Isolate() [1/2]

void HPS::ComponentPath::Isolate ( Canvas const &  in_canvas,
size_t  in_layer = 0,
Component::Visibility  in_subtree_visibility = Component::Visibility::PreserveNone 
)

Shows only this ComponentPath and hides all other Component objects under the given Canvas in the specified layer.

As this is implemented using a style applied with Drawing::Overlay::OverlayWithZ, a future highlight of this isolated ComponentPath must be applied with Drawing::Overlay::OverlayWithZ or Drawing::Overlay::Overlay so that the highlight appears on top of the isolated ComponentPath.

Parameters
in_canvasThe Canvas in which to isolate the ComponentPath.
in_layerThe layer under the provided Canvas in which to isolate the ComponentPath.
in_subtree_visibilityDictates how Isolate will interact with the visibility of components in the tree under this ComponentPath.

◆ Isolate() [2/2]

static void HPS::ComponentPath::Isolate ( HPS::ComponentPathArray in_components_to_be_isolated,
Canvas const &  in_canvas,
size_t  in_layer = 0,
Component::Visibility  in_subtree_visibility = Component::Visibility::PreserveNone 
)
static

Shows only the objects in the supplied ComponentPathArray and hides all other Component objects under the given Canvas in the specified layer.

As this is implemented using a style applied with Drawing::Overlay::OverlayWithZ, a future highlight of any ComponentPath in the supplied ComponentPathArray must be applied with Drawing::Overlay::OverlayWithZ or Drawing::Overlay::Overlay so that the highlight appears on top of the isolated ComponentPath.

Parameters
in_components_to_be_isolatedThe ComponentPathArray to isolate.
in_canvasThe Canvas in which to isolate the ComponentPath.
in_layerThe layer under the provided Canvas in which to isolate the ComponentPath.
in_subtree_visibilityDictates how Isolate will interact with the visibility of components in the tree under this ComponentPath.

◆ ObjectType()

HPS::Type HPS::ComponentPath::ObjectType ( ) const
inlinevirtual

Reimplemented from HPS::Object.

Here is the call graph for this function:

◆ operator!=()

bool HPS::ComponentPath::operator!= ( ComponentPath const &  in_that) const

Check if the source ComponentPath is not equivalent to this object.

Parameters
in_thatThe source ComponentPath to compare to this object.
Returns
true if the objects are not equivalent, false otherwise.

◆ operator+=() [1/3]

ComponentPath& HPS::ComponentPath::operator+= ( Component const &  in_component)

Appends the supplied Component into this object.

Same as Append function.

Parameters
in_keyThe key to be appended to this.
Returns
A reference to this object.

◆ operator+=() [2/3]

ComponentPath& HPS::ComponentPath::operator+= ( ComponentPath const &  in_path)

Appends the supplied ComponentPath into this object.

Same as Append function.

Parameters
in_key_pathThe ComponentPath to be appended to this.
Returns
A reference to this object.

◆ operator+=() [3/3]

ComponentPath& HPS::ComponentPath::operator+= ( ComponentArray const &  in_components)

Appends the supplied ComponentArray into this object.

Same as Append function.

Parameters
in_componentsThe ComponentArray to be appended to this.
Returns
A reference to this object.

◆ operator=() [1/3]

ComponentPath& HPS::ComponentPath::operator= ( ComponentPath &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this ComponentPath thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a ComponentPath to take the impl from.
Returns
A reference to this ComponentPath.

◆ operator=() [2/3]

ComponentPath& HPS::ComponentPath::operator= ( ComponentPath const &  in_that)

Copies the supplied path into this object.

Parameters
in_thatThe source of the copy.
Returns
A reference to this object.

◆ operator=() [3/3]

ComponentPath& HPS::ComponentPath::operator= ( ComponentArray const &  in_path)

Copies an array of components into this object.

Parameters
in_pathThe source array, assumed to be arranged from leaf to root.
Returns
A reference to this object.

◆ operator==()

bool HPS::ComponentPath::operator== ( ComponentPath const &  in_that) const

Check if the source ComponentPath is equivalent to this object.

Parameters
in_thatThe source ComponentPath to compare to this object.
Returns
true if the objects are equivalent, false otherwise.

◆ Reset()

◆ Set()

void HPS::ComponentPath::Set ( ComponentPath const &  in_that)

Copies the supplied path into this object.

Parameters
in_thatThe source of the copy.

◆ SetComponents() [1/2]

ComponentPath& HPS::ComponentPath::SetComponents ( ComponentArray const &  in_components)

Copies an array of components into this object.

Parameters
in_componentsThe source array, assumed to be arranged from leaf to root.
Returns
A reference to this object.

◆ SetComponents() [2/2]

ComponentPath& HPS::ComponentPath::SetComponents ( size_t  in_count,
Component const  in_components[] 
)

Copies an array of components into this object.

Parameters
in_countthe number of components in the array.
in_componentsThe source array, assumed to arranged from leaf to root.
Returns
A reference to this object.

◆ Show()

void HPS::ComponentPath::Show ( Canvas const &  in_canvas,
size_t  in_layer = 0,
Component::Visibility  in_subtree_visibility = Component::Visibility::PreserveNone 
)

Shows this ComponentPath under the given Canvas in the specified layer.

Parameters
in_canvasThe Canvas in which to show the ComponentPath.
in_layerThe layer under the provided Canvas in which to show the ComponentPath.
in_subtree_visibilityDictates how Show will interact with the visibility of components in the tree under this ComponentPath.

◆ Type()

◆ Unhighlight() [1/2]

void HPS::ComponentPath::Unhighlight ( Canvas const &  in_canvas,
HighlightOptionsKit const &  in_options = HighlightOptionsKit() 
) const

Unhighlights this ComponentPath with the provided options under the given Canvas in layer zero.

Parameters
in_canvasThe Canvas in which to perform the unhighlight.
in_optionsThe options to use to perform the unhighlight.

◆ Unhighlight() [2/2]

void HPS::ComponentPath::Unhighlight ( Canvas const &  in_canvas,
size_t  in_layer,
HighlightOptionsKit const &  in_options = HighlightOptionsKit() 
) const

Unhighlights this ComponentPath with the provided options under the given Canvas in the specified layer.

Parameters
in_canvasThe Canvas in which to perform the unhighlight.
in_layerThe layer under the provided Canvas in which to perform the unhighlight.
in_optionsThe options to use to perform the unhighlight.

Member Data Documentation

◆ staticType

const HPS::Type HPS::ComponentPath::staticType = HPS::Type::ComponentPath
static

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