Base class for 3D curves. More...
#include <cadex/ModelData_Curve.hxx>
Public Member Functions | |
ModelData_Curve () | |
Constructor. | |
ModelData_Curve (const ModelData_Curve &theOther) | |
Constructor. | |
ModelData_Curve (ModelData_Curve &&theOther) | |
Constructor. | |
~ModelData_Curve () | |
Destructor. | |
ModelData_Curve & | operator= (const ModelData_Curve &theOther) |
Assignment operator. | |
ModelData_Curve & | operator= (ModelData_Curve &&theOther) |
Move assignment operator. | |
ModelData_CurveType | Type () const |
Returns a curve type. | |
bool | IsNull () const |
Returns true if the object has not been initialized yet. | |
void | Nullify () |
Resets the object. | |
operator bool () const | |
Returns if the object has been initialized. | |
bool | IsPeriodic () const |
Returns true if the curve is periodic. | |
double | UMin () const |
Returns a minimum parameter of a definition domain. | |
double | UMax () const |
Returns a maximum parameter of a definition domain. | |
void | Domain (double &theUMin, double &theUMax) const |
Returns a definition domain. | |
ModelData_Point | Value (double theParameter) const |
Evaluates a point on the curve. | |
ModelData_Curve | Reversed () const |
Returns a curve with reversed orientation. | |
void | Transform (const ModelData_Transformation &theTransformation) |
Applies transformation matrix to this object. | |
ModelData_Curve | Transformed (const ModelData_Transformation &theTransformation) const |
Returns a copy this object after applying transformation. | |
ModelData_Continuity | Continuity () const |
Returns a continuity type of the curve. | |
void | D0 (double theParameter, ModelData_Point &theValue) const |
Returns the point theValue of parameter theParam. | |
void | D1 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1) const |
Returns the point theValue of parameter theParam and the first derivative theD1. | |
void | D2 (double theParameter, ModelData_Point &theValue, ModelData_Vector &theD1, ModelData_Vector &theD2) const |
Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives. | |
bool | DN (double theParameter, size_t theDerivativeOrder, ModelData_Point &theValue, ModelData_Vector theD[]) const |
double | Curvature (double theParameter) const |
Returns the curvature value of parameter theParam. | |
void | Normal (double theParameter, ModelData_Direction &theNormal) const |
Returns the normal direction theNormal of parameter theParam. | |
void | Mirror (const ModelData_Point &thePoint) |
Mirrors the curve relative to the point. | |
void | Mirror (const ModelData_Axis1Placement &theAxis) |
Mirrors the curve relative to the axis placement. | |
void | Mirror (const ModelData_Axis2Placement &theAxis) |
Mirrors the curve relative to the axis placement. | |
ModelData_Curve | Mirrored (const ModelData_Point &theRef) const |
Returns a copy this curve mirrored along the object. | |
ModelData_Curve | Mirrored (const ModelData_Axis1Placement &theAxis) const |
Returns a copy this curve mirrored along the object. | |
ModelData_Curve | Mirrored (const ModelData_Axis2Placement &theAxis) const |
Returns a copy this curve mirrored along the object. | |
void | Rotate (const ModelData_Axis1Placement &theAxis, double theAngle) |
Rotates the curve around the axis. | |
ModelData_Curve | Rotated (const ModelData_Axis1Placement &theAxis, double theAngle) const |
Returns a copy this curve rotated along the axis. | |
void | Translate (const ModelData_Vector &theVector) |
Translates the curve along the vector. | |
ModelData_Curve | Translated (const ModelData_Vector &theVector) const |
Returns a copy this curve translated along the vector. | |
void | Scale (const ModelData_Point &thePoint, double theScale) |
Scales the curve with respect to the point. | |
ModelData_Curve | Scaled (const ModelData_Point &thePoint, double theScale) const |
Returns a copy this curve scaled with respect to the point. | |
Public Attributes | |
operator Handle_C const | |
Base class for 3D curves.
3D curves are used to represent curves in 3D space. Each non-degenerated edge must refer to a 3D curve.
Refer to Curve Types for the list of supported curve types. Type() returns a curve type as enumeration value which can be used to downcast to a respective subclass type, for instance:
Curve is defined using parametric definition as \(\mathbf{C}(t)\) where \(\mathbf{C}\) is a 3D radius-vector \((x,y,z)^\top\) and \(t\) is a parameter from a definition range \([a, b]\).
UMin() and UMax(), and Domain() return parametric definition range. Parametric range can be bounded (e.g. \([0, 2\pi]\) for a circle) or unbounded (e.g. \((-\infty, +\infty)\) for a line).
At any parameter \(t\) within a definition range, the curve can be evaluated as follows:
The following example demonstrates computation of a point on a line at parameter t=2:
If the curve is periodic (IsPeriodic() returns true) then the curve can be evaluated at any parameter t, otherwise behavior is undefined (e.g. an exception can be thrown or a weird value can be returned).
Continuity() returns continuity ( \(C^0\), \(C^1\), \(C^2\), \(C^N\)) of the curve, where \(C^0\) that only the curve itself is continuous, \(C^1\) - that the curve is continuous together with its first derivative, and so on.
The curve can be modified using the following operations:
void cadex::ModelData_Curve::D0 | ( | double | theParam, |
ModelData_Point & | theValue | ||
) | const |
Returns the point theValue of parameter theParam.
Throws exception only for the ModelData_OffsetCurve if it is not possible to compute the current point. For example when the first derivative on the basis curve and the offset direction are parallel.
void cadex::ModelData_Curve::D1 | ( | double | theParam, |
ModelData_Point & | theValue, | ||
ModelData_Vector & | theD1 | ||
) | const |
Returns the point theValue of parameter theParam and the first derivative theD1.
Throws exception if the continuity of the curve is not \(C^1\).
void cadex::ModelData_Curve::D2 | ( | double | theParam, |
ModelData_Point & | theValue, | ||
ModelData_Vector & | theD1, | ||
ModelData_Vector & | theD2 | ||
) | const |
Returns the point theValue of parameter theParam, the first theD1 and second theD2 derivatives.
Throws exception if the continuity of the curve is not \(C^2\).
bool cadex::ModelData_Curve::DN | ( | double | theParam, |
size_t | theDerivativeOrder, | ||
ModelData_Point & | theValue, | ||
ModelData_Vector | theD[] | ||
) | const |
Returns true if calculation completed successfully. In this case theD contains values of the derivatives from 0 up to theDerivativeOrder. Otherwise returns false. May throw exception if the continuity of the curve is less than theDerivativeOrder.
Parameters:
void cadex::ModelData_Curve::Domain | ( | double & | theUMin, |
double & | theUMax | ||
) | const |
bool cadex::ModelData_Curve::IsNull | ( | ) | const |
Returns true if the object has not been initialized yet.
ModelData_Curve cadex::ModelData_Curve::Mirrored | ( | const ModelData_Axis1Placement & | theAxis | ) | const |
Returns a copy this curve mirrored along the object.
The contents of this object is not modified.
ModelData_Curve cadex::ModelData_Curve::Mirrored | ( | const ModelData_Axis2Placement & | theAxis | ) | const |
Returns a copy this curve mirrored along the object.
The contents of this object is not modified.
ModelData_Curve cadex::ModelData_Curve::Mirrored | ( | const ModelData_Point & | theRef | ) | const |
Returns a copy this curve mirrored along the object.
The contents of this object is not modified.
void cadex::ModelData_Curve::Nullify | ( | ) |
Resets the object.
IsNull() will return true after calling this method.
|
inline |
Returns if the object has been initialized.
Returns the value opposite to IsNull().
ModelData_Curve cadex::ModelData_Curve::Reversed | ( | ) | const |
Returns a curve with reversed orientation.
Creates a deep copy of the curve which does not share any definition with this object.
ModelData_Curve cadex::ModelData_Curve::Rotated | ( | const ModelData_Axis1Placement & | theAxis, |
double | theAngle | ||
) | const |
Returns a copy this curve rotated along the axis.
The contents of this object is not modified.
ModelData_Curve cadex::ModelData_Curve::Scaled | ( | const ModelData_Point & | thePoint, |
double | theScale | ||
) | const |
Returns a copy this curve scaled with respect to the point.
The contents of this object is not modified.
void cadex::ModelData_Curve::Transform | ( | const ModelData_Transformation & | theTransformation | ) |
Applies transformation matrix to this object.
Results depends on the actual curve type.
ModelData_Curve cadex::ModelData_Curve::Transformed | ( | const ModelData_Transformation & | theTransformation | ) | const |
Returns a copy this object after applying transformation.
The contents of this object is not modified.
ModelData_Curve cadex::ModelData_Curve::Translated | ( | const ModelData_Vector & | theVector | ) | const |
Returns a copy this curve translated along the vector.
The contents of this object is not modified.
double cadex::ModelData_Curve::UMax | ( | ) | const |
Returns a maximum parameter of a definition domain.
double cadex::ModelData_Curve::UMin | ( | ) | const |
Returns a minimum parameter of a definition domain.
ModelData_Point cadex::ModelData_Curve::Value | ( | double | theParameter | ) | const |
Evaluates a point on the curve.
theParameter must be within Domain() if the curve is not periodic.