Stores the source data and result of the measurement. Objects of this class can be created using ModelPrs_MeasurementFactory. More...
#include <cadex/ModelPrs_Measurement.hxx>
Public Types | |
typedef cadex::internal::ModelPrs_MeasurementImpl | ImplType |
Public Member Functions | |
ModelPrs_Measurement () | |
Constuctor. | |
ModelPrs_MeasurementType | Type () const |
Returns a type of measurement. | |
double | Value () const |
Returns a measurement result in current units. | |
Base_LengthUnit | LengthUnit () const |
Returns length unit of measurement. The default value is Base_LU_Millimeters. | |
void | SetLengthUnit (Base_LengthUnit theLengthUnit) |
Sets length unit. | |
Base_AngleUnit | AngleUnit () const |
Returns angle unit of measurement. The default value is Base_AU_Radian. | |
void | SetAngleUnit (Base_AngleUnit theAngleUnit) |
Sets angle unit. | |
double | Size () const |
Returns size of measurement in millimeters. The default value is 1. | |
void | SetSize (double theSize) |
Sets size of measurement in millimeters. | |
double | SizeOfFlyOut () const |
Returns value in millimeters describing how far the measurement annotation is shifted away from its sources. The default value is 0. | |
void | SetSizeOfFlyOut (double theSizeOfFlyOut) |
Sets size of fly out in millimeters. | |
![]() | |
void | Nullify () |
Resets reference to implementation object. | |
bool | IsNull () const |
Returns true if the object is nullified. | |
operator bool () const | |
Casts the object to the bool type. | |
internal::Base_HandledObject * | Impl () const |
Return a handle to backend (reserved for internal use). | |
Additional Inherited Members | |
![]() | |
Base_PublicObject (const internal::Base_HandledObject *theObject) | |
Constructor (reserved for internal use). | |
template<typename T > | |
T * | GetOrCreateImpl () |
Reserved for internal use. | |
Stores the source data and result of the measurement. Objects of this class can be created using ModelPrs_MeasurementFactory.
To display the measurement you need to create scene node from it using ModelPrs_SceneNodeFactory and add that to the scene. There are a few settings to change the look of a measurement. When these settings are changed after the measurement has already been displayed, it's necessary to either call ModelPrs_SceneNode::Invalidate or re-create a scene node for that measurement.
For instance, the following example demonstrates how to create measurement, display it, change its size and update the display:
cadex::ModelPrs_Measurement::ModelPrs_Measurement | ( | ) |
void cadex::ModelPrs_Measurement::SetAngleUnit | ( | Base_AngleUnit | theAngleUnit | ) |
Sets angle unit.
Has meaning for the following types of measurement:
void cadex::ModelPrs_Measurement::SetLengthUnit | ( | Base_LengthUnit | theLengthUnit | ) |
Sets length unit.
Has meaning for the following types of measurement:
void cadex::ModelPrs_Measurement::SetSize | ( | double | theSize | ) |
Sets size of measurement in millimeters.
Changes size of the following elements:
double cadex::ModelPrs_Measurement::SizeOfFlyOut | ( | ) | const |
Returns value in millimeters describing how far the measurement annotation is shifted away from its sources. The default value is 0.
The following examples demonstrate a difference between 0 and 20 values of fly out:
![]()
Size of fly out is 0 | ![]()
Size of fly out is 20 |
double cadex::ModelPrs_Measurement::Value | ( | ) | const |
Returns a measurement result in current units.
Only one kind of units has an effect on returned value. ModelPrs_Measurement::AngleUnit for angle measurements and ModelPrs_Measurement::LengthUnit for the rest. For instance, the following example demonstrates how to create measurement and change the unit: