#include <sprk.h>

Inheritance diagram for HPS::Component:
HPS::Sprocket HPS::Object HPS::CADModel HPS::Capture HPS::DWG::Component HPS::Exchange::Component HPS::Filter HPS::Parasolid::Component HPS::DWG::CADModel HPS::Exchange::CADModel HPS::Parasolid::CADModel HPS::DWG::Layout HPS::Exchange::Capture HPS::DWG::Layer HPS::Exchange::ProductOccurrence HPS::Exchange::Sheet HPS::Exchange::Filter

Public Types

enum  ComponentType : uint32_t {
  None = 0x00000000, GenericMask = 0xfffff000, ComponentType::ExchangeComponentMask = 0x00001000, ComponentType::ExchangeModelFile = 0x00001001,
  ComponentType::ExchangeProductOccurrence = 0x00001002, ComponentType::ExchangePartDefinition = 0x00001003, ComponentType::ExchangeView = 0x00001004, ComponentType::ExchangeFilter = 0x00001005,
  ComponentType::ExchangeRepresentationItemMask = 0x00003000, ComponentType::ExchangeRIBRepModel = 0x00003001, ComponentType::ExchangeRICurve = 0x00003002, ComponentType::ExchangeRIDirection = 0x00003003,
  ComponentType::ExchangeRIPlane = 0x00003004, ComponentType::ExchangeRIPointSet = 0x00003005, ComponentType::ExchangeRIPolyBRepModel = 0x00003006, ComponentType::ExchangeRIPolyWire = 0x00003007,
  ComponentType::ExchangeRISet = 0x00003008, ComponentType::ExchangeRICoordinateSystem = 0x00003009, ComponentType::ExchangeTopologyMask = 0x00005000, ComponentType::ExchangeTopoBody = 0x00005001,
  ComponentType::ExchangeTopoConnex = 0x00005002, ComponentType::ExchangeTopoShell = 0x00005003, ComponentType::ExchangeTopoFace = 0x00005004, ComponentType::ExchangeTopoLoop = 0x00005005,
  ComponentType::ExchangeTopoCoEdge = 0x00005006, ComponentType::ExchangeTopoEdge = 0x00005007, ComponentType::ExchangeTopoVertex = 0x00005008, ComponentType::ExchangeTopoSingleWireBody = 0x00005009,
  ComponentType::ExchangeTopoWireEdge = 0x0000500a, ComponentType::ExchangeDrawingMask = 0x00009000, ComponentType::ExchangeDrawingModel = 0x00009001, ComponentType::ExchangeDrawingView = 0x00009002,
  ComponentType::ExchangeDrawingSheet = 0x00009003, ComponentType::ExchangeBasicDrawingBlock = 0x00009004, ComponentType::ExchangeOperatorDrawingBlock = 0x00009005, ComponentType::ExchangePMIMask = 0x00011000,
  ComponentType::ExchangePMI = ExchangePMIMask, ComponentType::ExchangePMIText = 0x00011100, ComponentType::ExchangePMIRichText = 0x00011200, ComponentType::ExchangePMIRoughness = 0x00011300,
  ComponentType::ExchangePMIGDT = 0x00011400, ComponentType::ExchangePMIDatum = 0x00011500, ComponentType::ExchangePMILineWelding = 0x00011600, ComponentType::ExchangePMISpotWelding = 0x00011700,
  ComponentType::ExchangePMIDimension = 0x00011800, ComponentType::ExchangePMIBalloon = 0x00011900, ComponentType::ExchangePMICoordinate = 0x00011a00, ComponentType::ExchangePMIFastener = 0x00011b00,
  ComponentType::ExchangePMILocator = 0x00011c00, ComponentType::ExchangePMIMeasurementPoint = 0x00011d00, ComponentType::ParasolidComponentMask = 0x00020000, ComponentType::ParasolidModelFile = 0x00020001,
  ComponentType::ParasolidAssembly = 0x00020002, ComponentType::ParasolidInstance = 0x00020003, ComponentType::ParasolidTopologyMask = 0x00060000, ComponentType::ParasolidTopoBody = 0x00060001,
  ComponentType::ParasolidTopoRegion = 0x00060002, ComponentType::ParasolidTopoShell = 0x00060003, ComponentType::ParasolidTopoFace = 0x00060004, ComponentType::ParasolidTopoLoop = 0x00060005,
  ComponentType::ParasolidTopoFin = 0x00060006, ComponentType::ParasolidTopoEdge = 0x00060007, ComponentType::ParasolidTopoVertex = 0x00060008, ComponentType::DWGComponentMask = 0x00100000,
  ComponentType::DWGModelFile = 0x00100001, ComponentType::DWGLayout = 0x00100002, ComponentType::DWGBlockTable = 0x00100003, ComponentType::DWGBlockTableRecord = 0x00100004,
  ComponentType::DWGEntity = 0x00100005, ComponentType::DWGLayerTable = 0x00100006, ComponentType::DWGLayer = 0x00100007, ComponentType::UserComponent = 0x01000000
}





 
enum  DeleteMode { Standard, Full, StandardAndExchange }
 

