HPS::Exchange::CADModel

class HPS::Exchange::CADModel : public HPS::CADModel

The CADModel class is a smart pointer. It represents an A3DAsmModelFile in Exchange. The primary purpose of this class is simply to provide access to the underlying A3DAsmModelFile pointer for use by Exchange library functions.

Public Functions

CADModel()

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

CADModel(Component const &in_that)

This constructor creates a CADModel object that shares the underlying smart-pointer of the source Component. The copy will only be successful if the source component is really an upcast of an Exchange::CADModel object. Otherwise the copy will fail and the resulting Exchange::CADModel will be invalid.

Parameters

in_that – The source Component to copy.

CADModel(Exchange::CADModel &&in_that)

The move constructor creates an Exchange::CADModel by transferring the underlying object of the rvalue reference to this Exchange::CADModel.

Parameters

in_that – An rvalue reference to an Exchange::CADModel to take the underlying object from.

CADModel(Exchange::CADModel const &in_that)

The copy constructor creates an Exchange::CADModel object that shares the underlying smart-pointer of the source Exchange::CADModel.

Parameters

in_that – The source Exchange::CADModel to copy.

CADModel(HPS::CADModel const &in_that)

This constructor creates an Exchange::CADModel object that shares the underlying smart-pointer of the source HPS::CADModel. The copy will only be successful if the source component is really an upcast of an Exchange::CADModel object. Otherwise the copy will fail and the resulting Exchange::CADModel will be invalid.

Parameters

in_that – The source HPS::CADModel to copy.

LayerArray GetAllLayers() const

Get all layers defined in this CAD Model.

Returns

A list of all layers defined in this CAD Model.

HPS::Exchange::BIMData GetBIMData() const

Gets a const reference to BIM data. Only formats which support the concept of BIM data can have a non empty BIM Data.

Returns

the BIM data for this CADModel.

HPS::Component GetComponentFromEntity(A3DEntity *in_entity) const

Gets the Component associated with the given A3DEntity pointer (if any).

Parameters

in_entity – The A3DEntity pointer from which to find the associated Component.

Returns

The Component associated with the given A3DEntity pointer, or an empty component if there is no such Component.

ConfigurationArray GetConfigurations() const

Gets a list of configurations for this CADModel (if any). Only formats which support the concept of configurations can return a non-empty array, and only files of those formats which contain configurations will return a non-empty array.

Returns

The list of configurations for this CADModel.

UTF8Array GetCurrentConfiguration() const

Gets the current configuration for this CADModel if it exists. Only formats which support the concept of configurations can have a current configuration, and only files of those formats which contain configurations will have a current configuration.

Returns

The current configuration for this CADModel.

bool GetEntityOwnership() const

Whether this CADModel owns the associated A3DAsmModelFile or not. If this CADModel owns the associated A3DAsmModelFile, when it is deleted (via Exchange::CADModel::Delete), it will delete not only the associated Visualize components, segments and geometry but also the A3DAsmModelFile via A3DAsmModelFileDelete. If this CADModel does not own the associated A3DAsmModelFile, when it is deleted, it will only delete the associated Visualize components, segments and geometry, but not the A3DAsmModelFile. It will be up to the user to ensure the A3DAsmModelFile is deleted to reclaim any memory it has allocated in this case.

Returns

Whether this CADModel owns the associated A3DAsmModelFile.

A3DEntity *GetExchangeEntity() const

Gets the A3DEntity pointer corresponding to this Exchange::CADModel.

Returns

The A3DEntity pointer corresponding to this Exchange::CADModel.

SheetArray GetSheets() const

Gets a list of sheets for this CADModel (if any). Only formats which support the concept of sheets can return a non-empty array.

Returns

The list of sheets for this CADModel

void HideAllPMI(Canvas const &in_canvas, size_t in_layer = 0)

Forces the visibility of all PMI off in the given Canvas and layer. This will undo any hides, shows, isolates, or other highlights performed on PMI components contained within this CADModel via ComponentPath calls.

Parameters
  • in_canvas – The Canvas in which to perform the the operation

  • in_layer – The layer in the Canvas in which to perform the operation.

inline virtual HPS::Type ObjectType() const

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.

CADModel &operator=(Exchange::CADModel &&in_that)

The move assignment operator transfers the underlying object of the rvalue reference to this Exchange::CADModel.

Parameters

in_that – An rvalue reference to an Exchange::CADModel to take the underlying object from.

Returns

A reference to this Exchange::CADModel.

ReloadNotifier Reload(TessellationOptionsKit const &in_options = TessellationOptionsKit(), TranslationOptionsKit const &in_translation_options = TranslationOptionsKit())

Asynchronously reloads this CADModel. This will delete all underlying subcomponents and then reparse the underlying Exchange data.

Parameters
  • in_options – The options to use to generate tessellations for new Components (if necessary).

  • in_translation_options – The options to use for translation from Exchange BRep to Parasolid. This option only applies if a file was loaded via the ExchangeParasolid module and there are components underlying this component that need to be translated to Parasolid.

bool ReplaceExchangeEntity(Component const &in_component, A3DEntity *in_a3d_entity)

Replace the Exchange entity associated with the provided component. You are required to sync the HPS model tree with the PRC structures after calling this via Reload.

See

Reload

Parameters
  • in_component – The component whose entity is to be replaced.

  • in_a3d_entity – The new entity that will be associated with in_component.

Returns

true if the new entity was associated successfully, false otherwise.

void SetAllPMIInFront(bool in_enable, Canvas const &in_canvas, size_t in_layer = 0)

Forces all of the PMI in this CADModel to be rendered in front of the other geometry. contained within this CADModel via ComponentPath calls.

Parameters
  • in_enable – Dictates whether the pmi will be forced in front or not.

  • in_canvas – The Canvas in which to perform the the operation

  • in_layer – The layer in the Canvas in which to perform the operation.

void ShowAllPMI(Canvas const &in_canvas, size_t in_layer = 0)

Forces the visibility of all PMI on in the given Canvas and layer. This will undo any hides, shows, isolates, or other highlights performed on PMI components contained within this CADModel via ComponentPath calls.

Parameters
  • in_canvas – The Canvas in which to perform the the operation

  • in_layer – The layer in the Canvas in which to perform the operation.

void Tessellate(TessellationOptionsKit const &in_options)

Re-tessellate the given CADModel with the provided options. Tessellation occurs at the representation item level in Exchange. All representation items underneath this CADModel will be re-tessellated with the provided options. Additionally, only components for which there is BRep data can the tessellation be regenerated.

Parameters

in_options – The options to use to generate the new tessellation for this CADModel

TranslationNotifier Translate(TranslationOptionsKit const &in_translation_options)

Asynchronously translates this CADModel into an array of Parasolid parts, using the options provided. A valid Parasolid session is required for this function to succeed. If this CADModel was imported in tessellation only mode an empty Parasolid assembly will be returned.

Parameters

in_translation_options – Options used during the translation.

Returns

An TranslationNotifier object that can be used to query the import progress and status.

virtual ~CADModel()

Public Static Attributes

static const HPS::Type staticType = HPS::Type::ExchangeCADModel