Hoops Visualize HPS  version 2018-SP2
Hoops Visualize HPS 3D Rendering Engine
Looking for a senior C++ dev?
I'm looking for work. Hire me!
HPS::ComponentTree Class Reference

The ComponentTree 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. More...

#include <sprk.h>

Inheritance diagram for HPS::ComponentTree:
Collaboration diagram for HPS::ComponentTree:

Public Types

enum  ItemType {
  ItemType::None,
  ItemType::ExchangeComponent,
  ItemType::ExchangeModelFile,
  ItemType::ExchangeViewGroup,
  ItemType::ExchangeAnnotationViewGroup,
  ItemType::ExchangePMIGroup,
  ItemType::ExchangeModelGroup,
  ItemType::ParasolidComponent,
  ItemType::ParasolidModelFile,
  ItemType::DWGComponent,
  ItemType::DWGModelFile
}
 Enumerates the types of items that can be contained in a ComponentTree. More...
 

Public Member Functions

 ComponentTree ()
 The default constructor creates an uninitialized ComponentTree object. More...
 
 ComponentTree (Canvas const &in_canvas, size_t in_layer=0)
 This constructor creates a ComponentTree object associated with a Canvas and a layer. More...
 
 ComponentTree (ComponentTree const &in_that)
 The copy constructor creates a ComponentTree object that shares the underlying smart-pointer of the source ComponentTree. More...
 
 ComponentTree (ComponentTree &&in_that)
 The move constructor creates a ComponentTree by transferring the underlying object of the rvalue reference to this ComponentTree. More...
 
virtual ~ComponentTree ()
 
virtual HPS::Type ObjectType () const
 
ComponentTreeoperator= (ComponentTree const &in_that)
 Share the underlying smart-pointer of the ComponentTree source. More...
 
ComponentTreeoperator= (ComponentTree &&in_that)
 The move assignment operator transfers the underlying object of the rvalue reference to this ComponentTree. More...
 
virtual void Assign (ComponentTree const &in_that)
 Share the underlying smart-pointer of the ComponentTree source. More...
 
bool Equals (ComponentTree const &in_that) const
 Check if the source ComponentTree points to the same underlying impl as this ComponentTree. More...
 
bool operator!= (ComponentTree const &in_that) const
 Check if the source ComponentTree points to a different impl than this ComponentTree. More...
 
bool operator== (ComponentTree const &in_that) const
 Check if the source ComponentTree points to the same underlying impl as this ComponentTree. More...
 
void SetHighlightOptions (HighlightOptionsKit const &in_options)
 Sets the highlight options that will be used by this ComponentTree. More...
 
void SetHighlightOptions (HighlightOptionsKitArray const &in_options)
 Sets the highlight options that will be used by this ComponentTree. More...
 
void SetHighlightOptions (size_t in_count, HighlightOptionsKit const in_options [])
 Sets the highlight options that will be used by this ComponentTree. More...
 
void AddHighlightOptions (HighlightOptionsKit const &in_options)
 Appends one highlight options kit to the array that will be used by this ComponentTree. More...
 
HighlightOptionsKitArray GetHighlightOptions () const
 Gets the highlight options that will be used by this ComponentTree. More...
 
void SetRoot (ComponentTreeItemPtr const &in_root)
 Sets the root ComponentTreeItem for this ComponentTree. More...
 
ComponentTreeItemPtr GetRoot () const
 Gets the root ComponentTreeItem for this ComponentTree. More...
 
virtual void Flush ()
 Resets the root ComponentTreeItem for this ComponentTree. More...
 
void ReExpand ()
 Collapses the root ComponentTreeItem for this ComponentTree and then re-expands the tree. More...
 
void SetHighlightEventHandling (bool in_state)
 Whether the ComponentTree should handle highlighting events. More...
 
bool GetHighlightEventHandling () const
 Whether this ComponentTree is currently handling highlight events This include expanding the tree to the highlighted components, and making the text for the highlighted component tree items bold. More...
 