Public Member Functions

void AddKey (Key const &in_key)
 
void AddOwner (Component &in_owner, IncludeKey const &in_include=IncludeKey())
 
void AddReference (Component &in_reference)
 
bool AddTransform (MatrixKit const &in_transform)
 
virtual void Assign (Component const &in_that)
 
 Component ()
 
 Component (Component const &in_that)
 
 Component (Component &&in_that)
 
Component CopyTo (HPS::Component const &in_new_owner)
 
void Delete (HPS::Component::DeleteMode mode=HPS::Component::DeleteMode::Standard)
 
bool Equals (Component const &in_that) const
 
void Flush ()
 
MetadataArray GetAllMetadata () const
 
ComponentArray GetAllSubcomponents (ComponentType in_type) const
 
ComponentType GetComponentType () const
 
KeyArray GetKeys () const
 
Metadata GetMetadata (char const *in_name) const
 
UTF8 GetName () const
 
ComponentArray GetOwners () const
 
ComponentArray GetReferences () const
 
ComponentArray GetReferrers () const
 
ComponentArray GetSubcomponents () const
 
bool HasComponentType (ComponentType in_mask) const
 
HPS::Type ObjectType () const
 
bool operator!= (Component const &in_that) const
 
Componentoperator= (Component const &in_that)
 
Componentoperator= (Component &&in_that)
 
bool operator== (Component const &in_that) const
 
bool SetName (char const *in_new_name)
 
bool SetTransform (MatrixKit const &in_transform)
 
virtual ~Component ()
 
- Public Member Functions inherited from HPS::Sprocket
 Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 
virtual HPS::Type Type () const
 

Static Public Member Functions

static KeyPathArray GetKeyPath (Component const &in_component)
 
static KeyPathArray GetKeyPath (size_t in_count, Component const in_components[])
 
static KeyPathArray GetKeyPath (ComponentArray const &in_components)
 
- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::Component
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Detailed Description

The Component class is a smart pointer. It represents an arbitrary component of a structured file.

Member Enumeration Documentation

◆ ComponentType

enum HPS::Component::ComponentType : uint32_t
strong

Enumerates the format-dependent types a Component can represent.

Enumerator
ExchangeComponentMask 

Mask for any Exchange components.

ExchangeModelFile 

Represents an A3DAsmModelFile in Exchange. This will be represented by an Exchange::CADModel.

ExchangeProductOccurrence 

Represents an A3DAsmProductOccurrence in Exchange. This will be represented by an Exchange::Component.

ExchangePartDefinition 

Represents an A3DAsmPartDefinition in Exchange. This will be represented by an Exchange::Component.

ExchangeView 

Represents an A3DMkpView in Exchange. This will be represented by an Exchange::Capture component.

ExchangeFilter 

Represents an A3DMkpFilter in Exchange. This will be represented by an Exchange::Filter component.

