HPS::HCA::ModelTree

class HPS::HCA::ModelTree : public HPS::Sprocket

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.

Public Types

enum ItemType

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

Values:

enumerator None

No type.

enumerator Model

Item is an HCA::Model.

enumerator Node

Item is an HCA::Node.

Public Functions

virtual void Assign(ModelTree const &in_that)

Share the underlying smart-pointer of the ModelTree source.

Parameters

in_that – The ModelTree source of the assignment.

Returns

A reference to this ModelTree.

bool Equals(ModelTree const &in_that) const

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

Parameters

in_that – The source ModelTree to compare to this ModelTree.

Returns

true if the objects reference the same underlying data, false otherwise.

virtual void Flush()

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.

HPS::Canvas &GetCanvas() const

Gets the Canvas associated with this ModelTree.

Returns

The Canvas associated with this ModelTree.

HCA::Model &GetHCAModel() const

Gets the HCA Model associated with this ModelTree.

Returns

The HCA Model associated with this ModelTree.

ModelTreeItemPtr GetRoot() const

Gets the root ModelTreeItem for this ModelTree.

Returns

The root ModelTreeItem for this ModelTree.

ModelTree()

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

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
ModelTree(ModelTree &&in_that)

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

Parameters

in_that – An rvalue reference to a ModelTree to take the underlying object from.

ModelTree(ModelTree const &in_that)

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

Parameters

in_that – The source ModelTree to copy.

inline virtual HPS::Type ObjectType() const

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.

bool operator!=(ModelTree const &in_that) const

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

Parameters

in_that – The source ModelTree to compare to this ModelTree.

Returns

true if the objects reference different underlying data, false otherwise.

ModelTree &operator=(ModelTree &&in_that)

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

Parameters

in_that – An rvalue reference to a ModelTree to take the underlying object from.

Returns

A reference to this ModelTree.

ModelTree &operator=(ModelTree const &in_that)

Share the underlying smart-pointer of the ModelTree source.

Parameters

in_that – The ModelTree source of the assignment.

Returns

A reference to this ModelTree.

bool operator==(ModelTree const &in_that) const

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

Parameters

in_that – The source ModelTree to compare to this ModelTree.

Returns

true if the objects reference the same underlying data, false otherwise.

void 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.

See

Flush

See

ModelTreeItem::Expand

Parameters

in_root – The root ModelTreeItem for this ModelTree.