Hide menu
cadex::ModelPrs_MeasurementFactory Class Reference

Creates measurement objects that store the sources and result of a measurement. More...

Inheritance diagram for cadex::ModelPrs_MeasurementFactory:
cadex::Base_PublicObject

Public Types

typedef cadex::internal::ModelPrs_MeasurementFactoryImpl ImplType
 

Public Member Functions

 ModelPrs_MeasurementFactory ()
 Constructor.
 
ModelPrs_Measurement CreateDistance (const ModelData_Shape &theFirstShape, const ModelData_Shape &theSecondShape)
 Creates minimum distance measurement between any two shapes.
 
ModelPrs_Measurement CreateMinorRadius (const ModelData_Shape &theShape)
 Creates a radius measurement of an edge or a face that might have such. More...
 
ModelPrs_Measurement CreateMajorRadius (const ModelData_Shape &theShape)
 Creates a radius measurement of an edge or a face that might have such. More...
 
ModelPrs_Measurement CreateMinorDiameter (const ModelData_Shape &theShape)
 Creates a diameter measurement of an edge or a face that might have such. More...
 
ModelPrs_Measurement CreateMajorDiameter (const ModelData_Shape &theShape)
 Creates a diameter measurement of an edge or a face that might have such. More...
 
ModelPrs_Measurement CreateAngle (const ModelData_Face &theFirstFace, const ModelData_Face &theSecondFace)
 Creates an angle measurement between two planar faces.
 
ModelPrs_Measurement CreateAngle (const ModelData_Vertex &theFirstVertex, const ModelData_Vertex &theSecondVertex, const ModelData_Vertex &theThirdVertex)
 Creates an angle measurement between three vertices.
 
- Public Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject ()
 Constructor. More...
 
void Nullify ()
 Resets reference to implementation object.
 
bool IsNull () const
 Returns true if the object is nullified. More...
 
 operator bool () const
 Casts the object to the bool type. More...
 
internal::Base_HandledObject * Impl () const
 Return a handle to backend (reserved for internal use).
 
const internal::Base_Handle & HImpl () const
 
template<typename T >
T * Impl () const
 Reserved for internal use.
 
bool operator== (const Base_PublicObject &theObject) const
 
bool operator!= (const Base_PublicObject &theObject) const
 

Additional Inherited Members

- Protected Member Functions inherited from cadex::Base_PublicObject
 Base_PublicObject (const internal::Base_HandledObject *theObject)
 Constructor (reserved for internal use).
 
template<typename T >
T * GetOrCreateImpl ()
 Reserved for internal use.
 

Detailed Description

Creates measurement objects that store the sources and result of a measurement.

Warning
This class is a part of Visualization Toolkit add-on, which is licensed separately from the base CAD Exchanger SDK.
When impossible to create measurement from the given shape(-s) an empty ModelPrs_Measurement will be created.
Examples
visualization/qtquick_qml/measurements/main.cxx.

Member Function Documentation

◆ CreateMajorDiameter()

ModelPrs_Measurement cadex::ModelPrs_MeasurementFactory::CreateMajorDiameter ( const ModelData_Shape theShape)

Creates a diameter measurement of an edge or a face that might have such.

Returns the major diameter for toroidal surface or ellipse and the maximum achievable diameter for conical surface. Otherwise, when the shape has only one diameter, both CreateMajorRadius() and CreateMinorRadius() return the same result. For instance, the following example demonstrates creation of a diameter measurement for cone:

auto aCone = ModelAlgo_TopoPrimitives::CreateCone (10., 20., 30.);
ModelPrs_MeasurementFactory aMeasurementFactory;
auto aMajorDiameter = aMeasurementFactory.CreateMajorDiameter (aCone); // Value() should returns 20
auto aMinorDiameter = aMeasurementFactory.CreateMinorDiameter (aCone); // Value() should returns 10
auto anIsSame = (aMajorDiameter == aMinorDiameter); // false
Examples
visualization/qtquick_qml/measurements/main.cxx.

◆ CreateMajorRadius()

ModelPrs_Measurement cadex::ModelPrs_MeasurementFactory::CreateMajorRadius ( const ModelData_Shape theShape)

Creates a radius measurement of an edge or a face that might have such.

Returns the major radius for toroidal surface or ellipse and the maximum achievable radius for conical surface. Otherwise, when the shape has only one radius, both CreateMajorRadius() and CreateMinorRadius() return the same result. For instance, the following example demonstrates creation of a radius measurement for cylinder:

auto aCylinder = ModelAlgo_TopoPrimitives::CreateCylinder (10., 10.);
ModelPrs_MeasurementFactory aMeasurementFactory;
auto aMajorRadius = aMeasurementFactory.CreateMajorRadius (aCylinder);
auto aMinorRadius = aMeasurementFactory.CreateMinorRadius (aCylinder);
auto anIsSame = (aMajorRadius == aMinorRadius); // true
Examples
visualization/qtquick_qml/measurements/main.cxx.

◆ CreateMinorDiameter()

ModelPrs_Measurement cadex::ModelPrs_MeasurementFactory::CreateMinorDiameter ( const ModelData_Shape theShape)

Creates a diameter measurement of an edge or a face that might have such.

Returns the minor diameter for toroidal surface or ellipse and the minimal achievable diameter for conical surface.

See also
CreateMajorDiameter
Examples
visualization/qtquick_qml/measurements/main.cxx.

◆ CreateMinorRadius()

ModelPrs_Measurement cadex::ModelPrs_MeasurementFactory::CreateMinorRadius ( const ModelData_Shape theShape)

Creates a radius measurement of an edge or a face that might have such.

Returns the minor radius for toroidal surface or ellipse and the minimal achievable radius for conical surface.

See also
CreateMajorRadius
Examples
visualization/qtquick_qml/measurements/main.cxx.
ModelPrs_MeasurementFactory()
Constructor.
Definition: ModelPrs_MeasurementFactory.cxx:125
static ModelData_Solid CreateCylinder(double theRadius, double theHeight, double theAngle=2 *M_PI)
Creates a cylinder.
Definition: ModelAlgo_TopoPrimitives.cxx:192
static ModelData_Solid CreateCone(double theRadius1, double theRadius2, double theHeight, double theAngle=2 *M_PI)
Creates a cone.
Definition: ModelAlgo_TopoPrimitives.cxx:224