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:

None

No type.

Model

Item is an HCA.Model.

Node

Item is an HCA.Node.

Public Functions

void Assign (HPS.HCA.ModelTree in_that)

Share the underlying smart-pointer of the ModelTree source.

Param in_that

The ModelTree source of the assignment.

Return

A reference to this ModelTree.

bool Equals (HPS.HCA.ModelTree in_that)

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

Param in_that

The source ModelTree to compare to this ModelTree.

Return

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

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 ()

Gets the Canvas associated with this ModelTree.

Return

The Canvas associated with this ModelTree.

HPS.HCA.Model GetHCAModel ()

Gets the HCAModel associated with this ModelTree.

Return

The HCAModel associated with this ModelTree.

HPS.HCA.ModelTreeItem GetRoot ()

Gets the root ModelTreeItem for this ModelTree.

Return

The root ModelTreeItem for this ModelTree.

ModelTree ()

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

ModelTree (HPS.Canvas in_canvas, HPS.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.

Param in_canvas

The Canvas to associate this ModelTree with.

Param hca_model

The model to associate this ModelTree with.

ModelTree (HPS.HCA.ModelTree in_that)

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

Param in_that

The source ModelTree to copy.

override HPS.Type ObjectType ()

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

Return

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

void SetRoot (HPS.HCA.ModelTreeItem 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

Param in_root

The root ModelTreeItem for this ModelTree.