< Home

< Table of Contents

REFERENCE MANUAL

ComponentTreeItem Class Referenceabstract

#include <sprk.h>

Inheritance diagram for ComponentTreeItem:
Sprocket Object

Public Member Functions

virtual ComponentTreeItemPtr AddChild (Component const &in_component, ComponentTree::ItemType in_type)=0
 
virtual void Assign (ComponentTreeItem const &in_that)
 
virtual void Collapse ()
 
 ComponentTreeItem ()
 
 ComponentTreeItem (ComponentTreeItem const &in_that)
 
 ComponentTreeItem (ComponentTreeItem &&in_that)
 
 ComponentTreeItem (ComponentTreePtr const &in_tree, CADModel const &in_cad_model)
 
 ComponentTreeItem (ComponentTreePtr const &in_tree, Component const &in_component, ComponentTree::ItemType in_type)
 
bool Equals (ComponentTreeItem const &in_that) const
 
virtual void Expand ()
 
Component GetComponent () const
 
ComponentTree::ItemType GetItemType () const
 
ComponentPath GetPath () const
 
UTF8 GetTitle () const
 
ComponentTreePtr GetTree () const
 
bool HasChildren () const
 
void Hide ()
 
void Highlight ()
 
bool IsHidden () const
 
bool IsHighlighted () const
 
void Isolate ()
 
Type ObjectType () const
 
virtual void OnHide ()
 
virtual void OnHighlight (HighlightOptionsKit const &in_options)
 
virtual void OnShow ()
 
virtual void OnUnhighlight (HighlightOptionsKit const &in_options)
 
bool operator!= (ComponentTreeItem const &in_that) const
 
ComponentTreeItemoperator= (ComponentTreeItem const &in_that)
 
ComponentTreeItemoperator= (ComponentTreeItem &&in_that)
 
bool operator== (ComponentTreeItem const &in_that) const
 
void Show ()
 
void Unhighlight ()
 
- Public Member Functions inherited from Sprocket
 Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (Type in_mask) const
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 
Type Type () const
 

Additional Inherited Members

- Public Types inherited from Sprocket
enum  UpdateType { Synchronous, Asynchronous }
 
- Static Public Member Functions inherited from Object
template<typename T >
static intptr_t ClassID ()
 

Detailed Description

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.

Constructor & Destructor Documentation

ComponentTreeItem::ComponentTreeItem ( )

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

ComponentTreeItem::ComponentTreeItem ( ComponentTreeItem const &  in_that)

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

Parameters
in_thatThe source ComponentTreeItem to copy.
ComponentTreeItem::ComponentTreeItem ( ComponentTreeItem &&  in_that)

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