virtual HPS::Type Type () const
 This function returns the true type of the underlying object. More...
 
virtual bool Empty () const
 Indicates whether this object has any values set on it. More...
 
virtual void Reset ()
 Resets this object to its initial, uninitialized state. More...
 
bool HasType (HPS::Type in_mask) const
 This function indicates whether this Object has the given Type mask. More...
 
intptr_t GetClassID () const
 Returns a unique identifier that is shared by all objects of the same class. More...
 
intptr_t GetInstanceID () const
 Returns an identifier that can be used to identify which instance of a class an object is. More...
 

Static Public Member Functions

template<typename T >
static intptr_t ClassID ()
 Unique identifier for this class. More...
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::ComponentTree
 

Detailed Description

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

Member Enumeration Documentation

◆ ItemType

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

Enumerator
None 

No type.

ExchangeComponent 

Item is an Exchange::Component.

ExchangeModelFile 

Item is an Exchange::CADModel.

ExchangeViewGroup 

Item is a collection of Exchange::Capture objects.

ExchangeAnnotationViewGroup 

Item is a collection of Exchange::Capture objects which are annotation captures.

ExchangePMIGroup 

Item is a collection of Exchange::Component objects representing PMI.

ExchangeModelGroup 

Item is a collection of root Exchange::Component objects.

ParasolidComponent 
ParasolidModelFile 
DWGComponent 
DWGModelFile 

Constructor & Destructor Documentation

◆ ComponentTree() [1/4]

HPS::ComponentTree::ComponentTree ( )

The default constructor creates an uninitialized ComponentTree object.

The Type() function will return Type::None.

◆ ComponentTree() [2/4]

HPS::ComponentTree::ComponentTree ( Canvas const &  in_canvas,
size_t  in_layer = 0 
)

This constructor creates a ComponentTree object associated with a Canvas and a layer.

This constructor should be used to create a new ComponentTree object.

Parameters
in_canvasThe Canvas to associate this ComponentTree with.
in_layerThe layer in the Canvas to associate this ComponentTree with.

◆ ComponentTree() [3/4]

HPS::ComponentTree::ComponentTree ( ComponentTree const &  in_that)

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

Parameters
in_thatThe source ComponentTree to copy.

◆ ComponentTree() [4/4]

HPS::ComponentTree::ComponentTree ( ComponentTree &&  in_that)

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

Parameters
in_thatAn rvalue reference to a ComponentTree to take the underlying object from.

◆ ~ComponentTree()

virtual HPS::ComponentTree::~ComponentTree ( )
virtual

Member Function Documentation

◆ AddHighlightOptions()

void HPS::ComponentTree::AddHighlightOptions ( HighlightOptionsKit const &  in_options)

Appends one highlight options kit to the array that will be used by this ComponentTree.

These options are used to perform highlights of elements within the tree and to determine what items within the tree need to be marked as highlighted when highlights are performed by ComponentPath::Highlight. If the options kit requested is already part of the ComponentTree highlight options array, it will not be added to it.

Parameters
in_optionsThe highlight options that will be used by this ComponentTree.
See also
ComponentTreeItem::Highlight
ComponentTreeItem::Unhighlight
ComponentPath::Highlight
ComponentPath::Unhighlight

◆ Assign()

virtual void HPS::ComponentTree::Assign ( ComponentTree const &  in_that)
virtual

Share the underlying smart-pointer of the ComponentTree source.

Parameters
in_thatThe ComponentTree source of the assignment.
Returns
A reference to this ComponentTree.

◆ ClassID()

template<typename T >
static intptr_t HPS::Object::ClassID ( )
inlinestaticinherited

Unique identifier for this class.

Note: this method uses construction of static objects. If used in a constructor, it should be used in the body not the initializer list.

◆ Empty()

virtual bool HPS::Object::Empty ( ) const
inlinevirtualinherited

Indicates whether this object has any values set on it.

Returns
true if no values are set on this object, false otherwise.

