Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions | Protected Attributes
Geom2dAdaptor_Curve Class Reference

An interface between the services provided by any curve from the package Geom2d and those required of the curve by algorithms which use it. More...

#include <Geom2dAdaptor_Curve.hxx>

Inheritance diagram for Geom2dAdaptor_Curve:
Inheritance graph
[legend]

Data Structures

struct  BezierData
 Internal structure for Bezier curve evaluation data. More...
 
struct  BSplineData
 Internal structure for BSpline curve evaluation data. More...
 
struct  OffsetData
 Internal structure for 2D offset curve evaluation data. More...
 

Public Types

using CurveDataVariant
 Variant type for 2D curve-specific evaluation data.
 
- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object.
 

Public Member Functions

 Geom2dAdaptor_Curve ()
 
 Geom2dAdaptor_Curve (const occ::handle< Geom2d_Curve > &C)
 
 Geom2dAdaptor_Curve (const occ::handle< Geom2d_Curve > &C, const double UFirst, const double ULast)
 Standard_ConstructionError is raised if Ufirst>Ulast.
 
occ::handle< Adaptor2d_Curve2dShallowCopy () const override
 Shallow copy of adaptor.
 
void Reset ()
 Reset currently loaded curve (undone Load()).
 
void Load (const occ::handle< Geom2d_Curve > &theCurve)
 
void Load (const occ::handle< Geom2d_Curve > &theCurve, const double theUFirst, const double theULast)
 Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()
 
bool IsInitialized () const
 Returns true if the adaptor has been loaded with a curve.
 
const occ::handle< Geom2d_Curve > & Curve () const
 
double FirstParameter () const override
 
double LastParameter () const override
 
GeomAbs_Shape Continuity () const override
 
int NbIntervals (const GeomAbs_Shape S) const override
 If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.
 
void Intervals (NCollection_Array1< double > &T, const GeomAbs_Shape S) const override
 Stores in <T> the parameters bounding the intervals of continuity .
 
occ::handle< Adaptor2d_Curve2dTrim (const double First, const double Last, const double Tol) const override
 Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>
 
bool IsClosed () const override
 
bool IsPeriodic () const override
 
double Period () const override
 
gp_Pnt2d Value (const double U) const final
 Computes the point of parameter U on the curve.
 
void D0 (const double U, gp_Pnt2d &P) const final
 Computes the point of parameter U.
 
void D1 (const double U, gp_Pnt2d &P, gp_Vec2d &V) const final
 Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.
 
void D2 (const double U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2) const final
 Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.
 
