SceneTreeItem

class HPS.SceneTreeItem : public HPS.Sprocket

The SceneTreeItem class is a smart pointer which corresponds to an item or node in a tree object in a GUI toolkit, e.g., a TreeViewItem in WPF or an HTREEITEM in MFC. This class must be derived from to facilitate tree creation in the various GUI toolkits. It is used to represent items in a scene graph or segment browser.

Subclassed by HPS.SceneTreeItem.SceneTreeItemUnknown

Public Functions

abstract HPS.SceneTreeItem AddChild (HPS.Key in_key, HPS.SceneTree.ItemType in_type)

This function is used to create a new SceneTreeItem to be the child of this SceneTreeItem. This function will be invoked if this SceneTreeItem has children and Expand has been invoked on it. This function should contain any necessary calls to GUI toolkits to create the appropriate GUI elements, e.g., see the implementations in the mfc_sandbox or wpf_sandbox. Additionally, since this function requires the creation of a derived SceneTreeItem, that derived SceneTreeItem should use the base constructor which takes the same arguments this function.

Param in_key

The Key for this SceneTreeItem. Should be passed to as the corresponding argument to the base constructor.

Param in_type

The type for this SceneTreeItem. Should be passed to as the corresponding argument to the base constructor.

Return

A newly created object derived from SceneTreeItem.

abstract HPS.SceneTreeItem AddChild (HPS.Key in_key, HPS.SceneTree.ItemType in_type, string in_title)

This function is used to create a new SceneTreeItem to be the child of this SceneTreeItem. This function will be invoked if this SceneTreeItem has children and Expand has been invoked on it. This function should contain any necessary calls to GUI toolkits to create the appropriate GUI elements, e.g., see the implementations in the mfc_sandbox or wpf_sandbox. Additionally, since this function requires the creation of a derived SceneTreeItem, that derived SceneTreeItem should use the base constructor which takes the same arguments this function.

Param in_key

The Key for this SceneTreeItem. Should be passed to as the corresponding argument to the base constructor.

Param in_type

The type for this SceneTreeItem. Should be passed to as the corresponding argument to the base constructor.

Param in_title

The title for this SceneTreeItem. Should be passed to as the corresponding argument to the base constructor.

Return

A newly created object derived from SceneTreeItem.

void Assign (HPS.SceneTreeItem in_that)

Share the underlying smart-pointer of the SceneTreeItem source.

Param in_that

The SceneTreeItem source of the assignment.

Return

A reference to this SceneTreeItem.

void Collapse ()

This function should be invoked when this SceneTreeItem needs to collapse. If this function is overridden, the overriding function should invoke this base function. Additionally, this function will always release all children for this SceneTreeItem when invoked.

override void Dispose ()
delegate void DtorDelegate (IntPtr cPtr)
bool Equals (HPS.SceneTreeItem in_that)

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

Param in_that

The source SceneTreeItem to compare to this SceneTreeItem.

Return

true if the objects reference the same impl, false otherwise.

override bool Equals (Object obj)
void Expand ()

This function should be invoked when this SceneTreeItem needs to expand. If this function is overridden, the overriding function should invoke this base function. Additionally, this function will always repopulate the children for this SceneTreeItem when invoked.

override int GetHashCode ()
HPS.SceneTree.ItemType GetItemType ()

Gets the item type for this SceneTreeItem. This is used to determine what type of data this SceneTreeItem represents in the SceneTree.

Return

The item type for this SceneTreeItem.

HPS.Key GetKey ()

Gets the key for this SceneTreeItem. The type of the key depends on the SceneTree.ItemType for this SceneTreeItem.

Return

The key for this SceneTreeItem.

HPS.KeyPath GetKeyPath ()

Gets the key path for this SceneTreeItem.

Return

The key path for this SceneTreeItem.

string GetTitle ()

Gets the title for this SceneTreeItem. This is the text that should be displayed for this SceneTreeItem in the SceneTree.

Return

The title for this SceneTreeItem.

HPS.SceneTree GetTree ()

Gets the SceneTree associated with this SceneTreeItem. This provides a means of accessing the derived SceneTree by this SceneTreeItem if necessary.

Return

The SceneTree associated with this SceneTreeItem.

bool HasChildren ()

Indicates whether this SceneTreeItem has any children.

Return

Whether this SceneTreeItem has any children.

