CADModel

class HPS::CADModel : public HPS::Component

The CADModel class is a smart pointer. It represents the root Component for a structured file format.

Subclassed by HPS::DWG::CADModel, HPS::Exchange::CADModel, HPS::Parasolid::CADModel

Public Functions

View ActivateDefaultCapture()

Creates a new View object corresponding to the default capture for this CADModel. The View object that is returned will have the corresponding visibility settings, material settings, transformation settings, and camera for the default capture set on it.

Returns

A newly created View object corresponding to this Capture.

void AddMeasurement(Measurement const &in_measurement)
CADModel()

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

CADModel(CADModel &&in_that)

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

Parameters

in_that – An rvalue reference to a CADModel to take the underlying object from.

CADModel(CADModel const &in_that)

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

Parameters

in_that – The source CADModel to copy.

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 a CADModel object. Otherwise the copy will fail and the resulting CADModel will be invalid.

Parameters

in_that – The source Component to copy.

CADModel(Model const &in_that)

This constructor creates a CADModel object that is associated with the given Model. This will throw an exception if the given Model is not associated with a CADModel.

Parameters

in_that – The source Model to use to find the associated CADModel.

MeasurementArray &EditAllMeasurements()
FilterArray GetActiveFilters(View const &in_view) const

Get a list of the active filters on the given View.

Parameters

in_view – The View for which to get the active filters.

Returns

A list of the active filters on the given View.

CaptureArray GetAllCaptures() const

Get a list of all captures from all subcomponents for this CADModel.

Returns

A list of all captures from all subcomponents for this CADModel.

FilterArray GetAllFilters() const

Get a list of all filters from all subcomponents for this CADModel.

Returns

A list of all filters from all subcomponents for this CADModel.

MeasurementArray const &GetAllMeasurements() const

Get a list of all measurements from CADModel.

Returns

A list of all measurements from this CADModel.

Component GetComponentFromKey(Key const &in_key) const

Find the Component associated with the given Key (if any).

Parameters

in_key – The Key from which to find the associated Component.

Returns

The Component associated with the given Key (if any).

ComponentPath GetComponentPath(KeyPath const &in_key_path, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const

Get the ComponentPath which corresponds to the given KeyPath

.

The returned path will contain the Components which occurs along the given

KeyPath, up to the CADModel

.

If the path type requested is Unique, Components associated with keys which are implicitly along the key path will be included in the returned path, provided they can be determined unambiguously.

If the path type requested is Complete, all Components associated with keys which are implicitly along the path will be included in the returned path, if an entry cannot be determined unambiguously, it will be filled with the first eligible component found.

Example: a component with two owners will select the first owner out of the two, if the key path does not specify which of the two owners to consider, when using a Complete path type. It will instead not include any of the two owners when using Unique path type.

This function will throw an InvalidSpecificationException if the provided key path does not proceed from leaf to root. An error will be logged if the key path is ambiguous, and only components associated with the explicit keys in the key path will be returned in this case.

Parameters
Returns

The ComponentPath corresponding to the given KeyPath.

ComponentPath GetComponentPath(SelectionItem const &in_item, ComponentPath::PathType in_path_type = ComponentPath::PathType::Unique) const

Get the ComponentPath which corresponds to the given SelectionItem. The returned path will be the Component associated with each key which occurs along the KeyPath associated with the SelectionItem, up to the CADModel

.

If the path type requested is Unique, Components associated with keys which are implicitly along the key path will be included in the returned path, provided they can be determined unambiguously.

If the path type requested is Complete, all Components associated with keys which are implicitly along the path will be included in the returned path, if an entry cannot be determined unambiguously, it will be filled with the first eligible component found.

Example: a component with two owners will select the first owner out of the two, if the key path associated with the selection path does not specify which of the two owners to consider, when using a Complete path type. It will instead not include any of the two owners when using Unique path type.

This function will throw an InvalidSpecificationException if the provided key path does not proceed from leaf to root. An error will be logged if the key path is ambiguous, and only components associated with the explicit keys in the key path will be returned in this case.

Parameters
Returns

The ComponentPath corresponding to the given SelectionItem.

Model GetModel() const

Get the Model associated with this CADModel.

Returns

The Model associated with this CADModel.

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=(CADModel &&in_that)

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

Parameters

in_that – An rvalue reference to a CADModel to take the underlying object from.

Returns

A reference to this CADModel.

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

Resets the visibility in the view specified by the given Canvas and layer. This will undo any hides, shows or isolates performed on components contained within this CADModel via ComponentPath calls.

See

ComponentPath::Hide

See

ComponentPath::Show

See

ComponentPath::Isolate

Parameters
  • in_canvas – The Canvas in which to perform the the visibility reset.

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

virtual ~CADModel()

Public Static Attributes

static const HPS::Type staticType = HPS::Type::CADModel