HPS::Exchange::MeasurementOperator

class HPS.Exchange.MeasurementOperator : public HPS.Exchange.CommonMeasurementOperator

The MeasurementOperator class defines an operator which allows the user to insert measurements into the scene This operator requires the model be loaded using the Exchange bridge, and the model must contain B-rep.

The behavior of the operator, and its usage, vary based on the type of measurement the user wishes to insert.

<itemizedlist> <listitem>

Point to Point measurement: The Point to Point measurement mode allows the user to measure the distance between two arbitrary points. Usage:

</listitem> <listitem>

Click or tap where you want to insert the first measurement point.

</listitem> <listitem>

Click or tap where you want to insert the second measurement point

</listitem> <listitem>

Move the mouse or drag your finger to move the measurement geometry around.

</listitem> <listitem>

Click or lift your finger to position the measurement.

</listitem> <listitem>

Edge and Radius measurement: The Edge and Radius measurement mode allows the user to measure the length of an edge, or the radius of a circle, based on whether the edge clicked on is a line or a circle. Usage:

</listitem> <listitem>

Click or tap on the edge you want to measure

</listitem> <listitem>

Move the mouse or drag your finger to move the measurement geometry around.

</listitem> <listitem>

Click again or lift your finger to position the measurement.

</listitem> <listitem>

If the edge you selected is part of a circle, the circle radius will be measured, otherwise the edge length will be measured.

</listitem> <listitem>

Feature to Feature measurement: The Feature to Feature measurement mode allows the user to measure the shortest distance between two features. Usage:

</listitem> <listitem>

Click or tap on a face

</listitem> <listitem>

Click or tap on a different face

</listitem> <listitem>

Move the mouse or drag your finger to move the measurement geometry around.

</listitem> <listitem>

Click again or lift your finger to position the measurement.

</listitem> <listitem>

If both faces are planar, the shortest distance between them is measured

</listitem> <listitem>

If one face is planar and the other is id conical or cylindrical, the shortest distance between the center line and the face is measured

</listitem> <listitem>

If both faces are conical or cylindrical, the shortest distance between the two center lines is measured

</listitem> <listitem>

Face Angle measurement: The Face Angle measurement mode allows the user to measure the angle between two planar, non-parallel faces. Usage:

</listitem> <listitem>

Click or tap on a face

</listitem> <listitem>

Click or tap on a different face, which is not parallel to the first face

</listitem> <listitem>

Move the mouse or drag your finger to move the measurement geometry around.

</listitem> <listitem>

Click again or lift your finger to position the measurement.

</listitem> </itemizedlist>

Once a measurement has been inserted, its position can be modified by clicking on it, moving the mouse, and clicking once more once it is in the desired position. On touch-enabled devices measurements can be repositioned by dragging them into a new position. Pressing Escape will delete the measurement currently being inserted.

The operator will inject an Event of type MeasurementInsertedEvent every time a new measurement is inserted. The user can handle this event to obtain the segment key associated with every inserted measurement.

A valid CADModel needs to be passed to the constructor of this class.

Public Types

enum MeasurementType

Values:

PointToPoint
EdgeAndRadius
FeatureToFeature
FaceAngle

Public Functions

void ComputeExchangeScale (HPS.Exchange.Component in_edge_component, out double out_product_occurrence_scale, out double out_ri_scale, out double out_context_scale)

Compute the accumulated scales applied on the product occurrences, on the representation items, and on the context, until the given edge. The scales are set to 1 by default.

Param in_edge_component

The edge on which the scales are retrieved.

Param out_product_occurrence_scale

The accumulated scale on the product occurrences.

Param out_ri_scale

The scale on the representation item.

Param out_context_scale

The context scale.

void DeleteLastMeasurement ()

Delete the current measurement and brings the operator back to a state to start a new measurement

override void Dispose ()
HPS.HighlightOptionsKit GetHighlightOptions ()

Returns the highlight option kit currently used for mouse over highlighting.

Return