Reimplemented in HPS::STL::ImportResultsKit, HPS::STL::ImportOptionsKit, HPS::OBJ::ImportResultsKit, HPS::OBJ::ImportOptionsKit, HPS::Hardcopy::File::ExportOptionsKit, HPS::Stream::ExportOptionsKit, HPS::Stream::ImportResultsKit, HPS::Stream::ImportOptionsKit, HPS::PointCloud::ImportOptionsKit, HPS::PointCloud::ImportResultsKit, HPS::UpdateOptionsKit, HPS::HighlightSearchOptionsKit, HPS::HighlightOptionsKit, HPS::SelectionOptionsKit, HPS::SearchOptionsKit, HPS::CutGeometryGatheringOptionsKit, HPS::ShapeKit, HPS::ShaderKit, HPS::Shader::ImportOptionsKit, HPS::ImageKit, HPS::Image::ImportOptionsKit, HPS::Image::ExportOptionsKit, HPS::TextureOptionsKit, HPS::LinePatternKit, HPS::LinePatternParallelKit, HPS::LinePatternOptionsKit, HPS::GlyphKit, HPS::ApplicationWindowOptionsKit, HPS::OffScreenWindowOptionsKit, HPS::StandAloneWindowOptionsKit, HPS::GridKit, HPS::PolygonKit, HPS::MeshKit, HPS::ShellKit, HPS::ShellRelationResultsKit, HPS::ShellRelationOptionsKit, HPS::ShellOptimizationOptionsKit, HPS::TextKit, HPS::EllipticalArcKit, HPS::EllipseKit, HPS::TrimKit, HPS::NURBSSurfaceKit, HPS::NURBSCurveKit, HPS::SpotlightKit, HPS::InfiniteLineKit, HPS::CuttingSectionKit, HPS::CircularWedgeKit, HPS::CircularArcKit, HPS::CircleKit, HPS::SphereKit, HPS::CylinderKit, HPS::DistantLightKit, HPS::MarkerKit, HPS::LineKit, HPS::AttributeLockKit, HPS::FontInfoState, HPS::WindowInfoKit, HPS::DebuggingKit, HPS::SubwindowKit, HPS::ContourLineKit, HPS::VisualEffectsKit, HPS::TransformMaskKit, HPS::PostProcessEffectsKit, HPS::DrawingAttributeKit, HPS::HiddenLineAttributeKit, HPS::PerformanceKit, HPS::NURBSSurfaceAttributeKit, HPS::MaterialKit, HPS::MaterialMappingKit, HPS::MatrixKit, HPS::CurveAttributeKit, HPS::EdgeAttributeKit, HPS::LineAttributeKit, HPS::TextAttributeKit, HPS::CuttingSectionAttributeKit, HPS::CylinderAttributeKit, HPS::LightingAttributeKit, HPS::SphereAttributeKit, HPS::MarkerAttributeKit, HPS::CullingKit, HPS::ColorInterpolationKit, HPS::TransparencyKit, HPS::SelectabilityKit, HPS::CameraKit, HPS::VisibilityKit, HPS::BoundingKit, HPS::SegmentOptimizationOptionsKit, HPS::Publish::ExportOptionsKit, HPS::Publish::TextFieldKit, HPS::Publish::SignatureFieldKit, HPS::Publish::DropDownListKit, HPS::Exchange::TessellationOptionsKit, HPS::Publish::ListBoxKit, HPS::Exchange::ExportSTEPOptionsKit, HPS::Exchange::ExportParasolidOptionsKit, HPS::Publish::RadioButtonKit, HPS::Exchange::ExportIGESOptionsKit, HPS::Exchange::ExportXMLOptionsKit, HPS::Publish::CheckBoxKit, HPS::Exchange::ExportU3DOptionsKit, HPS::Exchange::ExportSTLOptionsKit, HPS::Publish::ButtonKit, HPS::Exchange::ExportPRCOptionsKit, HPS::Publish::LinkKit, HPS::Exchange::ExportJTOptionsKit, HPS::Publish::SlideTableKit, HPS::Exchange::ExportACISOptionsKit, HPS::Publish::TableKit, HPS::Exchange::Export3MFOptionsKit, HPS::Publish::ImageKit, HPS::Publish::TextKit, HPS::Exchange::ModelFileImportOptionsKit, HPS::Publish::ViewKit, HPS::Exchange::TranslationOptionsKit, HPS::Publish::ArtworkKit, HPS::Publish::AnnotationKit, HPS::ComponentPath, HPS::Exchange::ImportOptionsKit, HPS::Parasolid::ExportOptionsKit, HPS::Exchange::NURBSConversionOptionsKit, HPS::Parasolid::LineTessellationKit, HPS::Exchange::Configuration, HPS::Publish::PageKit, HPS::Parasolid::FacetTessellationKit, HPS::Publish::DocumentKit, HPS::Parasolid::ImportOptionsKit, HPS::DWG::ImportOptionsKit, HPS::OOC::ImportOptionsKit, HPS::Sketchup::ImportOptionsKit, and HPS::Sketchup::ImportResultsKit.

