1
0
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:
bugmaster
2011-03-16 07:30:28 +00:00
committed by bugmaster
parent 4903637061
commit 7fd59977df
16375 changed files with 3882564 additions and 0 deletions

94
src/GC/GC.cdl Executable file
View File

@@ -0,0 +1,94 @@
-- File: GC.cdl
-- Created: Fri Mar 27 15:18:48 1992
-- Author: Remi GILET
-- <reg@phobox>
---Copyright: Matra Datavision 1992
package GC
uses gp,
gce,
Geom,
StdFail
---Level : Public.
-- All methods of all classes will be public.
is
private deferred class Root;
---------------------------------------------------------------------------
-- Constructions of 3d geometrical elements from Geom.
---------------------------------------------------------------------------
class MakeLine;
---Purpose: Makes a Line from Geom.
class MakeCircle;
---Purpose: Makes a Circle from Geom.
class MakeHyperbola;
---Purpose: Makes an hyperbola from Geom.
class MakeEllipse;
---Purpose: Makes an ellipse from Geom.
class MakeSegment;
---Purpose: Makes a segment of Line from the 2 points <P1> and <P2>.
class MakeArcOfCircle;
---Purpose: Makes an arc of circle (TrimmedCurve from Geom).
class MakeArcOfEllipse;
---Purpose: Makes an arc of Ellipse (TrimmedCurve from Geom).
class MakeArcOfHyperbola;
---Purpose: Makes an arc of hyperbola (TrimmedCurve from Geom).
class MakeArcOfParabola;
---Purpose: Makes an arc of parabola (TrimmedCurve from Geom).
---------------------------------------------------------------------------
-- Constructions of planes from Geom.
---------------------------------------------------------------------------
class MakePlane;
---------------------------------------------------------------------------
-- Construction of surfaces from Geom.
---------------------------------------------------------------------------
class MakeCylindricalSurface;
---Purpose: Makes a cylindricalSurface <Cyl> from Geom.
class MakeConicalSurface;
---Purpose: Makes a ConicalSurface <Cone> from Geom.
class MakeTrimmedCylinder;
---Purpose: Makes a cylindricalSurface <Cyl> from Geom
class MakeTrimmedCone;
---Purpose: Makes a ConicalSurface <Cyl> from Geom
---------------------------------------------------------------------------
-- Constructions of Transformation from Geom.
---------------------------------------------------------------------------
class MakeTranslation;
---Purpose: Returns a translation transformation of vector <V>.
class MakeMirror;
---Purpose: Returns a symmetry transformation of center <P>.
class MakeRotation;
---Purpose: Returns a rotation transformation around the axis <A>
-- and of angle <Angle>.
class MakeScale;
---Purpose: Returns a scaling transformation with the center point
-- <Point> and the scaling value <Scale>.
end GC;

99
src/GC/GC_MakeArcOfCircle.cdl Executable file
View File