the highlight option kit currently used for mouse over highlighting.

HPS.Exchange.MeasurementOperator.MeasurementType GetMeasurementType ()

Returns the type of measurement the operator is currently set up to insert.

Return

The type of measurement the operator is currently set up to insert.

bool GetMouseOverHighlighting ()

Whether measurable geometry is highlighted when mousing over it

Return

true if measurable geometry is highlighted on mouse over, false otherwise.

override string GetName ()

Returns the name of the operator.

bool IsMeasurementActive ()

Whether a measurement is currently being inserted or edited.

Return

true if a measurement is being inserted or manipulated, false otherwise.

MeasurementOperator ()
MeasurementOperator (HPS.Exchange.CADModel in_cad_model)
MeasurementOperator (HPS.Exchange.CADModel in_cad_model, HPS.MouseButtons in_mouse_trigger)
MeasurementOperator (HPS.Exchange.CADModel in_cad_model, HPS.MouseButtons in_mouse_trigger, HPS.ModifierKeys in_modifier_trigger)
MeasurementOperator (HPS.Exchange.MeasurementOperator in_that)
override bool OnKeyDown (HPS.KeyboardState in_state)

This function is called whenever HPS receives a KeyDownEvent that signals a key was pressed. Pressing Escape while in the process of inserting a measurement deletes that measurement.

Return

true if the input event was handled, false otherwise.

override bool OnMouseDown (HPS.MouseState in_state)

This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed. This function inserts the measuring points.

Param in_state

A MouseState object describing the current mouse state.

Return

true if the input event was handled, false otherwise.

override bool OnMouseMove (HPS.MouseState in_state)

This function is called whenever HPS receives a MouseEvent that signals the mouse moved When the user has just inserted the second measurement point, this function allows the user to move the measurement If the user has selected an already existing measurement, this function allows the user to reposition the measurement

Param in_state

A MouseState object describing the current mouse state.

Return

true if the input event was handled, false otherwise.

override bool OnMouseUp (HPS.MouseState in_state)

This function is called whenever HPS receives a MouseEvent that signals a mouse button was released.

Param in_state

A MouseState object describing the current mouse state.

Return

true if the input event was handled, false otherwise.

override bool OnTouchDown (HPS.TouchState in_state)

This function is called whenever HPS receives a TouchEvent that signals the device was touched. This function inserts the measuring points.

Param in_state

A TouchState object describing the current touch state.

Return

true if the input event was handled, false otherwise.

override bool OnTouchMove (HPS.TouchState in_state)

This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved. When the user has just inserted the second measurement point, this function allows the user to move the measurement If the user has selected an already existing measurement, this function allows the user to reposition the measurement

Param in_state

A TouchState object describing the current touch state.

Return

true if the input event was handled, false otherwise.

override bool OnTouchUp (HPS.TouchState in_state)

This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.

Param in_state

A TouchState object describing the current touch state.

Return

true if the input event was handled, false otherwise.

override void OnViewAttached (HPS.View in_attached_view)

This function is called whenever a view is attached to this operator.

Param in_attached_view

The view attached to this operator.

override void OnViewDetached (HPS.View in_detached_view)

This function is called whenever a view is detached from this operator.

Param in_detached_view

The view detached from this operator.

void SetMeasurementType (HPS.Exchange.MeasurementOperator.MeasurementType in_measurement_type)

Sets the type of measurement to insert.

Param in_measurement_type

The type of measurement to insert.

void SetMouseOverHighlighting (bool in_highlighting)

Whether measurable geometry should be highlighted when mousing over it

Param in_highlighting

Whether measurable geometry should be highlighted when mousing over it.

void SetMouseOverHighlighting (bool in_highlighting, HPS.HighlightOptionsKit in_highlight_options_kit)

Whether measurable geometry should be highlighted when mousing over it

Param in_highlighting

Whether measurable geometry should be highlighted when mousing over it.

Param in_highlight_options_kit

The highlight kit used for mouse over highlights