ExchangeRepresentationItemMask 

Mask for any Exchange representation items.

ExchangeRIBRepModel 

Represents an A3DRiBrepModel in Exchange. This will be represented by an Exchange::Component.

ExchangeRICurve 

Represents an A3DRiCurve in Exchange. This will be represented by an Exchange::Component.

ExchangeRIDirection 

Represents an A3DRiDirection in Exchange. This will be represented by an Exchange::Component.

ExchangeRIPlane 

Represents an A3DRiPlane in Exchange. This will be represented by an Exchange::Component.

ExchangeRIPointSet 

Represents an A3DRiPointSet in Exchange. This will be represented by an Exchange::Component.

ExchangeRIPolyBRepModel 

Represents an A3DRiPolyBrepModel in Exchange. This will be represented by an Exchange::Component.

ExchangeRIPolyWire 

Represents an A3DRiPolyWire in Exchange. This will be represented by an Exchange::Component.

ExchangeRISet 

Represents an A3DRiSet in Exchange. This will be represented by an Exchange::Component.

ExchangeRICoordinateSystem 

Represents an A3DRiCoordinateSystem in Exchange. This will be represented by an Exchange::Component.

ExchangeTopologyMask 

Mask for any Exchange topology items.

ExchangeTopoBody 

Represents an A3DTopoBody in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoConnex 

Represents an A3DTopoConnex in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoShell 

Represents an A3DTopoShell in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoFace 

Represents an A3DTopoFace in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoLoop 

Represents an A3DTopoLoop in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoCoEdge 

Represents an A3DTopoCoEdge in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoEdge 

Represents an A3DTopoEdge in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoVertex 

Represents an A3DTopoVertex in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoSingleWireBody 

Represents an A3DTopoSingleWireBody in Exchange. This will be represented by an Exchange::Component.

ExchangeTopoWireEdge 

Represents an A3DTopoWireEdge in Exchange. This will be represented by an Exchange::Component.

ExchangeDrawingMask 

Mask for any Exchange drawing item.

ExchangeDrawingModel 

Represents an A3DDrawingModel in Exchange. This is the starting point of a drawing. It is found under a product occurrence. Generally there is only one Drawing Model per file, but it is possible to have more than one. This will be represented by an Exchange::Component.

ExchangeDrawingView 

Represents an A3DDrawingView in Exchange. A Drawing Sheet can contain views. Views are basically snapshot of the model from a particular angle. Each view has a name and a type, for example, front view, side view, section, etc. This will be represented by an Exchange::Component.

ExchangeDrawingSheet 

Represents an A3DDrawingSheet in Exchange. A DrawingModel contains one or more sheets. Each sheet represents a physical sheet of paper. Generally a sheet defines the frame of the drawing, contains the name of the paper format it reproduces, and contains a transform. One of the sheets is classified as the "active sheet" by the model, and this one will be what you see when you first load a drawing. There can only be one active sheet at the time, with all the inactive ones being hidden. Drawing sheets have metadata associated with them called 'IsDefaultSheet'. This is a BooleanMetadata. It will return true if the sheet is the active sheet, and false otherwise. This will be represented by an Exchange::Component.

ExchangeBasicDrawingBlock 

Represents an A3DDrawingBlockBasic in Exchange. Sheets and views contain blocks. Blocks can be of two types: basic or operator blocks. Operator blocks are blocks which reference a particular view. These two types are internally treated as the same thing. Blocks contain the actual representation items which will be tessellated and drawn on the screen. This will be represented by an Exchange::Component.

ExchangeOperatorDrawingBlock 

Represents an A3DDrawingBlockOperator in Exchange. Sheets and views contain blocks. Blocks can be of two types: basic or operator blocks. Operator blocks are blocks which reference a particular view. These two types are internally treated as the same thing. Blocks contain the actual representation items which will be tessellated and drawn on the screen. This will be represented by an Exchange::Component.

ExchangePMIMask 

Mask for any Exchange PMI items.

ExchangePMI 