@@ -0,0 +1,99 @@
-- File: MakeArcOfCircle.cdl
-- Created: Mon Sep 28 11:50:14 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeArcOfCircle from GC inherits Root from GC
---Purpose: Implements construction algorithms for an
-- arc of circle in 3D space. The result is a Geom_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 Pnt from gp,
Circ from gp,
Dir from gp,
Ax1 from gp,
Vec from gp,
Real from Standard,
TrimmedCurve from Geom
raises NotDone from StdFail
is
Create(Circ : Circ from gp ;
Alpha1, Alpha2 : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfCircle;
---Purpose: Make an arc of circle (TrimmedCurve from Geom) from
-- a circle between two angles Alpha1 and Alpha2
-- given in radiians.
Create(Circ : Circ from gp ;
P : Pnt from gp ;
Alpha : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfCircle;
---Purpose: Make an arc of circle (TrimmedCurve from Geom) from
-- a circle between point <P> and the angle Alpha
-- given in radians.
Create(Circ : Circ from gp ;
P1 : Pnt from gp ;
P2 : Pnt from gp ;
Sense : Boolean from Standard ) returns MakeArcOfCircle;
---Purpose: Make an arc of circle (TrimmedCurve from Geom) from
-- a circle between two points P1 and P2.
Create(P1 : Pnt from gp ;
P2 : Pnt from gp ;
P3 : Pnt from gp )
returns MakeArcOfCircle;
---Purpose: Make an arc of circle (TrimmedCurve from Geom) from
-- three points P1,P2,P3 between two points P1 and P2.
Create(P1 : Pnt from gp ;
V : Vec from gp ;
P2 : Pnt from gp )
returns MakeArcOfCircle;
---Purpose: Make an arc of circle (TrimmedCurve from Geom) from
-- two points P1,P2 and the tangente to the solution at
-- the point P1.
-- The orientation of the arc is:
-- - the sense determined by the order of the points P1, P3 and P2;
-- - the sense defined by the vector V; or
-- - for other syntaxes:
-- - the sense of Circ if Sense is true, or
-- - the opposite sense if Sense is false.
-- Note: Alpha1, Alpha2 and Alpha are angle values, given in radians.
-- Warning
-- If an error occurs (that is, when IsDone returns
-- false), the Status function returns:
-- - gce_ConfusedPoints if:
-- - any 2 of the 3 points P1, P2 and P3 are coincident, or
-- - P1 and P2 are coincident; or
-- - gce_IntersectionError if:
-- - P1, P2 and P3 are collinear and not coincident, or
-- - the vector defined by the points P1 and
-- P2 is collinear with the vector V.
Value(me) returns TrimmedCurve from Geom
raises NotDone
is static;
---Purpose: Returns the constructed arc of circle.
-- Exceptions StdFail_NotDone if no arc of circle is constructed.
---C++: return const&
Operator(me) returns TrimmedCurve from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;"
fields
TheArc : TrimmedCurve from Geom;
--The solution from Geom.
end MakeArcOfCircle;

169
src/GC/GC_MakeArcOfCircle.cxx Executable file
View File

@@ -0,0 +1,169 @@
// File: GC_MakeArcOfCircle.cxx
// Created: Fri Oct 2 16:30:57 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeArcOfCircle.ixx>
#include <gce_MakeCirc.hxx>
#include <gce_MakeLin.hxx>
#include <Geom_Circle.hxx>
#include <Extrema_ExtElC.hxx>
#include <Extrema_POnCurv.hxx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
//=======================================================================
//function : GC_MakeArcOfCircle
//purpose :
//=======================================================================
GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 )
{
Standard_Boolean sense;
//
gce_MakeCirc Cir(P1, P2, P3);
TheError = Cir.Status();
if (TheError == gce_Done) {
Standard_Real Alpha1, Alpha3;//,Alpha2
gp_Circ C(Cir.Value());
//modified by NIZNHY-PKV Thu Mar 3 10:53:02 2005f
//Alpha1 is always =0.
//Alpha1 = ElCLib::Parameter(C,P1);
//Alpha2 = ElCLib::Parameter(C,P2);
//Alpha3 = ElCLib::Parameter(C,P3);
//
//if (Alpha2 >= Alpha1 && Alpha2 <= Alpha3) sense = Standard_True;
//else if (Alpha1 <= Alpha3 && Alpha2 >= Alpha3 ) sense = Standard_True;
//else sense = Standard_False;
//
Alpha1=0.;
Alpha3 = ElCLib::Parameter(C, P3);
sense=Standard_True;
//modified by NIZNHY-PKV Thu Mar 3 10:53:04 2005t
Handle(Geom_Circle) Circ = new Geom_Circle(C);
TheArc= new Geom_TrimmedCurve(Circ, Alpha1, Alpha3, sense);
}
}
//=======================================================================
//function : GC_MakeArcOfCircle
//purpose :
//=======================================================================
GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Pnt& P1 ,
const gp_Vec& V ,
const gp_Pnt& P2 )
{
gp_Circ cir;
gce_MakeLin Corde(P1,P2);
TheError = Corde.Status();
if (TheError == gce_Done) {
gp_Lin corde(Corde.Value());
gp_Dir dir(corde.Direction());
gp_Dir dbid(V);
gp_Dir Daxe(dbid^dir);
gp_Dir Dir1(Daxe^dir);
gp_Lin bis(gp_Pnt((P1.X()+P2.X())/2.,(P1.Y()+P2.Y())/2.,
(P1.Z()+P2.Z())/2.),Dir1);
gp_Dir d(dbid^Daxe);
gp_Lin norm(P1,d);
Standard_Real Tol = 0.000000001;
Extrema_ExtElC distmin(bis,norm,Tol);
if (!distmin.IsDone()) { TheError = gce_IntersectionError; }
else {
Standard_Integer nbext = distmin.NbExt();
if (nbext == 0) { TheError = gce_IntersectionError; }
else {
Standard_Real TheDist = RealLast();
gp_Pnt pInt,pon1,pon2;
Standard_Integer i = 1;
Extrema_POnCurv Pon1,Pon2;
while (i<=nbext) {
if (distmin.SquareDistance(i)<TheDist) {
TheDist = distmin.SquareDistance(i);
distmin.Points(i,Pon1,Pon2);
pon1 = Pon1.Value();
pon2 = Pon2.Value();
pInt = gp_Pnt((pon1.XYZ()+pon2.XYZ())/2.);
}
i++;
}
Standard_Real Rad = (pInt.Distance(P1)+pInt.Distance(P2))/2.;
cir = gp_Circ(gp_Ax2(pInt,Daxe,d),Rad);
Standard_Real Alpha1 = ElCLib::Parameter(cir,P1);
Standard_Real Alpha3 = ElCLib::Parameter(cir,P2);
Handle(Geom_Circle) Circ = new Geom_Circle(cir);
TheArc= new Geom_TrimmedCurve(Circ,Alpha1,Alpha3, Standard_True);
}
}
}
}
//=======================================================================
//function : GC_MakeArcOfCircle
//purpose :
//=======================================================================
GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ ,
const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Boolean Sense )
{
Standard_Real Alpha1 = ElCLib::Parameter(Circ,P1);
Standard_Real Alpha2 = ElCLib::Parameter(Circ,P2);
Handle(Geom_Circle) C = new Geom_Circle(Circ);
TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
//=======================================================================
//function : GC_MakeArcOfCircle
//purpose :
//=======================================================================
GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ ,
const gp_Pnt& P ,
const Standard_Real Alpha ,
const Standard_Boolean Sense )
{
Standard_Real Alphafirst = ElCLib::Parameter(Circ,P);
Handle(Geom_Circle) C = new Geom_Circle(Circ);
TheArc= new Geom_TrimmedCurve(C,Alphafirst,Alpha,Sense);
TheError = gce_Done;
}
//=======================================================================
//function : GC_MakeArcOfCircle
//purpose :
//=======================================================================
GC_MakeArcOfCircle::GC_MakeArcOfCircle(const gp_Circ& Circ ,
const Standard_Real Alpha1 ,
const Standard_Real Alpha2 ,
const Standard_Boolean Sense )
{
Handle(Geom_Circle) C = new Geom_Circle(Circ);
TheArc= new Geom_TrimmedCurve(C,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfCircle::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheArc;
}
//=======================================================================
//function : Operator
//purpose :
//=======================================================================
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfCircle::Operator() const
{
return Value();
}
//=======================================================================
//function : operator
//purpose :
//=======================================================================
GC_MakeArcOfCircle::operator Handle(Geom_TrimmedCurve) () const
{
return Value();
}

71
src/GC/GC_MakeArcOfEllipse.cdl Executable file
View File

@@ -0,0 +1,71 @@
-- File: MakeArcOfEllipse.cdl
-- Created: Mon Sep 28 11:50:29 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeArcOfEllipse from GC inherits Root from GC
---Purpose: Implements construction algorithms for an arc
-- of ellipse in 3D space. The result is a Geom_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 Pnt from gp,
Elips from gp,
Dir from gp,
Ax1 from gp,
Real from Standard,
TrimmedCurve from Geom
raises NotDone from StdFail
is
Create(Elips : Elips from gp ;
Alpha1, Alpha2 : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfEllipse;
---Purpose: Constructs an arc of Ellipse (TrimmedCurve from Geom) from
-- a Ellipse between two parameters Alpha1 and Alpha2.
Create(Elips : Elips from gp ;
P : Pnt from gp ;
Alpha : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfEllipse;
---Purpose: Constructs an arc of Ellipse (TrimmedCurve from Geom) from
-- a Ellipse between point <P> and the angle Alpha
-- given in radians.
Create(Elips : Elips from gp ;
P1 : Pnt from gp ;
P2 : Pnt from gp ;
Sense : Boolean from Standard ) returns MakeArcOfEllipse;
---Purpose: Constructs an arc of Ellipse (TrimmedCurve from Geom) from
-- a Ellipse between two points P1 and P2.
-- The orientation of the arc of ellipse is:
-- - the sense of Elips if Sense is true, or
-- - the opposite sense if Sense is false.
-- Notes:
-- - Alpha1, Alpha2 and Alpha are angle values, given in radians.
-- - IsDone always returns true.
Value(me) returns TrimmedCurve from Geom
raises NotDone
is static;
---C++: return const&
---Purpose: Returns the constructed arc of ellipse.
Operator(me) returns TrimmedCurve from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;"
fields
TheArc : TrimmedCurve from Geom;
--The solution from Geom.
end MakeArcOfEllipse;

62
src/GC/GC_MakeArcOfEllipse.cxx Executable file
View File

@@ -0,0 +1,62 @@
// File: GC_MakeArcOfEllipse.cxx
// Created: Fri Oct 2 16:31:13 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeArcOfEllipse.ixx>
#include <Geom_Ellipse.hxx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips ,
const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Boolean Sense )
{
Standard_Real Alpha1 = ElCLib::Parameter(Elips,P1);
Standard_Real Alpha2 = ElCLib::Parameter(Elips,P2);
Handle(Geom_Ellipse) E = new Geom_Ellipse(Elips);
TheArc = new Geom_TrimmedCurve(E,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips ,
const gp_Pnt& P ,
const Standard_Real Alpha ,
const Standard_Boolean Sense )
{
Standard_Real Alphafirst = ElCLib::Parameter(Elips,P);
Handle(Geom_Ellipse) E = new Geom_Ellipse(Elips);
TheArc = new Geom_TrimmedCurve(E,Alphafirst,Alpha,Sense);
TheError = gce_Done;
}
GC_MakeArcOfEllipse::GC_MakeArcOfEllipse(const gp_Elips& Elips ,
const Standard_Real Alpha1 ,
const Standard_Real Alpha2 ,
const Standard_Boolean Sense )
{
Handle(Geom_Ellipse) E = new Geom_Ellipse(Elips);
TheArc = new Geom_TrimmedCurve(E,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfEllipse::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheArc;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfEllipse::Operator() const
{
return Value();
}
GC_MakeArcOfEllipse::operator Handle(Geom_TrimmedCurve) () const
{
return Value();
}

View File

@@ -0,0 +1,68 @@
-- File: MakeArcOfHyperbola.cdl
-- Created: Mon Sep 28 11:50:50 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeArcOfHyperbola from GC inherits Root from GC
---Purpose: Implements construction algorithms for an arc
-- of hyperbola in 3D space. The result is a Geom_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 Pnt from gp,
Hypr from gp,
Dir from gp,
Ax1 from gp,
Real from Standard,
TrimmedCurve from Geom
raises NotDone from StdFail
is
Create(Hypr : Hypr from gp ;
Alpha1, Alpha2 : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfHyperbola;
---Purpose: Creates an arc of Hyperbola (TrimmedCurve from Geom) from
-- a Hyperbola between two parameters Alpha1 and Alpha2
-- (given in radians).
Create(Hypr : Hypr from gp ;
P : Pnt from gp ;
Alpha : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfHyperbola;
---Purpose: Creates an arc of Hyperbola (TrimmedCurve from Geom) from
-- a Hyperbola between point <P> and the parameter
-- Alpha (given in radians).
Create(Hypr : Hypr from gp ;
P1 : Pnt from gp ;
P2 : Pnt from gp ;
Sense : Boolean from Standard ) returns MakeArcOfHyperbola;
---Purpose: Creates an arc of Hyperbola (TrimmedCurve from Geom) from
-- a Hyperbola between two points P1 and P2.
-- The orientation of the arc of hyperbola is:
-- - the sense of Hypr if Sense is true, or
-- - the opposite sense if Sense is false.
Value(me) returns TrimmedCurve from Geom
raises NotDone
is static;
--- Purpose: Returns the constructed arc of hyperbola.
---C++: return const&
Operator(me) returns TrimmedCurve from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;"
fields
TheArc : TrimmedCurve from Geom;
--The solution from Geom.
end MakeArcOfHyperbola;

View File

@@ -0,0 +1,60 @@
// File: GC_MakeArcOfHyperbola.cxx
// Created: Fri Oct 2 16:31:29 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeArcOfHyperbola.ixx>
#include <Geom_Hyperbola.hxx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
GC_MakeArcOfHyperbola::
GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Boolean Sense )
{
Standard_Real Alpha1 = ElCLib::Parameter(Hypr,P1);
Standard_Real Alpha2 = ElCLib::Parameter(Hypr,P2);
Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
TheArc = new Geom_TrimmedCurve(H,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
const gp_Pnt& P ,
const Standard_Real Alpha ,
const Standard_Boolean Sense )
{
Standard_Real Alphafirst = ElCLib::Parameter(Hypr,P);
Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
TheArc = new Geom_TrimmedCurve(H,Alphafirst,Alpha,Sense);
TheError = gce_Done;
}
GC_MakeArcOfHyperbola::GC_MakeArcOfHyperbola(const gp_Hypr& Hypr ,
const Standard_Real Alpha1 ,
const Standard_Real Alpha2 ,
const Standard_Boolean Sense )
{
Handle(Geom_Hyperbola) H = new Geom_Hyperbola(Hypr);
TheArc = new Geom_TrimmedCurve(H,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfHyperbola::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheArc;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfHyperbola::Operator() const
{
return Value();
}
GC_MakeArcOfHyperbola::operator Handle(Geom_TrimmedCurve) () const
{
return Value();
}

64
src/GC/GC_MakeArcOfParabola.cdl Executable file
View File

@@ -0,0 +1,64 @@
-- File: MakeArcOfParabola.cdl
-- Created: Mon Sep 28 11:51:03 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeArcOfParabola from GC inherits Root from GC
---Purpose: Implements construction algorithms for an arc
-- of parabola in 3D space. The result is a Geom_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 Pnt from gp,
Parab from gp,
Dir from gp,
Ax1 from gp,
Real from Standard,
TrimmedCurve from Geom
raises NotDone from StdFail
is
Create(Parab : Parab from gp ;
Alpha1, Alpha2 : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfParabola;
---Purpose: Creates an arc of Parabola (TrimmedCurve from Geom) from
-- a Parabola between two parameters Alpha1 and Alpha2
-- (given in radians).
Create(Parab : Parab from gp ;
P : Pnt from gp ;
Alpha : Real from Standard ;
Sense : Boolean from Standard ) returns MakeArcOfParabola;
---Purpose: Creates an arc of Parabola (TrimmedCurve from Geom) from
-- a Parabola between point <P> and the parameter
-- Alpha (given in radians).
Create(Parab : Parab from gp ;
P1 : Pnt from gp ;
P2 : Pnt from gp ;
Sense : Boolean from Standard ) returns MakeArcOfParabola;
---Purpose: Creates an arc of Parabola (TrimmedCurve from Geom) from
-- a Parabola between two points P1 and P2.
Value(me) returns TrimmedCurve from Geom
raises NotDone
is static;
---Purpose: Returns the constructed arc of parabola.
---C++: return const&
Operator(me) returns TrimmedCurve from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;"
fields
TheArc : TrimmedCurve from Geom;
--The solution from Geom.
end MakeArcOfParabola;

59
src/GC/GC_MakeArcOfParabola.cxx Executable file
View File

@@ -0,0 +1,59 @@
// File: GC_MakeArcOfParabola.cxx
// Created: Fri Oct 2 16:31:46 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeArcOfParabola.ixx>
#include <Geom_Parabola.hxx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab ,
const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Boolean Sense )
{
Standard_Real Alpha1 = ElCLib::Parameter(Parab,P1);
Standard_Real Alpha2 = ElCLib::Parameter(Parab,P2);
Handle(Geom_Parabola) P = new Geom_Parabola(Parab);
TheArc = new Geom_TrimmedCurve(P,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab ,
const gp_Pnt& P ,
const Standard_Real Alpha ,
const Standard_Boolean Sense )
{
Standard_Real Alphafirst = ElCLib::Parameter(Parab,P);
Handle(Geom_Parabola) Parabola = new Geom_Parabola(Parab);
TheArc = new Geom_TrimmedCurve(Parabola,Alphafirst,Alpha,Sense);
TheError = gce_Done;
}
GC_MakeArcOfParabola::GC_MakeArcOfParabola(const gp_Parab& Parab ,
const Standard_Real Alpha1 ,
const Standard_Real Alpha2 ,
const Standard_Boolean Sense )
{
Handle(Geom_Parabola) P = new Geom_Parabola(Parab);
TheArc = new Geom_TrimmedCurve(P,Alpha1,Alpha2,Sense);
TheError = gce_Done;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfParabola::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheArc;
}
const Handle(Geom_TrimmedCurve)& GC_MakeArcOfParabola::Operator() const
{
return Value();
}
GC_MakeArcOfParabola::operator Handle(Geom_TrimmedCurve) () const
{
return Value();
}

105
src/GC/GC_MakeCircle.cdl Executable file
View File

@@ -0,0 +1,105 @@
-- File: MakeCircle.cdl
-- Created: Mon Sep 28 11:49:17 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeCircle from GC inherits Root from GC
---Purpose : This class implements the following algorithms used
-- to create Cirlec from Geom.
--
-- * 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.
-- The circle's parameter is the angle (Radian).
-- The parametrization range is [0,2*PI].
-- The circle is a closed and periodic curve.
-- The center of the circle is the Location point of its axis
-- placement. The XDirection of the axis placement defines the
-- origin of the parametrization.
uses Pnt from gp,
Circ from gp,
Circle from Geom,
Dir from gp,
Ax1 from gp,
Ax2 from gp,
Real from Standard
raises NotDone from StdFail
is
Create (C : Circ from gp) returns MakeCircle;
--- Purpose : creates a circle from a non persistent circle C by its conversion.
Create (A2 : Ax2 from gp ;
Radius : Real from Standard) returns MakeCircle;
--- Purpose :
-- A2 is the local coordinates system of the circle.
-- It is not forbidden to create a circle with Radius = 0.0
-- Status is "NegativeRadius" if Radius < 0.
Create(Circ : Circ from gp ;
Dist : Real from Standard) returns MakeCircle;
---Purpose : Make a Circle from Geom <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 : Circ from gp;
Point : Pnt from gp) returns MakeCircle;
---Purpose : Make a Circle from Geom <TheCirc> parallel to another
-- Circ <Circ> and passing through a Pnt <Point>.
Create(P1,P2,P3 : Pnt from gp) returns MakeCircle;
---Purpose : Make a Circ from gp <TheCirc> passing through 3
-- Pnt2d <P1>,<P2>,<P3>.
Create(Center : Pnt from gp ;
Norm : Dir from gp ;
Radius : Real from Standard) returns MakeCircle;
---Purpose : Make a Circle from Geom <TheCirc> with its center
-- <Center> and the normal of its plane <Norm> and
-- its radius <Radius>.
Create(Center : Pnt from gp ;
PtAxis : Pnt from gp ;
Radius : Real from Standard) returns MakeCircle;
---Purpose : Make a Circle from Geom <TheCirc> with its center
-- <Center> and the normal of its plane defined by the
-- two points <Center> and <PtAxis> and its radius <Radius>.
Create(Axis : Ax1 from gp ;
Radius : Real from Standard) returns MakeCircle;
---Purpose : Make a Circle from Geom <TheCirc> with its center
-- <Center> and its radius <Radius>.
Value(me) returns Circle from Geom
raises NotDone
is static;
--- Purpose:
-- Returns the constructed circle.
-- Exceptions
-- StdFail_NotDone if no circle is constructed.
---C++: return const&
Operator(me) returns Circle from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Circle() const;"
fields
TheCircle : Circle from Geom;
--The solution from Geom.
end MakeCircle;

102
src/GC/GC_MakeCircle.cxx Executable file
View File

@@ -0,0 +1,102 @@
// File: GC_MakeCircle.cxx
// Created: Fri Oct 2 16:32:04 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeCircle.ixx>
#include <gce_MakeCirc.hxx>
#include <StdFail_NotDone.hxx>
GC_MakeCircle::GC_MakeCircle(const gp_Circ& C)
{
TheError = gce_Done;
TheCircle = new Geom_Circle(C);
}
GC_MakeCircle::GC_MakeCircle(const gp_Ax2& A2 ,
const Standard_Real Radius)
{
if (Radius < 0.) { TheError = gce_NegativeRadius; }
else {
TheError = gce_Done;
TheCircle = new Geom_Circle(gp_Circ(A2,Radius));
}
}
GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ ,
const gp_Pnt& Point )
{
gp_Circ C = gce_MakeCirc(Circ,Point);
TheCircle = new Geom_Circle(C);
TheError = gce_Done;
}
GC_MakeCircle::GC_MakeCircle(const gp_Circ& Circ ,
const Standard_Real Dist )
{
gce_MakeCirc C = gce_MakeCirc(Circ,Dist);
TheError = C.Status();
if (TheError == gce_Done) {
TheCircle = new Geom_Circle(C.Value());
}
}
GC_MakeCircle::GC_MakeCircle(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 )
{
gce_MakeCirc C = gce_MakeCirc(P1,P2,P3);
TheError = C.Status();
if (TheError == gce_Done) {
TheCircle = new Geom_Circle(C.Value());
}
}
GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point ,
const gp_Dir& Norm ,
const Standard_Real Radius )
{
gce_MakeCirc C = gce_MakeCirc(Point,Norm,Radius);
TheError = C.Status();
if (TheError == gce_Done) {
TheCircle = new Geom_Circle(C.Value());
}
}
GC_MakeCircle::GC_MakeCircle(const gp_Pnt& Point ,
const gp_Pnt& PtAxis ,
const Standard_Real Radius )
{
gce_MakeCirc C = gce_MakeCirc(Point,PtAxis,Radius);
TheError = C.Status();
if (TheError == gce_Done) {
TheCircle = new Geom_Circle(C.Value());
}
}
GC_MakeCircle::GC_MakeCircle(const gp_Ax1& Axis ,
const Standard_Real Radius )
{
gce_MakeCirc C = gce_MakeCirc(Axis,Radius);
TheError = C.Status();
if (TheError == gce_Done) {
TheCircle = new Geom_Circle(C.Value());
}
}
const Handle(Geom_Circle)& GC_MakeCircle::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheCircle;
}
const Handle(Geom_Circle)& GC_MakeCircle::Operator() const
{
return Value();
}
GC_MakeCircle::operator Handle(Geom_Circle) () const
{
return Value();
}

132
src/GC/GC_MakeConicalSurface.cdl Executable file
View File

@@ -0,0 +1,132 @@
-- File: MakeCone.cdl
-- Created: Mon Sep 28 11:51:45 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeConicalSurface from GC inherits Root from GC
---Purpose : This class implements the following algorithms used
-- to create a ConicalSurface from Geom.
-- * Create a ConicalSurface parallel to another and passing
-- through a point.
-- * Create a ConicalSurface parallel to another at a distance
-- <Dist>.
-- * Create a ConicalSurface by 4 points.
-- * Create a ConicalSurface by its axis and 2 points.
-- * Create a ConicalSurface by 2 points and 2 radius.
-- The local coordinate system of the ConicalSurface is defined
-- with an axis placement (see class ElementarySurface).
--
-- The "ZAxis" is the symmetry axis of the ConicalSurface,
-- it gives the direction of increasing parametric value V.
-- The apex of the surface is on the negative side of this axis.
--
-- The parametrization range is :
-- U [0, 2*PI], V ]-infinite, + infinite[
--
-- The "XAxis" and the "YAxis" define the placement plane of the
-- surface (Z = 0, and parametric value V = 0) perpendicular to
-- the symmetry axis. The "XAxis" defines the origin of the
-- parameter U = 0. The trigonometric sense gives the positive
-- orientation for the parameter U.
--
-- When you create a ConicalSurface the U and V directions of
-- parametrization are such that at each point of the surface the
-- normal is oriented towards the "outside region".
uses Pnt from gp,
Ax1 from gp,
Ax2 from gp,
Lin from gp,
Cone from gp,
ConicalSurface from Geom,
Real from Standard
raises NotDone from StdFail
is
Create (A2 : Ax2 from gp ;
Ang : Real from Standard;
Radius : Real from Standard) returns MakeConicalSurface;
--- Purpose :
-- A2 defines the local coordinate system of the conical surface.
-- Ang is the conical surface semi-angle ]0, PI/2[.
-- Radius is the radius of the circle Viso in the placement plane
-- of the conical surface defined with "XAxis" and "YAxis".
-- The "ZDirection" of A2 defines the direction of the surface's
-- axis of symmetry.
-- If the location point of A2 is the apex of the surface
-- Radius = 0 .
-- At the creation the parametrization of the surface is defined
-- such that the normal Vector (N = D1U ^ D1V) is oriented towards
-- the "outside region" of the surface.
-- Status is "NegativeRadius" if Radius < 0.0 or "BadAngle" if
-- Ang < Resolution from gp or Ang >= PI/ - Resolution
Create (C : Cone from gp) returns MakeConicalSurface;
--- Purpose : Creates a ConicalSurface from a non persistent Cone from package gp.
Create(Cone : Cone from gp;
Point : Pnt from gp) returns MakeConicalSurface;
---Purpose : Make a ConicalSurface from Geom <TheCone> parallel to another
-- ConicalSurface <Cone> and passing through a Pnt <Point>.
Create(Cone : Cone from gp ;
Dist : Real from Standard) returns MakeConicalSurface;
---Purpose : Make a ConicalSurface from Geom <TheCone> parallel to another
-- ConicalSurface <Cone> at the distance <Dist> which can
-- be greater or lower than zero.
Create(P1 : Pnt from gp;
P2 : Pnt from gp;
P3 : Pnt from gp;
P4 : Pnt from gp) returns MakeConicalSurface;
---Purpose : Make a ConicalSurface from Geom <TheCone> passing through 3
-- Pnt <P1>,<P2>,<P3>.
-- Its axis is <P1P2> and the radius of its base is
-- the distance between <P3> and <P1P2>.
-- The distance between <P4> and <P1P2> is the radius of
-- the section passing through <P4>.
-- An error iss raised if <P1>,<P2>,<P3>,<P4> are
-- colinear or if <P3P4> is perpendicular to <P1P2> or
-- <P3P4> is colinear to <P1P2>.
Create(Axis : Ax1 from gp;
P1,P2 : Pnt from gp) returns MakeConicalSurface;
---Purpose: Make a ConicalSurface by its axis <Axis> and and two points.
Create(Axis : Lin from gp;
P1,P2 : Pnt from gp) returns MakeConicalSurface;
---Purpose: Make a ConicalSurface by its axis <Axis> and and two points.
Create(P1 : Pnt from gp ;
P2 : Pnt from gp ;
R1 : Real from Standard;
R2 : Real from Standard) returns MakeConicalSurface;
---Purpose: Make a ConicalSurface with two points and two radius.
-- The axis of the solution is the line passing through
-- <P1> and <P2>.
-- <R1> is the radius of the section passing through <P1>
-- and <R2> the radius of the section passing through <P2>.
Value(me) returns ConicalSurface from Geom
raises NotDone
is static;
---Purpose: Returns the constructed cone.
-- Exceptions
-- StdFail_NotDone if no cone is constructed.
---C++: return const&
Operator(me) returns ConicalSurface from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_ConicalSurface() const;"
fields
TheCone : ConicalSurface from Geom;
--The solution from Geom.
end MakeConicalSurface;

110
src/GC/GC_MakeConicalSurface.cxx Executable file
View File

@@ -0,0 +1,110 @@
// File: GC_MakeConicalSurface.cxx
// Created: Fri Oct 2 16:33:58 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeConicalSurface.ixx>
#include <gce_MakeCone.hxx>
#include <gp.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_NotImplemented.hxx>
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax2& A2 ,
const Standard_Real Ang ,
const Standard_Real Radius)
{
if (Radius < 0.) { TheError = gce_NegativeRadius; }
else if (Ang <= gp::Resolution() || Ang >= PI/2. - gp::Resolution()) {
TheError = gce_BadAngle;
}
else {
TheError = gce_Done;
TheCone = new Geom_ConicalSurface(A2,Ang,Radius);
}
}
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& C)
{
TheError = gce_Done;
TheCone = new Geom_ConicalSurface(C);
}
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& , //C,
const gp_Pnt& ) //P )
{
Standard_NotImplemented::Raise("GC_MakeConicalSurface");
}
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Cone& , //C,
const Standard_Real) // Dist )
{
Standard_NotImplemented::Raise("GC_MakeConicalSurface");
}
//=========================================================================
// Creation d un cone par quatre points. +
// les deux premiers donnent l axe. +
// le troisieme donne le rayon de la base. +
// le troisieme et le quatrieme le demi angle. +
//=========================================================================
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 ,
const gp_Pnt& P4 )
{
gce_MakeCone C = gce_MakeCone(P1,P2,P3,P4);
TheError = C.Status();
if (TheError == gce_Done) {
TheCone = new Geom_ConicalSurface(C.Value());
}
}
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Ax1& , //Axis,
const gp_Pnt& , //P1 ,
const gp_Pnt& ) //P2 )
{
Standard_NotImplemented::Raise("GC_MakeConicalSurface");
}
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Lin& , //Axis,
const gp_Pnt& , //P1 ,
const gp_Pnt& ) //P2 )
{
Standard_NotImplemented::Raise("GC_MakeConicalSurface");
}
//=========================================================================
//=========================================================================
GC_MakeConicalSurface::GC_MakeConicalSurface(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Real R1 ,
const Standard_Real R2 )
{
gce_MakeCone C = gce_MakeCone(P1,P2,R1,R2);
TheError = C.Status();
if (TheError == gce_Done) {
TheCone = new Geom_ConicalSurface(C);
}
}
const Handle(Geom_ConicalSurface)& GC_MakeConicalSurface::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheCone;
}
const Handle(Geom_ConicalSurface)& GC_MakeConicalSurface::Operator() const
{
return Value();
}
GC_MakeConicalSurface::operator Handle(Geom_ConicalSurface) () const
{
return Value();
}