bool HasItemType (HPS.SceneTree.ItemType in_mask)

Indicates whether this SceneTreeItem has the given ItemType mask.

Param in_mask

The ItemType mask to check against this SceneTreeItem.

Return

true if this SceneTreeItem has the given ItemType mask, false otherwise.

void Highlight ()

This function will cause this SceneTreeItem to be highlighted with the options specified in the associated SceneTree. This will cause elements along the path to this item (and this item itself) to be marked as selected if they aren’t already. Depending on the type of the SceneTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed.

See

Select

void Highlight (HPS.HighlightOptionsKit in_highlight_options)

This function will cause this SceneTreeItem to be highlighted with the options specified in the associated SceneTree. This will cause elements along the path to this item (and this item itself) to be marked as selected if they aren’t already. Depending on the type of the SceneTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed. If the options requested is not part of the associated SceneTree highlight options, it will be added to them.

See

Select

Param in_highlight_options

The highlight options used during highlighting

void Highlight (ulong in_highlight_options_index)

This function will cause this SceneTreeItem to be highlighted with the options specified in the associated SceneTree. This will cause elements along the path to this item (and this item itself) to be marked as selected if they aren’t already. Depending on the type of the SceneTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed.

See

Select

bool IsExpanded ()

Indicates whether this SceneTreeItem is currently expanded.

Return

Whether this SceneTreeItem is currently expanded.

bool IsHighlightable ()

Indicates whether this SceneTreeItem is able to be highlighted. Some items, like those in static trees, cannot be highlighted.

See

Highlight

See

IsHighlighted

Return

Whether this SceneTreeItem is highlightable.

bool IsHighlighted ()

Indicates whether this SceneTreeItem is currently highlighted with the options specified in the associated SceneTree. This may mean that the Highlight function on this SceneTreeItem was invoked, or that the key backing this SceneTreeItem was highlighted by the HighlightOperator or HighlightAreaOperator.

See

Highlight

See

Unhighlight

Return

Whether this SceneTreeItem is currently highlighted with the options specified in the associated SceneTree.

bool IsSelected ()

Indicates whether this SceneTreeItem is currently marked as selected.

See

Select

See

Unselect

Return

Whether this SceneTreeItem is currently marked as selected.

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

Collapses this SceneTreeItem and then re-expands the tree. It will try to preserve the original expansion state, however, if the underlying scene structure has changed, the resulting expansion may look different.

delegate void RemoveCacheItemDelegate (IntPtr cPtr)
SceneTreeItem ()

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

SceneTreeItem (HPS.SceneTree in_tree, HPS.Canvas in_canvas)

This constructor creates a SceneTreeItem suitable for acting as a root in a SceneTree. This root would start at the Canvas. The Canvas provided to this constructor should be the same as the Canvas associated with the SceneTree, otherwise an exception will be thrown.

See

SceneTree.SetRoot

Param in_tree

The SceneTree with which to associate this new root SceneTreeItem.

Param in_canvas

The Canvas for this root SceneTreeItem.

SceneTreeItem (HPS.SceneTree in_tree, HPS.Key in_key, HPS.SceneTree.ItemType in_type)

This constructor creates a SceneTreeItem which is not suitable for acting as a root in a SceneTree, but is suitable to be a SceneTreeItem under the root of the SceneTree. This constructor should be the one invoked in the overridden AddChild function.

See

AddChild

Param in_tree

The SceneTree with which to associate this new SceneTreeItem.

Param in_key

The Key for this SceneTreeItem. This value should come from the corresponding argument to AddChild.

Param in_type

The type of this SceneTreeItem. This value should come from the corresponding argument to AddChild.

SceneTreeItem (HPS.SceneTree in_tree, HPS.Key in_key, HPS.SceneTree.ItemType in_type, string in_title)

This constructor creates a SceneTreeItem which is not suitable for acting as a root in a SceneTree, but is suitable to be a SceneTreeItem under the root of the SceneTree. This constructor should be the one invoked in the overridden AddChild function.

See

AddChild

Param in_tree

The SceneTree with which to associate this new SceneTreeItem.

Param in_key

The Key for this SceneTreeItem. This value should come from the corresponding argument to AddChild.

Param in_type

The type of this SceneTreeItem. This value should come from the corresponding argument to AddChild.