◆ Equals()

bool HPS::ComponentTree::Equals ( ComponentTree const &  in_that) const

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

Parameters
in_thatThe source ComponentTree to compare to this ComponentTree.
Returns
true if the objects reference the same impl, false otherwise.

◆ Flush()

virtual void HPS::ComponentTree::Flush ( )
virtual

Resets the root ComponentTreeItem for this ComponentTree.

This will release the root ComponentTreeItem by this ComponentTree and set the root to a null pointer. If this function is overridden, the overriding function should invoke this base function.

◆ GetClassID()

intptr_t HPS::Object::GetClassID ( ) const
inherited

Returns a unique identifier that is shared by all objects of the same class.

Returns
A unique value shared by all objects of the same class.

◆ GetHighlightEventHandling()

bool HPS::ComponentTree::GetHighlightEventHandling ( ) const

Whether this ComponentTree is currently handling highlight events This include expanding the tree to the highlighted components, and making the text for the highlighted component tree items bold.

Returns
Whether this ComponentTree is currently handling highlight events.

◆ GetHighlightOptions()

HighlightOptionsKitArray HPS::ComponentTree::GetHighlightOptions ( ) const

Gets the highlight options that will be used by this ComponentTree.

Returns
An array of highlight options that will be used by this ComponentTree.

◆ GetInstanceID()

intptr_t HPS::Object::GetInstanceID ( ) const
inherited

Returns an identifier that can be used to identify which instance of a class an object is.

Different keys and controls will return the same value if they are backed by the same database resource.

Returns
A value unique to an instance of an object and all objects that are backed by the same database resource.

◆ GetRoot()

ComponentTreeItemPtr HPS::ComponentTree::GetRoot ( ) const

Gets the root ComponentTreeItem for this ComponentTree.

Returns
The root ComponentTreeItem for this ComponentTree.

◆ HasType()

bool HPS::Object::HasType ( HPS::Type  in_mask) const
inherited

This function indicates whether this Object has the given Type mask.

Parameters
in_maskThe Type mask to check against this Object.
Returns
true if this Object has the given Type mask, false otherwise.

◆ ObjectType()

virtual HPS::Type HPS::ComponentTree::ObjectType ( ) const
inlinevirtual

Reimplemented from HPS::Object.

Here is the call graph for this function:

◆ operator!=()

bool HPS::ComponentTree::operator!= ( ComponentTree const &  in_that) const

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

Parameters
in_thatThe source ComponentTree to compare to this ComponentTree.
Returns
true if the objects reference different impls, false otherwise.

◆ operator=() [1/2]

ComponentTree& HPS::ComponentTree::operator= ( ComponentTree const &  in_that)

Share the underlying smart-pointer of the ComponentTree source.

Parameters
in_thatThe ComponentTree source of the assignment.
Returns
A reference to this ComponentTree.