Represents a generic A3DMkpMarkup in Exchange. This will be represented by an Exchange::Component.

ExchangePMIText 

Represents an A3DMarkupText in Exchange. This will be represented by an Exchange::Component.

ExchangePMIRichText 

Represents an A3DMarkupRichText in Exchange. This will be represented by an Exchange::Component.

ExchangePMIRoughness 

Represents an A3DMarkupRoughness in Exchange. This will be represented by an Exchange::Component.

ExchangePMIGDT 

Represents an A3DMarkupGDT in Exchange. This will be represented by an Exchange::Component.

ExchangePMIDatum 

Represents an A3DMarkupDatum in Exchange. This will be represented by an Exchange::Component.

ExchangePMILineWelding 

Represents an A3DMarkupLineWelding in Exchange. This will be represented by an Exchange::Component.

ExchangePMISpotWelding 

Represents an A3DMarkupSpotWelding in Exchange. This will be represented by an Exchange::Component.

ExchangePMIDimension 

Represents an A3DMarkupDimension in Exchange. This will be represented by an Exchange::Component.

ExchangePMIBalloon 

Represents an A3DMarkupBalloon in Exchange. This will be represented by an Exchange::Component.

ExchangePMICoordinate 

Represents an A3DMarkupCoordinate in Exchange. This will be represented by an Exchange::Component.

ExchangePMIFastener 

Represents an A3DMarkupFastener in Exchange. This will be represented by an Exchange::Component.

ExchangePMILocator 

Represents an A3DMarkupLocator in Exchange. This will be represented by an Exchange::Component.

ExchangePMIMeasurementPoint 

Represents an A3DMarkupMeasurementPoint in Exchange. This will be represented by an Exchange::Component.

ParasolidComponentMask 

Mask for any Parasolid components.

ParasolidModelFile 

Abstract component representing the root of a Parasolid file. Does not map to any Parasolid element.

ParasolidAssembly 

Represents a PK_ASSEMBLY in Parasolid. This will be represented by a Parasolid::Component.

ParasolidInstance 

Represents a PK_INSTANCE in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopologyMask 

Mask for any Parasolid topological items.

ParasolidTopoBody 

Represents a PK_BODY in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoRegion 

Represents a PK_REGION in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoShell 

Represents a PK_SHELL in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoFace 

Represents a PK_FACE in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoLoop 

Represents a PK_LOOP in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoFin 

Represents a PK_FIN in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoEdge 

Represents a PK_EDGE in Parasolid. This will be represented by a Parasolid::Component.

ParasolidTopoVertex 

Represents a PK_VERTEX in Parasolid. This will be represented by a Parasolid::Component.

DWGComponentMask 

Mask for any DWG components.

DWGModelFile 

Represents an AcDbDatabase in RealDWG. This will be represented by a DWG::CADModel.

DWGLayout 

Represents an AcDbLayout in RealDWG.

DWGBlockTable 

Represents an AcDbBlockTable in RealDWG.

DWGBlockTableRecord 

Represents an AcDbBlockTableRecord in RealDWG.

DWGEntity 

Represents an AcDbEntity in RealDWG.

DWGLayerTable 

Represents an AcDbLayerTable in RealDWG.

DWGLayer 

Represents an AcDbLayer in RealDWG.

UserComponent 

Represents a user created component.

◆ DeleteMode

Enumerates whether The Delete operation will use the mode Standard, Full or StandardAndExchange.

Constructor & Destructor Documentation

◆ Component() [1/3]

HPS::Component::Component ( )

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

◆ Component() [2/3]

HPS::Component::Component ( Component const &  in_that)

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

Parameters
in_thatThe source Component to copy.

◆ Component() [3/3]

HPS::Component::Component ( Component &&  in_that)

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

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

◆ ~Component()

virtual HPS::Component::~Component ( )
virtual

Releases a reference to this Component. The Component will not be deleted unless the final reference is destroyed.

Reimplemented in HPS::Parasolid::Component, HPS::Exchange::Component, and HPS::DWG::Component.