View File

@@ -0,0 +1,117 @@
-- File: MakeCylindricalSurface.cdl
-- Created: Mon Sep 28 11:51:29 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeCylindricalSurface from GC inherits Root from GC
---Purpose : This class implements the following algorithms used
-- to create a CylindricalSurface from Geom.
-- * Create a CylindricalSurface parallel to another and
-- passing through a point.
-- * Create a CylindricalSurface parallel to another at a
-- distance
-- <Dist>.
-- * Create a CylindricalSurface passing through 3 points.
-- * Create a CylindricalSurface by its axis and radius.
-- * Create a cylindricalSurface by its circular base.
-- The local coordinate system of the CylindricalSurface is defined
-- with an axis placement (see class ElementarySurface).
--
-- The "ZAxis" is the symmetry axis of the CylindricalSurface,
-- it gives the direction of increasing parametric value V.
--
-- The parametrization range is :
-- U [0, 2*PI], V ]- infinite, + infinite[
--
-- The "XAxis" and the "YAxis" define the placement plane of the
-- surface (Z = 0, and parametric value V = 0) perpendicular to
-- the symmetry axis. The "XAxis" defines the origin of the
-- parameter U = 0. The trigonometric sense gives the positive
-- orientation for the parameter U.
uses Pnt from gp,
Ax1 from gp,
Ax2 from gp,
Circ from gp,
Cylinder from gp,
CylindricalSurface from Geom,
Real from Standard
raises NotDone from StdFail
is
Create (A2 : Ax2; Radius : Real) returns MakeCylindricalSurface;
--- Purpose :
-- A2 defines the local coordinate system of the cylindrical surface.
-- The "ZDirection" of A2 defines the direction of the surface's
-- axis of symmetry.
-- At the creation the parametrization of the surface is defined
-- such that the normal Vector (N = D1U ^ D1V) is oriented towards
-- the "outside region" of the surface.
-- Warnings :
-- It is not forbidden to create a cylindrical surface with
-- Radius = 0.0
--- Status is "NegativeRadius" if Radius < 0.0
Create (C : Cylinder from gp) returns MakeCylindricalSurface;
--- Purpose :
-- Creates a CylindricalSurface from a non persistent Cylinder
-- from package gp.
Create(Cyl : Cylinder from gp;
Point : Pnt from gp) returns MakeCylindricalSurface;
---Purpose : Make a CylindricalSurface from Geom <TheCylinder>
-- parallel to another
-- CylindricalSurface <Cylinder> and passing through a
-- Pnt <Point>.
Create(Cyl : Cylinder from gp ;
Dist : Real from Standard) returns MakeCylindricalSurface;
---Purpose : Make a CylindricalSurface from Geom <TheCylinder>
-- parallel to another
-- CylindricalSurface <Cylinder> at the distance <Dist>
-- which can be greater or lower than zero.
-- The radius of the result is the absolute value of the
-- radius of <Cyl> plus <Dist>
Create(P1 : Pnt from gp;
P2 : Pnt from gp;
P3 : Pnt from gp) returns MakeCylindricalSurface;
---Purpose : Make a CylindricalSurface from Geom <TheCylinder>
-- passing through 3 Pnt <P1>,<P2>,<P3>.
-- Its axis is <P1P2> and its radius is the distance
-- between <P3> and <P1P2>
Create(Axis : Ax1 from gp ;
Radius : Real from Standard) returns MakeCylindricalSurface;
---Purpose: Make a CylindricalSurface by its axis <Axis> and radius
-- <Radius>.
Create(Circ : Circ from gp) returns MakeCylindricalSurface;
---Purpose: Make a CylindricalSurface by its circular base.
Value(me) returns CylindricalSurface from Geom
raises NotDone
is static;
---Purpose: Returns the constructed cylinder.
-- Exceptions StdFail_NotDone if no cylinder is constructed.
---C++: return const&
Operator(me) returns CylindricalSurface from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_CylindricalSurface() const;"
fields
TheCylinder : CylindricalSurface from Geom;
--The solution from Geom.
end MakeCylindricalSurface;

View File

@@ -0,0 +1,102 @@
// File: GC_MakeCylindricalSurface.cxx
// Created: Fri Oct 2 16:35:54 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeCylindricalSurface.ixx>
#include <gce_MakeCylinder.hxx>
#include <gp_Lin.hxx>
#include <StdFail_NotDone.hxx>
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& C)
{
TheError = gce_Done;
TheCylinder = new Geom_CylindricalSurface(C);
}
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax2& A2 ,
const Standard_Real Radius)
{
if (Radius < 0.0) { TheError = gce_NegativeRadius; }
else {
TheError = gce_Done;
TheCylinder = new Geom_CylindricalSurface(A2,Radius);
}
}
//=========================================================================
// Construction d un cylindre par axe <A1> et rayon <Radius>. +
//=========================================================================
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Ax1& A1 ,
const Standard_Real Radius )
{
gce_MakeCylinder Cyl = gce_MakeCylinder(A1,Radius);
TheError = Cyl.Status();
if (TheError == gce_Done) {
TheCylinder=new Geom_CylindricalSurface(Cyl.Value());
}
}
//=========================================================================
// Construction d un cylindre par un cercle <Cir>. +
//=========================================================================
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Circ& Circ ) {
gp_Cylinder Cyl = gce_MakeCylinder(Circ);
TheCylinder=new Geom_CylindricalSurface(Cyl);
TheError = gce_Done;
}
//=========================================================================
// Construction d un cylindre par trois points <P1>, <P2>, <P3>. +
// Les deux premiers points definissent l axe. +
// Le troisieme donne le rayon. +
//=========================================================================
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 ) {
gce_MakeCylinder Cyl = gce_MakeCylinder(P1,P2,P3);
TheError = Cyl.Status();
if (TheError == gce_Done) {
TheCylinder=new Geom_CylindricalSurface(Cyl.Value());
}
}
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& Cyl ,
const Standard_Real Dist)
{
TheError = gce_Done;
Standard_Real R = Abs(Cyl.Radius()-Dist);
TheCylinder = new Geom_CylindricalSurface(Cyl);
TheCylinder->SetRadius(R);
}
GC_MakeCylindricalSurface::GC_MakeCylindricalSurface(const gp_Cylinder& Cyl ,
const gp_Pnt& Point)
{
TheError = gce_Done;
gp_Cylinder C(Cyl);
gp_Lin L(C.Axis());
Standard_Real R = L.Distance(Point);
C.SetRadius(R);
TheCylinder = new Geom_CylindricalSurface(C);
}
const Handle(Geom_CylindricalSurface)&
GC_MakeCylindricalSurface::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheCylinder;
}
const Handle(Geom_CylindricalSurface)& GC_MakeCylindricalSurface::Operator() const
{
return Value();
}
GC_MakeCylindricalSurface::operator Handle(Geom_CylindricalSurface) () const
{
return Value();
}

