![]() |
Open CASCADE Technology Reference Manual 8.0.0
|
Template utility functions for CLProps curve local property computation. Provides access policies (DirectAccess, ToolAccess) and shared algorithms for evaluating derivatives, tangents, curvature, normals, and centres of curvature. More...
Data Structures | |
| struct | DirectAccess |
| Direct access policy: calls D0/D1/D2/D3 methods on the curve object. Works with occ::handle<T> and by-value curve types. More... | |
| struct | ToolAccess |
| Tool-based access policy: delegates to static Tool methods. Used for HLRBRep types where Tool class provides the interface. More... | |
Functions | |
| template<typename T > | |
| T & | Deref (T &theObj) |
| Dereference by-value or reference types (identity). | |
| template<typename T > | |
| T & | Deref (occ::handle< T > &theHandle) |
| Dereference occ::handle types. | |
| template<typename T > | |
| const T & | Deref (const occ::handle< T > &theHandle) |
| Dereference const occ::handle types. | |
| template<typename Access , typename Curve , typename Pnt , typename Vec > | |
| void | EvalDerivatives (Curve &theCurve, double theU, int theOrder, Pnt &thePnt, Vec *theDerivArr) |
| Evaluate curve derivatives at parameter theU up to specified order. | |
| template<typename Access , typename Curve , typename Vec , typename Pnt , typename Dir > | |
| void | ComputeTangent (Curve &theCurve, double theU, const Vec *theDerivArr, const Pnt &, int theSigOrder, Dir &theDir) |
| Compute tangent direction with sign correction for higher-order derivatives. When the first significant derivative has order > 1, the sign of the tangent is determined by comparing with the chord direction near the point. | |
| template<typename Vec > | |
| double | ComputeCurvature (const Vec &theD1, const Vec &theD2, double theTolSq) |
| Compute curvature from first and second derivatives. Returns |D1 x D2| / |D1|^3, or 0 if derivatives are collinear or D2 is null. | |
| template<typename Vec , typename Dir > | |
| void | ComputeNormal (const Vec &theD1, const Vec &theD2, Dir &theDir) |
| Compute normal direction from first and second derivatives. Normal = D2*(D1*D1) - D1*(D1*D2), using the vector triple product identity. | |
| template<typename Vec , typename Pnt > | |
| void | ComputeCentreOfCurvature (const Pnt &thePnt, const Vec &theD1, const Vec &theD2, double theCurvature, Pnt &theCentre) |
| Compute centre of curvature from point, derivatives, and curvature. Centre = Point + Normal / Curvature. | |
| template<typename Access , typename Curve , typename Pnt , typename Vec > | |
| void | SetParameter (Curve &theCurve, double theU, double &theStoredU, int theDerOrder, Pnt &thePnt, Vec *theDerivArr, LProp_Status &theTanStatus) |
| SetParameter wrapper: sets parameter, evaluates derivatives, resets tangent status. | |
| template<typename Access , typename Curve , typename Pnt , typename Vec > | |
| const Vec & | EnsureDeriv (Curve &theCurve, double theU, int &theDerOrder, int theRequired, Pnt &thePnt, Vec *theDerivArr) |
| Ensure derivatives up to the required order are computed. | |
| template<typename Vec , typename Props > | |
| bool | IsTangentDefined (Props &theProps, int theCN, double theLinTol, int &theSigOrder, LProp_Status &theTanStatus) |
| IsTangentDefined: searches for first non-null derivative. Calls theProps.D1(), theProps.D2(), theProps.D3() to upgrade derivatives as needed. | |
| template<typename Access , typename Props , typename Curve , typename Vec , typename Pnt , typename Dir > | |
| void | Tangent (Props &theProps, Curve &theCurve, double theU, const Vec *theDerivArr, const Pnt &theRefPnt, const int &theSigOrder, Dir &theDir) |
| Tangent: checks IsTangentDefined, then computes tangent direction. | |
| template<typename Props , typename Vec > | |
| double | Curvature (Props &theProps, const Vec &theD1, const Vec &theD2, double theLinTol, const int &theSigOrder, double &theCurvature) |
| Curvature: checks IsTangentDefined, returns RealLast if higher-order, else computes. | |
| template<typename Props , typename Vec , typename Dir > | |
| void | Normal (Props &theProps, const Vec &theD1, const Vec &theD2, double theLinTol, Dir &theDir) |
| Normal: checks curvature, then computes normal direction. | |
| template<typename Props , typename Vec , typename Pnt > | |
| void | CentreOfCurvature (Props &theProps, const Pnt &thePnt, const Vec &theD1, const Vec &theD2, double theLinTol, double &theCurvature, Pnt &theCentre) |
| CentreOfCurvature: checks curvature, then computes centre. | |
Template utility functions for CLProps curve local property computation. Provides access policies (DirectAccess, ToolAccess) and shared algorithms for evaluating derivatives, tangents, curvature, normals, and centres of curvature.
| void LProp_CurveUtils::CentreOfCurvature | ( | Props & | theProps, |
| const Pnt & | thePnt, | ||
| const Vec & | theD1, | ||
| const Vec & | theD2, | ||
| double | theLinTol, | ||
| double & | theCurvature, | ||
| Pnt & | theCentre ) |
CentreOfCurvature: checks curvature, then computes centre.
| [in,out] | theProps | CLProps object |
| [in] | thePnt | current point |
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [in] | theLinTol | linear tolerance |
| [in,out] | theCurvature | curvature value field |
| [out] | theCentre | computed centre of curvature |
| void LProp_CurveUtils::ComputeCentreOfCurvature | ( | const Pnt & | thePnt, |
| const Vec & | theD1, | ||
| const Vec & | theD2, | ||
| double | theCurvature, | ||
| Pnt & | theCentre ) |
Compute centre of curvature from point, derivatives, and curvature. Centre = Point + Normal / Curvature.
| [in] | thePnt | current point |
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [in] | theCurvature | curvature value (must be non-zero) |
| [out] | theCentre | computed centre of curvature |
| double LProp_CurveUtils::ComputeCurvature | ( | const Vec & | theD1, |
| const Vec & | theD2, | ||
| double | theTolSq ) |
Compute curvature from first and second derivatives. Returns |D1 x D2| / |D1|^3, or 0 if derivatives are collinear or D2 is null.
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [in] | theTolSq | squared linear tolerance |
| void LProp_CurveUtils::ComputeNormal | ( | const Vec & | theD1, |
| const Vec & | theD2, | ||
| Dir & | theDir ) |
Compute normal direction from first and second derivatives. Normal = D2*(D1*D1) - D1*(D1*D2), using the vector triple product identity.
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [out] | theDir | computed normal direction |
| void LProp_CurveUtils::ComputeTangent | ( | Curve & | theCurve, |
| double | theU, | ||
| const Vec * | theDerivArr, | ||
| const Pnt & | , | ||
| int | theSigOrder, | ||
| Dir & | theDir ) |
Compute tangent direction with sign correction for higher-order derivatives. When the first significant derivative has order > 1, the sign of the tangent is determined by comparing with the chord direction near the point.
| [in,out] | theCurve | curve object |
| [in] | theU | current parameter |
| [in] | theDerivArr | derivative array |
| [in] | theRefPnt | reference point (used only for type deduction) |
| [in] | theSigOrder | order of first significant derivative |
| [out] | theDir | computed tangent direction |
| double LProp_CurveUtils::Curvature | ( | Props & | theProps, |
| const Vec & | theD1, | ||
| const Vec & | theD2, | ||
| double | theLinTol, | ||
| const int & | theSigOrder, | ||
| double & | theCurvature ) |
Curvature: checks IsTangentDefined, returns RealLast if higher-order, else computes.
| [in,out] | theProps | CLProps object |
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [in] | theLinTol | linear tolerance |
| [in] | theSigOrder | order of first significant derivative |
| [out] | theCurvature | curvature value field |
| const T & LProp_CurveUtils::Deref | ( | const occ::handle< T > & | theHandle | ) |
Dereference const occ::handle types.
| T & LProp_CurveUtils::Deref | ( | occ::handle< T > & | theHandle | ) |
Dereference occ::handle types.
| T & LProp_CurveUtils::Deref | ( | T & | theObj | ) |
Dereference by-value or reference types (identity).
| const Vec & LProp_CurveUtils::EnsureDeriv | ( | Curve & | theCurve, |
| double | theU, | ||
| int & | theDerOrder, | ||
| int | theRequired, | ||
| Pnt & | thePnt, | ||
| Vec * | theDerivArr ) |
Ensure derivatives up to the required order are computed.
| [in,out] | theCurve | curve object |
| [in] | theU | parameter value |
| [in,out] | theDerOrder | current derivative order (upgraded if needed) |
| [in] | theRequired | required derivative order |
| [out] | thePnt | evaluated point |
| [out] | theDerivArr | derivative array |
| void LProp_CurveUtils::EvalDerivatives | ( | Curve & | theCurve, |
| double | theU, | ||
| int | theOrder, | ||
| Pnt & | thePnt, | ||
| Vec * | theDerivArr ) |
Evaluate curve derivatives at parameter theU up to specified order.
| [in,out] | theCurve | curve object |
| [in] | theU | parameter value |
| [in] | theOrder | maximum derivative order (0-3) |
| [out] | thePnt | evaluated point |
| [out] | theDerivArr | derivative array (size >= theOrder) |
| bool LProp_CurveUtils::IsTangentDefined | ( | Props & | theProps, |
| int | theCN, | ||
| double | theLinTol, | ||
| int & | theSigOrder, | ||
| LProp_Status & | theTanStatus ) |
IsTangentDefined: searches for first non-null derivative. Calls theProps.D1(), theProps.D2(), theProps.D3() to upgrade derivatives as needed.
| [in,out] | theProps | CLProps object |
| [in] | theCN | continuity order |
| [in] | theLinTol | linear tolerance |
| [out] | theSigOrder | order of first significant derivative |
| [in,out] | theTanStatus | tangent status field |
| void LProp_CurveUtils::Normal | ( | Props & | theProps, |
| const Vec & | theD1, | ||
| const Vec & | theD2, | ||
| double | theLinTol, | ||
| Dir & | theDir ) |
Normal: checks curvature, then computes normal direction.
| [in,out] | theProps | CLProps object |
| [in] | theD1 | first derivative |
| [in] | theD2 | second derivative |
| [in] | theLinTol | linear tolerance |
| [out] | theDir | computed normal direction |
| void LProp_CurveUtils::SetParameter | ( | Curve & | theCurve, |
| double | theU, | ||
| double & | theStoredU, | ||
| int | theDerOrder, | ||
| Pnt & | thePnt, | ||
| Vec * | theDerivArr, | ||
| LProp_Status & | theTanStatus ) |
SetParameter wrapper: sets parameter, evaluates derivatives, resets tangent status.
| [in,out] | theCurve | curve object |
| [in] | theU | parameter value |
| [out] | theStoredU | stored parameter field |
| [in] | theDerOrder | current derivative order |
| [out] | thePnt | evaluated point |
| [out] | theDerivArr | derivative array |
| [out] | theTanStatus | tangent status field |
| void LProp_CurveUtils::Tangent | ( | Props & | theProps, |
| Curve & | theCurve, | ||
| double | theU, | ||
| const Vec * | theDerivArr, | ||
| const Pnt & | theRefPnt, | ||
| const int & | theSigOrder, | ||
| Dir & | theDir ) |
Tangent: checks IsTangentDefined, then computes tangent direction.
| [in,out] | theProps | CLProps object |
| [in,out] | theCurve | curve object |
| [in] | theU | current parameter |
| [in] | theDerivArr | derivative array |
| [in] | theRefPnt | reference point (for type deduction) |
| [in] | theSigOrder | order of first significant derivative |
| [out] | theDir | computed tangent direction |