Member Function Documentation

◆ AddKey()

void HPS::Component::AddKey ( Key const &  in_key)

Adds a key to be associated with this Component. This will additionally ensure this key can be used to find this Component via CADModel::GetComponentFromKey on the owning CADModel. In general, this will either be a SegmentKey or a GeometryKey (or a subclass thereof), but it may also be an IncludeKey, which is necessary for an instanced Component. If an IncludeKey is associated with this Component, the underlying target of the include will be associated with this Component, though the include will be stored as well to determine things like the associated KeyPath correctly.

Parameters
in_keyThe key to associate with this Component.

◆ AddOwner()

void HPS::Component::AddOwner ( Component in_owner,
IncludeKey const &  in_include = IncludeKey() 
)

Adds an owner to this Component. This is intended to facilitate adding additional owners to an instanced Component, and allows specifying the associated IncludeKey for the additional owner. It is possible to add an owner without adding an IncludeKey, and, if desired, add the IncludeKey separately via AddKey.

Parameters
in_ownerThe Component to act as an additional owner for this Component.
in_includeThe IncludeKey for this Component for this new owner. This defaults to an uninitialized IncludeKey.

◆ AddReference()

void HPS::Component::AddReference ( Component in_reference)

Adds a Component as a reference to this Component.

Parameters
in_referenceThe Component to add as a reference to this Component.

◆ AddTransform()

bool HPS::Component::AddTransform ( MatrixKit const &  in_transform)

Appends a transform to the underlying PRC or Parasolid data associated with this component.

Warning
For Parasolid components, only transformations which are rigid motions can be applied. Calling SetTransform from a Parasolid component with a transform which is not a rigid motion, such as a shear, will cause the function to fail.
For Exchange components, only components of type ExchangeProductOccurrence, or components that have the type ExchangeRepresentationItemMask can have transforms applied to them. Additionally, SetTransform does not work on Exchange models which have a Drawing structure to them. This would include CATDrawing files and 2D DWG files loaded through Exchange. Any attempt to use this function on those models will produce a warning.
Parameters
in_transformThe transform to apply to this component.
Returns
true if transform was applied correctly, false otherwise.

◆ Assign()

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

Share the underlying smart-pointer of the Component source.

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

◆ CopyTo()

Component HPS::Component::CopyTo ( HPS::Component const &  in_new_owner)

Creates a deep copy of this component under another component. Please note how entity copying is handled for each type of entity:

  • Copying a RepresentationItem to a ProductOccurrence: The copy of the representation item will be inserted under the Part Definition under the target Product Occurrence
  • Copying a RepresentationItem to a PartDefinition: supported
  • Copying a RepresentationItem to a RepresentationItemSet: supported
  • Copying a PartDefinition to a ProductOccurrence: The function will create a new ProductOccurrence object, insert the copy into the children of this product occurrence and then insert this product occurrence under the target product occurrence. This is to avoid rewrite on the original PartDefinition of the target ProductOccurrence (if one exists)
  • Copying a ProductOccurrence to a ProductOccurrence: The newly created copy will be inserted under the target Product Occurrence. However we need to note that if the target ProductOccurrence already has a prototype, the prototype will not be visualized by HPS but only the newly created copy will be. In the case of ExternalData, both will be rendered by HPS.
  • Copying a ProductOccurrence to a Exchange ModelFile: The A3DAsmModelFile under the target component will be deleted, and a new one will be created. This new model is identical with the old model except that the copy of the source ProductOccurrence will be inserted under this new model. In this case, since we create a new CADModel, the reload process may take more time since we need to re-render the whole new model.

In any case, if the function fails, it will return an empty Component, so checking if the type of the returned component is None or not can be considered a way to test if the function succeeded or failed.

