Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
442 changes: 12 additions & 430 deletions src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_Curve.cxx

Large diffs are not rendered by default.

152 changes: 15 additions & 137 deletions src/ModelingData/TKBRep/BRepAdaptor/BRepAdaptor_Curve.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,10 @@
#ifndef _BRepAdaptor_Curve_HeaderFile
#define _BRepAdaptor_Curve_HeaderFile

#include <Adaptor3d_CurveOnSurface.hxx>
#include <gp_Trsf.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <GeomAdaptor_TransformedCurve.hxx>
#include <TopoDS_Edge.hxx>
#include <Adaptor3d_Curve.hxx>
#include <Standard_Real.hxx>
#include <GeomAbs_Shape.hxx>
#include <Standard_Integer.hxx>
#include <NCollection_Array1.hxx>
#include <GeomAbs_CurveType.hxx>

class TopoDS_Face;
class Adaptor3d_CurveOnSurface;
class gp_Pnt;
class gp_Vec;
class gp_Lin;
class gp_Circ;
class gp_Elips;
class gp_Hypr;
class gp_Parab;
class Geom_BezierCurve;
class Geom_BSplineCurve;
class Geom_OffsetCurve;

//! The Curve from BRepAdaptor allows to use an Edge
//! of the BRep topology like a 3D curve.
Expand All @@ -53,9 +34,9 @@ class Geom_OffsetCurve;
//! surface is used. It is possible to enforce using a
//! curve on surface by creating or initialising with
//! an Edge and a Face.
class BRepAdaptor_Curve : public Adaptor3d_Curve
class BRepAdaptor_Curve : public GeomAdaptor_TransformedCurve
{
DEFINE_STANDARD_RTTIEXT(BRepAdaptor_Curve, Adaptor3d_Curve)
DEFINE_STANDARD_RTTIEXT(BRepAdaptor_Curve, GeomAdaptor_TransformedCurve)
public:
//! Creates an undefined Curve with no Edge loaded.
Standard_EXPORT BRepAdaptor_Curve();
Expand Down Expand Up @@ -87,136 +68,33 @@ public:
//! the face.
Standard_EXPORT void Initialize(const TopoDS_Edge& E, const TopoDS_Face& F);

//! Returns the coordinate system of the curve.
Standard_EXPORT const gp_Trsf& Trsf() const;

//! Returns True if the edge geometry is computed from
//! a 3D curve.
Standard_EXPORT bool Is3DCurve() const;

//! Returns True if the edge geometry is computed from
//! a pcurve on a surface.
Standard_EXPORT bool IsCurveOnSurface() const;

//! Returns the Curve of the edge.
Standard_EXPORT const GeomAdaptor_Curve& Curve() const;

//! Returns the CurveOnSurface of the edge.
Standard_EXPORT const Adaptor3d_CurveOnSurface& CurveOnSurface() const;

//! Returns the edge.
Standard_EXPORT const TopoDS_Edge& Edge() const;

//! Returns the edge tolerance.
Standard_EXPORT double Tolerance() const;

Standard_EXPORT double FirstParameter() const override;

Standard_EXPORT double LastParameter() const override;

Standard_EXPORT GeomAbs_Shape Continuity() const override;

//! Returns the number of intervals for continuity
//! <S>. May be one if Continuity(me) >= <S>
Standard_EXPORT int NbIntervals(const GeomAbs_Shape S) const override;

//! Stores in <T> the parameters bounding the intervals
//! of continuity <S>.
//!
//! The array must provide enough room to accommodate
//! for the parameters. i.e. T.Length() > NbIntervals()
Standard_EXPORT void Intervals(NCollection_Array1<double>& T,
const GeomAbs_Shape S) 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>
Standard_EXPORT occ::handle<Adaptor3d_Curve> Trim(const double First,
const double Last,
const double Tol) const override;

Standard_EXPORT bool IsClosed() const override;

Standard_EXPORT bool IsPeriodic() const override;

Standard_EXPORT double Period() const override;

//! Computes the point of parameter U on the curve
Standard_EXPORT gp_Pnt Value(const double U) const override;

//! Computes the point of parameter U.
Standard_EXPORT void D0(const double U, gp_Pnt& P) const override;

//! Computes the point of parameter U on the curve
//! with its first derivative.
//! Raised if the continuity of the current interval
//! is not C1.
Standard_EXPORT void D1(const double U, gp_Pnt& P, gp_Vec& V) const override;

//! 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.
Standard_EXPORT void D2(const double U, gp_Pnt& P, gp_Vec& V1, gp_Vec& V2) const override;

//! 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.
Standard_EXPORT void D3(const double U,
gp_Pnt& P,
gp_Vec& V1,
gp_Vec& V2,
gp_Vec& V3) const override;

//! 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.
Standard_EXPORT gp_Vec DN(const double U, const int N) const override;

//! returns the parametric resolution
Standard_EXPORT double Resolution(const double R3d) const override;

Standard_EXPORT GeomAbs_CurveType GetType() const override;

Standard_EXPORT gp_Lin Line() const override;

Standard_EXPORT gp_Circ Circle() const override;

Standard_EXPORT gp_Elips Ellipse() const override;

Standard_EXPORT gp_Hypr Hyperbola() const override;

Standard_EXPORT gp_Parab Parabola() const override;

Standard_EXPORT int Degree() const override;

Standard_EXPORT bool IsRational() const override;

Standard_EXPORT int NbPoles() const override;

Standard_EXPORT int NbKnots() const override;

//! Warning:
//! This will make a copy of the Bezier Curve since it applies to it myTsrf.
//! Be careful when using this method.
Standard_EXPORT occ::handle<Geom_BezierCurve> Bezier() const override;

//! Warning:
//! This will make a copy of the BSpline Curve since it applies to it myTsrf.
//! Be careful when using this method.
Standard_EXPORT occ::handle<Geom_BSplineCurve> BSpline() const override;

Standard_EXPORT occ::handle<Geom_OffsetCurve> OffsetCurve() const override;
// Note: Most methods are inherited from GeomAdaptor_TransformedCurve.
// The following methods provide access to the underlying curve/transformation:
// - Curve() - returns const GeomAdaptor_Curve&
// - ChangeCurve() - returns GeomAdaptor_Curve&
// - Trsf() - returns const gp_Trsf&
// - Is3DCurve() - returns true if 3D curve is used
// - IsCurveOnSurface() - returns true if COS is used
// - CurveOnSurface() - returns const Adaptor3d_CurveOnSurface&
//
// Value, D0, D1, D2, D3, DN methods are inherited and marked as final.
// They apply the transformation automatically.

private:
gp_Trsf myTrsf;
GeomAdaptor_Curve myCurve;
occ::handle<Adaptor3d_CurveOnSurface> myConSurf;
TopoDS_Edge myEdge;
TopoDS_Edge myEdge;
};

#endif // _BRepAdaptor_Curve_HeaderFile
2 changes: 2 additions & 0 deletions src/ModelingData/TKG3d/GTests/FILES.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ set(OCCT_TKG3d_GTests_FILES
GeomEval_TBezierSurface_Test.cxx
GeomAPI_ExtremaCurveCurve_Test.cxx
GeomAPI_Interpolate_Test.cxx
GeomAdaptor_TransformedCurve_Test.cxx
GeomGridEval_CurveOnSurface_Test.cxx
GeomGridEval_BezierCurve_Test.cxx
GeomGridEval_BezierSurface_Test.cxx
GeomGridEval_BSplineSurface_Test.cxx
Expand Down
Loading
Loading