Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Namespaces | Functions
LProp_CurveUtils.hxx File Reference
#include <LProp_NotDefined.hxx>
#include <LProp_Status.hxx>
#include <Standard_Handle.hxx>
#include <cmath>

Data Structures

struct  LProp_CurveUtils::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  LProp_CurveUtils::ToolAccess< Tool >
 Tool-based access policy: delegates to static Tool methods. Used for HLRBRep types where Tool class provides the interface. More...
 

Namespaces

namespace  LProp_CurveUtils
 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.
 

Functions

template<typename T >
T & LProp_CurveUtils::Deref (T &theObj)
 Dereference by-value or reference types (identity).
 
template<typename T >
T & LProp_CurveUtils::Deref (occ::handle< T > &theHandle)
 Dereference occ::handle types.
 
template<typename T >
const T & LProp_CurveUtils::Deref (const occ::handle< T > &theHandle)
 Dereference const occ::handle types.
 
template<typename Access , typename Curve , typename Pnt , typename Vec >
void LProp_CurveUtils::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 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.
 
template<typename Vec >
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.
 
template<typename Vec , typename Dir >
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.
 
template<typename Vec , typename Pnt >
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.
 
template<typename Access , typename Curve , typename Pnt , typename Vec >
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.
 
template<typename Access , typename Curve , typename Pnt , typename Vec >
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.
 
template<typename Vec , typename Props >
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.
 
template<typename Access , typename Props , typename Curve , typename Vec , typename Pnt , typename Dir >
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.
 
template<typename Props , typename Vec >
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.
 
template<typename Props , typename Vec , typename Dir >
void LProp_CurveUtils::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 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.