Additional notes about the deep copy process: The deep copy process for ProductOccurrence and RepresentationItem uses two functions of Exchange: A3DAsmProductOccurrenceDeepCopy and A3DRiRepresentationItemDeepCopy. These functions can make changes to the structure of the entity, so we may not have a copy that is an exact replica of the source entity. More on this can be found here: https://docs.techsoft3d.com/exchange/latest/build/group__a3d__productoccurrence.html#ga4923ada4d2d9d04466b6213c66a2d62c and https://docs.techsoft3d.com/exchange/latest/build/group__a3d__ricontent.html#gac1eb0015f2b9601689a03112a0db2004

For PartDefinition and RepresentationItemSet, which lack a deep copy function in Exchange, the PartDefinition is only shallow copied, so its children pointers are shared between the source and the target. The deep copy process copies all the attributes of the source entity, thus, if the modelling matrix of the source entity if relative to its parents, the location of the copied entity will also be relative to its new parents.

Parameters
in_new_ownerThe component which will be the owner of the newly created component.
Returns
The newly created component.
Note
This will currently only work for derived Exchange components.

◆ Delete()

void HPS::Component::Delete ( HPS::Component::DeleteMode  mode = HPS::Component::DeleteMode::Standard)

The behavior of the Delete function varies according to the type of object it's being called on.

HPS:

Component
Removes this component from memory and invalidates any component objects referring to it. All owners of this component will no longer have it as a subcomponent, all components that reference this component will no longer have it as a reference, and the keys underlying this component will be deleted. Any subcomponents of this component that have multiple owners will have this component removed as an owner. Any subcomponents of this component that have only this component as an owner will be recursively deleted via this function.

Invoking this function on an instance of an object derived from Component will perform some additional cleanup relevant to the derived type. For example, performing a delete on a CADModel will delete the default capture associated with the CADModel, delete its associated Model, and delete the mapping information between keys and components, in addition to performing all the operations for a generic component. See below for the behavior of derived types in the integrations that create component trees.

Lastly, note that it is not necessary to construct or cast a component to its specific type to ensure the appropriate delete logic is used. The appropriate logic will always be invoked even if using a base Component object handle to a derived type.

Exchange:

Component, ProductOccurrence, Sheet, Capture, Filter
Invoking delete on these types will not modify the associated Exchange data. It will remove the associated A3DEntity pointer and component from the mapping data accessible via Exchange::CADModel::GetComponentFromEntity, and then it will invoke the base Component delete logic.

CADModel
Invoking delete on an Exchange::CADModel will delete the underlying A3DAsmModelFile via A3DAsmModelFileDelete if Exchange::CADModel::GetEntityOwnership is true. It will additionally clean up the associated A3DRWParamsPrcReadHelper if one was created during import (see Exchange::ImportOptionsKit::SetPRCReadHelper). The mapping data between A3DEntity pointers and components will also be deleted, and lastly it will invoke the delete logic for the base CADModel.

Parasolid:

Component
Invoking delete on this type will invoke PK_ENTITY_delete on the underlying Parasolid entity if the entity has class PK_CLASS_assembly or PK_CLASS_body. It will remove this Parasolid entity and component from the mapping data accessible via Parasolid::CADModel::GetComponentFromEntity, and then it will invoke the base Component delete logic.

CADModel
The mapping data between Parasolid entities and components will be deleted, and then it will invoke the base CADModel delete logic.

DWG:

Component, Layer, Layout
Invoking delete on these types will not modify the associated DWG database. It will simply invoke the base Component delete logic.

CADModel
Invoking delete on a DWG::CADModel will release the underlying AcDbDatabase via acdbReleaseHostDwg, and then it will invoke the base CADModel delete logic.

Parameters
modeThe DeleteMode that we will use.

◆ Equals()

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

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

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

◆ Flush()

void HPS::Component::Flush ( )

Removes all references to the underlying subcomponents, but leaves this Component around. If a subcomponent of the component being flushed has multiple owners, the flush will simply remove the reference to that subcomponent. If a subcomponent of the component being flushed has only one owner (the component being flushed), that subcomponent will be deleted. Any handles to the deleted components will become invalid.

◆ GetAllMetadata()