void D3 (const double U, gp_Pnt2d &P, gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const final
 Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.
 
gp_Vec2d DN (const double U, const int N) const final
 The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.
 
double Resolution (const double Ruv) const override
 returns the parametric resolution
 
GeomAbs_CurveType GetType () const override
 Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.
 
gp_Lin2d Line () const override
 
gp_Circ2d Circle () const override
 
gp_Elips2d Ellipse () const override
 
gp_Hypr2d Hyperbola () const override
 
gp_Parab2d Parabola () const override
 
int Degree () const override
 
bool IsRational () const override
 
int NbPoles () const override
 
int NbKnots () const override
 
int NbSamples () const override
 
occ::handle< Geom2d_BezierCurveBezier () const override
 
occ::handle< Geom2d_BSplineCurveBSpline () const override
 
gp_Pnt2d EvalD0 (const double theU) const final
 Point evaluation. Raises an exception on failure.
 
Geom2d_Curve::ResD1 EvalD1 (const double theU) const final
 D1 evaluation. Raises an exception on failure.
 
Geom2d_Curve::ResD2 EvalD2 (const double theU) const final
 D2 evaluation. Raises an exception on failure.
 
Geom2d_Curve::ResD3 EvalD3 (const double theU) const final
 D3 evaluation. Raises an exception on failure.
 
gp_Vec2d EvalDN (const double theU, const int theN) const final
 DN evaluation. Raises an exception on failure.
 
- Public Member Functions inherited from Adaptor2d_Curve2d
 ~Adaptor2d_Curve2d () override
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
 
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
 
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
 
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
 
bool IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
bool IsKind (const char *const theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism.
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero.
 
int GetRefCount () const noexcept
 Get the reference counter of this object.
 
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
 
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
 
virtual void Delete () const
 Memory deallocator for transient classes.
 

Protected Attributes

occ::handle< Geom2d_CurvemyCurve
 
GeomAbs_CurveType myTypeCurve
 
double myFirst
 
double myLast
 
CurveDataVariant myCurveData
 Curve-specific evaluation data (BSpline, Bezier, offset)
 

Additional Inherited Members

- Static Public Member Functions inherited from Standard_Transient
static constexpr const charget_type_name ()
 Returns a type descriptor about this object.
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.
 

Detailed Description

An interface between the services provided by any curve from the package Geom2d and those required of the curve by algorithms which use it.

Polynomial coefficients of BSpline curves used for their evaluation are cached for better performance. Therefore these evaluations are not thread-safe and parallel evaluations need to be prevented.

Member Typedef Documentation

◆ CurveDataVariant

Initial value:
std::variant<std::monostate,
OffsetData,
BezierData,
BSplineData>
Describes a circle in the plane (2D space). A circle is defined by its radius and positioned in the p...
Definition gp_Circ2d.hxx:50
Describes an ellipse in the plane (2D space). An ellipse is defined by its major and minor radii and ...
Definition gp_Elips2d.hxx:45
Describes a branch of a hyperbola in the plane (2D space). A hyperbola is defined by its major and mi...
Definition gp_Hypr2d.hxx:66
Describes a line in 2D space. A line is positioned in the plane with an axis (a gp_Ax2d object) which...
Definition gp_Lin2d.hxx:39
Describes a parabola in the plane (2D space). A parabola is defined by its focal length (that is,...
Definition gp_Parab2d.hxx:48

Variant type for 2D curve-specific evaluation data.

Constructor & Destructor Documentation

◆ Geom2dAdaptor_Curve() [1/3]

Geom2dAdaptor_Curve::Geom2dAdaptor_Curve ( )

◆ Geom2dAdaptor_Curve() [2/3]

Geom2dAdaptor_Curve::Geom2dAdaptor_Curve ( const occ::handle< Geom2d_Curve > & C)

◆ Geom2dAdaptor_Curve() [3/3]

Geom2dAdaptor_Curve::Geom2dAdaptor_Curve ( const occ::handle< Geom2d_Curve > & C,
const double UFirst,
const double ULast )

Standard_ConstructionError is raised if Ufirst>Ulast.

Member Function Documentation

◆ Bezier()

occ::handle< Geom2d_BezierCurve > Geom2dAdaptor_Curve::Bezier ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ BSpline()

occ::handle< Geom2d_BSplineCurve > Geom2dAdaptor_Curve::BSpline ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Circle()

gp_Circ2d Geom2dAdaptor_Curve::Circle ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Continuity()

GeomAbs_Shape Geom2dAdaptor_Curve::Continuity ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Curve()

const occ::handle< Geom2d_Curve > & Geom2dAdaptor_Curve::Curve ( ) const
inline

◆ D0()

void Geom2dAdaptor_Curve::D0 ( const double U,
gp_Pnt2d & P ) const
finalvirtual

Computes the point of parameter U.

Reimplemented from Adaptor2d_Curve2d.

◆ D1()

void Geom2dAdaptor_Curve::D1 ( const double U,
gp_Pnt2d & P,
gp_Vec2d & V ) const
finalvirtual

Computes the point of parameter U on the curve with its first derivative. Raised if the continuity of the current interval is not C1.

Reimplemented from Adaptor2d_Curve2d.

◆ D2()

void Geom2dAdaptor_Curve::D2 ( const double U,
gp_Pnt2d & P,
gp_Vec2d & V1,
gp_Vec2d & V2 ) const
finalvirtual

Returns the point P of parameter U, the first and second derivatives V1 and V2. Raised if the continuity of the current interval is not C2.

Reimplemented from Adaptor2d_Curve2d.

◆ D3()

void Geom2dAdaptor_Curve::D3 ( const double U,
gp_Pnt2d & P,
gp_Vec2d & V1,
gp_Vec2d & V2,
gp_Vec2d & V3 ) const
finalvirtual

Returns the point P of parameter U, the first, the second and the third derivative. Raised if the continuity of the current interval is not C3.

Reimplemented from Adaptor2d_Curve2d.

◆ Degree()

int Geom2dAdaptor_Curve::Degree ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ DN()

gp_Vec2d Geom2dAdaptor_Curve::DN ( const double U,
const int N ) const
finalvirtual

The returned vector gives the value of the derivative for the order of derivation N. Raised if the continuity of the current interval is not CN. Raised if N < 1.

Reimplemented from Adaptor2d_Curve2d.

◆ Ellipse()

gp_Elips2d Geom2dAdaptor_Curve::Ellipse ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ EvalD0()

gp_Pnt2d Geom2dAdaptor_Curve::EvalD0 ( const double theU) const
finalvirtual

Point evaluation. Raises an exception on failure.

Reimplemented from Adaptor2d_Curve2d.

◆ EvalD1()

Geom2d_Curve::ResD1 Geom2dAdaptor_Curve::EvalD1 ( const double theU) const
finalvirtual

D1 evaluation. Raises an exception on failure.

Reimplemented from Adaptor2d_Curve2d.

◆ EvalD2()

Geom2d_Curve::ResD2 Geom2dAdaptor_Curve::EvalD2 ( const double theU) const
finalvirtual

D2 evaluation. Raises an exception on failure.

Reimplemented from Adaptor2d_Curve2d.

◆ EvalD3()

Geom2d_Curve::ResD3 Geom2dAdaptor_Curve::EvalD3 ( const double theU) const
finalvirtual

D3 evaluation. Raises an exception on failure.

Reimplemented from Adaptor2d_Curve2d.

◆ EvalDN()

gp_Vec2d Geom2dAdaptor_Curve::EvalDN ( const double theU,
const int theN ) const
finalvirtual

DN evaluation. Raises an exception on failure.

Reimplemented from Adaptor2d_Curve2d.

◆ FirstParameter()

double Geom2dAdaptor_Curve::FirstParameter ( ) const
inlineoverridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ GetType()

GeomAbs_CurveType Geom2dAdaptor_Curve::GetType ( ) const
inlineoverridevirtual

Returns the type of the curve in the current interval: Line, Circle, Ellipse, Hyperbola, Parabola, BezierCurve, BSplineCurve, OtherCurve.

Reimplemented from Adaptor2d_Curve2d.

◆ Hyperbola()

gp_Hypr2d Geom2dAdaptor_Curve::Hyperbola ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Intervals()

void Geom2dAdaptor_Curve::Intervals ( NCollection_Array1< double > & T,
const GeomAbs_Shape S ) const
overridevirtual

Stores in <T> the parameters bounding the intervals of continuity .

The array must provide enough room to accommodate for the parameters. i.e. T.Length() > NbIntervals()

Reimplemented from Adaptor2d_Curve2d.

◆ IsClosed()

bool Geom2dAdaptor_Curve::IsClosed ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ IsInitialized()

bool Geom2dAdaptor_Curve::IsInitialized ( ) const
inline

Returns true if the adaptor has been loaded with a curve.

◆ IsPeriodic()

bool Geom2dAdaptor_Curve::IsPeriodic ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ IsRational()

bool Geom2dAdaptor_Curve::IsRational ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ LastParameter()

double Geom2dAdaptor_Curve::LastParameter ( ) const
inlineoverridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Line()

gp_Lin2d Geom2dAdaptor_Curve::Line ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Load() [1/2]

void Geom2dAdaptor_Curve::Load ( const occ::handle< Geom2d_Curve > & theCurve)
inline

◆ Load() [2/2]

void Geom2dAdaptor_Curve::Load ( const occ::handle< Geom2d_Curve > & theCurve,
const double theUFirst,
const double theULast )
inline

Standard_ConstructionError is raised if theUFirst > theULast + Precision::PConfusion()

◆ NbIntervals()

int Geom2dAdaptor_Curve::NbIntervals ( const GeomAbs_Shape S) const
overridevirtual

If necessary, breaks the curve in intervals of continuity . And returns the number of intervals.

Reimplemented from Adaptor2d_Curve2d.

◆ NbKnots()

int Geom2dAdaptor_Curve::NbKnots ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ NbPoles()

int Geom2dAdaptor_Curve::NbPoles ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ NbSamples()

int Geom2dAdaptor_Curve::NbSamples ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Parabola()

gp_Parab2d Geom2dAdaptor_Curve::Parabola ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Period()

double Geom2dAdaptor_Curve::Period ( ) const
overridevirtual

Reimplemented from Adaptor2d_Curve2d.

◆ Reset()

void Geom2dAdaptor_Curve::Reset ( )

Reset currently loaded curve (undone Load()).

◆ Resolution()

double Geom2dAdaptor_Curve::Resolution ( const double Ruv) const
overridevirtual

returns the parametric resolution

Reimplemented from Adaptor2d_Curve2d.

◆ ShallowCopy()

occ::handle< Adaptor2d_Curve2d > Geom2dAdaptor_Curve::ShallowCopy ( ) const
overridevirtual

Shallow copy of adaptor.

Reimplemented from Adaptor2d_Curve2d.

◆ Trim()

occ::handle< Adaptor2d_Curve2d > Geom2dAdaptor_Curve::Trim ( const double First,
const double Last,
const double Tol ) const
overridevirtual

Returns a curve equivalent of <me> between parameters <First> and <Last>. <Tol> is used to test for 3d points confusion. If <First> >= <Last>

Reimplemented from Adaptor2d_Curve2d.

◆ Value()

gp_Pnt2d Geom2dAdaptor_Curve::Value ( const double U) const
finalvirtual

Computes the point of parameter U on the curve.

Reimplemented from Adaptor2d_Curve2d.

Field Documentation

◆ myCurve

occ::handle<Geom2d_Curve> Geom2dAdaptor_Curve::myCurve
protected

◆ myCurveData

CurveDataVariant Geom2dAdaptor_Curve::myCurveData
protected

Curve-specific evaluation data (BSpline, Bezier, offset)

◆ myFirst

double Geom2dAdaptor_Curve::myFirst
protected

◆ myLast

double Geom2dAdaptor_Curve::myLast
protected

◆ myTypeCurve

GeomAbs_CurveType Geom2dAdaptor_Curve::myTypeCurve
protected

The documentation for this class was generated from the following file: