mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
166
src/Adaptor2d/Adaptor2d.cdl
Executable file
166
src/Adaptor2d/Adaptor2d.cdl
Executable file
@@ -0,0 +1,166 @@
|
||||
-- File: Adaptor2d.cdl
|
||||
-- Created: Thu Oct 8 10:33:07 1992
|
||||
-- Author: Isabelle GRIGNON
|
||||
-- <isg@sdsun2>
|
||||
---Copyright: Matra Davision 1992
|
||||
|
||||
|
||||
|
||||
|
||||
package Adaptor2d
|
||||
|
||||
---Purpose: The Adaptor2d package is used to help defining
|
||||
-- reusable geometric algorithms. i.e. that can be
|
||||
-- used on curves and surfaces.
|
||||
--
|
||||
-- It defines general services for objects :
|
||||
--
|
||||
-- - the 2d curve. Curve2d
|
||||
--
|
||||
-- The services are :
|
||||
--
|
||||
-- - Usual services found in Geom or Geom2d :
|
||||
--
|
||||
-- * parameter range, value and derivatives, etc...
|
||||
--
|
||||
-- - Continuity breakout services :
|
||||
--
|
||||
-- * Allows to divide a curve or a surfaces in
|
||||
-- parts with a given derivation order.
|
||||
--
|
||||
-- - Special geometries detection services :
|
||||
--
|
||||
-- * Allows to test for special cases that can
|
||||
-- be processed more easily :
|
||||
-- - Conics, Quadrics, Bezier, BSpline ...
|
||||
--
|
||||
-- And to get the correponding data form the
|
||||
-- package gp or Geom. The special type
|
||||
-- OtherCurve means that no special case has
|
||||
-- been detected and the algorithm may use
|
||||
-- only the evaluation methods (D0, D1, ...)
|
||||
--
|
||||
--
|
||||
-- For each category Curve2d, Curve, Surface we
|
||||
-- define three classes, we illustrate now the
|
||||
-- principles with the Curve, the same applies to
|
||||
-- Curve2d and Surface.
|
||||
--
|
||||
-- The class Curve is the abstract root for all
|
||||
-- Curves used by algorithms, it is handled by value
|
||||
-- and provides as deferred methods the services
|
||||
-- described above.
|
||||
--
|
||||
-- Some services (breakout) requires to create new
|
||||
-- curves, this leads to memory allocation
|
||||
-- considerations (who create the curve, who deletes
|
||||
-- it ?). To solve this problem elegantly the curve
|
||||
-- will return a HCurve, the HCurve is a curve
|
||||
-- handled by reference so it will be deallocated
|
||||
-- automatically when it is not used.
|
||||
--
|
||||
-- A third class GenHCurve is provided, this class is
|
||||
-- generic and its utility is to provide automatic
|
||||
-- generation of the HCurve class when you have
|
||||
-- written the Curve class.
|
||||
--
|
||||
--
|
||||
-- * Let us show an example (with 2d curves) :
|
||||
--
|
||||
-- Imagine an algorithm to intersect curves, this
|
||||
-- algorithms is written to process Curve2d from
|
||||
-- Adaptor2d :
|
||||
--
|
||||
-- A method may look like :
|
||||
--
|
||||
-- Intersect(C1,C2 : Curve2d from Adaptor2d);
|
||||
--
|
||||
-- Which will look like in C++
|
||||
--
|
||||
-- Intersect(const Adaptor2d_Curve2d& C1,
|
||||
-- const Adaptor2d_Curve2d& C2)
|
||||
-- {
|
||||
-- // you can call any method
|
||||
-- Standard_Real first1 = C1.FirstParameter();
|
||||
--
|
||||
-- // but avoid to copy in an Adaptor2d_Curve which
|
||||
-- // is an Abstract class, use a reference or a pointer
|
||||
--
|
||||
-- const Adaptor2d_Curve& C = C1;
|
||||
-- const Adaptor2d_Curve *pC = &C1;
|
||||
--
|
||||
-- // If you are interseted in Intervals you must
|
||||
-- // store them in a HCurve to ensure they are kept
|
||||
-- // in memory. Then a referrence may be used.
|
||||
--
|
||||
-- Handle(Adaptor2d_HCurve) HCI = C1.Interval(1);
|
||||
--
|
||||
-- const Adaptor2d_Curve& CI = HCI->Curve();
|
||||
-- pC = &(HCI->Curve());
|
||||
--
|
||||
--
|
||||
-- * The Adaptor2d provides also Generic classes
|
||||
-- implementing algorithmic curves and surfaces.
|
||||
--
|
||||
-- - IsoCurve : Isoparametric curve on a surface.
|
||||
-- - CurveOnSurface : 2D curve in the parametric
|
||||
-- space of a surface.
|
||||
--
|
||||
--
|
||||
-- - OffsetCurve2d : 2d offset curve
|
||||
-- - ProjectedCurve : 3d curve projected on a plane
|
||||
-- - SurfaceOfLinearExtrusion
|
||||
-- - SurfaceOfRevolution
|
||||
--
|
||||
-- They are instantiated with HCurve, HSurface, HCurved2d
|
||||
|
||||
uses
|
||||
Standard,
|
||||
MMgt,
|
||||
TColStd,
|
||||
GeomAbs,
|
||||
TopAbs,
|
||||
TColgp,
|
||||
gp,
|
||||
Geom2d,
|
||||
math
|
||||
|
||||
is
|
||||
|
||||
deferred class Curve2d;
|
||||
---Purpose: Root of the 2d curve.
|
||||
|
||||
pointer Curve2dPtr to Curve2d from Adaptor2d;
|
||||
|
||||
deferred class HCurve2d;
|
||||
---Purpose: deferred class for the 2d curves manipulated with
|
||||
-- Handle.
|
||||
|
||||
generic class GenHCurve2d;
|
||||
---Purpose: Generic class used to create a curve inheriting
|
||||
-- from HCurve2d.
|
||||
|
||||
|
||||
|
||||
--
|
||||
-- The following classes are used to define an abstract
|
||||
-- simplified "topology" for surfaces. This is used by
|
||||
-- algorithm as mass properties or surface intersections.
|
||||
--
|
||||
|
||||
|
||||
class Line2d;
|
||||
|
||||
class HLine2d instantiates GenHCurve2d(Line2d from Adaptor2d);
|
||||
---Purpose: Use by the TopolTool to trim a surface.
|
||||
|
||||
--
|
||||
-- The following classes provides algorithmic curves and
|
||||
-- surface, they are inheriting from Curve and Surface and the
|
||||
-- correponding HCurve and HSurface is instantiated.
|
||||
--
|
||||
--
|
||||
|
||||
|
||||
|
||||
end Adaptor2d;
|
225
src/Adaptor2d/Adaptor2d_Curve2d.cdl
Executable file
225
src/Adaptor2d/Adaptor2d_Curve2d.cdl
Executable file
@@ -0,0 +1,225 @@
|
||||
-- File: Adaptor2d_Curve2d.cdl
|
||||
-- Created: Fri Apr 2 11:52:37 1993
|
||||
-- Author: Bruno DUMORTIER
|
||||
-- <dub@phylox>
|
||||
---Copyright: Matra Datavision 1993
|
||||
|
||||
|
||||
deferred class Curve2d from Adaptor2d
|
||||
|
||||
---Purpose: Root class for 2D curves on which geometric
|
||||
-- algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve, and those required of
|
||||
-- the curve by algorithms, which use it.
|
||||
-- A derived concrete class is provided:
|
||||
-- Geom2dAdaptor_Curve for a curve from the Geom2d package.
|
||||
|
||||
uses
|
||||
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
Delete(me:out) is virtual;
|
||||
---C++: alias "Standard_EXPORT virtual ~Adaptor2d_Curve2d(){Delete();}"
|
||||
|
||||
FirstParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
LastParameter(me) returns Real
|
||||
is virtual;
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs
|
||||
is virtual;
|
||||
|
||||
NbIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: If necessary, breaks the curve in intervals of
|
||||
-- continuity <S>. And returns the number of
|
||||
-- intervals.
|
||||
is virtual;
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is virtual;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- Local methods - Apply to the current interval.
|
||||
-- By default the current interval is the first.
|
||||
--
|
||||
|
||||
IsClosed(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
IsPeriodic(me) returns Boolean
|
||||
is virtual;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is virtual;
|
||||
|
||||
Value(me; U : Real) returns Pnt2d from gp
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
D0 (me; U : Real; P : out Pnt2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve.
|
||||
is virtual;
|
||||
|
||||
D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp)
|
||||
--- Purpose : Computes the point of parameter U on the curve with its
|
||||
-- first derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C1.
|
||||
is virtual;
|
||||
|
||||
D2 (me; U : Real; P : out Pnt2d from gp; V1, V2 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first and second
|
||||
-- derivatives V1 and V2.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C2.
|
||||
is virtual;
|
||||
|
||||
D3 (me; U : Real; P : out Pnt2d from gp; V1, V2, V3 : out Vec2d from gp)
|
||||
--- Purpose :
|
||||
-- Returns the point P of parameter U, the first, the second
|
||||
-- and the third derivative.
|
||||
raises
|
||||
DomainError from Standard
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not C3.
|
||||
is virtual;
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec2d from gp
|
||||
--- Purpose :
|
||||
-- The returned vector gives the value of the derivative for the
|
||||
-- order of derivation N.
|
||||
raises
|
||||
DomainError from Standard,
|
||||
--- Purpose : Raised if the continuity of the current interval
|
||||
-- is not CN.
|
||||
OutOfRange from Standard
|
||||
--- Purpose : Raised if N < 1.
|
||||
is virtual;
|
||||
|
||||
Resolution(me; R3d : Real) returns Real
|
||||
---Purpose : Returns the parametric resolution corresponding
|
||||
-- to the real space resolution <R3d>.
|
||||
is virtual;
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs
|
||||
---Purpose: Returns the type of the curve in the current
|
||||
-- interval : Line, Circle, Ellipse, Hyperbola,
|
||||
-- Parabola, BezierCurve, BSplineCurve, OtherCurve.
|
||||
is virtual;
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Circle(me) returns Circ2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Ellipse(me) returns Elips2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
Parabola(me) returns Parab2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is virtual;
|
||||
|
||||
end Curve2d;
|
||||
|
||||
|
366
src/Adaptor2d/Adaptor2d_Curve2d.cxx
Executable file
366
src/Adaptor2d/Adaptor2d_Curve2d.cxx
Executable file
@@ -0,0 +1,366 @@
|
||||
// File: Adaptor2d_Curve2d.cxx
|
||||
// Created: Thu Jul 1 16:09:05 1993
|
||||
// Author: Bruno DUMORTIER
|
||||
// <dub@sdsun1>
|
||||
|
||||
#include <Adaptor2d_Curve2d.ixx>
|
||||
#include <Standard_NotImplemented.hxx>
|
||||
|
||||
void Adaptor2d_Curve2d::Delete()
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Curve2d::FirstParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::FirstParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Curve2d::LastParameter() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::LastParameter");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor2d_Curve2d::Continuity() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Continuity");
|
||||
return GeomAbs_C0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Integer Adaptor2d_Curve2d::NbIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Integer Adaptor2d_Curve2d::NbIntervals(const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbIntervals");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor2d_Curve2d::Intervals(TColStd_Array1OfReal& T,
|
||||
// const GeomAbs_Shape S) const
|
||||
void Adaptor2d_Curve2d::Intervals(TColStd_Array1OfReal& ,
|
||||
const GeomAbs_Shape ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Intervals");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Handle(Adaptor2d_HCurve2d) Adaptor2d_Curve2d::Trim(const Standard_Real First,
|
||||
// const Standard_Real Last ,
|
||||
// const Standard_Real Tol) const
|
||||
Handle(Adaptor2d_HCurve2d) Adaptor2d_Curve2d::Trim(const Standard_Real ,
|
||||
const Standard_Real ,
|
||||
const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Trim");
|
||||
return Handle(Adaptor2d_HCurve2d)();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Curve2d::IsClosed() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsClosed");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Curve2d::IsPeriodic() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsPeriodic");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Curve2d::Period() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Period");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Pnt2d Adaptor2d_Curve2d::Value(const Standard_Real U) const
|
||||
gp_Pnt2d Adaptor2d_Curve2d::Value(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Value");
|
||||
return gp_Pnt2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor2d_Curve2d::D0(const Standard_Real U, gp_Pnt2d& P) const
|
||||
void Adaptor2d_Curve2d::D0(const Standard_Real , gp_Pnt2d& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D0");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor2d_Curve2d::D1(const Standard_Real U,
|
||||
// gp_Pnt2d& P, gp_Vec2d& V) const
|
||||
void Adaptor2d_Curve2d::D1(const Standard_Real ,
|
||||
gp_Pnt2d& , gp_Vec2d& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D1");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor2d_Curve2d::D2(const Standard_Real U,
|
||||
// gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
|
||||
void Adaptor2d_Curve2d::D2(const Standard_Real ,
|
||||
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D2");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//void Adaptor2d_Curve2d::D3(const Standard_Real U,
|
||||
// gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3)
|
||||
void Adaptor2d_Curve2d::D3(const Standard_Real ,
|
||||
gp_Pnt2d& , gp_Vec2d& , gp_Vec2d& , gp_Vec2d& ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::D3");
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Vec2d Adaptor2d_Curve2d::DN(const Standard_Real U,
|
||||
// const Standard_Integer N) const
|
||||
gp_Vec2d Adaptor2d_Curve2d::DN(const Standard_Real ,
|
||||
const Standard_Integer ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::DN");
|
||||
return gp_Vec2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Real Adaptor2d_Curve2d::Resolution(const Standard_Real R3d) const
|
||||
Standard_Real Adaptor2d_Curve2d::Resolution(const Standard_Real ) const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Resolution");
|
||||
return 0.;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType Adaptor2d_Curve2d::GetType() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::GetType");
|
||||
return GeomAbs_OtherCurve;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin2d Adaptor2d_Curve2d::Line() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Line");
|
||||
return gp_Lin2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ2d Adaptor2d_Curve2d::Circle() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Circle");
|
||||
return gp_Circ2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Elips2d Adaptor2d_Curve2d::Ellipse() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Ellipse");
|
||||
return gp_Elips2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Hypr2d Adaptor2d_Curve2d::Hyperbola() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Hyperbola");
|
||||
return gp_Hypr2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Parab2d Adaptor2d_Curve2d::Parabola() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Parabola");
|
||||
return gp_Parab2d();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Curve2d::Degree() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Degree");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Curve2d::IsRational() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::IsRational");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Curve2d::NbPoles() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbPole");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Curve2d::NbKnots() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::NbKnots");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BezierCurve) Adaptor2d_Curve2d::Bezier() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::Bezier");
|
||||
return Handle(Geom2d_BezierCurve)();
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BSplineCurve) Adaptor2d_Curve2d::BSpline() const
|
||||
{
|
||||
Standard_NotImplemented::Raise("Adaptor2d_Curve2d::BSpline");
|
||||
return Handle(Geom2d_BSplineCurve)();
|
||||
}
|
||||
|
||||
|
||||
|
70
src/Adaptor2d/Adaptor2d_GenHCurve2d.cdl
Executable file
70
src/Adaptor2d/Adaptor2d_GenHCurve2d.cdl
Executable file
@@ -0,0 +1,70 @@
|
||||
-- File: Adaptor2d_GenHCurve2d.cdl
|
||||
-- Created: Wed Feb 23 11:38:12 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
|
||||
generic class GenHCurve2d from Adaptor2d
|
||||
(TheCurve as Curve2d from Adaptor2d)
|
||||
|
||||
inherits HCurve2d from Adaptor2d
|
||||
|
||||
---Purpose: Generic class used to create a curve2d manipulated
|
||||
-- with Handle from a curve2d described by the class Curve2d.
|
||||
|
||||
uses
|
||||
|
||||
Curve2d from Adaptor2d
|
||||
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create
|
||||
---Purpose: Creates an empty GenHCurve2d.
|
||||
returns mutable GenHCurve2d from Adaptor2d;
|
||||
|
||||
|
||||
Create(C: TheCurve)
|
||||
|
||||
---Purpose: Creates a GenHCurve2d from a Curve
|
||||
returns mutable GenHCurve2d from Adaptor2d;
|
||||
|
||||
|
||||
Set(me: mutable; C: TheCurve)
|
||||
|
||||
---Purpose: Sets the field of the GenHCurve2d.
|
||||
is static;
|
||||
|
||||
Curve2d(me)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve2d.
|
||||
-- This is redefined from HCurve2d, cannot be inline.
|
||||
--
|
||||
---C++: return const &
|
||||
|
||||
returns Curve2d from Adaptor2d
|
||||
is static;
|
||||
|
||||
ChangeCurve2d(me : mutable)
|
||||
|
||||
---Purpose: Returns the curve used to create the GenHCurve.
|
||||
--
|
||||
---C++: return &
|
||||
---C++: inline
|
||||
|
||||
returns TheCurve;
|
||||
|
||||
|
||||
fields
|
||||
|
||||
myCurve : TheCurve is protected;
|
||||
|
||||
end GenHCurve2d;
|
35
src/Adaptor2d/Adaptor2d_GenHCurve2d.gxx
Executable file
35
src/Adaptor2d/Adaptor2d_GenHCurve2d.gxx
Executable file
@@ -0,0 +1,35 @@
|
||||
//=======================================================================
|
||||
//function : Adaptor2d_GenHCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_GenHCurve2d::Adaptor2d_GenHCurve2d () {}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor2d_GenHCurve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_GenHCurve2d::Adaptor2d_GenHCurve2d (const TheCurve& C):
|
||||
myCurve(C)
|
||||
{}
|
||||
|
||||
//=======================================================================
|
||||
//function : Set
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_GenHCurve2d::Set(const TheCurve& C)
|
||||
{
|
||||
myCurve = C;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Curve2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Adaptor2d_Curve2d& Adaptor2d_GenHCurve2d::Curve2d () const
|
||||
{
|
||||
return myCurve;
|
||||
}
|
9
src/Adaptor2d/Adaptor2d_GenHCurve2d.lxx
Executable file
9
src/Adaptor2d/Adaptor2d_GenHCurve2d.lxx
Executable file
@@ -0,0 +1,9 @@
|
||||
// File: Adaptor2d_GenHCurve2d.lxx
|
||||
// Created: Tue May 9 16:08:08 1995
|
||||
// Author: Xavier BENVENISTE
|
||||
// <xab@nonox>
|
||||
|
||||
inline TheCurve& Adaptor2d_GenHCurve2d::ChangeCurve2d()
|
||||
{
|
||||
return myCurve;
|
||||
}
|
206
src/Adaptor2d/Adaptor2d_HCurve2d.cdl
Executable file
206
src/Adaptor2d/Adaptor2d_HCurve2d.cdl
Executable file
@@ -0,0 +1,206 @@
|
||||
-- File: Adaptor2d_HCurve2d.cdl
|
||||
-- Created: Wed Feb 23 11:21:19 1994
|
||||
-- Author: model
|
||||
-- <model@topsn2>
|
||||
---Copyright: Matra Datavision 1994
|
||||
|
||||
|
||||
deferred class HCurve2d from Adaptor2d inherits TShared from MMgt
|
||||
|
||||
---Purpose: Root class for 2D curves manipulated by handles, on
|
||||
-- which geometric algorithms work.
|
||||
-- An adapted curve is an interface between the
|
||||
-- services provided by a curve, and those required of
|
||||
-- the curve by algorithms, which use it.
|
||||
-- A derived specific class is provided:
|
||||
-- Geom2dAdaptor_HCurve for a curve from the Geom2d package.
|
||||
|
||||
|
||||
|
||||
uses
|
||||
|
||||
Array1OfReal from TColStd,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
Vec2d from gp,
|
||||
Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Lin2d from gp,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
Curve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard,
|
||||
NotImplemented from Standard
|
||||
|
||||
is
|
||||
|
||||
--
|
||||
-- Access to the curve
|
||||
--
|
||||
|
||||
Curve2d(me) returns Curve2d from Adaptor2d
|
||||
---Purpose: Returns a reference to the Curve2d inside the HCurve2d.
|
||||
--
|
||||
---C++: return const &
|
||||
is deferred;
|
||||
|
||||
|
||||
-- Curve methods, they are provided for convenience. Each
|
||||
-- method M() is defined inline as :
|
||||
--
|
||||
-- Adaptor_HCurve::M() { Curve().M(); }
|
||||
--
|
||||
-- See the class Curve for comments on the methods.
|
||||
--
|
||||
--
|
||||
-- Global methods - Apply to the whole curve.
|
||||
--
|
||||
|
||||
FirstParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
LastParameter(me) returns Real ;
|
||||
---C++: inline
|
||||
|
||||
Continuity(me) returns Shape from GeomAbs ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
NbIntervals(me ; S : Shape from GeomAbs) returns Integer ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
|
||||
---C++: inline
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is static;
|
||||
|
||||
--
|
||||
-- Local methods - Apply to the current interval.
|
||||
-- By default the current interval is the first.
|
||||
--
|
||||
|
||||
IsClosed(me) returns Boolean ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
IsPeriodic(me) returns Boolean ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Period(me) returns Real ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Value(me; U : Real) returns Pnt2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D0 (me; U : Real; P : out Pnt2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D1 (me; U : Real; P : out Pnt2d from gp ; V : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D2 (me; U : Real; P : out Pnt2d from gp;
|
||||
V1, V2 : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
D3 (me; U : Real; P : out Pnt2d from gp;
|
||||
V1, V2, V3 : out Vec2d from gp) ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
DN (me; U : Real; N : Integer) returns Vec2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Resolution(me; R3d : Real) returns Real ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
GetType(me) returns CurveType from GeomAbs ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
--
|
||||
-- The following methods must be called when GetType returned
|
||||
-- the corresponding type.
|
||||
--
|
||||
|
||||
Line(me) returns Lin2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Circle(me) returns Circ2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Ellipse(me) returns Elips2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Parabola(me) returns Parab2d from gp ;
|
||||
---C++: inline
|
||||
--
|
||||
|
||||
Degree(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard ;
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
---C++: inline
|
||||
raises
|
||||
NoSuchObject from Standard,
|
||||
OutOfRange from Standard -- if TK has not length NbKnots
|
||||
is virtual;
|
||||
|
||||
|
||||
end HCurve2d;
|
2
src/Adaptor2d/Adaptor2d_HCurve2d.cxx
Executable file
2
src/Adaptor2d/Adaptor2d_HCurve2d.cxx
Executable file
@@ -0,0 +1,2 @@
|
||||
#include <Adaptor2d_HCurve2d.ixx>
|
||||
|
284
src/Adaptor2d/Adaptor2d_HCurve2d.lxx
Executable file
284
src/Adaptor2d/Adaptor2d_HCurve2d.lxx
Executable file
@@ -0,0 +1,284 @@
|
||||
|
||||
#include <Adaptor2d_Curve2d.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor2d_HCurve2d::FirstParameter() const
|
||||
{
|
||||
return Curve2d().FirstParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor2d_HCurve2d::LastParameter() const
|
||||
{
|
||||
return Curve2d().LastParameter();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_Shape Adaptor2d_HCurve2d::Continuity() const
|
||||
{
|
||||
return Curve2d().Continuity();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor2d_HCurve2d::NbIntervals(const GeomAbs_Shape S) const
|
||||
{
|
||||
return Curve2d().NbIntervals(S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Intervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor2d_HCurve2d::Intervals(TColStd_Array1OfReal& T,
|
||||
const GeomAbs_Shape S) const
|
||||
{
|
||||
Curve2d().Intervals(T,S);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Adaptor2d_HCurve2d) Adaptor2d_HCurve2d::Trim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real Tol) const
|
||||
{
|
||||
return Curve2d().Trim(First,Last,Tol);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor2d_HCurve2d::IsClosed() const
|
||||
{
|
||||
return Curve2d().IsClosed();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor2d_HCurve2d::IsPeriodic() const
|
||||
{
|
||||
return Curve2d().IsPeriodic();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor2d_HCurve2d::Period() const
|
||||
{
|
||||
return Curve2d().Period();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Pnt2d Adaptor2d_HCurve2d::Value(const Standard_Real U) const
|
||||
{
|
||||
return Curve2d().Value(U);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor2d_HCurve2d::D0(const Standard_Real U, gp_Pnt2d& P) const
|
||||
{
|
||||
Curve2d().D0(U,P);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor2d_HCurve2d::D1(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V) const
|
||||
{
|
||||
Curve2d().D1(U,P,V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor2d_HCurve2d::D2(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
|
||||
{
|
||||
Curve2d().D2(U,P,V1,V2);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline void Adaptor2d_HCurve2d::D3(const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const
|
||||
{
|
||||
Curve2d().D3(U,P,V1,V2,V3);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Vec2d Adaptor2d_HCurve2d::DN(const Standard_Real U, const Standard_Integer N) const
|
||||
{
|
||||
return Curve2d().DN(U,N);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Real Adaptor2d_HCurve2d::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return Curve2d().Resolution(R3d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline GeomAbs_CurveType Adaptor2d_HCurve2d::GetType() const
|
||||
{
|
||||
return Curve2d().GetType();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Lin2d Adaptor2d_HCurve2d::Line() const
|
||||
{
|
||||
return Curve2d().Line();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Circ2d Adaptor2d_HCurve2d::Circle() const
|
||||
{
|
||||
return Curve2d().Circle();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Elips2d Adaptor2d_HCurve2d::Ellipse() const
|
||||
{
|
||||
return Curve2d().Ellipse();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Hypr2d Adaptor2d_HCurve2d::Hyperbola() const
|
||||
{
|
||||
return Curve2d().Hyperbola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline gp_Parab2d Adaptor2d_HCurve2d::Parabola() const
|
||||
{
|
||||
return Curve2d().Parabola();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor2d_HCurve2d::Degree() const
|
||||
{
|
||||
return Curve2d().Degree() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Boolean Adaptor2d_HCurve2d::IsRational() const
|
||||
{
|
||||
return Curve2d().IsRational() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
inline Standard_Integer Adaptor2d_HCurve2d::NbPoles() const
|
||||
{
|
||||
return Curve2d().NbPoles() ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Standard_Integer Adaptor2d_HCurve2d::NbKnots() const
|
||||
{
|
||||
return Curve2d().NbKnots() ;
|
||||
}
|
||||
|
||||
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_BezierCurve) Adaptor2d_HCurve2d::Bezier() const
|
||||
{
|
||||
return Curve2d().Bezier();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
inline Handle(Geom2d_BSplineCurve) Adaptor2d_HCurve2d::BSpline() const
|
||||
{
|
||||
return Curve2d().BSpline();
|
||||
}
|
||||
|
199
src/Adaptor2d/Adaptor2d_Line2d.cdl
Executable file
199
src/Adaptor2d/Adaptor2d_Line2d.cdl
Executable file
@@ -0,0 +1,199 @@
|
||||
-- File: Adaptor2d_Line2d.cdl
|
||||
-- Created: Tue May 2 10:15:46 1995
|
||||
-- Author: Modelistation
|
||||
-- <model@fuegox>
|
||||
---Copyright: Matra Datavision 1995
|
||||
|
||||
|
||||
|
||||
class Line2d from Adaptor2d inherits Curve2d from Adaptor2d
|
||||
|
||||
uses
|
||||
Array1OfReal from TColStd,
|
||||
Pnt2d from gp,
|
||||
Dir2d from gp,
|
||||
Vec2d from gp,
|
||||
Lin2d from gp,
|
||||
Ax2d from gp,
|
||||
Circ2d from gp,
|
||||
Elips2d from gp,
|
||||
Hypr2d from gp,
|
||||
Parab2d from gp,
|
||||
Shape from GeomAbs,
|
||||
CurveType from GeomAbs,
|
||||
BezierCurve from Geom2d,
|
||||
BSplineCurve from Geom2d,
|
||||
HCurve2d from Adaptor2d
|
||||
|
||||
raises
|
||||
|
||||
OutOfRange from Standard,
|
||||
NoSuchObject from Standard,
|
||||
DomainError from Standard
|
||||
|
||||
is
|
||||
|
||||
Create returns Line2d from Adaptor2d;
|
||||
|
||||
Create(P: Pnt2d from gp;
|
||||
D: Dir2d from gp;
|
||||
UFirst,ULast: Real from Standard)
|
||||
returns Line2d from Adaptor2d;
|
||||
|
||||
Load(me : in out; L : Lin2d from gp)
|
||||
is static;
|
||||
|
||||
Load(me : in out; L : Lin2d from gp;
|
||||
UFirst,ULast: Real from Standard)
|
||||
is static;
|
||||
|
||||
FirstParameter(me)
|
||||
returns Real from Standard
|
||||
is redefined static;
|
||||
|
||||
LastParameter(me)
|
||||
returns Real from Standard
|
||||
is redefined static;
|
||||
|
||||
Continuity(me)
|
||||
returns Shape from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
NbIntervals(me; S : Shape from GeomAbs) returns Integer
|
||||
---Purpose: If necessary, breaks the curve in intervals of
|
||||
-- continuity <S>. And returns the number of
|
||||
-- intervals.
|
||||
is redefined static;
|
||||
|
||||
Intervals(me; T : in out Array1OfReal from TColStd;
|
||||
S : Shape from GeomAbs)
|
||||
---Purpose: Stores in <T> the parameters bounding the intervals
|
||||
-- of continuity <S>.
|
||||
--
|
||||
-- The array must provide enough room to accomodate
|
||||
-- for the parameters. i.e. T.Length() > NbIntervals()
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
is redefined static;
|
||||
|
||||
Trim(me; First, Last, Tol : Real) returns HCurve2d from Adaptor2d
|
||||
---Purpose: Returns a curve equivalent of <me> between
|
||||
-- parameters <First> and <Last>. <Tol> is used to
|
||||
-- test for 3d points confusion.
|
||||
raises
|
||||
OutOfRange from Standard
|
||||
---Purpose: If <First> >= <Last>
|
||||
is redefined static;
|
||||
|
||||
IsClosed(me)
|
||||
returns Boolean from Standard
|
||||
is redefined static;
|
||||
|
||||
IsPeriodic(me)
|
||||
returns Boolean from Standard
|
||||
is redefined static;
|
||||
|
||||
Period(me) returns Real
|
||||
raises
|
||||
DomainError from Standard -- if the curve is not periodic
|
||||
is redefined static;
|
||||
|
||||
Value(me; X: Real from Standard)
|
||||
returns Pnt2d from gp
|
||||
is redefined static;
|
||||
|
||||
D0(me; X: Real from Standard; P: out Pnt2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D1(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D2(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V1,V2: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
D3(me; X: Real from Standard;
|
||||
P: out Pnt2d from gp; V1,V2,V3: out Vec2d from gp)
|
||||
is redefined static;
|
||||
|
||||
DN (me; U : Real; N : Integer)
|
||||
returns Vec2d from gp
|
||||
is redefined static;
|
||||
|
||||
|
||||
Resolution(me; R3d : Real)
|
||||
returns Real from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
GetType(me)
|
||||
returns CurveType from GeomAbs
|
||||
is redefined static;
|
||||
|
||||
|
||||
Line(me)
|
||||
returns Lin2d from gp
|
||||
is redefined static;
|
||||
|
||||
Circle(me) returns Circ2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Ellipse(me) returns Elips2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Hyperbola(me) returns Hypr2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
Parabola(me) returns Parab2d from gp
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
Degree(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
IsRational(me) returns Boolean
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
NbPoles(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
NbKnots(me) returns Integer
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
|
||||
|
||||
Bezier(me) returns BezierCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
BSpline(me) returns BSplineCurve from Geom2d
|
||||
raises
|
||||
NoSuchObject from Standard
|
||||
is redefined static;
|
||||
|
||||
fields
|
||||
|
||||
myUfirst : Real from Standard;
|
||||
myUlast : Real from Standard;
|
||||
myAx2d : Ax2d from gp;
|
||||
|
||||
end Line2d;
|
359
src/Adaptor2d/Adaptor2d_Line2d.cxx
Executable file
359
src/Adaptor2d/Adaptor2d_Line2d.cxx
Executable file
@@ -0,0 +1,359 @@
|
||||
#include <Adaptor2d_Line2d.ixx>
|
||||
|
||||
#include <Precision.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <Standard_OutOfRange.hxx>
|
||||
#include <Standard_NoSuchObject.hxx>
|
||||
#include <Adaptor2d_HLine2d.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor2d_Line2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_Line2d::Adaptor2d_Line2d()
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Adaptor_Line2d
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Adaptor2d_Line2d::Adaptor2d_Line2d(const gp_Pnt2d& P, const gp_Dir2d& D,
|
||||
const Standard_Real UFirst,
|
||||
const Standard_Real ULast):
|
||||
myUfirst(UFirst),myUlast(ULast),myAx2d(P,D)
|
||||
{
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::Load(const gp_Lin2d& L)
|
||||
{
|
||||
myAx2d = L.Position();
|
||||
myUfirst = -Precision::Infinite();
|
||||
myUlast = Precision::Infinite();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Load
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::Load(const gp_Lin2d& L, const Standard_Real Fi, const Standard_Real La)
|
||||
{
|
||||
myAx2d = L.Position();
|
||||
myUfirst = Fi;
|
||||
myUlast = La;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : FirstParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Line2d::FirstParameter() const
|
||||
{
|
||||
return myUfirst;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : LastParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Line2d::LastParameter() const
|
||||
{
|
||||
return myUlast;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Continuity
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_Shape Adaptor2d_Line2d::Continuity() const
|
||||
{
|
||||
return GeomAbs_CN;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : NbIntervals
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//Standard_Integer Adaptor2d_Line2d::NbIntervals(const GeomAbs_Shape S) const
|
||||
Standard_Integer Adaptor2d_Line2d::NbIntervals(const GeomAbs_Shape ) const
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Interval
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::Intervals(TColStd_Array1OfReal& T,
|
||||
// const GeomAbs_Shape S) const
|
||||
const GeomAbs_Shape ) const
|
||||
{
|
||||
T(T.Lower()) = myUfirst;
|
||||
T(T.Lower()+1) = myUlast;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Trim
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Adaptor2d_HCurve2d) Adaptor2d_Line2d::Trim
|
||||
(const Standard_Real First,
|
||||
const Standard_Real Last,
|
||||
const Standard_Real) const
|
||||
{
|
||||
Handle(Adaptor2d_HLine2d) HL = new Adaptor2d_HLine2d();
|
||||
HL->ChangeCurve2d().Load(gp_Lin2d(myAx2d),First,Last);
|
||||
return HL;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsClosed
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Line2d::IsClosed() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : IsPeriodic
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Line2d::IsPeriodic() const
|
||||
{
|
||||
return Standard_False;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Period
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Line2d::Period() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Value
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Pnt2d Adaptor2d_Line2d::Value(const Standard_Real X) const
|
||||
{
|
||||
return ElCLib::LineValue(X,myAx2d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D0
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::D0(const Standard_Real X, gp_Pnt2d& P) const
|
||||
{
|
||||
P = ElCLib::LineValue(X,myAx2d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D1
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::D1(const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V) const
|
||||
{
|
||||
ElCLib::LineD1(X,myAx2d,P,V);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D2
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::D2(const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2) const
|
||||
{
|
||||
ElCLib::LineD1(X,myAx2d,P,V1);
|
||||
V2.SetCoord(0.,0.);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : D3
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
void Adaptor2d_Line2d::D3(const Standard_Real X, gp_Pnt2d& P, gp_Vec2d& V1, gp_Vec2d& V2, gp_Vec2d& V3) const
|
||||
{
|
||||
ElCLib::LineD1(X,myAx2d,P,V1);
|
||||
V2.SetCoord(0.,0.);
|
||||
V3.SetCoord(0.,0.);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : DN
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
//gp_Vec2d Adaptor2d_Line2d::DN(const Standard_Real U, const Standard_Integer N) const
|
||||
gp_Vec2d Adaptor2d_Line2d::DN(const Standard_Real , const Standard_Integer N) const
|
||||
{
|
||||
if (N<=0) {Standard_OutOfRange::Raise();}
|
||||
if (N==1) {
|
||||
return myAx2d.Direction();
|
||||
}
|
||||
return gp_Vec2d(0.,0.);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Resolution
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real Adaptor2d_Line2d::Resolution(const Standard_Real R3d) const
|
||||
{
|
||||
return R3d; // nul !!!!
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : GetType
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
GeomAbs_CurveType Adaptor2d_Line2d::GetType() const
|
||||
{
|
||||
return GeomAbs_Line;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Line
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Lin2d Adaptor2d_Line2d::Line() const
|
||||
{
|
||||
return gp_Lin2d(myAx2d);
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Circle
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Circ2d Adaptor2d_Line2d::Circle() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return gp_Circ2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Ellipse
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Elips2d Adaptor2d_Line2d::Ellipse() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return gp_Elips2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Hyperbola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Hypr2d Adaptor2d_Line2d::Hyperbola() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return gp_Hypr2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Parabola
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
gp_Parab2d Adaptor2d_Line2d::Parabola() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return gp_Parab2d();
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : Degree
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Line2d::Degree() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return 0 ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : IsRational
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Boolean Adaptor2d_Line2d::IsRational() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return 0 ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbPoles
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Line2d::NbPoles() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return 0 ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : NbKnots
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Integer Adaptor2d_Line2d::NbKnots() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
return 0 ;
|
||||
}
|
||||
//=======================================================================
|
||||
//function : Bezier
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BezierCurve) Adaptor2d_Line2d::Bezier() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
Handle(Geom2d_BezierCurve) nul;
|
||||
return nul;
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
//function : BSpline
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Handle(Geom2d_BSplineCurve) Adaptor2d_Line2d::BSpline() const
|
||||
{
|
||||
Standard_NoSuchObject::Raise();
|
||||
Handle(Geom2d_BSplineCurve) nul;
|
||||
return nul;
|
||||
}
|
||||
|
Reference in New Issue
Block a user