mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-04 13:13:25 +03:00
Integration of OCCT 6.5.0 from SVN
This commit is contained in:
78
src/GCE2d/GCE2d.cdl
Executable file
78
src/GCE2d/GCE2d.cdl
Executable file
@@ -0,0 +1,78 @@
|
||||
-- File: GCE2d.cdl
|
||||
-- Created: Tue May 5 09:01:53 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@topsn3>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
package GCE2d
|
||||
|
||||
uses gp,
|
||||
Geom2d,
|
||||
gce,
|
||||
StdFail
|
||||
|
||||
|
||||
---Level : Public.
|
||||
-- All methods of all classes will be public.
|
||||
|
||||
|
||||
|
||||
is
|
||||
|
||||
private deferred class Root;
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
-- Constructions of 2d geometrical elements from Geom2d.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
class MakeLine;
|
||||
---Purpose: Makes a Line from Geom2d.
|
||||
|
||||
class MakeCircle;
|
||||
---Purpose: Makes a Circle from Geom2d.
|
||||
|
||||
class MakeHyperbola;
|
||||
---Purpose: Makes an hyperbola from Geom2d.
|
||||
|
||||
class MakeEllipse;
|
||||
---Purpose: Makes an Ellipse from Geom2d.
|
||||
|
||||
class MakeParabola;
|
||||
---Purpose: Makes a parabola from Geom2d.
|
||||
|
||||
class MakeSegment;
|
||||
---Purpose: Makes a segment of Line (TrimmedCurve from Geom2d).
|
||||
|
||||
class MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d).
|
||||
|
||||
class MakeArcOfEllipse;
|
||||
---Purpose: Makes an arc of ellipse (TrimmedCurve from Geom2d).
|
||||
|
||||
class MakeArcOfParabola;
|
||||
---Purpose: Makes an arc of parabola (TrimmedCurve from Geom2d).
|
||||
|
||||
class MakeArcOfHyperbola;
|
||||
---Purpose: Makes an arc of hyperbola (TrimmedCurve from Geom2d).
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
-- Constructions of Transformation from Geom2d.
|
||||
---------------------------------------------------------------------------
|
||||
|
||||
class MakeTranslation;
|
||||
---Purpose: Returns a translation transformation.
|
||||
|
||||
class MakeMirror;
|
||||
---Purpose: Returns a symmetry transformation.
|
||||
|
||||
class MakeRotation;
|
||||
---Purpose: Returns a rotation transformation.
|
||||
|
||||
class MakeScale;
|
||||
---Purpose: Returns a scaling transformation.
|
||||
|
||||
|
||||
end GCE2d;
|
||||
|
||||
|
||||
|
86
src/GCE2d/GCE2d_MakeArcOfCircle.cdl
Executable file
86
src/GCE2d/GCE2d_MakeArcOfCircle.cdl
Executable file
@@ -0,0 +1,86 @@
|
||||
-- File: MakeArcOfCircle.cdl
|
||||
-- Created: Mon Sep 28 11:50:14 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeArcOfCircle from GCE2d inherits Root from GCE2d
|
||||
---Purpose: Implements construction algorithms for an arc of
|
||||
-- circle in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
-- A MakeArcOfCircle object provides a framework for:
|
||||
-- - defining the construction of the arc of circle,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results. In particular, the Value
|
||||
-- function returns the constructed arc of circle.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Vec2d from gp,
|
||||
Real from Standard,
|
||||
Boolean from Standard,
|
||||
TrimmedCurve from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create(Circ : Circ2d from gp ;
|
||||
Alpha1, Alpha2 : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
-- a circle between two parameters Alpha1 and Alpha2.
|
||||
-- The two parameters are angles. The parameters are
|
||||
-- in radians.
|
||||
|
||||
Create(Circ : Circ2d from gp ;
|
||||
P : Pnt2d from gp ;
|
||||
Alpha : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
-- a circle between point <P> and the parameter
|
||||
-- Alpha. Alpha is given in radians.
|
||||
|
||||
Create(Circ : Circ2d from gp ;
|
||||
P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
-- a circle between two points P1 and P2.
|
||||
|
||||
Create(P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ;
|
||||
P3 : Pnt2d from gp )
|
||||
returns MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
-- three points P1,P2,P3 between two points P1 and P3,
|
||||
-- and passing through the point P2.
|
||||
|
||||
Create(P1 : Pnt2d from gp ;
|
||||
V : Vec2d from gp ;
|
||||
P2 : Pnt2d from gp )
|
||||
returns MakeArcOfCircle;
|
||||
---Purpose: Makes an arc of circle (TrimmedCurve from Geom2d) from
|
||||
-- two points P1,P2 and the tangente to the solution at
|
||||
-- the point P1.
|
||||
|
||||
Value(me) returns TrimmedCurve from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed arc of circle.
|
||||
-- Exceptions StdFail_NotDone if no arc of circle is constructed.
|
||||
|
||||
Operator(me) returns TrimmedCurve from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_TrimmedCurve() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheArc : TrimmedCurve from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeArcOfCircle;
|
116
src/GCE2d/GCE2d_MakeArcOfCircle.cxx
Executable file
116
src/GCE2d/GCE2d_MakeArcOfCircle.cxx
Executable file
@@ -0,0 +1,116 @@
|
||||
// File: GCE2d_MakeArcOfCircle.cxx
|
||||
// Created: Fri Oct 2 16:30:57 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeArcOfCircle.ixx>
|
||||
#include <gp_Vec2d.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <gce_MakeCirc2d.hxx>
|
||||
#include <gce_MakeLin2d.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <IntAna2d_AnaIntersection.hxx>
|
||||
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const gp_Pnt2d& P3 )
|
||||
{
|
||||
gce_MakeCirc2d Cir = gce_MakeCirc2d(P1,P2,P3);
|
||||
TheError = Cir.Status();
|
||||
if (TheError == gce_Done) {
|
||||
gp_Circ2d C(Cir.Value());
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(C,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(C,P3);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(C);
|
||||
TheArc= new Geom2d_TrimmedCurve(Circ,Alpha1,Alpha2,Standard_True);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Vec2d& V ,
|
||||
const gp_Pnt2d& P2 )
|
||||
{
|
||||
Standard_Boolean Sense;
|
||||
gp_Circ2d cir;
|
||||
gp_Lin2d corde = gce_MakeLin2d(P1,P2);
|
||||
gp_Dir2d dir(corde.Direction());
|
||||
gp_Lin2d bis(gp_Pnt2d((P1.X()+P2.X())/2.,(P1.Y()+P2.Y())/2.),
|
||||
gp_Dir2d(-dir.Y(),dir.X()));
|
||||
gp_Lin2d norm(P1,gp_Dir2d(-V.Y(),V.X()));
|
||||
TheError = gce_ConfusedPoints;
|
||||
|
||||
IntAna2d_AnaIntersection Intp(bis,norm);
|
||||
|
||||
if (Intp.IsDone())
|
||||
{
|
||||
if (!Intp.IsEmpty())
|
||||
{
|
||||
gp_Pnt2d center(Intp.Point(1).Value());
|
||||
Standard_Real rad = (center.Distance(P1)+center.Distance(P2))/2.;
|
||||
cir = gce_MakeCirc2d(center,rad);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
}
|
||||
|
||||
if (TheError == gce_Done) {
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(cir,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(cir,P2);
|
||||
Handle(Geom2d_Circle) Circ = new Geom2d_Circle(cir);
|
||||
gp_Vec2d vv(dir);
|
||||
Standard_Real cross = V^vv;
|
||||
Sense = cross > 0.;
|
||||
TheArc= new Geom2d_TrimmedCurve(Circ,Alpha1,Alpha2,Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Circ,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Circ,P2);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Circ,P);
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::GCE2d_MakeArcOfCircle(const gp_Circ2d& Circ ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Handle(Geom2d_Circle) C = new Geom2d_Circle(Circ);
|
||||
TheArc= new Geom2d_TrimmedCurve(C,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfCircle::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheArc;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfCircle::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfCircle::operator Handle(Geom2d_TrimmedCurve) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
72
src/GCE2d/GCE2d_MakeArcOfEllipse.cdl
Executable file
72
src/GCE2d/GCE2d_MakeArcOfEllipse.cdl
Executable file
@@ -0,0 +1,72 @@
|
||||
-- File: MakeArcOfEllipse.cdl
|
||||
-- Created: Mon Sep 28 11:50:29 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeArcOfEllipse from GCE2d inherits Root from GCE2d
|
||||
---Purpose: Implements construction algorithms for an arc of
|
||||
-- ellipse in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
-- A MakeArcOfEllipse object provides a framework for:
|
||||
-- - defining the construction of the arc of ellipse,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results. In particular, the Value
|
||||
-- function returns the constructed arc of ellipse.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Elips2d from gp,
|
||||
Real from Standard,
|
||||
Boolean from Standard,
|
||||
TrimmedCurve from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create(Elips : Elips2d from gp ;
|
||||
Alpha1, Alpha2 : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfEllipse;
|
||||
---Purpose: Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
-- a Ellipse between two parameters Alpha1 and Alpha2.
|
||||
|
||||
Create(Elips : Elips2d from gp ;
|
||||
P : Pnt2d from gp ;
|
||||
Alpha : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfEllipse;
|
||||
---Purpose: Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
-- a Ellipse between point <P> and the parameter
|
||||
-- Alpha.
|
||||
|
||||
Create(Elips : Elips2d from gp ;
|
||||
P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfEllipse;
|
||||
---Purpose: Make an arc of Ellipse (TrimmedCurve from Geom2d) from
|
||||
-- a Ellipse between two points P1 and P2.
|
||||
-- Please, note: The orientation of the arc is:
|
||||
-- - the trigonometric sense if Sense is not defined or
|
||||
-- is true (default value), or
|
||||
-- - the opposite sense if Sense is false.
|
||||
-- - Alpha1, Alpha2 and Alpha are angle values, given in radians.
|
||||
-- - IsDone always returns true.
|
||||
|
||||
Value(me) returns TrimmedCurve from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed arc of ellipse.
|
||||
|
||||
Operator(me) returns TrimmedCurve from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_TrimmedCurve() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheArc : TrimmedCurve from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeArcOfEllipse;
|
62
src/GCE2d/GCE2d_MakeArcOfEllipse.cxx
Executable file
62
src/GCE2d/GCE2d_MakeArcOfEllipse.cxx
Executable file
@@ -0,0 +1,62 @@
|
||||
// File: GCE2d_MakeArcOfEllipse.cxx
|
||||
// Created: Fri Oct 2 16:31:13 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeArcOfEllipse.ixx>
|
||||
#include <Geom2d_Ellipse.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Elips,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Elips,P2);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Elips,P);
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfEllipse::GCE2d_MakeArcOfEllipse(const gp_Elips2d& Elips ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Handle(Geom2d_Ellipse) E = new Geom2d_Ellipse(Elips);
|
||||
TheArc = new Geom2d_TrimmedCurve(E,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfEllipse::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheArc;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfEllipse::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfEllipse::operator Handle(Geom2d_TrimmedCurve) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
71
src/GCE2d/GCE2d_MakeArcOfHyperbola.cdl
Executable file
71
src/GCE2d/GCE2d_MakeArcOfHyperbola.cdl
Executable file
@@ -0,0 +1,71 @@
|
||||
-- File: MakeArcOfHyperbola.cdl
|
||||
-- Created: Mon Sep 28 11:50:50 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeArcOfHyperbola from GCE2d inherits Root from GCE2d
|
||||
---Purpose: Implements construction algorithms for an arc of
|
||||
-- hyperbola in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
-- A MakeArcOfHyperbola object provides a framework for:
|
||||
-- - defining the construction of the arc of hyperbola,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results. In particular, the Value
|
||||
-- function returns the constructed arc of hyperbola.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Hypr2d from gp,
|
||||
Real from Standard,
|
||||
Boolean from Standard,
|
||||
TrimmedCurve from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create(Hypr : Hypr2d from gp ;
|
||||
Alpha1, Alpha2 : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfHyperbola;
|
||||
---Purpose: Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
-- a Hyperbola between two parameters Alpha1 and Alpha2.
|
||||
|
||||
Create(Hypr : Hypr2d from gp ;
|
||||
P : Pnt2d from gp ;
|
||||
Alpha : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfHyperbola;
|
||||
---Purpose: Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
-- a Hyperbola between point <P> and the parameter
|
||||
-- Alpha.
|
||||
|
||||
Create(Hypr : Hypr2d from gp ;
|
||||
P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfHyperbola;
|
||||
---Purpose: Makes an arc of Hyperbola (TrimmedCurve from Geom2d) from
|
||||
-- a Hyperbola between two points P1 and P2.
|
||||
-- Note: the orientation of the arc of hyperbola is:
|
||||
-- - the trigonometric sense if Sense is not defined or
|
||||
-- is true (default value), or
|
||||
-- - the opposite sense if Sense is false.
|
||||
-- - IsDone always returns true.
|
||||
|
||||
Value(me) returns TrimmedCurve from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed arc of hyperbola.
|
||||
|
||||
Operator(me) returns TrimmedCurve from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_TrimmedCurve() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheArc : TrimmedCurve from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeArcOfHyperbola;
|
61
src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx
Executable file
61
src/GCE2d/GCE2d_MakeArcOfHyperbola.cxx
Executable file
@@ -0,0 +1,61 @@
|
||||
// File: GCE2d_MakeArcOfHyperbola.cxx
|
||||
// Created: Fri Oct 2 16:31:29 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeArcOfHyperbola.ixx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom2d_Hyperbola.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense)
|
||||
{
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::
|
||||
GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P);
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::
|
||||
GCE2d_MakeArcOfHyperbola(const gp_Hypr2d& Hypr ,
|
||||
const Standard_Real Alpha1,
|
||||
const Standard_Real Alpha2,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Handle(Geom2d_Hyperbola) H = new Geom2d_Hyperbola(Hypr);
|
||||
TheArc = new Geom2d_TrimmedCurve(H,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfHyperbola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheArc;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfHyperbola::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfHyperbola::operator Handle(Geom2d_TrimmedCurve) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
71
src/GCE2d/GCE2d_MakeArcOfParabola.cdl
Executable file
71
src/GCE2d/GCE2d_MakeArcOfParabola.cdl
Executable file
@@ -0,0 +1,71 @@
|
||||
-- File: MakeArcOfParabola.cdl
|
||||
-- Created: Mon Sep 28 11:51:03 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeArcOfParabola from GCE2d inherits Root from GCE2d
|
||||
---Purpose: Implements construction algorithms for an arc of
|
||||
-- parabola in the plane. The result is a Geom2d_TrimmedCurve curve.
|
||||
-- A MakeArcOfParabola object provides a framework for:
|
||||
-- - defining the construction of the arc of parabola,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results. In particular, the Value
|
||||
-- function returns the constructed arc of parabola.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Parab2d from gp,
|
||||
Real from Standard,
|
||||
Boolean from Standard,
|
||||
TrimmedCurve from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create(Parab : Parab2d from gp ;
|
||||
Alpha1, Alpha2 : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfParabola;
|
||||
---Purpose: Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
-- a Parabola between two parameters Alpha1 and Alpha2.
|
||||
|
||||
Create(Parab : Parab2d from gp ;
|
||||
P : Pnt2d from gp ;
|
||||
Alpha : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfParabola;
|
||||
---Purpose: Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
-- a Parabola between point <P> and the parameter
|
||||
-- Alpha.
|
||||
|
||||
Create(Parab : Parab2d from gp ;
|
||||
P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeArcOfParabola;
|
||||
---Purpose: Make an arc of Parabola (TrimmedCurve from Geom2d) from
|
||||
-- a Parabola between two points P1 and P2.
|
||||
-- Please, note: the orientation of the arc of parabola is:
|
||||
-- - the trigonometric sense if Sense is not defined
|
||||
-- or is true (default value), or
|
||||
-- - the opposite sense if Sense is false.
|
||||
-- - IsDone always returns true.
|
||||
|
||||
Value(me) returns TrimmedCurve from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed arc of parabola.
|
||||
|
||||
Operator(me) returns TrimmedCurve from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_TrimmedCurve() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheArc : TrimmedCurve from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeArcOfParabola;
|
60
src/GCE2d/GCE2d_MakeArcOfParabola.cxx
Executable file
60
src/GCE2d/GCE2d_MakeArcOfParabola.cxx
Executable file
@@ -0,0 +1,60 @@
|
||||
// File: GCE2d_MakeArcOfParabola.cxx
|
||||
// Created: Fri Oct 2 16:31:46 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeArcOfParabola.ixx>
|
||||
#include <Geom2d_Parabola.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const Standard_Boolean Sense ) {
|
||||
Standard_Real Alpha1 = ElCLib::Parameter(Parab,P1);
|
||||
Standard_Real Alpha2 = ElCLib::Parameter(Parab,P2);
|
||||
Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(P,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const gp_Pnt2d& P ,
|
||||
const Standard_Real Alpha ,
|
||||
const Standard_Boolean Sense ) {
|
||||
Standard_Real Alphafirst = ElCLib::Parameter(Parab,P);
|
||||
Handle(Geom2d_Parabola) Parabola = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(Parabola,Alphafirst,Alpha,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfParabola::
|
||||
GCE2d_MakeArcOfParabola(const gp_Parab2d& Parab ,
|
||||
const Standard_Real Alpha1 ,
|
||||
const Standard_Real Alpha2 ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
Handle(Geom2d_Parabola) P = new Geom2d_Parabola(Parab);
|
||||
TheArc = new Geom2d_TrimmedCurve(P,Alpha1,Alpha2,Sense);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfParabola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheArc;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeArcOfParabola::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeArcOfParabola::operator Handle(Geom2d_TrimmedCurve) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
109
src/GCE2d/GCE2d_MakeCircle.cdl
Executable file
109
src/GCE2d/GCE2d_MakeCircle.cdl
Executable file
@@ -0,0 +1,109 @@
|
||||
-- File: MakeCircle.cdl
|
||||
-- Created: Mon Sep 28 11:49:17 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeCircle from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose : This class implements the following algorithms used
|
||||
-- to create Cirlec from Geom2d.
|
||||
--
|
||||
-- * Create a Circle parallel to another and passing
|
||||
-- though a point.
|
||||
-- * Create a Circle parallel to another at the distance
|
||||
-- Dist.
|
||||
-- * Create a Circle passing through 3 points.
|
||||
-- * Create a Circle with its center and the normal of its
|
||||
-- plane and its radius.
|
||||
-- * Create a Circle with its axis and radius.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Circ2d from gp,
|
||||
Ax2d from gp,
|
||||
Ax22d from gp,
|
||||
Circle from Geom2d,
|
||||
Real from Standard
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create (C : Circ2d from gp) returns MakeCircle;
|
||||
--- Purpose : creates a circle from a non persistent one.
|
||||
|
||||
Create (A : Ax2d from gp ;
|
||||
Radius : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True) returns MakeCircle;
|
||||
--- Purpose :
|
||||
-- A is the "XAxis" of the circle which defines the origin
|
||||
-- of parametrization.
|
||||
-- It is not forbidden to create a circle with Radius = 0.0
|
||||
-- The status is "NegativeRadius" if Radius < 0.
|
||||
|
||||
Create (A : Ax22d from gp ;
|
||||
Radius : Real from Standard ) returns MakeCircle;
|
||||
--- Purpose :
|
||||
-- A is the local coordinate system of the circle which defines
|
||||
-- the origin of parametrization.
|
||||
-- It is not forbidden to create a circle with Radius = 0.0
|
||||
-- The status is "NegativeRadius" if Radius < 0.
|
||||
|
||||
Create(Circ : Circ2d from gp ;
|
||||
Dist : Real from Standard) returns MakeCircle;
|
||||
---Purpose : Make a Circle from Geom2d <TheCirc> parallel to another
|
||||
-- Circ <Circ> with a distance <Dist>.
|
||||
-- If Dist is greater than zero the result is enclosing
|
||||
-- the circle <Circ>, else the result is enclosed by the
|
||||
-- circle <Circ>.
|
||||
|
||||
Create(Circ : Circ2d from gp;
|
||||
Point : Pnt2d from gp) returns MakeCircle;
|
||||
---Purpose : Make a Circle from Geom2d <TheCirc> parallel to another
|
||||
-- Circ <Circ> and passing through a Pnt <Point>.
|
||||
|
||||
Create(P1,P2,P3 : Pnt2d from gp) returns MakeCircle;
|
||||
---Purpose : Make a Circ from gp <TheCirc> passing through 3
|
||||
-- Pnt2d <P1>,<P2>,<P3>.
|
||||
|
||||
Create(P : Pnt2d from gp ;
|
||||
Radius : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True) returns MakeCircle;
|
||||
---Purpose : Make a Circ from geom2d <TheCirc> by its center an radius.
|
||||
|
||||
Create(Center : Pnt2d from gp ;
|
||||
Point : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True)
|
||||
returns MakeCircle;
|
||||
---Purpose : Makes a Circle from geom2d <TheCirc> with its center
|
||||
-- <Center> and a point giving the radius.
|
||||
-- If Sense is true the local coordinate system of
|
||||
-- the solution is direct and non direct in the other case.
|
||||
-- Warning
|
||||
-- The MakeCircle class does not prevent the
|
||||
-- construction of a circle with a null radius.
|
||||
-- If an error occurs (that is, when IsDone returns
|
||||
-- false), the Status function returns:
|
||||
-- - gce_NegativeRadius if Radius is less than 0.0, or
|
||||
-- - gce_IntersectionError if points P1, P2 and P3
|
||||
-- are collinear and the three are not coincident.
|
||||
|
||||
Value(me) returns Circle from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed circle.
|
||||
-- Exceptions StdFail_NotDone if no circle is constructed.
|
||||
|
||||
Operator(me) returns Circle from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Circle() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheCircle : Circle from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeCircle;
|
||||
|
105
src/GCE2d/GCE2d_MakeCircle.cxx
Executable file
105
src/GCE2d/GCE2d_MakeCircle.cxx
Executable file
@@ -0,0 +1,105 @@
|
||||
// File: GCE2d_MakeCircle.cxx
|
||||
// Created: Fri Oct 2 16:32:04 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeCircle.ixx>
|
||||
#include <gce_MakeCirc2d.hxx>
|
||||
#include <Geom2d_Circle.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& C)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(C);
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax2d& A ,
|
||||
const Standard_Real Radius,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A,Radius,Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Ax22d& A ,
|
||||
const Standard_Real Radius)
|
||||
{
|
||||
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheCircle = new Geom2d_Circle(A,Radius);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
|
||||
const gp_Pnt2d& Point )
|
||||
{
|
||||
gp_Circ2d C = gce_MakeCirc2d(Circ,Point);
|
||||
TheCircle = new Geom2d_Circle(C);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Circ2d& Circ ,
|
||||
const Standard_Real Dist )
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Circ,Dist);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 ,
|
||||
const gp_Pnt2d& P3 )
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(P1,P2,P3);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Radius ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Point,Radius,Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::GCE2d_MakeCircle(const gp_Pnt2d& Center ,
|
||||
const gp_Pnt2d& Point ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
gce_MakeCirc2d C = gce_MakeCirc2d(Center,Point,Sense);
|
||||
TheError = C.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheCircle = new Geom2d_Circle(C.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheCircle;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Circle)& GCE2d_MakeCircle::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeCircle::operator Handle(Geom2d_Circle) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
90
src/GCE2d/GCE2d_MakeEllipse.cdl
Executable file
90
src/GCE2d/GCE2d_MakeEllipse.cdl
Executable file
@@ -0,0 +1,90 @@
|
||||
-- File: MakeEllipse.cdl
|
||||
-- Created: Mon Sep 28 11:49:44 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeEllipse from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose :This class implements the following algorithms used to
|
||||
-- create Ellipse from gp.
|
||||
-- * Create an Ellipse from two apex and the center.
|
||||
-- Defines an ellipse in 2D space.
|
||||
-- The parametrization range is [0,2*PI].
|
||||
-- The ellipse is a closed and periodic curve.
|
||||
-- The center of the ellipse is the "Location" point of its
|
||||
-- axis placement "XAxis".
|
||||
-- The "XAxis" of the ellipse defines the origin of the
|
||||
-- parametrization, it is the major axis of the ellipse.
|
||||
-- The YAxis is the minor axis of the ellipse.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Ellipse from Geom2d,
|
||||
Elips2d from gp,
|
||||
Ax22d from gp,
|
||||
Ax2d from gp
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create (E : Elips2d from gp) returns MakeEllipse;
|
||||
--- Purpose :
|
||||
-- Creates an ellipse from a non persistent one from package gp
|
||||
|
||||
Create (MajorAxis : Ax2d from gp ;
|
||||
MajorRadius : Real from Standard ;
|
||||
MinorRadius : Real from Standard ;
|
||||
Sense : Boolean from Standard = Standard_True )
|
||||
returns MakeEllipse;
|
||||
--- Purpose :
|
||||
-- MajorAxis is the local coordinate system of the ellipse.
|
||||
-- It is the "XAxis". The minor axis is the YAxis of the
|
||||
-- ellipse.
|
||||
-- Sense give the sense of parametrization of the Ellipse.
|
||||
-- It is not forbidden to create an ellipse with MajorRadius =
|
||||
-- MinorRadius.
|
||||
-- The status is "InvertRadius" if MajorRadius < MinorRadius or
|
||||
-- "NegativeRadius" if MinorRadius < 0.
|
||||
|
||||
Create (Axis : Ax22d from gp ;
|
||||
MajorRadius, MinorRadius : Real from Standard)
|
||||
returns MakeEllipse;
|
||||
--- Purpose :
|
||||
-- Axis is the local coordinate system of the ellipse.
|
||||
-- It is not forbidden to create an ellipse with MajorRadius =
|
||||
-- MinorRadius.
|
||||
-- The status is "InvertRadius" if MajorRadius < MinorRadius or
|
||||
-- "NegativeRadius" if MinorRadius < 0.
|
||||
|
||||
|
||||
Create(S1,S2 : Pnt2d from gp;
|
||||
Center : Pnt2d from gp) returns MakeEllipse;
|
||||
---Purpose: Make an Ellipse centered on the point Center, where
|
||||
-- - the major axis of the ellipse is defined by Center and S1,
|
||||
-- - its major radius is the distance between Center and S1, and
|
||||
-- - its minor radius is the distance between S2 and the major axis.
|
||||
-- The implicit orientation of the ellipse is:
|
||||
-- - the sense defined by Axis or E,
|
||||
-- - the sense defined by points Center, S1 and S2,
|
||||
-- - the trigonometric sense if Sense is not given or is true, or
|
||||
-- - the opposite sense if Sense is false.
|
||||
|
||||
Value(me) returns Ellipse from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed ellipse.
|
||||
-- Exceptions StdFail_NotDone if no ellipse is constructed.
|
||||
|
||||
Operator(me) returns Ellipse from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Ellipse() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheEllipse : Ellipse from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeEllipse;
|
64
src/GCE2d/GCE2d_MakeEllipse.cxx
Executable file
64
src/GCE2d/GCE2d_MakeEllipse.cxx
Executable file
@@ -0,0 +1,64 @@
|
||||
// File: GCE2d_MakeEllipse.cxx
|
||||
// Created: Fri Oct 2 16:36:08 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeEllipse.ixx>
|
||||
#include <gce_MakeElips2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Elips2d& E)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheEllipse = new Geom2d_Ellipse(E);
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax22d& Axis ,
|
||||
const Standard_Real MajorRadius ,
|
||||
const Standard_Real MinorRadius )
|
||||
{
|
||||
gce_MakeElips2d E = gce_MakeElips2d(Axis,MajorRadius,MinorRadius);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Ax2d& MajorAxis ,
|
||||
const Standard_Real MajorRadius ,
|
||||
const Standard_Real MinorRadius ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
gce_MakeElips2d E = gce_MakeElips2d(MajorAxis,MajorRadius,MinorRadius,Sense);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::GCE2d_MakeEllipse(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& S2 ,
|
||||
const gp_Pnt2d& Center ) {
|
||||
gce_MakeElips2d E = gce_MakeElips2d(S1,S2,Center);
|
||||
TheError = E.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheEllipse = new Geom2d_Ellipse(E.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheEllipse;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Ellipse)& GCE2d_MakeEllipse::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeEllipse::operator Handle(Geom2d_Ellipse) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
110
src/GCE2d/GCE2d_MakeHyperbola.cdl
Executable file
110
src/GCE2d/GCE2d_MakeHyperbola.cdl
Executable file
@@ -0,0 +1,110 @@
|
||||
-- File: MakeHyperbola.cdl
|
||||
-- Created: Mon Sep 28 11:49:29 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeHyperbola from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose :This class implements the following algorithms used to
|
||||
-- create Hyperbola from Geom2d.
|
||||
-- * Create an Hyperbola from two apex and the center.
|
||||
-- Defines the main branch of an hyperbola.
|
||||
-- The parameterization range is ]-infinite,+infinite[
|
||||
-- It is possible to get the other branch and the two conjugate
|
||||
-- branches of the main branch.
|
||||
--
|
||||
-- ^YAxis
|
||||
-- |
|
||||
-- FirstConjugateBranch
|
||||
-- |
|
||||
-- Other | Main
|
||||
-- --------------------- C ------------------------------>XAxis
|
||||
-- Branch | Branch
|
||||
-- |
|
||||
-- SecondConjugateBranch
|
||||
-- |
|
||||
--
|
||||
-- The major radius is the distance between the Location point
|
||||
-- of the hyperbola C and the apex of the main Branch (or the
|
||||
-- Other branch). The major axis is the "XAxis".
|
||||
-- The minor radius is the distance between the Location point
|
||||
-- of the hyperbola C and the apex of the First (or Second)
|
||||
-- Conjugate branch. The minor axis is the "YAxis".
|
||||
-- The major radius can be lower than the minor radius.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Hypr from gp,
|
||||
Hypr2d from gp,
|
||||
Ax2d from gp,
|
||||
Ax22d from gp,
|
||||
Hyperbola from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create (H : Hypr2d from gp) returns MakeHyperbola;
|
||||
--- Purpose :
|
||||
-- Creates an Hyperbola from a non persistent one from package gp
|
||||
|
||||
Create (MajorAxis : Ax2d from gp ;
|
||||
MajorRadius : Real from Standard;
|
||||
MinorRadius : Real from Standard;
|
||||
Sense : Boolean from Standard) returns MakeHyperbola;
|
||||
--- Purpose :
|
||||
-- MajorAxis is the "XAxis" of the hyperbola.
|
||||
-- The major radius of the hyperbola is on this "XAxis" and
|
||||
-- the minor radius is on the "YAxis" of the hyperbola.
|
||||
-- The status is "NegativeRadius" if MajorRadius < 0.0 or if
|
||||
-- MinorRadius < 0.0
|
||||
|
||||
Create (Axis : Ax22d from gp ;
|
||||
MajorRadius : Real from Standard;
|
||||
MinorRadius : Real from Standard) returns MakeHyperbola;
|
||||
--- Purpose :
|
||||
-- Axis is the local coordinate system of the hyperbola.
|
||||
-- The major radius of the hyperbola is on this "XAxis" and
|
||||
-- the minor radius is on the "YAxis" of the hyperbola.
|
||||
-- The status is "NegativeRadius" if MajorRadius < 0.0 or if
|
||||
-- MinorRadius < 0.0
|
||||
|
||||
Create(S1,S2 : Pnt2d from gp;
|
||||
Center : Pnt2d from gp) returns MakeHyperbola;
|
||||
---Purpose: Creates a hyperbol centered on the origin of the coordinate system
|
||||
-- Axis, with major and minor radii MajorRadius and
|
||||
-- MinorRadius, where the major axis is the "X Axis"
|
||||
-- of Axis (Axis is the local coordinate system of the hyperbola).
|
||||
-- The implicit orientation of the ellipse is:
|
||||
-- - the sense defined by Axis or H,
|
||||
-- - the sense defined by points Center, S1 and S2,
|
||||
-- - the trigonometric sense if Sense is not given or is true, or
|
||||
-- - the opposite sense if Sense is false.
|
||||
-- Warning
|
||||
-- If an error occurs (that is, when IsDone returns
|
||||
-- false), the Status function returns:
|
||||
-- - gce_NegativeRadius if MajorRadius or
|
||||
-- MinorRadius is less than 0.0, or
|
||||
-- - gce_InvertAxis if the major radius defined by
|
||||
-- Center and S1 is less than the minor radius
|
||||
-- defined by Center, S1 and S2.Make an Hyperbola with its center and two apexes.
|
||||
|
||||
|
||||
Value(me) returns Hyperbola from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed hyperbola.
|
||||
-- Exceptions: StdFail_NotDone if no hyperbola is constructed.
|
||||
|
||||
Operator(me) returns Hyperbola from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Hyperbola() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheHyperbola : Hyperbola from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeHyperbola;
|
64
src/GCE2d/GCE2d_MakeHyperbola.cxx
Executable file
64
src/GCE2d/GCE2d_MakeHyperbola.cxx
Executable file
@@ -0,0 +1,64 @@
|
||||
// File: GCE2d_MakeHyperbola.cxx
|
||||
// Created: Fri Oct 2 16:36:22 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeHyperbola.ixx>
|
||||
#include <gce_MakeHypr2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Hypr2d& H)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheHyperbola = new Geom2d_Hyperbola(H);
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax2d& MajorAxis ,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(MajorAxis,MajorRadius,MinorRadius,Sense);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Ax22d& Axis ,
|
||||
const Standard_Real MajorRadius,
|
||||
const Standard_Real MinorRadius)
|
||||
{
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(Axis,MajorRadius,MinorRadius);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::GCE2d_MakeHyperbola(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& S2 ,
|
||||
const gp_Pnt2d& Center ) {
|
||||
gce_MakeHypr2d H = gce_MakeHypr2d(S1,S2,Center);
|
||||
TheError = H.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheHyperbola = new Geom2d_Hyperbola(H.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Hyperbola)& GCE2d_MakeHyperbola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheHyperbola;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Hyperbola)& GCE2d_MakeHyperbola::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeHyperbola::operator Handle(Geom2d_Hyperbola) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
78
src/GCE2d/GCE2d_MakeLine.cdl
Executable file
78
src/GCE2d/GCE2d_MakeLine.cdl
Executable file
@@ -0,0 +1,78 @@
|
||||
-- File: MakeLine.cdl
|
||||
-- Created: Mon Sep 28 11:48:51 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeLine from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose : This class implements the following algorithms used
|
||||
-- to create a Line from Geom2d.
|
||||
-- * Create a Line parallel to another and passing
|
||||
-- through a point.
|
||||
-- * Create a Line passing through 2 points.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Lin2d from gp,
|
||||
Ax2d from gp,
|
||||
Dir2d from gp,
|
||||
Line from Geom2d,
|
||||
Real from Standard
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create (A : Ax2d from gp) returns MakeLine;
|
||||
--- Purpose :
|
||||
-- Creates a line located in 2D space with the axis placement A.
|
||||
-- The Location of A is the origin of the line.
|
||||
|
||||
Create (L : Lin2d from gp) returns MakeLine;
|
||||
--- Purpose :
|
||||
-- Creates a line from a non persistent line from package gp.
|
||||
|
||||
Create (P : Pnt2d from gp;
|
||||
V : Dir2d from gp) returns MakeLine;
|
||||
--- Purpose :
|
||||
-- P is the origin and V is the direction of the line.
|
||||
|
||||
Create(Lin : Lin2d from gp;
|
||||
Point : Pnt2d from gp) returns MakeLine;
|
||||
---Purpose : Make a Line from Geom2d <TheLin> parallel to another
|
||||
-- Lin <Lin> and passing through a Pnt <Point>.
|
||||
|
||||
Create(Lin : Lin2d from gp ;
|
||||
Dist : Real from Standard) returns MakeLine;
|
||||
---Purpose : Make a Line from Geom2d <TheLin> parallel to another
|
||||
-- Lin <Lin> at a distance <Dist>.
|
||||
|
||||
Create(P1 : Pnt2d from gp;
|
||||
P2 : Pnt2d from gp) returns MakeLine;
|
||||
---Purpose : Make a Line from Geom2d <TheLin> passing through 2
|
||||
-- Pnt <P1>,<P2>.
|
||||
-- It returns false if <p1> and <P2> are confused.
|
||||
-- Warning
|
||||
-- If points P1 and P2 coincident (that is, when IsDone
|
||||
-- returns false), the Status function returns gce_ConfusedPoints.
|
||||
|
||||
Value(me) returns Line from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed line.
|
||||
-- Exceptions StdFail_NotDone if no line is constructed.
|
||||
|
||||
Operator(me) returns Line from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Line() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheLine : Line from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeLine;
|
||||
|
||||
|
78
src/GCE2d/GCE2d_MakeLine.cxx
Executable file
78
src/GCE2d/GCE2d_MakeLine.cxx
Executable file
@@ -0,0 +1,78 @@
|
||||
// File: GCE2d_MakeLine.cxx
|
||||
// Created: Fri Oct 2 16:36:34 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeLine.ixx>
|
||||
#include <gce_MakeLin2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
//=========================================================================
|
||||
// Constructions of 2d geometrical elements from Geom2d.
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Ax2d& A)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(A);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& L)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(L);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P,
|
||||
const gp_Dir2d& V)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheLine = new Geom2d_Line(P,V);
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
{
|
||||
gce_MakeLin2d L(P1,P2);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin ,
|
||||
const gp_Pnt2d& Point )
|
||||
{
|
||||
gce_MakeLin2d L(Lin,Point);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::GCE2d_MakeLine(const gp_Lin2d& Lin ,
|
||||
const Standard_Real Dist )
|
||||
{
|
||||
gce_MakeLin2d L(Lin,Dist);
|
||||
TheError = L.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheLine = new Geom2d_Line(L.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Line)& GCE2d_MakeLine::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheLine;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Line) & GCE2d_MakeLine::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeLine::operator Handle(Geom2d_Line) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
57
src/GCE2d/GCE2d_MakeMirror.cdl
Executable file
57
src/GCE2d/GCE2d_MakeMirror.cdl
Executable file
@@ -0,0 +1,57 @@
|
||||
-- File: MakeMirror.cdl
|
||||
-- Created: Mon Sep 28 11:52:47 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeMirror
|
||||
|
||||
from GCE2d
|
||||
|
||||
---Purpose: This class implements elementary construction algorithms for a
|
||||
-- symmetrical transformation in 2D space about a point
|
||||
-- or axis. The result is a Geom2d_Transformation transformation.
|
||||
-- A MakeMirror object provides a framework for:
|
||||
-- - defining the construction of the transformation,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the result.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Ax2d from gp,
|
||||
Dir2d from gp,
|
||||
Lin2d from gp,
|
||||
Transformation from Geom2d,
|
||||
Real from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Point : Pnt2d from gp) returns MakeMirror;
|
||||
---Puprose: Make a symetry transformation of center <Point>.
|
||||
|
||||
Create(Axis : Ax2d from gp) returns MakeMirror;
|
||||
---Puprose: Make a symetry transformation of axis <Axis>.
|
||||
|
||||
Create(Line : Lin2d from gp) returns MakeMirror;
|
||||
---Puprose: Make a symetry transformation of axis <Line>.
|
||||
|
||||
Create(Point : Pnt2d from gp;
|
||||
Direc : Dir2d from gp) returns MakeMirror;
|
||||
---Purpose: Make a symetry transformation af axis defined by
|
||||
-- <Point> and <Direc>.
|
||||
|
||||
Value(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed transformation.
|
||||
|
||||
Operator(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Transformation() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheMirror : Transformation from Geom2d;
|
||||
|
||||
end MakeMirror;
|
||||
|
60
src/GCE2d/GCE2d_MakeMirror.cxx
Executable file
60
src/GCE2d/GCE2d_MakeMirror.cxx
Executable file
@@ -0,0 +1,60 @@
|
||||
// File: GCE2d_MakeMirror.cxx
|
||||
// Created: Fri Oct 2 16:36:54 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeMirror.ixx>
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une symetrie de Geom2d par rapport a un point. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ) {
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(Point);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une symetrie de Geom2d par rapport a une droite. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Ax2d& Axis ) {
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(Axis);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une symetrie de Geom2d par rapport a une droite. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Lin2d& Line ) {
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(gp_Ax2d(Line.Location(),Line.Direction()));
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une symetrie 3d de Geom2d par rapport a une droite definie +
|
||||
// par un point et une direction. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeMirror::GCE2d_MakeMirror(const gp_Pnt2d& Point ,
|
||||
const gp_Dir2d& Direc ) {
|
||||
TheMirror = new Geom2d_Transformation();
|
||||
TheMirror->SetMirror(gp_Ax2d(Point,Direc));
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeMirror::Value() const
|
||||
{
|
||||
return TheMirror;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeMirror::Operator() const
|
||||
{
|
||||
return TheMirror;
|
||||
}
|
||||
|
||||
GCE2d_MakeMirror::operator Handle(Geom2d_Transformation) () const
|
||||
{
|
||||
return TheMirror;
|
||||
}
|
||||
|
106
src/GCE2d/GCE2d_MakeParabola.cdl
Executable file
106
src/GCE2d/GCE2d_MakeParabola.cdl
Executable file
@@ -0,0 +1,106 @@
|
||||
-- File: MakeParabola.cdl
|
||||
-- Created: Mon Sep 28 11:49:29 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeParabola from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose :This class implements the following algorithms used to
|
||||
-- create Parabola from Geom2d.
|
||||
-- * Create an Parabola from two apex and the center.
|
||||
-- Defines the parabola in the parameterization range :
|
||||
-- ]-infinite,+infinite[
|
||||
-- The vertex of the parabola is the "Location" point of the
|
||||
-- local coordinate system "XAxis" of the parabola.
|
||||
-- The "XAxis" of the parabola is its axis of symmetry.
|
||||
-- The "Xaxis" is oriented from the vertex of the parabola to the
|
||||
-- Focus of the parabola.
|
||||
-- The equation of the parabola in the local coordinate system is
|
||||
-- Y**2 = (2*P) * X
|
||||
-- P is the distance between the focus and the directrix of the
|
||||
-- parabola called Parameter).
|
||||
-- The focal length F = P/2 is the distance between the vertex
|
||||
-- and the focus of the parabola.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Parab2d from gp,
|
||||
Ax2d from gp,
|
||||
Ax22d from gp,
|
||||
Parabola from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create (Prb : Parab2d from gp) returns MakeParabola;
|
||||
--- Purpose : Creates a parabola from a non persistent one.
|
||||
|
||||
Create (Axis : Ax22d from gp ;
|
||||
Focal : Real from Standard ) returns MakeParabola;
|
||||
--- Purpose : Creates a parabola with its local coordinate system and it's focal
|
||||
-- length "Focal".
|
||||
-- The "Location" point of "Axis" is the vertex of the parabola
|
||||
--- Status is "NegativeFocusLength" if Focal < 0.0
|
||||
|
||||
Create (MirrorAxis : Ax2d from gp ;
|
||||
Focal : Real from Standard;
|
||||
Sense : Boolean from Standard) returns MakeParabola;
|
||||
--- Purpose : Creates a parabola with its "MirrorAxis" and it's focal length "Focal".
|
||||
-- MirrorAxis is the axis of symmetry of the curve, it is the
|
||||
-- "XAxis". The "YAxis" is parallel to the directrix of the
|
||||
-- parabola. The "Location" point of "MirrorAxis" is the vertex of the parabola
|
||||
--- Status is "NegativeFocusLength" if Focal < 0.0
|
||||
|
||||
Create (D : Ax22d from gp ;
|
||||
F : Pnt2d from gp ) returns MakeParabola;
|
||||
--- Purpose : Creates a parabola with the local coordinate system and the focus point.
|
||||
-- The sense of parametrization is given by Sense.
|
||||
|
||||
Create (D : Ax2d from gp ;
|
||||
F : Pnt2d from gp ;
|
||||
Sense : Boolean from Standard = Standard_True) returns MakeParabola;
|
||||
--- Purpose :
|
||||
-- D is the directrix of the parabola and F the focus point.
|
||||
-- The symmetry axis "XAxis" of the parabola is normal to the
|
||||
-- directrix and pass through the focus point F, but its
|
||||
-- "Location" point is the vertex of the parabola.
|
||||
-- The "YAxis" of the parabola is parallel to D and its "Location"
|
||||
-- point is the vertex of the parabola.
|
||||
|
||||
Create(S1,O : Pnt2d from gp) returns MakeParabola;
|
||||
---Purpose: Make a parabola with focal point S1 and
|
||||
-- center O
|
||||
-- The branch of the parabola returned will have <S1> as
|
||||
-- focal point
|
||||
-- The implicit orientation of the parabola is:
|
||||
-- - the same one as the parabola Prb,
|
||||
-- - the sense defined by the coordinate system Axis or the directrix D,
|
||||
-- - the trigonometric sense if Sense is not given or is true, or
|
||||
-- - the opposite sense if Sense is false.
|
||||
-- Warning
|
||||
-- The MakeParabola class does not prevent the
|
||||
-- construction of a parabola with a null focal distance.
|
||||
-- If an error occurs (that is, when IsDone returns
|
||||
-- false), the Status function returns:
|
||||
-- - gce_NullFocusLength if Focal is less than 0.0, or
|
||||
-- - gce_NullAxis if points S1 and O are coincident.
|
||||
|
||||
Value(me) returns Parabola from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed parabola.
|
||||
-- Exceptions StdFail_NotDone if no parabola is constructed.
|
||||
|
||||
Operator(me) returns Parabola from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Parabola() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheParabola : Parabola from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeParabola;
|
79
src/GCE2d/GCE2d_MakeParabola.cxx
Executable file
79
src/GCE2d/GCE2d_MakeParabola.cxx
Executable file
@@ -0,0 +1,79 @@
|
||||
// File: GCE2d_MakeParabola.cxx
|
||||
// Created: Fri Oct 2 16:36:22 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeParabola.ixx>
|
||||
#include <gce_MakeParab2d.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Parab2d& Prb)
|
||||
{
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(Prb);
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& MirrorAxis,
|
||||
const Standard_Real Focal ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
if (Focal <0.0) { TheError = gce_NullFocusLength; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(MirrorAxis,Focal,Sense);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis ,
|
||||
const Standard_Real Focal)
|
||||
{
|
||||
if (Focal <0.0) { TheError = gce_NullFocusLength; }
|
||||
else {
|
||||
TheError = gce_Done;
|
||||
TheParabola = new Geom2d_Parabola(Axis,Focal);
|
||||
}
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax22d& Axis ,
|
||||
const gp_Pnt2d& F )
|
||||
{
|
||||
TheError = gce_Done;
|
||||
gp_Parab2d para(Axis,F);
|
||||
TheParabola = new Geom2d_Parabola(para);
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Ax2d& D ,
|
||||
const gp_Pnt2d& F ,
|
||||
const Standard_Boolean Sense )
|
||||
{
|
||||
TheError = gce_Done;
|
||||
gp_Parab2d para(D,F,Sense);
|
||||
TheParabola = new Geom2d_Parabola(para);
|
||||
}
|
||||
|
||||
|
||||
GCE2d_MakeParabola::GCE2d_MakeParabola(const gp_Pnt2d& S1 ,
|
||||
const gp_Pnt2d& O ) {
|
||||
gce_MakeParab2d P = gce_MakeParab2d(S1,O);
|
||||
TheError = P.Status();
|
||||
if (TheError == gce_Done) {
|
||||
TheParabola = new Geom2d_Parabola(P.Value());
|
||||
}
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Parabola)& GCE2d_MakeParabola::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheParabola;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Parabola)& GCE2d_MakeParabola::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeParabola::operator Handle(Geom2d_Parabola) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
44
src/GCE2d/GCE2d_MakeRotation.cdl
Executable file
44
src/GCE2d/GCE2d_MakeRotation.cdl
Executable file
@@ -0,0 +1,44 @@
|
||||
-- File: MakeRotation.cdl
|
||||
-- Created: Mon Sep 28 11:52:57 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeRotation
|
||||
|
||||
from GCE2d
|
||||
|
||||
---Purpose: This class implements an elementary construction algorithm for
|
||||
-- a rotation in 2D space. The result is a Geom2d_Transformation transformation.
|
||||
-- A MakeRotation object provides a framework for:
|
||||
-- - defining the construction of the transformation,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the result.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Transformation from Geom2d,
|
||||
Real from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Point : Pnt2d from gp ;
|
||||
Angle : Real from Standard) returns MakeRotation;
|
||||
---Purpose: Constructs a rotation through angle Angle about the center Point.
|
||||
|
||||
Value(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed transformation.
|
||||
|
||||
Operator(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Transformation() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheRotation : Transformation from Geom2d;
|
||||
|
||||
end MakeRotation;
|
||||
|
||||
|
36
src/GCE2d/GCE2d_MakeRotation.cxx
Executable file
36
src/GCE2d/GCE2d_MakeRotation.cxx
Executable file
@@ -0,0 +1,36 @@
|
||||
// File: GCE2d_MakeRotation.cxx
|
||||
// Created: Fri Oct 2 16:37:27 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeRotation.ixx>
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une rotation 3d de gp d angle Angle par rapport a une +
|
||||
// droite Line. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeRotation::GCE2d_MakeRotation(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Angle ) {
|
||||
TheRotation = new Geom2d_Transformation();
|
||||
TheRotation->SetRotation(Point,Angle);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeRotation::Value() const
|
||||
{
|
||||
return TheRotation;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeRotation::Operator() const
|
||||
{
|
||||
return TheRotation;
|
||||
}
|
||||
|
||||
GCE2d_MakeRotation::operator Handle(Geom2d_Transformation) () const
|
||||
{
|
||||
return TheRotation;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
46
src/GCE2d/GCE2d_MakeScale.cdl
Executable file
46
src/GCE2d/GCE2d_MakeScale.cdl
Executable file
@@ -0,0 +1,46 @@
|
||||
-- File: MakeScale.cdl
|
||||
-- Created: Mon Sep 28 11:53:08 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeScale
|
||||
|
||||
from GCE2d
|
||||
|
||||
---Purpose: This class implements an elementary construction algorithm for
|
||||
-- a scaling transformation in 2D space. The result is a
|
||||
-- Geom2d_Transformation transformation.
|
||||
-- A MakeScale object provides a framework for:
|
||||
-- - defining the construction of the transformation,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the result.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Transformation from Geom2d,
|
||||
Real from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Point : Pnt2d from gp ;
|
||||
Scale : Real from Standard) returns MakeScale;
|
||||
---Purpose: Constructs a scaling transformation with
|
||||
-- - Point as the center of the transformation, and
|
||||
-- - Scale as the scale factor.
|
||||
|
||||
Value(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed transformation.
|
||||
|
||||
Operator(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Transformation() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheScale : Transformation from Geom2d;
|
||||
|
||||
end MakeScale;
|
||||
|
32
src/GCE2d/GCE2d_MakeScale.cxx
Executable file
32
src/GCE2d/GCE2d_MakeScale.cxx
Executable file
@@ -0,0 +1,32 @@
|
||||
// File: GCE2d_MakeScale.cxx
|
||||
// Created: Fri Oct 2 16:37:41 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeScale.ixx>
|
||||
|
||||
//=========================================================================
|
||||
// Creation d un homothetie de gp de centre Point et de rapport Scale. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeScale::GCE2d_MakeScale(const gp_Pnt2d& Point ,
|
||||
const Standard_Real Scale ) {
|
||||
TheScale = new Geom2d_Transformation();
|
||||
TheScale->SetScale(Point,Scale);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeScale::Value() const
|
||||
{
|
||||
return TheScale;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeScale::Operator() const
|
||||
{
|
||||
return TheScale;
|
||||
}
|
||||
|
||||
GCE2d_MakeScale::operator Handle(Geom2d_Transformation) () const
|
||||
{
|
||||
return TheScale;
|
||||
}
|
||||
|
84
src/GCE2d/GCE2d_MakeSegment.cdl
Executable file
84
src/GCE2d/GCE2d_MakeSegment.cdl
Executable file
@@ -0,0 +1,84 @@
|
||||
-- File: MakeSegment.cdl
|
||||
-- Created: Mon Sep 28 11:49:59 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeSegment from GCE2d inherits Root from GCE2d
|
||||
|
||||
---Purpose: Implements construction algorithms for a line
|
||||
-- segment in the plane. The result is a
|
||||
-- Geom2d_TrimmedCurve curve.
|
||||
-- A MakeSegment object provides a framework for:
|
||||
-- - defining the construction of the line segment,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the results. In particular, the Value
|
||||
-- function returns the constructed line segment.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Real from Standard,
|
||||
Lin2d from gp,
|
||||
Dir2d from gp,
|
||||
TrimmedCurve from Geom2d
|
||||
|
||||
raises NotDone from StdFail
|
||||
|
||||
is
|
||||
|
||||
Create(P1, P2 : Pnt2d from gp ) returns MakeSegment;
|
||||
---Purpose: Make a segment of Line from the 2 points <P1> and <P2>.
|
||||
-- Status is "ConfusedPoints" if <P1> and <P2> are confused.
|
||||
|
||||
Create(P1 : Pnt2d from gp ;
|
||||
V : Dir2d from gp ;
|
||||
P2 : Pnt2d from gp ) returns MakeSegment;
|
||||
---Purpose: Make a segment of Line from the point <P1> with
|
||||
-- the direction <P> and ended by the projection of
|
||||
-- <P2> on the line <P1,V>.
|
||||
-- Status is "ConfusedPoints" if <P1> and <P2> are confused.
|
||||
|
||||
Create(Line : Lin2d from gp ;
|
||||
U1, U2 : Real from Standard ) returns MakeSegment;
|
||||
---Purpose: Make a segment of Line from the line <Line>
|
||||
-- between the two parameters U1 and U2.
|
||||
-- Status is "SameParamters" if <U1> is equal <U2>.
|
||||
|
||||
Create(Line : Lin2d from gp ;
|
||||
Point : Pnt2d from gp ;
|
||||
Ulast : Real from Standard ) returns MakeSegment;
|
||||
---Purpose: Make a segment of Line from the line <Line>
|
||||
-- between the point <Point> and the parameter Ulast.
|
||||
-- It returns NullObject if <U1> is equal <U2>.
|
||||
|
||||
Create(Line : Lin2d from gp ;
|
||||
P1 : Pnt2d from gp ;
|
||||
P2 : Pnt2d from gp ) returns MakeSegment;
|
||||
---Purpose: Make a segment of Line from the line <Line>
|
||||
-- between the two points <P1> and <P2>.
|
||||
-- It returns NullObject if <P1> and <P2> are confused.
|
||||
-- Warning
|
||||
-- If the points which limit the segment are coincident
|
||||
-- for given points or for the projection of given points
|
||||
-- on the line which supports the line segment (that is,
|
||||
-- when IsDone returns false), the Status function
|
||||
-- returns gce_ConfusedPoints. This warning only
|
||||
-- concerns the first two constructors.
|
||||
|
||||
Value(me) returns TrimmedCurve from Geom2d
|
||||
raises NotDone
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed line segment.
|
||||
-- Exceptions StdFail_NotDone if no line segment is constructed.
|
||||
|
||||
Operator(me) returns TrimmedCurve from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_TrimmedCurve() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheSegment : TrimmedCurve from Geom2d;
|
||||
--The solution from Geom2d.
|
||||
|
||||
end MakeSegment;
|
82
src/GCE2d/GCE2d_MakeSegment.cxx
Executable file
82
src/GCE2d/GCE2d_MakeSegment.cxx
Executable file
@@ -0,0 +1,82 @@
|
||||
// File: GCE2d_MakeSegment.cxx
|
||||
// Created: Fri Oct 2 16:37:54 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeSegment.ixx>
|
||||
#include <GCE2d_MakeLine.hxx>
|
||||
#include <StdFail_NotDone.hxx>
|
||||
#include <Geom2d_Line.hxx>
|
||||
#include <ElCLib.hxx>
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 ,
|
||||
const gp_Dir2d& V ,
|
||||
const gp_Pnt2d& P2 )
|
||||
{
|
||||
gp_Lin2d Line(P1,V);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line,P2);
|
||||
if (Ulast != 0.0) {
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,0.0,Ulast,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
else { TheError = gce_ConfusedPoints; }
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
{
|
||||
Standard_Real dist = P1.Distance(P2);
|
||||
if (dist != 0.0) {
|
||||
Handle(Geom2d_Line) L = GCE2d_MakeLine(P1,P2);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,0.,dist,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
else { TheError = gce_ConfusedPoints; }
|
||||
}
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const gp_Pnt2d& Point ,
|
||||
const Standard_Real U )
|
||||
{
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line,Point);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment=new Geom2d_TrimmedCurve(L,Ufirst,U,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const gp_Pnt2d& P1 ,
|
||||
const gp_Pnt2d& P2 )
|
||||
{
|
||||
Standard_Real Ufirst = ElCLib::Parameter(Line,P1);
|
||||
Standard_Real Ulast = ElCLib::Parameter(Line,P2);
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,Ufirst,Ulast,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::GCE2d_MakeSegment(const gp_Lin2d& Line ,
|
||||
const Standard_Real U1 ,
|
||||
const Standard_Real U2 )
|
||||
{
|
||||
Handle(Geom2d_Line) L = new Geom2d_Line(Line);
|
||||
TheSegment = new Geom2d_TrimmedCurve(L,U1,U2,Standard_True);
|
||||
TheError = gce_Done;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeSegment::Value() const
|
||||
{
|
||||
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
|
||||
return TheSegment;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_TrimmedCurve)& GCE2d_MakeSegment::Operator() const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
||||
GCE2d_MakeSegment::operator Handle(Geom2d_TrimmedCurve) () const
|
||||
{
|
||||
return Value();
|
||||
}
|
||||
|
49
src/GCE2d/GCE2d_MakeTranslation.cdl
Executable file
49
src/GCE2d/GCE2d_MakeTranslation.cdl
Executable file
@@ -0,0 +1,49 @@
|
||||
-- File: MakeTranslation.cdl
|
||||
-- Created: Mon Sep 28 11:52:25 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
class MakeTranslation
|
||||
|
||||
from GCE2d
|
||||
|
||||
---Purpose: This class implements elementary construction algorithms for a
|
||||
-- translation in 2D space. The result is a
|
||||
-- Geom2d_Transformation transformation.
|
||||
-- A MakeTranslation object provides a framework for:
|
||||
-- - defining the construction of the transformation,
|
||||
-- - implementing the construction algorithm, and
|
||||
-- - consulting the result.
|
||||
|
||||
uses Pnt2d from gp,
|
||||
Transformation from Geom2d,
|
||||
Vec2d from gp,
|
||||
Real from Standard
|
||||
|
||||
is
|
||||
|
||||
Create(Vect : Vec2d from gp) returns MakeTranslation;
|
||||
---Purpose: Constructs a translation along the vector Vect.
|
||||
|
||||
Create(Point1 : Pnt2d from gp;
|
||||
Point2 : Pnt2d from gp) returns MakeTranslation;
|
||||
---Purpose: Constructs a translation along the vector
|
||||
-- (Point1,Point2) defined from the point Point1 to the point Point2.
|
||||
|
||||
Value(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---Purpose: Returns the constructed transformation.
|
||||
|
||||
Operator(me) returns Transformation from Geom2d
|
||||
is static;
|
||||
---C++: return const&
|
||||
---C++: alias "Standard_EXPORT operator Handle_Geom2d_Transformation() const;"
|
||||
|
||||
fields
|
||||
|
||||
TheTranslation : Transformation from Geom2d;
|
||||
|
||||
end MakeTranslation;
|
||||
|
42
src/GCE2d/GCE2d_MakeTranslation.cxx
Executable file
42
src/GCE2d/GCE2d_MakeTranslation.cxx
Executable file
@@ -0,0 +1,42 @@
|
||||
// File: GCE2d_MakeTranslation.cxx
|
||||
// Created: Fri Oct 2 16:38:15 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@topsn3>
|
||||
|
||||
#include <GCE2d_MakeTranslation.ixx>
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une translation 3d de Geom2d de vecteur de tanslation Vec. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Vec2d& Vec ) {
|
||||
TheTranslation = new Geom2d_Transformation();
|
||||
TheTranslation->SetTranslation(Vec);
|
||||
}
|
||||
|
||||
//=========================================================================
|
||||
// Creation d une translation 3d de Geom2d de vecteur de tanslation le +
|
||||
// vecteur reliant Point1 a Point2. +
|
||||
//=========================================================================
|
||||
|
||||
GCE2d_MakeTranslation::GCE2d_MakeTranslation(const gp_Pnt2d& Point1 ,
|
||||
const gp_Pnt2d& Point2 ) {
|
||||
TheTranslation = new Geom2d_Transformation();
|
||||
TheTranslation->SetTranslation(Point1,Point2);
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeTranslation::Value() const
|
||||
{
|
||||
return TheTranslation;
|
||||
}
|
||||
|
||||
const Handle(Geom2d_Transformation)& GCE2d_MakeTranslation::Operator() const
|
||||
{
|
||||
return TheTranslation;
|
||||
}
|
||||
|
||||
GCE2d_MakeTranslation::operator Handle(Geom2d_Transformation) () const
|
||||
{
|
||||
return TheTranslation;
|
||||
}
|
||||
|
37
src/GCE2d/GCE2d_Root.cdl
Executable file
37
src/GCE2d/GCE2d_Root.cdl
Executable file
@@ -0,0 +1,37 @@
|
||||
-- File: Root.cdl
|
||||
-- Created: Tue Sep 29 12:29:04 1992
|
||||
-- Author: Remi GILET
|
||||
-- <reg@sdsun2>
|
||||
---Copyright: Matra Datavision 1992
|
||||
|
||||
private deferred class Root from GCE2d
|
||||
|
||||
---Purpose : This class implements the common services for
|
||||
-- all classes of gce which report error.
|
||||
|
||||
uses
|
||||
|
||||
ErrorType from gce
|
||||
|
||||
is
|
||||
|
||||
IsDone(me) returns Boolean
|
||||
is static;
|
||||
---C++: inline
|
||||
---Purpose: Returns true if the construction is successful.
|
||||
|
||||
Status(me) returns ErrorType from gce
|
||||
is static;
|
||||
---C++: inline
|
||||
---Purpose: Returns the status of the construction
|
||||
-- - gce_Done, if the construction is successful, or
|
||||
-- - another value of the gce_ErrorType enumeration
|
||||
-- indicating why the construction failed.
|
||||
|
||||
fields
|
||||
|
||||
TheError : ErrorType from gce is protected;
|
||||
---Purpose: Enumeration to know why the algorithm didn t succeed.
|
||||
|
||||
end Root;
|
||||
|
1
src/GCE2d/GCE2d_Root.cxx
Executable file
1
src/GCE2d/GCE2d_Root.cxx
Executable file
@@ -0,0 +1 @@
|
||||
#include <GCE2d_Root.ixx>
|
27
src/GCE2d/GCE2d_Root.lxx
Executable file
27
src/GCE2d/GCE2d_Root.lxx
Executable file
@@ -0,0 +1,27 @@
|
||||
// File: GCE2d_Root.cxx
|
||||
// Created: Tue Sep 29 12:34:39 1992
|
||||
// Author: Remi GILET
|
||||
// <reg@sdsun2>
|
||||
|
||||
|
||||
inline Standard_Boolean GCE2d_Root::IsDone () const
|
||||
{
|
||||
return TheError == gce_Done;
|
||||
}
|
||||
|
||||
inline gce_ErrorType GCE2d_Root::Status() const
|
||||
{
|
||||
return TheError;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user