Param in_title

The title for this SceneTreeItem. This value should come from the corresponding argument to AddChild.

SceneTreeItem (HPS.SceneTree in_tree, HPS.Layout in_layout)

This constructor creates a SceneTreeItem suitable for acting as a root in a SceneTree. This root would start at the Layout. The Layout provided to this constructor should be accessible from the Canvas associated with the SceneTree, otherwise an exception will be thrown.

See

SceneTree.SetRoot

Param in_tree

The SceneTree with which to associate this new root SceneTreeItem.

Param in_layout

The Layout for this root SceneTreeItem.

SceneTreeItem (HPS.SceneTree in_tree, HPS.Model in_model)

This constructor creates a SceneTreeItem suitable for acting as a root in a SceneTree. This root would start at the Model. The Model provided to this constructor should be accessible from the Canvas associated with the SceneTree, otherwise an exception will be thrown.

See

SceneTree.SetRoot

Param in_tree

The SceneTree with which to associate this new root SceneTreeItem.

Param in_model

The Model for this root SceneTreeItem.

SceneTreeItem (HPS.SceneTree in_tree, HPS.View in_view)

This constructor creates a SceneTreeItem suitable for acting as a root in a SceneTree. This root would start at the View. The View provided to this constructor should be accessible from the Canvas associated with the SceneTree, otherwise an exception will be thrown.

See

SceneTree.SetRoot

Param in_tree

The SceneTree with which to associate this new root SceneTreeItem.

Param in_view

The View for this root SceneTreeItem.

SceneTreeItem (HPS.SceneTreeItem in_that)

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

Param in_that

The source SceneTreeItem to copy.

void Select ()

This function will be invoked when this SceneTreeItem should be marked as selected. Marking an item as selected means that the key backing this SceneTreeItem has been highlighted with the options specified in the associated SceneTree or is along a path in which a highlight has occurred. This highlighting may have come as a result of the Highlight function on a SceneTreeItem being invoked (not necessarily this SceneTreeItem), or potentially due to the HighlightOperator or HighlightAreaOperator highlighting the key backing this SceneTreeItem or highlighting some path which includes the key backing this SceneTreeItem. This function is meant to be overridden to allow one to change the appearance of a selected SceneTreeItem, e.g., by bolding the text or changing an icon, to signify this new state. If this function is overridden, the overriding function should invoke this base function.

void Unhighlight ()

This function will remove the highlight with the options specified in the associated SceneTree from this SceneTreeItem. This can cause elements along the path to this item (and this item itself) to be marked as unselected unless those items lie along a path which is still highlighted. Depending on the type of the SceneTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed.

See

Unselect

void Unhighlight (HPS.HighlightOptionsKit in_highlight_options)

This function will remove the highlight with the options specified in the associated SceneTree from this SceneTreeItem. This can cause elements along the path to this item (and this item itself) to be marked as unselected unless those items lie along a path which is still highlighted. Depending on the type of the SceneTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed. If the options requested is not part of the associated SceneTree highlight options, it will be added to them.

See

Unselect

void Unhighlight (ulong in_highlight_options_index)

This function will remove the highlight with the options specified in the associated SceneTree from this SceneTreeItem. This can cause elements along the path to this item (and this item itself) to be marked as unselected unless those items lie along a path which is still highlighted. Depending on the type of the SceneTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed.

See

Unselect

void Unselect ()

This function will be invoked when this SceneTreeItem should be marked as unselected. Marking an item as unselected means that the key backing this SceneTreeItem is no longer highlighted with the options specified in the associated SceneTree or is no longer along a path in which a highlight has occurred. This unhighlighting may have come as a result of the Unhighlight function on a SceneTreeItem being invoked (not necessarily this SceneTreeItem), or potentially due to the HighlightOperator or HighlightAreaOperator unhighlighting the key backing this SceneTreeItem. or unhighlighting some path which includes the key backing this SceneTreeItem. This function is meant to be overridden to allow one to change the appearance of a selected SceneTreeItem, e.g., by no longer bolding the text or changing an icon, to signify this new state. If this function is overridden, the overriding function should invoke this base function.

Public Static Functions

bool operator!= (HPS.SceneTreeItem a, HPS.SceneTreeItem b)
bool operator== (HPS.SceneTreeItem a, HPS.SceneTreeItem b)