MetadataArray HPS::Component::GetAllMetadata ( ) const

Get all Metadata objects associated with this Component.

Returns
All Metadata objects associated with this Component.

◆ GetAllSubcomponents()

ComponentArray HPS::Component::GetAllSubcomponents ( ComponentType  in_type) const

Gets all components under this Component that have the specified ComponentType mask. This will examine this subcomponents of this Component, the subcomponents of the subcomponents, and so on.

Parameters
in_typeMask of the components to look for.
Returns
The Component objects under this Component (if any) which have the specified mask.

◆ GetComponentType()

ComponentType HPS::Component::GetComponentType ( ) const

Gets the specific format-dependent type this Component represents.

Returns
The specific format-dependent type this Component represents.

◆ GetKeyPath() [1/3]

static KeyPathArray HPS::Component::GetKeyPath ( Component const &  in_component)
static

Gets the list of KeyPath objects that correspond to the given Component. There will be at least one KeyPath, and possibly more than one if a particular Component is instanced, e.g., if the Component corresponds to the wheel of a car, a KeyPath would be returned for each wheel (driver side front and rear, and passenger side front and rear). Each KeyPath in the list will also include the portion of the path above the Model (associated with the root CADModel) for each View, Layout layer, and Canvas permutation which includes the Model. This function will not take into account any includes or paths which do not come from the Component hierarchy or the View, Layout, and Canvas permutations which include the Model.

Parameters
in_componentThe Component for which to compute the corresponding KeyPath objects.
Returns
A list of all KeyPath objects which refer to the given Component.
See also
HighlightControl

◆ GetKeyPath() [2/3]

static KeyPathArray HPS::Component::GetKeyPath ( size_t  in_count,
Component const  in_components[] 
)
static

Gets the list of KeyPath objects that correspond to the given ComponentPath. This function can be used to get the KeyPath for a particular instance of an instanced Component. For a non-instanced Component, since the ComponentPath can be determined unambiguously, the KeyPath returned will be the same as if only the leaf non-instanced Component was given to this function. There will be at least one KeyPath returned, and possibly more than one for each View, Layout layer, and Canvas which include the Model associated with the root CADModel. This function will not take into account any includes or paths which do not come from the Component hierarchy or the View, Layout, and Canvas permutations which include the Model.

Parameters
in_countSize of the following array.
in_componentsThe ComponentPath for which to compute the corresponding KeyPath objects. The path should be defined such that the first element is the leaf Component, and the last element is the root CADModel. Each element in the path should be an owner of the preceding Component, otherwise an exception will be thrown.
Returns
A list of all KeyPath objects which refer to the given Component.
See also
HighlightControl

◆ GetKeyPath() [3/3]

static KeyPathArray HPS::Component::GetKeyPath ( ComponentArray const &  in_components)
static

Gets the list of KeyPath objects that correspond to the given ComponentPath. This function can be used to get the KeyPath for a particular instance of an instanced Component. For a non-instanced Component, since the ComponentPath can be determined unambiguously, the KeyPath returned will be the same as if only the leaf non-instanced Component was given to this function. There will be at least one KeyPath returned, and possibly more than one for each View, Layout layer, and Canvas which include the Model associated with the root CADModel. This function will not take into account any includes or paths which do not come from the Component hierarchy or the View, Layout, and Canvas permutations which include the Model.

Parameters
in_componentsThe ComponentPath for which to compute the corresponding KeyPath objects. The path should be defined such that the first element is the leaf Component, and the last element is the root CADModel. Each element in the path should be an owner of the preceding Component, otherwise an exception will be thrown.
Returns
A list of all KeyPath objects which refer to the given Component.
See also
HighlightControl

◆ GetKeys()

KeyArray HPS::Component::GetKeys ( ) const

Get the underlying keys (if any) which represent this Component. Generally this will either be a segment or geometry key.

Returns
The underlying keys (if any) which represent this Component.

◆ GetMetadata()

Metadata HPS::Component::GetMetadata ( char const *  in_name) const