76
src/GC/GC_MakeEllipse.cdl Executable file
View File

@@ -0,0 +1,76 @@
-- File: MakeEllipse.cdl
-- Created: Mon Sep 28 11:49:44 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeEllipse from GC inherits Root from GC
---Purpose :This class implements construction algorithms for an ellipse in
-- 3D space. The result is a Geom_Ellipse ellipse.
-- A MakeEllipse object provides a framework for:
-- - defining the construction of the ellipse,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed ellipse.
uses Pnt from gp,
Ax2 from gp,
Hypr from gp,
Ellipse from Geom,
Elips from gp
raises NotDone from StdFail
is
Create (E : Elips from gp) returns MakeEllipse;
--- Purpose :
-- Creates an ellipse from a non persistent ellipse E from package gp by its conversion.
Create (A2 : Ax2 from gp ;
MajorRadius, MinorRadius : Real from Standard) returns MakeEllipse;
--- Purpose : Constructs an ellipse with major and minor radii MajorRadius and
-- MinorRadius, and located in the plane defined by
-- the "X Axis" and "Y Axis" of the coordinate system A2, where:
-- - its center is the origin of A2, and
-- - its major axis is the "X Axis" of A2;
-- Warnings :
-- The MakeEllipse class does not prevent the
-- construction of an ellipse where MajorRadius is equal to MinorRadius.
-- If an error occurs (that is, when IsDone returns
-- false), the Status function returns:
-- - gce_InvertRadius if MajorRadius is less than MinorRadius;
-- - gce_NegativeRadius if MinorRadius is less than 0.0;
-- - gce_NullAxis if the points S1 and Center are coincident; or
-- - gce_InvertAxis if:
-- - the major radius computed with Center and S1
-- is less than the minor radius computed with Center, S1 and S2, or
-- - Center, S1 and S2 are collinear.
Create(S1,S2 : Pnt from gp;
Center : Pnt from gp) returns MakeEllipse;
---Purpose: Constructs an ellipse centered on the point Center, where
-- - the plane of the ellipse is defined by Center, S1 and S2,
-- - its major axis 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.
Value(me) returns Ellipse from Geom
raises NotDone
is static;
---Purpose: Returns the constructed ellipse.
-- Exceptions StdFail_NotDone if no ellipse is constructed.
---C++: return const&
Operator(me) returns Ellipse from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Ellipse() const;"
fields
TheEllipse : Ellipse from Geom;
--The solution from Geom.
end MakeEllipse;