Parameters
in_thatAn rvalue reference to a ComponentTreeItem to take the underlying object from.
ComponentTreeItem::ComponentTreeItem ( ComponentTreePtr const &  in_tree,
CADModel const &  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.

Parameters
in_treeThe ComponentTree with which to associate this new root ComponentTreeItem.
in_cad_modelThe CADModel for this root ComponentTreeItem.
See also
ComponentTree::SetRoot
ComponentTreeItem::ComponentTreeItem ( ComponentTreePtr const &  in_tree,
Component const &  in_component,
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.

Parameters
in_treeThe ComponentTree with which to associate this new ComponentTreeItem.
in_componentThe Component for this ComponentTreeItem. This value should come from the corresponding argument to AddChild.
in_typeThe type of this ComponentTreeItem. This value should come from the corresponding argument to AddChild.
See also
AddChild

Member Function Documentation

virtual ComponentTreeItemPtr ComponentTreeItem::AddChild ( Component const &  in_component,
ComponentTree::ItemType  in_type 
)
pure virtual

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.

Parameters
in_componentThe Component for this ComponentTreeItem. Should be passed to as the corresponding argument to the base constructor.
in_typeThe type for this ComponentTreeItem. Should be passed to as the corresponding argument to the base constructor.
Returns
A newly created object derived from ComponentTreeItem.
virtual void ComponentTreeItem::Assign ( ComponentTreeItem const &  in_that)
virtual

Share the underlying smart-pointer of the ComponentTreeItem source.

Parameters
in_thatThe ComponentTreeItem source of the assignment.
Returns
A reference to this ComponentTreeItem.
virtual void ComponentTreeItem::Collapse ( )
virtual

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.

bool ComponentTreeItem::Equals ( ComponentTreeItem const &  in_that) const

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

Parameters
in_thatThe source ComponentTreeItem to compare to this ComponentTreeItem.
Returns
true if the objects reference the same impl, false otherwise.
virtual void ComponentTreeItem::Expand ( )
virtual

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.

Component ComponentTreeItem::GetComponent ( ) const

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

Returns
The Component for this ComponentTreeItem.
ComponentTree::ItemType ComponentTreeItem::GetItemType ( ) const

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

Returns
The item type for this ComponentTreeItem.
ComponentPath ComponentTreeItem::GetPath ( ) const

Gets the ComponentPath corresponding to this ComponentTreeItem.

Returns
The ComponentPath corresponding to this ComponentTreeItem.
UTF8 ComponentTreeItem::GetTitle ( ) const

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

Returns
The title for this ComponentTreeItem.
ComponentTreePtr ComponentTreeItem::GetTree ( ) const

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

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

Indicates whether this ComponentTreeItem has any children.

Returns
Whether this ComponentTreeItem has any children.
void ComponentTreeItem::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.

See also
OnHide
void ComponentTreeItem::Highlight ( )

This function will cause this ComponentTreeItem to be highlighted with the options 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 ComponentTreeItem::IsHidden ( ) const

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.

Returns
Whether this ComponentTreeItem is currently hidden.
See also
Hide
Show
Isolate
ComponentPath::Hide
ComponentPath::Show
ComponentPath::Isolate
bool ComponentTreeItem::IsHighlighted ( ) const

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.

Returns
Whether this ComponentTreeItem is currently highlighted with the options specified in the associated ComponentTree.
See also
Highlight
Unhighlight
void ComponentTreeItem::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.

See also
OnHide
OnShow
Type ComponentTreeItem::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared. This does not necessarily give the true type of the underlying object.

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

Reimplemented from Object.

virtual void ComponentTreeItem::OnHide ( )
virtual

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.

virtual void ComponentTreeItem::OnHighlight ( HighlightOptionsKit const &  in_options)
virtual

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.

Parameters
in_optionsThe HighlightOptionsKit for the associated highlight.
virtual void ComponentTreeItem::OnShow ( )
virtual

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.

virtual void ComponentTreeItem::OnUnhighlight ( HighlightOptionsKit const &  in_options)
virtual

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.

Parameters
in_optionsThe HighlightOptionsKit for the associated unhighlight.
bool ComponentTreeItem::operator!= ( ComponentTreeItem const &  in_that) const

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

Parameters
in_thatThe source ComponentTreeItem to compare to this ComponentTreeItem.
Returns
true if the objects reference different impls, false otherwise.
ComponentTreeItem& ComponentTreeItem::operator= ( ComponentTreeItem const &  in_that)

Share the underlying smart-pointer of the ComponentTreeItem source.

Parameters
in_thatThe ComponentTreeItem source of the assignment.
Returns
A reference to this ComponentTreeItem.
ComponentTreeItem& ComponentTreeItem::operator= ( ComponentTreeItem &&  in_that)

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

Parameters
in_thatAn rvalue reference to a ComponentTreeItem to take the underlying object from.
Returns
A reference to this ComponentTreeItem.
bool ComponentTreeItem::operator== ( ComponentTreeItem const &  in_that) const

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

Parameters
in_thatThe source ComponentTreeItem to compare to this ComponentTreeItem.
Returns
true if the objects reference the same impl, false otherwise.
void ComponentTreeItem::Show ( )

This function will cause this ComponentTreeItem to be visible if it isn't already. This will cause this item to be marked as 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.

See also
OnShow
void ComponentTreeItem::Unhighlight ( )

This function will remove the highlight with the options specified in the associated ComponentTree from this ComponentTreeItem. This will cause this item to be marked as unhighlighted. Depending on the type of the ComponentTreeItem, sometimes an unhighlight is nonsensical. In this case, no unhighlight will be performed.

See also
OnUnhighlight

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