ComponentTreeItem

class HPS.ComponentTreeItem : HPS.Sprocket

The ComponentTreeItem 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 component or model browser.

Subclassed by HPS.ComponentTreeItem.ComponentTreeItemUnknown

Public Functions

abstract HPS.ComponentTreeItem AddChild (HPS.Component in_component, HPS.ComponentTree.ItemType in_type)

This function is used to create a new ComponentTreeItem to be the child of this ComponentTreeItem. This function will be invoked if this ComponentTreeItem 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. Additionally, since this function requires the creation of a derived ComponentTreeItem, that derived ComponentTreeItem should use the base constructor which takes the same arguments this function.

Param in_component:
 The Component for this ComponentTreeItem. Should be passed to as the corresponding argument to the base constructor.
Param in_type:The type for this ComponentTreeItem. Should be passed to as the corresponding argument to the base constructor.
Return:A newly created object derived from ComponentTreeItem.
void Assign (HPS.ComponentTreeItem in_that)

Share the underlying smart-pointer of the ComponentTreeItem source.

Param in_that:The ComponentTreeItem source of the assignment.
Return:A reference to this ComponentTreeItem.
void Collapse ()

This function should be invoked when this ComponentTreeItem 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 ComponentTreeItem when invoked.

ComponentTreeItem ()

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

ComponentTreeItem (HPS.ComponentTree in_tree, HPS.CADModel in_cad_model)

This constructor creates a ComponentTreeItem suitable for acting as a root in a ComponentTree. The CADModel provided to this constructor should be accessible from the Canvas and layer associated with the ComponentTree, otherwise an exception will be thrown.

Param in_tree:The ComponentTree with which to associate this new root ComponentTreeItem.
Param in_cad_model:
 The CADModel for this root ComponentTreeItem.
ComponentTreeItem (HPS.ComponentTree in_tree, HPS.Component in_component, HPS.ComponentTree.ItemType in_type)

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

See also

AddChild

Param in_tree:The ComponentTree with which to associate this new ComponentTreeItem.
Param in_component:
 The Component for this ComponentTreeItem. This value should come from the corresponding argument to AddChild.
Param in_type:The type of this ComponentTreeItem. This value should come from the corresponding argument to AddChild.
ComponentTreeItem (HPS.ComponentTreeItem in_that)

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

Param in_that:The source ComponentTreeItem to copy.
override void Dispose ()
delegate void DtorDelegate (IntPtr cPtr)
bool Equals (HPS.ComponentTreeItem in_that)

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

Param in_that:The source ComponentTreeItem to compare to this ComponentTreeItem.
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 ComponentTreeItem 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 ComponentTreeItem when invoked.

HPS.Component GetComponent ()

Gets the Component for this ComponentTreeItem. The type of the Component depends on the ComponentTree.ItemType for this ComponentTreeItem.

Return:The Component for this ComponentTreeItem.
override int GetHashCode ()
HPS.ComponentTree.ItemType GetItemType ()

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

Return:The item type for this ComponentTreeItem.
HPS.ComponentPath GetPath ()

Gets the ComponentPath corresponding to this ComponentTreeItem.

Return:The ComponentPath corresponding to this ComponentTreeItem.
string GetTitle ()

Gets the title for this ComponentTreeItem. This is the text that should be displayed for this ComponentTreeItem in the ComponentTree.

Return:The title for this ComponentTreeItem.
HPS.ComponentTree GetTree ()

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

Return:The ComponentTree associated with this ComponentTreeItem.
bool HasChildren ()

Indicates whether this ComponentTreeItem has any children.

Return:Whether this ComponentTreeItem has any children.
void Hide ()

This function will cause this ComponentTreeItem to be hidden if it isn’t already. This will cause this item to be marked as hidden if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a hide is nonsensical. In this case, no hide will be performed. If activated, this forces the visibility of the associated ComponentPath and all components under this path to invisible. Any visibility changes made previously at or below this path are flushed. When performing a highlight in combination with this function the highlight must be applied with Drawing.Overlay.InPlace to display properly. See this section for limitations and details on managing component visibility.

See also

OnHide

See also

Show

See also

Isolate

See also

ResetVisibility

See also

IsHidden

See also

Programming Guide: Managing Component Visibility

void Highlight ()

This function will cause this ComponentTreeItem to be highlighted with the nth option specified in the associated ComponentTree. This will cause this item to be marked as highlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed.

See also

OnHighlight

void Highlight (HPS.HighlightOptionsKit in_highlight_options)

This function will cause this ComponentTreeItem to be highlighted with the options specified. If the options requested is not part of the associated ComponentTree highlight options, it will be added to them. This will cause this item to be marked as highlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed.

See also

OnHighlight

Param in_highlight_options:
 The highlight options used during highlighting
void Highlight (ulong in_highlight_options_index)

This function will cause this ComponentTreeItem to be highlighted with the nth option specified in the associated ComponentTree. This will cause this item to be marked as highlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a highlight is nonsensical. In this case, no highlight will be performed.

See also

OnHighlight

bool IsExpanded ()

Indicates whether this ComponentTreeItem is currently expanded.

Return:Whether this ComponentTreeItem is currently expanded.
bool IsHidden ()

Indicates whether this ComponentTreeItem is currently hidden. This may mean that the Hide function on this ComponentTreeItem was invoked, or that the Component backing this ComponentTreeItem was hidden via ComponentPath.Hide or ComponentPath.Isolate.

See also

Hide

See also

Show

See also

Isolate

See also

ResetVisibility

See also

Programming Guide: Managing Component Visibility