53
src/GC/GC_MakeEllipse.cxx Executable file
View File

@@ -0,0 +1,53 @@
// File: GC_MakeEllipse.cxx
// Created: Fri Oct 2 16:36:08 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeEllipse.ixx>
#include <gce_MakeElips.hxx>
#include <StdFail_NotDone.hxx>
GC_MakeEllipse::GC_MakeEllipse(const gp_Elips& E)
{
TheError = gce_Done;
TheEllipse = new Geom_Ellipse(E);
}
GC_MakeEllipse::GC_MakeEllipse(const gp_Ax2& A2 ,
const Standard_Real MajorRadius,
const Standard_Real MinorRadius)
{
if ( MinorRadius < 0.0) { TheError = gce_NegativeRadius; }
else if ( MajorRadius < MinorRadius) { TheError = gce_InvertAxis; }
else {
TheError = gce_Done;
TheEllipse = new Geom_Ellipse(gp_Elips(A2,MajorRadius,MinorRadius));
}
}
GC_MakeEllipse::GC_MakeEllipse(const gp_Pnt& S1 ,
const gp_Pnt& S2 ,
const gp_Pnt& Center ) {
gce_MakeElips E = gce_MakeElips(S1,S2,Center);
TheError = E.Status();
if (TheError == gce_Done) {
TheEllipse = new Geom_Ellipse(E.Value());
}
}
const Handle(Geom_Ellipse)& GC_MakeEllipse::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheEllipse;
}
const Handle(Geom_Ellipse)& GC_MakeEllipse::Operator() const
{
return Value();
}
GC_MakeEllipse::operator Handle(Geom_Ellipse) () const
{
return Value();
}

85
src/GC/GC_MakeHyperbola.cdl Executable file
View File

@@ -0,0 +1,85 @@
-- File: MakeHyperbola.cdl
-- Created: Mon Sep 28 11:49:29 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeHyperbola from GC inherits Root from GC
---Purpose :This class implements construction algorithms for a hyperbola in
-- 3D space. The result is a Geom_Hyperbola hyperbola.
-- A MakeHyperbola object provides a framework for:
-- - defining the construction of the hyperbola,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed hyperbola.
-- To define 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 Pnt from gp,
Hypr from gp,
Ax2 from gp,
Hyperbola from Geom
raises NotDone from StdFail
is
Create (H : Hypr from gp) returns MakeHyperbola;
--- Purpose :
-- Creates an Hyperbola from a non persistent hyperbola from package gp by conversion.
Create (A2 : Ax2 from gp ;
MajorRadius, MinorRadius : Real from Standard) returns MakeHyperbola;
--- Purpose : Constructs a hyperbola centered on the origin of the coordinate system
-- A2, with major and minor radii MajorRadius and MinorRadius, where:
-- the plane of the hyperbola is defined by the "X Axis" and "Y Axis" of A2,
-- - its major axis is the "X Axis" of A2.
Create(S1,S2 : Pnt from gp;
Center : Pnt from gp) returns MakeHyperbola;
---Purpose: Constructs a hyperbola centered on the point Center, where
-- - the plane of the hyperbola is defined by Center, S1 and S2,
-- - its major axis 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;
Value(me) returns Hyperbola from Geom
raises NotDone
is static;
---Purpose: Returns the constructed hyperbola.
-- Exceptions StdFail_NotDone if no hyperbola is constructed.
---C++: return const&
Operator(me) returns Hyperbola from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Hyperbola() const;"
fields
TheHyperbola : Hyperbola from Geom;
--The solution from Geom.
end MakeHyperbola;

52
src/GC/GC_MakeHyperbola.cxx Executable file
View File

@@ -0,0 +1,52 @@
// File: GC_MakeHyperbola.cxx
// Created: Fri Oct 2 16:36:22 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeHyperbola.ixx>
#include <gce_MakeHypr.hxx>
#include <StdFail_NotDone.hxx>
GC_MakeHyperbola::GC_MakeHyperbola(const gp_Hypr& H)
{
TheError = gce_Done;
TheHyperbola = new Geom_Hyperbola(H);
}
GC_MakeHyperbola::GC_MakeHyperbola(const gp_Ax2& A2 ,
const Standard_Real MajorRadius,
const Standard_Real MinorRadius)
{
if (MajorRadius < 0. || MinorRadius < 0.0) { TheError = gce_NegativeRadius; }
else {
TheError = gce_Done;
TheHyperbola = new Geom_Hyperbola(gp_Hypr(A2,MajorRadius,MinorRadius));
}
}
GC_MakeHyperbola::GC_MakeHyperbola(const gp_Pnt& S1 ,
const gp_Pnt& S2 ,
const gp_Pnt& Center ) {
gce_MakeHypr H = gce_MakeHypr(S1,S2,Center);
TheError = H.Status();
if (TheError == gce_Done) {
TheHyperbola = new Geom_Hyperbola(H.Value());
}
}
const Handle(Geom_Hyperbola)& GC_MakeHyperbola::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheHyperbola;
}
const Handle(Geom_Hyperbola)& GC_MakeHyperbola::Operator() const
{
return Value();
}
GC_MakeHyperbola::operator Handle(Geom_Hyperbola) () const
{
return Value();
}

78
src/GC/GC_MakeLine.cdl Executable file
View 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 GC inherits Root from GC
---Purpose : This class implements the following algorithms used
-- to create a Line from Geom.
-- * Create a Line parallel to another and passing
-- through a point.
-- * Create a Line passing through 2 points.
-- A MakeLine object provides a framework for:
-- - defining the construction of the line,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed line.
uses Pnt from gp,
Lin from gp,
Ax1 from gp,
Dir from gp,
Line from Geom,
Real from Standard
raises NotDone from StdFail
is
Create (A1 : Ax1 from gp) returns MakeLine;
--- Purpose :
-- Creates a line located in 3D space with the axis placement A1.
-- The Location of A1 is the origin of the line.
Create (L : Lin from gp) returns MakeLine;
--- Purpose :
-- Creates a line from a non persistent line from package gp.
Create (P : Pnt from gp;
V : Dir from gp) returns MakeLine;
--- Purpose :
-- P is the origin and V is the direction of the line.
Create(Lin : Lin from gp;
Point : Pnt from gp) returns MakeLine;
---Purpose : Make a Line from Geom <TheLin> parallel to another
-- Lin <Lin> and passing through a Pnt <Point>.
Create(P1 : Pnt from gp;
P2 : Pnt from gp) returns MakeLine;
---Purpose : Make a Line from Geom <TheLin> passing through 2
-- Pnt <P1>,<P2>.
-- It returns false if <p1> and <P2> are confused.
-- Warning
-- If the points P1 and P2 are coincident (that is, when
-- IsDone returns false), the Status function returns gce_ConfusedPoints.
Value(me) returns Line from Geom
raises NotDone
is static;
---Purpose: Returns the constructed line.
-- Exceptions StdFail_NotDone if no line is constructed.
---C++: return const&
Operator(me) returns Line from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Line() const;"
fields
TheLine : Line from Geom;
--The solution from Geom.
end MakeLine;

68
src/GC/GC_MakeLine.cxx Executable file
View File

@@ -0,0 +1,68 @@
// File: GC_MakeLine.cxx
// Created: Fri Oct 2 16:36:34 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeLine.ixx>
#include <gce_MakeLin.hxx>
#include <StdFail_NotDone.hxx>
//=========================================================================
// Constructions of 3d geometrical elements from Geom.
//=========================================================================
GC_MakeLine::GC_MakeLine(const gp_Pnt& P ,
const gp_Dir& V )
{
TheError = gce_Done;
TheLine = new Geom_Line(P,V);
}
GC_MakeLine::GC_MakeLine(const gp_Ax1& A1 )
{
TheError = gce_Done;
TheLine = new Geom_Line(A1);
}
GC_MakeLine::GC_MakeLine(const gp_Lin& L )
{
TheError = gce_Done;
TheLine = new Geom_Line(L);
}
GC_MakeLine::GC_MakeLine(const gp_Pnt& P1 ,
const gp_Pnt& P2 )
{
gce_MakeLin L(P1,P2);
TheError = L.Status();
if (TheError == gce_Done) {
TheLine = new Geom_Line(L.Value());
}
}
GC_MakeLine::GC_MakeLine(const gp_Lin& Lin ,
const gp_Pnt& Point )
{
gce_MakeLin L(Lin,Point);
TheError = L.Status();
if (TheError == gce_Done) {
TheLine = new Geom_Line(L.Value());
}
}
const Handle(Geom_Line)& GC_MakeLine::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheLine;
}
const Handle(Geom_Line)& GC_MakeLine::Operator() const
{
return Value();
}
GC_MakeLine::operator Handle(Geom_Line) () const
{
return Value();
}

65
src/GC/GC_MakeMirror.cdl Executable file
View File

@@ -0,0 +1,65 @@
-- File: MakeMirror.cdl
-- Created: Mon Sep 28 11:52:47 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeMirror
from GC
---Purpose: This class implements elementary construction algorithms for a
-- symmetrical transformation in 3D space about a point,
-- axis or plane. The result is a Geom_Transformation transformation.
-- A MakeMirror object provides a framework for:
-- - defining the construction of the transformation,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses Pnt from gp,
Ax1 from gp,
Ax2 from gp,
Dir from gp,
Pln from gp,
Lin from gp,
Transformation from Geom,
Real from Standard
is
Create(Point : Pnt from gp) returns MakeMirror;
---Puprose: Make a symetry transformation of center <Point>.
Create(Axis : Ax1 from gp) returns MakeMirror;
---Puprose: Make a symetry transformation of axis <Axis>.
Create(Line : Lin from gp) returns MakeMirror;
---Puprose: Make a symetry transformation of axis <Line>.
Create(Point : Pnt from gp;
Direc : Dir from gp) returns MakeMirror;
---Purpose: Make a symetry transformation af axis defined by
-- <Point> and <Direc>.
Create(Plane : Pln from gp) returns MakeMirror;
---Purpose: Make a symetry transformation of plane <Plane>.
Create(Plane : Ax2 from gp) returns MakeMirror;
---Purpose: Make a symetry transformation of plane <Plane>.
Value(me) returns Transformation from Geom
is static;
---Purpose: Returns the constructed transformation.
---C++: return const&
Operator(me) returns Transformation from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Transformation() const;"
fields
TheMirror : Transformation from Geom;
end MakeMirror;