◆ operator=() [2/2]

ComponentTree& HPS::ComponentTree::operator= ( ComponentTree &&  in_that)

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

Parameters
in_thatAn rvalue reference to a ComponentTree to take the underlying object from.
Returns
A reference to this ComponentTree.

◆ operator==()

bool HPS::ComponentTree::operator== ( ComponentTree const &  in_that) const

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

Parameters
in_thatThe source ComponentTree to compare to this ComponentTree.
Returns
true if the objects reference the same impl, false otherwise.

◆ ReExpand()

void HPS::ComponentTree::ReExpand ( )

Collapses the root ComponentTreeItem for this ComponentTree 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.

◆ Reset()

◆ SetHighlightEventHandling()

void HPS::ComponentTree::SetHighlightEventHandling ( bool  in_state)

Whether the ComponentTree should handle highlighting events.

This include expanding the tree to the highlighted components, and making the text for the highlighted component tree items bold. By default the ComponentTree will handle highlight events.

Parameters
in_stateWhether to handle highlight events.

◆ SetHighlightOptions() [1/3]

void HPS::ComponentTree::SetHighlightOptions ( HighlightOptionsKit const &  in_options)

Sets the highlight options that will be used by this ComponentTree.

These options are used to perform highlights of elements within the tree and to determine what items within the tree need to be marked as highlighted when highlights are performed by ComponentPath::Highlight. Calling this function replaces any highlight options previously set on this object.

Parameters
in_optionsThe highlight options that will be used by this ComponentTree.
See also
ComponentTreeItem::Highlight
ComponentTreeItem::Unhighlight
ComponentPath::Highlight
ComponentPath::Unhighlight

◆ SetHighlightOptions() [2/3]

void HPS::ComponentTree::SetHighlightOptions ( HighlightOptionsKitArray const &  in_options)

Sets the highlight options that will be used by this ComponentTree.

These options are used to perform highlights of elements within the tree and to determine what items within the tree need to be marked as highlighted when highlights are performed by ComponentPath::Highlight. Calling this function replaces any highlight options previously set on this object. All elements of the array should be unique. In the case of multiple identical elements, only the first unique one will be added.

Parameters
in_optionsAn array of highlight options that will be used by this ComponentTree.
See also
ComponentTreeItem::Highlight
ComponentTreeItem::Unhighlight
ComponentPath::Highlight
ComponentPath::Unhighlight

◆ SetHighlightOptions() [3/3]

void HPS::ComponentTree::SetHighlightOptions ( size_t  in_count,
HighlightOptionsKit const  in_options[] 
)

Sets the highlight options that will be used by this ComponentTree.

These options are used to perform highlights of elements within the tree and to determine what items within the tree need to be marked as highlighted when highlights are performed by ComponentPath::Highlight. Calling this function replaces any highlight options previously set on this object. All elements of the array should be unique. In the case of multiple identical elements, only the first unique one will be added.

Parameters
in_countthe number of highlight options kits in the in_options array
in_optionsAn array of highlight options that will be used by this ComponentTree.
See also
ComponentTreeItem::Highlight
ComponentTreeItem::Unhighlight
ComponentPath::Highlight
ComponentPath::Unhighlight

◆ SetRoot()

void HPS::ComponentTree::SetRoot ( ComponentTreeItemPtr const &  in_root)

Sets the root ComponentTreeItem for this ComponentTree.

This object should be created on the heap and it should have been created with a ComponentTreeItem constructor which took a CADModel, otherwise an exception will be thrown. Additionally, if there was already an existing root for this ComponentTree, the Flush function will be invoked prior to setting this as the new root, and Expand will be invoked on the new root.

Parameters
in_rootThe root ComponentTreeItem for this ComponentTree.
See also
Flush
ComponentTreeItem::Expand

◆ Type()

Member Data Documentation

◆ staticType

const HPS::Type HPS::ComponentTree::staticType = HPS::Type::ComponentTree
static

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