Note

The state of this ComponentTreeItem may not yet mirror the state of the underlying ComponentPath as the notification is asynchronous. In order for this ComponentTreeItem to mirror the state of the underlying ComponentPath, a synchronous update needs to be performed on the associated view.

Return:Whether this ComponentTreeItem is currently hidden.
bool IsHighlighted ()

Indicates whether this ComponentTreeItem is currently highlighted with the options specified in the associated ComponentTree. This may mean that the Highlight function on this ComponentTreeItem was invoked, or that the Component backing this ComponentTreeItem was highlighted by ComponentPath.Highlight.

See also

Highlight

See also

Unhighlight

Note

The state of this ComponentTreeItem may not yet mirror the state of the underlying ComponentPath as the notification is asynchronous. In order for this ComponentTreeItem to mirror the state of the underlying ComponentPath, a synchronous update needs to be performed on the associated view.

Return:Whether this ComponentTreeItem is currently highlighted with the options specified in the associated ComponentTree.
void Isolate ()

This function will cause this ComponentTreeItem to be isolated, i.e., all other items will be hidden and this item will be shown. This will cause this item to be marked as visible if it isn’t already, and all other items to be marked as hidden. Depending on the type of the ComponentTreeItem, sometimes an isolate is nonsensical. In this case, no isolate will be performed. When performing a highlight in combination with this function the highlight must be applied with Drawing.Overlay.InPlace to display properly. See this section for limitations and details on managing component visibility.

See also

OnHide

See also

OnShow

See also

Show

See also

Hide

See also

ResetVisibility

See also

IsHidden

See also

Programming Guide: Managing Component Visibility

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

This function will be invoked when this ComponentTreeItem should be marked as hidden. This hiding may have come as a result of the Hide or Isolate function on a ComponentTreeItem being invoked, or due to ComponentPath.Hide being invoked on the Component backing this ComponentTreeItem. This function is meant to be overridden to allow one to change the appearance of a hidden ComponentTreeItem, e.g., by graying the text or changing an icon, to signify this new state. If this function is overridden, the overriding function should invoke this base function.

See also

Hide

void OnHighlight (HPS.HighlightOptionsKit in_options)

This function will be invoked when this ComponentTreeItem should be marked as highlighted. This highlighting may have come as a result of the Highlight function on a ComponentTreeItem being invoked, or due to ComponentPath.Highlight being invoked on the Component backing this ComponentTreeItem. This function is meant to be overridden to allow one to change the appearance of a highlighted ComponentTreeItem, 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.

Param in_options:
 The HighlightOptionsKit for the associated highlight.
void OnShow ()

This function will be invoked when this ComponentTreeItem should be marked as visible. This visibility may have come as a result of the Show or Isolate function on a ComponentTreeItem being invoked, or due to ComponentPath.Show or ComponentPath.Isolate being invoked on the Component backing this ComponentTreeItem. This function is meant to be overridden to allow one to change the appearance of a visible ComponentTreeItem, e.g., by no longer graying out the text or changing an icon, to signify this new state. If this function is overridden, the overriding function should invoke this base function.

See also

Show

void OnUnhighlight (HPS.HighlightOptionsKit in_options)

This function will be invoked when this ComponentTreeItem should be marked as unhighlighted. This unhighlighting may have come as a result of the Unhighlight function on a ComponentTreeItem being invoked, or due to ComponentPath.Unhighlight being invoked on the Component backing this ComponentTreeItem. This function is meant to be overridden to allow one to change the appearance of a unhighlighted ComponentTreeItem, 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.

Param in_options:
 The HighlightOptionsKit for the associated unhighlight.
void ReExpand ()

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

delegate void RemoveCacheItemDelegate (IntPtr cPtr)
void ResetVisibility ()

This function will cause the visibility of this ComponentTreeItem to be reset to what is dictated by the associated CADModel & View. See this section for limitations and details on managing component visibility.

See also

Hide

See also

Show

See also

Isolate

See also

IsHidden

See also

Programming Guide: Managing Component Visibility

void Show ()

This function will cause this ComponentTreeItem to be visible if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a show is nonsensical. In this case, no show will be performed. If activated, this makes the selected path visibile but preserves the model-defined visibility of any components that exist underneath the associated ComponentPath. Any visibility changes made subsequently at or below this path are honored unless they are redundant. When performing a highlight in combination with this function the highlight must be applied with Drawing.Overlay.InPlace to display properly. See this section for limitations and details on managing component visibility.

See also

OnShow

See also

Hide

See also

Isolate

See also

ResetVisibility

See also

IsHidden

See also

Programming Guide: Managing Component Visibility

void Unhighlight ()

This function will cause this ComponentTreeItem to be unhighlighted with the nth option specified in the associated ComponentTree. This will cause this item to be marked as unhighlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed.

See also

OnUnhighlight

void Unhighlight (HPS.HighlightOptionsKit in_highlight_options)

This function will cause this ComponentTreeItem to be unhighlighted with the options specified. If the options requested is not part of the associated ComponentTree highlight options, it will be added to them. This will cause this item to be marked as unhighlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes a highlight is nonsensical. In this case, no unhighlight will be performed.

See also

OnUnhighlight

Param in_highlight_options:
 The highlight options used during unhighlighting
void Unhighlight (ulong in_highlight_options_index)

This function will cause this ComponentTreeItem to be unhighlighted with the nth option specified in the associated ComponentTree. This will cause this item to be marked as unhighlighted if it isn’t already. Depending on the type of the ComponentTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed.

See also

OnUnhighlight

Public Static Functions

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