#include <sprk_hca.h>

Inheritance diagram for HPS::HCA::ModelTree:
HPS::Sprocket HPS::Object

Public Types

enum  ItemType { ItemType::None, ItemType::Model, ItemType::Node }
 

Public Member Functions

virtual void Assign (ModelTree const &in_that)
 
bool Equals (ModelTree const &in_that) const
 
virtual void Flush ()
 
HPS::CanvasGetCanvas () const
 
HCA::ModelGetHCAModel () const
 
ModelTreeItemPtr GetRoot () const
 
 ModelTree ()
 
 ModelTree (Canvas const &in_canvas, HCA::Model &hca_model)
 
 ModelTree (ModelTree const &in_that)
 
 ModelTree (ModelTree &&in_that)
 
virtual HPS::Type ObjectType () const
 
bool operator!= (ModelTree const &in_that) const
 
ModelTreeoperator= (ModelTree const &in_that)
 
ModelTreeoperator= (ModelTree &&in_that)
 
bool operator== (ModelTree const &in_that) const
 
void SetRoot (ModelTreeItemPtr const &in_root)
 
- Public Member Functions inherited from HPS::Sprocket
Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 
virtual HPS::Type Type () const
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::HCAModelTree
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Detailed Description

The ModelTree class is a smart pointer which corresponds to a tree object in a GUI toolkit, e.g., a TreeView in WPF or a CTreeCtrl in MFC. This class can be derived from to facilitate tree creation in the various GUI toolkits. It is used to create a model browser.

Member Enumeration Documentation

◆ ItemType

Enumerates the types of items that can be contained in a ModelTree.

Enumerator
None 

No type.

Model 

Item is an HCA::Model.

Node 

Item is an HCA::Node.

Constructor & Destructor Documentation

◆ ModelTree() [1/4]

HPS::HCA::ModelTree::ModelTree ( )

The default constructor creates an uninitialized ModelTree object. The Type() function will return Type::None.

◆ ModelTree() [2/4]

HPS::HCA::ModelTree::ModelTree ( Canvas const &  in_canvas,
HCA::Model hca_model 
)

This constructor creates a ModelTree object associated with a Canvas and the specified HCA::Model. This constructor should be used to create a new ModelTree object.

Parameters
in_canvasThe Canvas to associate this ModelTree with.
hca_modelThe model to associate this ModelTree with.

◆ ModelTree() [3/4]

HPS::HCA::ModelTree::ModelTree ( ModelTree const &  in_that)

The copy constructor creates a ModelTree object that shares the underlying smart-pointer of the source ModelTree.

Parameters
in_thatThe source ModelTree to copy.

◆ ModelTree() [4/4]

HPS::HCA::ModelTree::ModelTree ( ModelTree &&  in_that)

The move constructor creates a ModelTree by transferring the underlying object of the rvalue reference to this ModelTree.

Parameters
in_thatAn rvalue reference to a ModelTree to take the underlying object from.

Member Function Documentation

◆ Assign()

virtual void HPS::HCA::ModelTree::Assign ( ModelTree const &  in_that)
virtual

Share the underlying smart-pointer of the ModelTree source.

Parameters
in_thatThe ModelTree source of the assignment.
Returns
A reference to this ModelTree.

◆ Equals()

bool HPS::HCA::ModelTree::Equals ( ModelTree const &  in_that) const

Check if the source ModelTree points to the same underlying impl as this ModelTree.

Parameters
in_thatThe source ModelTree to compare to this ModelTree.
Returns
true if the objects reference the same underlying data, false otherwise.

◆ Flush()

virtual void HPS::HCA::ModelTree::Flush ( )
virtual

Resets the root ModelTreeItem for this ModelTree.
This will release the root ModelTreeItem by this ModelTree and set the root to a null pointer.
If this function is overridden, the overriding function should invoke this base function.

◆ GetCanvas()

HPS::Canvas& HPS::HCA::ModelTree::GetCanvas ( ) const

Gets the Canvas associated with this ModelTree.

Returns
The Canvas associated with this ModelTree.

◆ GetHCAModel()

HCA::Model& HPS::HCA::ModelTree::GetHCAModel ( ) const

Gets the HCA Model associated with this ModelTree.

Returns
The HCA Model associated with this ModelTree.

◆ GetRoot()

ModelTreeItemPtr HPS::HCA::ModelTree::GetRoot ( ) const

Gets the root ModelTreeItem for this ModelTree.

Returns
The root ModelTreeItem for this ModelTree.

◆ ObjectType()

virtual HPS::Type HPS::HCA::ModelTree::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Object.

◆ operator!=()

bool HPS::HCA::ModelTree::operator!= ( ModelTree const &  in_that) const

Check if the source ModelTree points to a different impl than this ModelTree.

Parameters
in_thatThe source ModelTree to compare to this ModelTree.
Returns
true if the objects reference different underlying data, false otherwise.

◆ operator=() [1/2]

ModelTree& HPS::HCA::ModelTree::operator= ( ModelTree const &  in_that)

Share the underlying smart-pointer of the ModelTree source.

Parameters
in_thatThe ModelTree source of the assignment.
Returns
A reference to this ModelTree.

◆ operator=() [2/2]

ModelTree& HPS::HCA::ModelTree::operator= ( ModelTree &&  in_that)

The move assignment operator transfers the underlying object of the rvalue reference to this ModelTree.

Parameters
in_thatAn rvalue reference to a ModelTree to take the underlying object from.
Returns
A reference to this ModelTree.

◆ operator==()

bool HPS::HCA::ModelTree::operator== ( ModelTree const &  in_that) const

Check if the source ModelTree points to the same underlying impl as this ModelTree.

Parameters
in_thatThe source ModelTree to compare to this ModelTree.
Returns
true if the objects reference the same underlying data, false otherwise.

◆ SetRoot()

void HPS::HCA::ModelTree::SetRoot ( ModelTreeItemPtr const &  in_root)

Sets the root ModelTreeItem for this ModelTree. This object should be created on the heap and it should have been created with a ModelTreeItem constructor which took an HCA::Model, otherwise an exception will be thrown. Additionally, if there was already an existing root for this ModelTree, the Flush function will be invoked prior to setting this as the new root, and ModelTreeItem::Expand will be invoked on the new root.

Parameters
in_rootThe root ModelTreeItem for this ModelTree.
See also
Flush
ModelTreeItem::Expand

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