Get the single Metadata object with the given name associated with this Component (if present).

Parameters
in_nameUTF8-encoded name of the Metadata object to find on this Component.
Returns
The single Metadata object with the given name associated with this Component (if present).

◆ GetName()

UTF8 HPS::Component::GetName ( ) const

Gets the name for this Component. This is a convenience function equivalent to getting the "Name" metadata for this Component. If a Component does not have a name, an empty UTF8 object will be returned.

Returns
The name (if any) for this Component.

◆ GetOwners()

ComponentArray HPS::Component::GetOwners ( ) const

Get the Component objects (if any) which "own" this Component. Generally this will be a single element or no elements for a root component. It is possible for there to be multiple owners of a Component if it is instanced (i.e., it may have both a prototype and a containing Component).

See also
GetReferrers()
Returns
The Component objects (if any) which "own" this Component.

◆ GetReferences()

ComponentArray HPS::Component::GetReferences ( ) const

Get the Component objects (if any) which are referenced by this Component. These are Component objects which are associated with this Component, but not "owned" by this Component, and would not be deleted if this Component is deleted (though the reference relationship will be removed).

Returns
The Component objects (if any) which are referenced by this Component.

◆ GetReferrers()

ComponentArray HPS::Component::GetReferrers ( ) const

Gets the Component objects which refer to this Component (if any). These relationships are defined in the original CAD file and can be arbitrarily assigned between Components.

For the Exchange implementation of the Component hierarchy, Referrers will typically indicate which PMI elements refer to the Component being inspected.

See also
GetOwners()
Returns
The Component objects which refer to this Component.

◆ GetSubcomponents()

ComponentArray HPS::Component::GetSubcomponents ( ) const

Get the subcomponent objects (if any) owned or referenced by this Component. These Component objects would be deleted if this Component is deleted.

Returns
The subcomponent objects (if any) owned or referenced by this Component.

◆ HasComponentType()

bool HPS::Component::HasComponentType ( ComponentType  in_mask) const

This function indicates whether this Component has the given ComponentType mask.

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

◆ ObjectType()

HPS::Type HPS::Component::ObjectType ( ) const
inlinevirtual

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

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

Reimplemented from HPS::Object.

Reimplemented in HPS::CADModel, HPS::Capture, HPS::Filter, HPS::Exchange::Filter, HPS::Exchange::Capture, HPS::Parasolid::CADModel, HPS::Exchange::CADModel, HPS::Exchange::Sheet, HPS::Parasolid::Component, HPS::DWG::Layout, HPS::Exchange::ProductOccurrence, HPS::DWG::CADModel, HPS::Exchange::Component, HPS::DWG::Layer, and HPS::DWG::Component.

◆ operator!=()

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

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

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

◆ operator=() [1/2]

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

Share the underlying smart-pointer of the Component source.

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

◆ operator=() [2/2]

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

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

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

◆ operator==()

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

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

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

◆ SetName()

bool HPS::Component::SetName ( char const *  in_new_name)

Sets the name for this component.

Parameters
in_nameThe new name for this component.
Returns
true if the name was set successfully, false otherwise.
Note
This will currently only work for derived Exchange components.

◆ SetTransform()

bool HPS::Component::SetTransform ( MatrixKit const &  in_transform)

Applies a transform to the underlying PRC or Parasolid data associated with this component, replacing any transforms currently set on it.

Warning
For Parasolid components, only transformations which are rigid motions can be applied. Calling SetTransform from a Parasolid component with a transform which is not a rigid motion, such as a shear, will cause the function to fail.
For Exchange components, only components of type ExchangeProductOccurrence, or components that have the type ExchangeRepresentationItemMask can have transforms applied to them. Additionally, SetTransform does not work on Exchange models which have a Drawing structure to them. This would include CATDrawing files and 2D DWG files loaded through Exchange. Any attempt to use this function on those models will produce a warning.
Parameters
in_transformThe transform to apply to this component.
Returns
true if transform was applied correctly, false otherwise.

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