82
src/GC/GC_MakeMirror.cxx Executable file
View File

@@ -0,0 +1,82 @@
// File: GC_MakeMirror.cxx
// Created: Fri Oct 2 16:36:54 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeMirror.ixx>
#include <GC_MakeMirror.hxx>
#include <gp_Ax3.hxx>
#include <StdFail_NotDone.hxx>
//=========================================================================
// Creation d une symetrie de Geom par rapport a un point. +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(Point);
}
//=========================================================================
// Creation d une symetrie de Geom par rapport a une droite. +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Ax1& Axis ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(Axis);
}
//=========================================================================
// Creation d une symetrie de Geom par rapport a une droite. +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Lin& Line ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(gp_Ax1(Line.Location(),Line.Direction()));
}
//=========================================================================
// Creation d une symetrie 3d de Geom par rapport a une droite definie +
// par un point et une direction. +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Pnt& Point ,
const gp_Dir& Direc ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(gp_Ax1(Point,Direc));
}
//=========================================================================
// Creation d une symetrie 3d de Geom par rapport a un plan defini par +
// un Ax2 (Normale au plan et axe x du plan). +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Ax2& Plane ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(Plane);
}
//=========================================================================
// Creation d une symetrie 3d de gp par rapport a un plan Plane. +
//=========================================================================
GC_MakeMirror::GC_MakeMirror(const gp_Pln& Plane ) {
TheMirror = new Geom_Transformation();
TheMirror->SetMirror(Plane.Position().Ax2());
}
const Handle(Geom_Transformation)& GC_MakeMirror::Value() const
{
return TheMirror;
}
const Handle(Geom_Transformation)& GC_MakeMirror::Operator() const
{
return TheMirror;
}
GC_MakeMirror::operator Handle(Geom_Transformation) () const
{
return TheMirror;
}

103
src/GC/GC_MakePlane.cdl Executable file
View File

@@ -0,0 +1,103 @@
-- File: MakePlane.cdl
-- Created: Mon Sep 28 11:51:13 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakePlane from GC inherits Root from GC
---Purpose : This class implements the following algorithms used
-- to create a Plane from gp.
-- * Create a Plane parallel to another and passing
-- through a point.
-- * Create a Plane passing through 3 points.
-- * Create a Plane by its normal
-- A MakePlane object provides a framework for:
-- - defining the construction of the plane,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed plane.
uses Pnt from gp,
Pln from gp,
Ax2 from gp,
Dir from gp,
Plane from Geom,
Ax1 from gp,
Real from Standard
raises NotDone from StdFail
is
Create (A2 : Ax2) returns MakePlane;
--- Purpose :
-- Creates a plane located in 3D space with an axis placement
-- two axis. The "ZDirection" of "A2" is the direction normal
-- to the plane. The "Location" point of "A2" is the origin of
-- the plane. The "XDirection" and "YDirection" of "A2" define
-- the directions of the U isoparametric and V isoparametric
-- curves.
Create (Pl : Pln from gp) returns MakePlane;
--- Purpose :
-- Creates a plane from a non persistent plane from package gp.
Create (P : Pnt from gp;
V : Dir from gp) returns MakePlane;
--- Purpose :
-- P is the "Location" point or origin of the plane.
-- V is the direction normal to the plane.
Create (A, B, C ,D : Real from Standard) returns MakePlane;
--- Purpose :
-- Creates a plane from its cartesian equation :
-- Ax + By + Cz + D = 0.0
-- Status is "BadEquation" if Sqrt (A*A + B*B + C*C)
-- <= Resolution from gp
Create(Pln : Pln from gp;
Point : Pnt from gp) returns MakePlane;
---Purpose : Make a Plane from Geom <ThePlane> parallel to another
-- Pln <Pln> and passing through a Pnt <Point>.
Create(Pln : Pln from gp ;
Dist : Real from Standard) returns MakePlane;
---Purpose : Make a Plane from Geom <ThePlane> parallel to another
-- Pln <Pln> at the distance <Dist> which can be greater
-- or lower than zero.
-- In the first case the result is at the distance
-- <Dist> to the plane <Pln> in the direction of the
-- normal to <Pln>.
-- Otherwize it is in the oposite direction.
Create(P1 : Pnt from gp;
P2 : Pnt from gp;
P3 : Pnt from gp) returns MakePlane;
---Purpose : Make a Plane from Geom <ThePlane> passing through 3
-- Pnt <P1>,<P2>,<P3>.
-- It returns false if <P1> <P2> <P3> are confused.
Create(Axis : Ax1 from gp) returns MakePlane;
---Purpose: Make a Plane passing through the location of <Axis>and
-- normal to the Direction of <Axis>.
Value(me) returns Plane from Geom
raises NotDone
is static;
---Purpose: Returns the constructed plane.
-- Exceptions StdFail_NotDone if no plane is constructed.
---C++: return const&
Operator(me) returns Plane from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Plane() const;"
fields
ThePlane : Plane from Geom;
--The solution from Geom.
end MakePlane;

124
src/GC/GC_MakePlane.cxx Executable file
View File

@@ -0,0 +1,124 @@
// File: GC_MakePlane.cxx
// Created: Fri Oct 2 16:37:10 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakePlane.ixx>
#include <gce_MakePln.hxx>
#include <gp.hxx>
#include <gp_Ax3.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_NotImplemented.hxx>
GC_MakePlane::GC_MakePlane(const gp_Ax2& ) //A2)
{
Standard_NotImplemented::Raise("GC_MakePlane");
}
GC_MakePlane::GC_MakePlane(const gp_Pln& Pl)
{
TheError = gce_Done;
ThePlane = new Geom_Plane(Pl);
}
GC_MakePlane::GC_MakePlane(const gp_Pnt& P,
const gp_Dir& V)
{
TheError = gce_Done;
ThePlane = new Geom_Plane(P,V);
}
GC_MakePlane::GC_MakePlane(const Standard_Real A,
const Standard_Real B,
const Standard_Real C,
const Standard_Real D)
{
if (Sqrt(A*A + B*B +C*C) <= gp::Resolution()) {
TheError = gce_BadEquation;
}
else {
TheError = gce_Done;
ThePlane = new Geom_Plane(gp_Pln(A,B,C,D));
}
}
//=========================================================================
// Creation d un Geom_Plane passant par trois points. +
//=========================================================================
GC_MakePlane::GC_MakePlane(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 ) {
gce_MakePln Pl(P1,P2,P3);
TheError = Pl.Status();
if (TheError == gce_Done) {
ThePlane = new Geom_Plane(Pl.Value());
}
}
//=========================================================================
// Creation d un Geom_Plane parallele a un pln a une distance donnee. +
//=========================================================================
GC_MakePlane::GC_MakePlane(const gp_Pln& Pl ,
const Standard_Real Dist ) {
gp_Pln Pln = gce_MakePln(Pl,Dist);
TheError = gce_Done;
ThePlane = new Geom_Plane(Pln);
}
//=========================================================================
// Creation d un Geom_Plane parallele a un pln passant par un point +
// <Point1>. +
//=========================================================================
GC_MakePlane::GC_MakePlane(const gp_Pln& Pl ,
const gp_Pnt& Point ) {
gp_Pln Pln= gce_MakePln(Pl,Point);
TheError = gce_Done;
ThePlane = new Geom_Plane(Pln);
}
//=========================================================================
// Creation d un Geom_Plane a partir d un Ax1 (Point + Normale). +
//=========================================================================
GC_MakePlane::GC_MakePlane(const gp_Ax1& Axis ) {
gp_Pln Pln = gce_MakePln(Axis);
TheError = gce_Done;
ThePlane = new Geom_Plane(Pln);
}
//=========================================================================
// Creation d un Geom_Plane par un tableau de points. +
//=========================================================================
/*GC_MakePlane::GC_MakePlane(const TColgp_Array1OfPnt& Pts ,
Standard_Real ErrMax ,
Standard_Real ErrMean ) {
GC_MakePln Pln(Pts,ErrMax,ErrMean);
TheError = Pln.Status();
if (TheError == GC_Done) {
ThePlane = new Geom_Plane(Pln.Value());
}
}
*/
const Handle(Geom_Plane)& GC_MakePlane::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return ThePlane;
}
const Handle(Geom_Plane)& GC_MakePlane::Operator() const
{
return Value();
}
GC_MakePlane::operator Handle(Geom_Plane) () const
{
return Value();
}

54
src/GC/GC_MakeRotation.cdl Executable file
View File

@@ -0,0 +1,54 @@
-- File: MakeRotation.cdl
-- Created: Mon Sep 28 11:52:57 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeRotation
from GC
---Purpose: This class implements elementary construction algorithms for a
-- rotation in 3D space. The result is a
-- Geom_Transformation transformation.
-- A MakeRotation object provides a framework for:
-- - defining the construction of the transformation,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses Pnt from gp,
Lin from gp,
Ax1 from gp,
Dir from gp,
Transformation from Geom,
Real from Standard
is
Create(Line : Lin from gp ;
Angle : Real from Standard) returns MakeRotation;
--- Purpose: Constructs a rotation through angle Angle about the axis defined by the line Line.
Create(Axis : Ax1 from gp ;
Angle : Real from Standard) returns MakeRotation;
---Purpose: Constructs a rotation through angle Angle about the axis defined by the axis Axis.
Create(Point : Pnt from gp ;
Direc : Dir from gp ;
Angle : Real from Standard) returns MakeRotation;
---Purpose: Constructs a rotation through angle Angle about the axis
-- defined by the point Point and the unit vector Direc.
Value(me) returns Transformation from Geom
is static;
---Purpose: Returns the constructed transformation.
---C++: return const&
Operator(me) returns Transformation from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Transformation() const;"
fields
TheRotation : Transformation from Geom;
end MakeRotation;

61
src/GC/GC_MakeRotation.cxx Executable file
View File

@@ -0,0 +1,61 @@
// File: GC_MakeRotation.cxx
// Created: Fri Oct 2 16:37:27 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeRotation.ixx>
#include <GC_MakeRotation.hxx>
#include <StdFail_NotDone.hxx>
//=========================================================================
// Creation d une rotation 3d de gp d angle Angle par rapport a une +
// droite Line. +
//=========================================================================
GC_MakeRotation::GC_MakeRotation(const gp_Lin& Line ,
const Standard_Real Angle ) {
TheRotation = new Geom_Transformation();
TheRotation->SetRotation(gp_Ax1(Line.Location(),Line.Direction()),Angle);
}
//=========================================================================
// Creation d une rotation 3d de gp d angle Angle par rapport a un +
// axe Axis. +
//=========================================================================
GC_MakeRotation::GC_MakeRotation(const gp_Ax1& Axis ,
const Standard_Real Angle ) {
TheRotation = new Geom_Transformation();
TheRotation->SetRotation(Axis,Angle);
}
//=========================================================================
// Creation d une rotation 3d de gp d angle Angle par rapport a une +
// droite issue du point Point et de direction Direc. +
//=========================================================================
GC_MakeRotation::GC_MakeRotation(const gp_Pnt& Point ,
const gp_Dir& Direc ,
const Standard_Real Angle ) {
TheRotation = new Geom_Transformation();
TheRotation->SetRotation(gp_Ax1(Point,Direc),Angle);
}
const Handle(Geom_Transformation)& GC_MakeRotation::Value() const
{
return TheRotation;
}
const Handle(Geom_Transformation)& GC_MakeRotation::Operator() const
{
return TheRotation;
}
GC_MakeRotation::operator Handle(Geom_Transformation) () const
{
return TheRotation;
}

46
src/GC/GC_MakeScale.cdl Executable file
View 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 GC
---Purpose: This class implements an elementary construction algorithm for
-- a scaling transformation in 3D space. The result is a
-- Geom_Transformation transformation.
-- A MakeScale object provides a framework for:
-- - defining the construction of the transformation,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses Pnt from gp,
Transformation from Geom,
Real from Standard
is
Create(Point : Pnt 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 Geom
is static;
---Purpose: Returns the constructed transformation.
---C++: return const&
Operator(me) returns Transformation from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Transformation() const;"
fields
TheScale : Transformation from Geom;
end MakeScale;

34
src/GC/GC_MakeScale.cxx Executable file
View File

@@ -0,0 +1,34 @@
// File: GC_MakeScale.cxx
// Created: Fri Oct 2 16:37:41 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeScale.ixx>
#include <GC_MakeScale.hxx>
#include <StdFail_NotDone.hxx>
//=========================================================================
// Creation d un homothetie de gp de centre Point et de rapport Scale. +
//=========================================================================
GC_MakeScale::GC_MakeScale(const gp_Pnt& Point ,
const Standard_Real Scale ) {
TheScale = new Geom_Transformation();
TheScale->SetScale(Point,Scale);
}
const Handle(Geom_Transformation)& GC_MakeScale::Value() const
{
return TheScale;
}
const Handle(Geom_Transformation)& GC_MakeScale::Operator() const
{
return TheScale;
}
GC_MakeScale::operator Handle(Geom_Transformation) () const
{
return TheScale;
}

66
src/GC/GC_MakeSegment.cdl Executable file
View File

@@ -0,0 +1,66 @@
-- File: MakeSegment.cdl
-- Created: Mon Sep 28 11:49:59 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeSegment from GC inherits Root from GC
--- Purpose: Implements construction algorithms for a line
-- segment in 3D space. The result is a Geom_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 Pnt from gp,
Real from Standard,
Lin from gp,
TrimmedCurve from Geom
raises NotDone from StdFail
is
Create(P1, P2 : Pnt from gp ) returns MakeSegment;
---Purpose: Make a segment of Line from the 2 points <P1> and <P2>.
-- It returns NullObject if <P1> and <P2> are confused.
Create(Line : Lin from gp ;
U1, U2 : Real from Standard ) returns MakeSegment;
---Purpose: Make a segment of Line from the line <Line1>
-- between the two parameters U1 and U2.
-- It returns NullObject if <U1> is equal <U2>.
Create(Line : Lin from gp ;
Point : Pnt from gp ;
Ulast : Real from Standard ) returns MakeSegment;
---Purpose: Make a segment of Line from the line <Line1>
-- between the point <Point> and the parameter Ulast.
-- It returns NullObject if <U1> is equal <U2>.
Create(Line : Lin from gp ;
P1 : Pnt from gp ;
P2 : Pnt from gp ) returns MakeSegment;
---Purpose: Make a segment of Line from the line <Line1>
-- between the two points <P1> and <P2>.
-- It returns NullObject if <U1> is equal <U2>.
Value(me) returns TrimmedCurve from Geom
raises NotDone
is static;
---Purpose: Returns the constructed line segment.
---C++: return const&
Operator(me) returns TrimmedCurve from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_TrimmedCurve() const;"
fields
TheSegment : TrimmedCurve from Geom;
--The solution from Geom.
end MakeSegment;

66
src/GC/GC_MakeSegment.cxx Executable file
View File

@@ -0,0 +1,66 @@
// File: GC_MakeSegment.cxx
// Created: Fri Oct 2 16:37:54 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeSegment.ixx>
#include <GC_MakeLine.hxx>
#include <Geom_Line.hxx>
#include <StdFail_NotDone.hxx>
#include <ElCLib.hxx>
GC_MakeSegment::GC_MakeSegment(const gp_Pnt& P1 ,
const gp_Pnt& P2 )
{
Standard_Real dist = P1.Distance(P2);
Handle(Geom_Line) L = GC_MakeLine(P1,P2);
TheSegment = new Geom_TrimmedCurve(L,0.,dist,Standard_True);
TheError = gce_Done;
}
GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line ,
const gp_Pnt& Point ,
const Standard_Real U )
{
Standard_Real Ufirst = ElCLib::Parameter(Line,Point);
Handle(Geom_Line) L = new Geom_Line(Line);
TheSegment=new Geom_TrimmedCurve(L,Ufirst,U,Standard_True);
TheError = gce_Done;
}
GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line ,
const gp_Pnt& P1 ,
const gp_Pnt& P2 )
{
Standard_Real Ufirst = ElCLib::Parameter(Line,P1);
Standard_Real Ulast = ElCLib::Parameter(Line,P2);
Handle(Geom_Line) L = new Geom_Line(Line);
TheSegment = new Geom_TrimmedCurve(L,Ufirst,Ulast,Standard_True);
TheError = gce_Done;
}
GC_MakeSegment::GC_MakeSegment(const gp_Lin& Line ,
const Standard_Real U1 ,
const Standard_Real U2 )
{
Handle(Geom_Line) L = new Geom_Line(Line);
TheSegment = new Geom_TrimmedCurve(L,U1,U2,Standard_True);
TheError = gce_Done;
}
const Handle(Geom_TrimmedCurve)& GC_MakeSegment::Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheSegment;
}
const Handle(Geom_TrimmedCurve)& GC_MakeSegment::Operator() const
{
return Value();
}
GC_MakeSegment::operator Handle(Geom_TrimmedCurve) () const
{
return Value();
}

48
src/GC/GC_MakeTranslation.cdl Executable file
View File

@@ -0,0 +1,48 @@
-- File: MakeTranslation.cdl
-- Created: Mon Sep 28 11:52:25 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeTranslation
from GC
---Purpose: This class mplements elementary construction algorithms for a
-- translation in 3D space. The result is a
-- Geom_Transformation transformation.
-- A MakeTranslation object provides a framework for:
-- - defining the construction of the transformation,
-- - implementing the construction algorithm, and
-- - consulting the result.
uses Pnt from gp,
Transformation from Geom,
Vec from gp,
Real from Standard
is
Create(Vect : Vec from gp) returns MakeTranslation;
---Purpose: Constructs a translation along the vector " Vect "
Create(Point1 : Pnt from gp;
Point2 : Pnt 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 Geom
is static;
---Purpose: Returns the constructed transformation.
---C++: return const&
Operator(me) returns Transformation from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_Transformation() const;"
fields
TheTranslation : Transformation from Geom;
end MakeTranslation;

44
src/GC/GC_MakeTranslation.cxx Executable file
View File

@@ -0,0 +1,44 @@
// File: GC_MakeTranslation.cxx
// Created: Fri Oct 2 16:38:15 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeTranslation.ixx>
#include <GC_MakeTranslation.hxx>
#include <StdFail_NotDone.hxx>
//=========================================================================
// Creation d une translation 3d de Geom de vecteur de tanslation Vec. +
//=========================================================================
GC_MakeTranslation::GC_MakeTranslation(const gp_Vec& Vec ) {
TheTranslation = new Geom_Transformation();
TheTranslation->SetTranslation(Vec);
}
//=========================================================================
// Creation d une translation 3d de Geom de vecteur de tanslation le +
// vecteur reliant Point1 a Point2. +
//=========================================================================
GC_MakeTranslation::GC_MakeTranslation(const gp_Pnt& Point1 ,
const gp_Pnt& Point2 ) {
TheTranslation = new Geom_Transformation();
TheTranslation->SetTranslation(Point1,Point2);
}
const Handle(Geom_Transformation)& GC_MakeTranslation::Value() const
{
return TheTranslation;
}
const Handle(Geom_Transformation)& GC_MakeTranslation::Operator() const
{
return TheTranslation;
}
GC_MakeTranslation::operator Handle(Geom_Transformation) () const
{
return TheTranslation;
}

75
src/GC/GC_MakeTrimmedCone.cdl Executable file
View File

@@ -0,0 +1,75 @@
-- File: MakeTrimmedCone.cdl
-- Created: Mon Sep 28 11:52:10 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeTrimmedCone from GC inherits Root from GC
--- Purpose: Implements construction algorithms for a trimmed
-- cone limited by two planes orthogonal to its axis. The
-- result is a Geom_RectangularTrimmedSurface surface.
-- A MakeTrimmedCone provides a framework for:
-- - defining the construction of the trimmed cone,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed trimmed cone.
uses Pnt from gp,
Ax1 from gp,
Lin from gp,
Cone from gp,
RectangularTrimmedSurface from Geom,
Real from Standard
raises NotDone from StdFail
is
Create(P1,P2,P3,P4 : Pnt from gp ) returns MakeTrimmedCone;
---Purpose: Make a RectangularTrimmedSurface <TheCone> from Geom
-- It is trimmed by P3 and P4.
-- Its axis is <P1P2> and the radius of its base is
-- the distance between <P3> and <P1P2>.
-- The distance between <P4> and <P1P2> is the radius of
-- the section passing through <P4>.
-- An error iss raised if <P1>,<P2>,<P3>,<P4> are
-- colinear or if <P3P4> is perpendicular to <P1P2> or
-- <P3P4> is colinear to <P1P2>.
Create(P1,P2 : Pnt from gp ;
R1,R2 : Real from Standard) returns MakeTrimmedCone;
---Purpose : Make a RectangularTrimmedSurface from Geom <TheCone>
-- from a cone and trimmed by two points P1 and P2 and
-- the two radius <R1> and <R2> of the sections passing
-- through <P1> an <P2>.
-- Warning
-- If an error occurs (that is, when IsDone returns
-- false), the Status function returns:
-- - gce_ConfusedPoints if points P1 and P2, or P3 and P4, are coincident;
-- - gce_NullAngle if:
-- - the lines joining P1 to P2 and P3 to P4 are parallel, or
-- - R1 and R2 are equal (i.e. their difference is less than gp::Resolution());
-- - gce_NullRadius if:
-- - the line joining P1 to P2 is perpendicular to the line joining P3 to P4, or
-- - the points P1, P2, P3 and P4 are collinear;
-- - gce_NegativeRadius if R1 or R2 is negative; or
-- - gce_NullAxis if points P1 and P2 are coincident (2nd syntax only).
Value(me) returns RectangularTrimmedSurface from Geom
raises NotDone
is static;
---Purpose: Returns the constructed trimmed cone.
-- StdFail_NotDone if no trimmed cone is constructed.
---C++: return const&
Operator(me) returns RectangularTrimmedSurface from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_RectangularTrimmedSurface() const;"
fields
TheCone : RectangularTrimmedSurface from Geom;
--The solution from Geom.
end MakeTrimmedCone;

80
src/GC/GC_MakeTrimmedCone.cxx Executable file
View File

@@ -0,0 +1,80 @@
// File: GC_MakeTrimmedCone.cxx
// Created: Fri Oct 2 16:38:33 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeTrimmedCone.ixx>
#include <GC_MakeConicalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <Geom_ConicalSurface.hxx>
#include <gp_Dir.hxx>
#include <gp_Lin.hxx>
#include <gp_Pnt.hxx>
#include <Extrema_ExtPElC.hxx>
//=========================================================================
// Creation d un cone par quatre points. +
// les deux premiers donnent l axe. +
// le troisieme donne le rayon de la base. +
// le troisieme et le quatrieme le demi angle. +
//=========================================================================
GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 ,
const gp_Pnt& P4 )
{
GC_MakeConicalSurface Cone(P1,P2,P3,P4);
TheError = Cone.Status();
if (TheError == gce_Done) {
gp_Dir D1(P2.XYZ()-P1.XYZ());
gp_Lin L1(P1,D1);
Extrema_ExtPElC ext1(P3,L1,1.0e-7,-2.0e+100,+2.0e+100);
Extrema_ExtPElC ext2(P4,L1,1.0e-7,-2.0e+100,+2.0e+100);
gp_Pnt P5 = ext1.Point(1).Value();
gp_Pnt P6 = ext2.Point(1).Value();
Standard_Real D = P6.Distance(P5)/cos((Cone.Value())->SemiAngle());
TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True);
}
}
//=========================================================================
//=========================================================================
GC_MakeTrimmedCone::GC_MakeTrimmedCone(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const Standard_Real R1 ,
const Standard_Real R2 )
{
GC_MakeConicalSurface Cone(P1,P2,R1,R2);
TheError = Cone.Status();
if (TheError == gce_Done) {
Standard_Real D = (P2.Distance(P1))/cos((Cone.Value())->SemiAngle());
TheCone=new Geom_RectangularTrimmedSurface(Cone.Value(),0.,2.*PI,0.,D,Standard_True,Standard_True);
}
}
//=======================================================================
//function : Value
//purpose :
//=======================================================================
const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCone::
Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheCone;
}
const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCone::
Operator() const
{
return Value();
}
GC_MakeTrimmedCone::
operator Handle(Geom_RectangularTrimmedSurface) () const
{
return Value();
}

View File

@@ -0,0 +1,97 @@
-- File: MakeTrimmedCylinder.cdl
-- Created: Mon Sep 28 11:51:57 1992
-- Author: Remi GILET
-- <reg@sdsun2>
---Copyright: Matra Datavision 1992
class MakeTrimmedCylinder from GC inherits Root from GC
--- Purpose: Implements construction algorithms for a trimmed
-- cylinder limited by two planes orthogonal to its axis.
-- The result is a Geom_RectangularTrimmedSurface surface.
-- A MakeTrimmedCylinder provides a framework for:
-- - defining the construction of the trimmed cylinder,
-- - implementing the construction algorithm, and
-- - consulting the results. In particular, the Value
-- function returns the constructed trimmed cylinder.
uses Pnt from gp,
Ax1 from gp,
Lin from gp,
Cylinder from gp,
Circ from gp,
RectangularTrimmedSurface from Geom,
Real from Standard
raises NotDone from StdFail
is
Create(P1,P2,P3 : Pnt from gp ) returns MakeTrimmedCylinder;
---Purpose: Make a cylindricalSurface <Cyl> from Geom
-- Its axis is is <P1P2> and its radius is the distance
-- between <P3> and <P1P2>.
-- The height is the distance between P1 and P2.
Create(Circ : Circ from gp ;
Height : Real from Standard ) returns MakeTrimmedCylinder;
---Purpose: Make a cylindricalSurface <Cyl> from gp by its base <Circ>.
-- Its axis is the normal to the plane defined bi <Circ>.
-- <Height> can be greater than zero or lower than zero.
-- In the first case the V parametric direction of the
-- result has the same orientation as the normal to <Circ>.
-- In the other case it has the opposite orientation.
Create(A1 : Ax1 from gp ;
Radius : Real from Standard ;
Height : Real from Standard ) returns MakeTrimmedCylinder;
---Purpose: Make a cylindricalSurface <Cyl> from gp by its
-- axis <A1> and its radius <Radius>.
-- It returns NullObject if <Radius> is lower than zero.
-- <Height> can be greater than zero or lower than zero.
-- In the first case the V parametric direction of the
-- result has the same orientation as <A1>.
-- In the other case it has the opposite orientation.
Create(Cyl : Cylinder from gp ;
P : Pnt from gp ;
Height : Real from Standard ) returns MakeTrimmedCylinder;
---Purpose: Make a RectangularTrimmedSurface <Cylinder> from gp by
-- a cylinder from gp.
-- It is trimmed by the point <P> and the heigh <Heigh>.
-- <Height> can be greater than zero or lower than zero.
-- in the first case the limit section is in the side of
-- the positives V paramters of <Cyl> and in the other
-- side if <Heigh> is lower than zero.
Create(Cyl : Cylinder from gp ;
P1,P2 : Pnt from gp ) returns MakeTrimmedCylinder;
---Purpose: Make a RectangularTrimmedSurface <Cylinder> from gp by
-- a cylinder from gp.
-- It is trimmed by the two points <P1> and <P2>.
-- Warning
-- 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_ConfusedPoints if the points P1 and P2 are coincident.
-- - gce_ColinearPoints if the points P1, P2 and P3 are collinear.
Value(me) returns RectangularTrimmedSurface from Geom
raises NotDone
is static;
---Purpose: Returns the constructed trimmed cylinder.
-- Exceptions
-- StdFail_NotDone if no trimmed cylinder is constructed.
---C++: return const&
Operator(me) returns RectangularTrimmedSurface from Geom
is static;
---C++: return const&
---C++: alias "Standard_EXPORT operator Handle_Geom_RectangularTrimmedSurface() const;"
fields
TheCyl : RectangularTrimmedSurface from Geom;
--The solution from Geom.
end MakeTrimmedCylinder;

View File

@@ -0,0 +1,89 @@
// File: GC_MakeTrimmedCylinder.cxx
// Created: Fri Oct 2 16:38:49 1992
// Author: Remi GILET
// <reg@topsn3>
#include <GC_MakeTrimmedCylinder.ixx>
#include <GC_MakeCylindricalSurface.hxx>
#include <StdFail_NotDone.hxx>
#include <Standard_NotImplemented.hxx>
//=========================================================================
// Creation d un cylindre limite par trois points <P1>, <P2> et <P3>. +
// le cylindre resultat a comme hauteur la distance de <P1> a <P2>. +
// Il a comme rayon la distance de <P3> a l axe <P1P2>. +
//=========================================================================
GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Pnt& P1 ,
const gp_Pnt& P2 ,
const gp_Pnt& P3 )
{
GC_MakeCylindricalSurface Cyl(P1,P2,P3);
TheError = Cyl.Status();
if (TheError == gce_Done) {
TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
P2.Distance(P1),Standard_True,Standard_True);
}
}
//=========================================================================
// Creation d un cylindre limite par un cercle et une hauteur. +
//=========================================================================
GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Circ& Circ ,
const Standard_Real Height ) {
GC_MakeCylindricalSurface Cyl(Circ);
TheError = Cyl.Status();
if (TheError == gce_Done) {
TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
Height,Standard_True,Standard_True);
}
}
//=========================================================================
//=========================================================================
GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Ax1& A1 ,
const Standard_Real Radius ,
const Standard_Real Height ) {
GC_MakeCylindricalSurface Cyl(A1,Radius);
TheError = Cyl.Status();
if (TheError == gce_Done) {
TheCyl = new Geom_RectangularTrimmedSurface(Cyl.Value(),0.,2.*PI,0.,
Height,Standard_True,Standard_True);
}
}
GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl,
const gp_Pnt& , // P,
const Standard_Real )//Height)
{
Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder");
}
GC_MakeTrimmedCylinder::GC_MakeTrimmedCylinder(const gp_Cylinder& , // Cyl,
const gp_Pnt& , // P1,
const gp_Pnt& ) // P2)
{
Standard_NotImplemented::Raise("GC_MakeTrimmedCylinder");
}
const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCylinder::
Value() const
{
StdFail_NotDone_Raise_if(!TheError == gce_Done,"");
return TheCyl;
}
const Handle(Geom_RectangularTrimmedSurface)& GC_MakeTrimmedCylinder::
Operator() const
{
return Value();
}
GC_MakeTrimmedCylinder::
operator Handle(Geom_RectangularTrimmedSurface) () const
{
return Value();
}

37
src/GC/GC_Root.cdl Executable file
View 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 GC
---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;
---Purpose: Returns true if the construction is successful.
---C++: inline
Status(me) returns ErrorType from gce
is static;
---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.
---C++: inline
fields
TheError : ErrorType from gce is protected;
---Purpose: This enumeration lets know why the algorithm has not succeed.
end Root;

1
src/GC/GC_Root.cxx Executable file
View File

@@ -0,0 +1 @@
#include <GC_Root.ixx>

27
src/GC/GC_Root.lxx Executable file
View File

@@ -0,0 +1,27 @@
// File: GC_Root.cxx
// Created: Tue Sep 29 12:34:39 1992
// Author: Remi GILET
// <reg@sdsun2>
inline Standard_Boolean GC_Root::IsDone () const
{
return TheError == gce_Done;
}
inline gce_ErrorType GC_Root::Status() const
{
return TheError;
}