diff --git a/adm/UDLIST b/adm/UDLIST index 52144951f2..c24cc57fe3 100644 --- a/adm/UDLIST +++ b/adm/UDLIST @@ -171,7 +171,6 @@ p MAT p MAT2d p NLPlate p Plate -p Primitives p ShapeAlgo p ShapeAnalysis p ShapeBuild diff --git a/src/BRepPrim/BRepPrim.cdl b/src/BRepPrim/BRepPrim.cdl index 76d216fedf..a4d78e58b0 100644 --- a/src/BRepPrim/BRepPrim.cdl +++ b/src/BRepPrim/BRepPrim.cdl @@ -41,20 +41,18 @@ uses gp, Geom2d, Geom, - Primitives, TopoDS, BRep is + enumeration Direction is + ---Purpose: + XMin, XMax, YMin, YMax, ZMin, ZMax + end Direction; + class Builder; - - deferred class OneAxis instantiates OneAxis from Primitives( - Shell from TopoDS, - Face from TopoDS, - Wire from TopoDS, - Edge from TopoDS, - Vertex from TopoDS, - Builder from BRepPrim); + + deferred class OneAxis; class Revolution; @@ -66,13 +64,7 @@ is class Torus; - class GWedge instantiates Wedge from Primitives( - Shell from TopoDS, - Face from TopoDS, - Wire from TopoDS, - Edge from TopoDS, - Vertex from TopoDS, - Builder from BRepPrim); + class GWedge; class Wedge; diff --git a/src/Primitives/Primitives_Wedge.cdl b/src/BRepPrim/BRepPrim_GWedge.cdl similarity index 77% rename from src/Primitives/Primitives_Wedge.cdl rename to src/BRepPrim/BRepPrim_GWedge.cdl index 23bb97d75c..dea577ed97 100644 --- a/src/Primitives/Primitives_Wedge.cdl +++ b/src/BRepPrim/BRepPrim_GWedge.cdl @@ -14,13 +14,8 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class Wedge from Primitives( - TheShell as any; - TheFace as any; - TheWire as any; - TheEdge as any; - TheVertex as any; - TheBuilder as any) +class GWedge from BRepPrim + ---Purpose: A wedge is defined by : -- @@ -45,21 +40,27 @@ generic class Wedge from Primitives( uses - Direction from Primitives, + Direction from BRepPrim, - Ax2 from gp, - Pln from gp, - Lin from gp, - Pnt from gp + Ax2 from gp, + Pln from gp, + Lin from gp, + Pnt from gp, + Shell from TopoDS, + Face from TopoDS, + Wire from TopoDS, + Edge from TopoDS, + Vertex from TopoDS, + Builder from BRepPrim raises DomainError, OutOfRange is - Create(B : TheBuilder; Axes : Ax2 from gp; dx, dy, dz : Real) - returns Wedge from Primitives - ---Purpose: Creates a Wedge algorithm. is the axis + Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz : Real) + returns GWedge from BRepPrim + ---Purpose: Creates a GWedge algorithm. is the axis -- system for the primitive. -- -- XMin, YMin, ZMin are set to 0 @@ -72,9 +73,9 @@ is -- dx,dy,dz should be positive raises DomainError; - Create(B : TheBuilder; Axes : Ax2 from gp; dx, dy, dz, ltx : Real) - returns Wedge from Primitives - ---Purpose: Creates a Wedge primitive. is the axis + Create(B : Builder from BRepPrim; Axes : Ax2 from gp; dx, dy, dz, ltx : Real) + returns GWedge from BRepPrim + ---Purpose: Creates a GWedge primitive. is the axis -- system for the primitive. -- -- XMin, YMin, ZMin are set to 0 @@ -88,10 +89,10 @@ is -- ltx should not be negative raises DomainError; - Create(B : TheBuilder; Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min, + Create(B : Builder from BRepPrim; Axes : Ax2 from gp; xmin, ymin, zmin, z2min, x2min, xmax, ymax, zmax, z2max, x2max : Real) - returns Wedge from Primitives - ---Purpose: Create a Wedge primitive. is the axis + returns GWedge from BRepPrim + ---Purpose: Create a GWedge primitive. is the axis -- system for the primitive. -- -- all the fields are set to the corresponding value @@ -143,80 +144,80 @@ is ---Purpose: Returns X2Max value from . is static; - Open(me : in out; d1 : Direction from Primitives) + Open(me : in out; d1 : Direction from BRepPrim) ---Purpose: Opens in direction. A face and its edges -- or vertices are said nonexistant. raises DomainError is static; - Close(me : in out; d1 : Direction from Primitives) + Close(me : in out; d1 : Direction from BRepPrim) ---Purpose: Closes in direction. A face and its -- edges or vertices are said existant. raises DomainError is static; - IsInfinite(me; d1 : Direction from Primitives) + IsInfinite(me; d1 : Direction from BRepPrim) ---Purpose: Returns True if is open in direction. returns Boolean; - Shell(me : in out) returns TheShell + Shell(me : in out) returns Shell from TopoDS ---Purpose: Returns the Shell containing the Faces of . -- ---C++: return const & is static; - HasFace(me; d1 : Direction from Primitives) + HasFace(me; d1 : Direction from BRepPrim) ---Purpose: Returns True if has a Face in direction. returns Boolean; - Face(me : in out; d1 : Direction from Primitives) returns TheFace + Face(me : in out; d1 : Direction from BRepPrim) returns Face from TopoDS ---Purpose: Returns the Face of located in direction. -- ---C++: return const & raises DomainError is static; - Plane(me : in out; d1 : Direction from Primitives) returns Pln from gp + Plane(me : in out; d1 : Direction from BRepPrim) returns Pln from gp ---Purpose: Returns the plane of the Face of located in -- direction. raises DomainError is static; - HasWire(me; d1 : Direction from Primitives) + HasWire(me; d1 : Direction from BRepPrim) ---Purpose: Returns True if has a Wire in direction. returns Boolean; - Wire(me : in out; d1 : Direction from Primitives) returns TheWire + Wire(me : in out; d1 : Direction from BRepPrim) returns Wire from TopoDS ---Purpose: Returns the Wire of located in direction. -- ---C++: return const & raises DomainError is static; - HasEdge(me; d1, d2 : Direction from Primitives) + HasEdge(me; d1, d2 : Direction from BRepPrim) ---Purpose: Returns True if has an Edge in direction. returns Boolean; - Edge(me : in out; d1, d2 : Direction from Primitives) returns TheEdge + Edge(me : in out; d1, d2 : Direction from BRepPrim) returns Edge from TopoDS ---Purpose: Returns the Edge of located in direction. -- ---C++: return const & raises DomainError is static; - Line(me : in out; d1, d2 : Direction from Primitives) returns Lin from gp + Line(me : in out; d1, d2 : Direction from BRepPrim) returns Lin from gp ---Purpose: Returns the line of the Edge of located in -- direction. raises DomainError is static; - HasVertex(me; d1, d2, d3 : Direction from Primitives) + HasVertex(me; d1, d2, d3 : Direction from BRepPrim) ---Purpose: Returns True if has a Vertex in -- direction. returns Boolean; - Vertex(me : in out; d1, d2, d3 : Direction from Primitives) - returns TheVertex + Vertex(me : in out; d1, d2, d3 : Direction from BRepPrim) + returns Vertex from TopoDS ---Purpose: Returns the Vertex of located in -- direction. -- @@ -224,7 +225,7 @@ is raises DomainError is static; - Point(me : in out; d1, d2, d3 : Direction from Primitives) + Point(me : in out; d1, d2, d3 : Direction from BRepPrim) returns Pnt from gp ---Purpose: Returns the point of the Vertex of located in -- direction. @@ -232,7 +233,7 @@ is is static; fields - myBuilder : TheBuilder; + myBuilder : Builder from BRepPrim; myAxes : Ax2 from gp; XMin : Real; @@ -248,10 +249,10 @@ fields -- the Topology - myShell : TheShell; + myShell : Shell from TopoDS; ShellBuilt : Boolean; - myVertices : TheVertex [8]; + myVertices : Vertex from TopoDS [8]; -- 0 : xmin ymin zmin -- 1 : xmax ymin zmin -- 2 : xmin ymax zmin @@ -262,7 +263,7 @@ fields -- 7 : xmax ymax zmax VerticesBuilt : Boolean [8]; - myEdges : TheEdge [12]; + myEdges : Edge from TopoDS [12]; -- 0 : xmin ymin -- 1 : xmax ymin -- 2 : xmin ymax @@ -277,7 +278,7 @@ fields -- 11 : zmax xmax EdgesBuilt : Boolean [12]; - myWires : TheWire [6]; + myWires : Wire from TopoDS [6]; -- 0 : xmin -- 1 : xmax -- 2 : ymin @@ -286,7 +287,7 @@ fields -- 5 : zmax WiresBuilt : Boolean [6]; - myFaces : TheFace [6]; + myFaces : Face from TopoDS [6]; -- 0 : xmin -- 1 : xmax -- 2 : ymin @@ -303,4 +304,4 @@ fields -- 4 : zmin -- 5 : zmax -end Wedge; +end GWedge; diff --git a/src/Primitives/Primitives_Wedge.gxx b/src/BRepPrim/BRepPrim_GWedge.cxx similarity index 72% rename from src/Primitives/Primitives_Wedge.gxx rename to src/BRepPrim/BRepPrim_GWedge.cxx index d802c176ec..f4ced3893a 100644 --- a/src/Primitives/Primitives_Wedge.gxx +++ b/src/BRepPrim/BRepPrim_GWedge.cxx @@ -14,6 +14,8 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include @@ -21,6 +23,14 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + #include #include @@ -45,41 +55,41 @@ static const Standard_Integer tab[6][6] = {{-1,-1, 0, 1, 8, 9}, { 9,11, 5, 7,-1,-1}}; //======================================================================= -//function : Primitives_Wedge_NumDir1 +//function : BRepPrim_Wedge_NumDir1 //purpose : when giving a direction return the range of the face //======================================================================= -static Standard_Integer Primitives_Wedge_NumDir1 - (const Primitives_Direction d1) { return num[d1]; } +static Standard_Integer BRepPrim_Wedge_NumDir1 + (const BRepPrim_Direction d1) { return num[d1]; } //======================================================================= -//function : Primitives_Wedge_NumDir2 +//function : BRepPrim_Wedge_NumDir2 //purpose : when giving two directions return the range of the edge //======================================================================= -static Standard_Integer Primitives_Wedge_NumDir2 - (const Primitives_Direction d1, - const Primitives_Direction d2) +static Standard_Integer BRepPrim_Wedge_NumDir2 + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2) { - Standard_Integer i1 = Primitives_Wedge_NumDir1(d1); - Standard_Integer i2 = Primitives_Wedge_NumDir1(d2); + Standard_Integer i1 = BRepPrim_Wedge_NumDir1(d1); + Standard_Integer i2 = BRepPrim_Wedge_NumDir1(d2); if ( i1/2 == i2/2 ) Standard_DomainError::Raise(); return tab[i1][i2]; } //======================================================================= -//function : Primitives_Wedge_NumDir3 +//function : BRepPrim_Wedge_NumDir3 //purpose : when giving three directions return the range of the vertex //======================================================================= -static Standard_Integer Primitives_Wedge_NumDir3 - (const Primitives_Direction d1, - const Primitives_Direction d2, - const Primitives_Direction d3) +static Standard_Integer BRepPrim_Wedge_NumDir3 + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2, + const BRepPrim_Direction d3) { - Standard_Integer i1 = Primitives_Wedge_NumDir1(d1); - Standard_Integer i2 = Primitives_Wedge_NumDir1(d2); - Standard_Integer i3 = Primitives_Wedge_NumDir1(d3); + Standard_Integer i1 = BRepPrim_Wedge_NumDir1(d1); + Standard_Integer i2 = BRepPrim_Wedge_NumDir1(d2); + Standard_Integer i3 = BRepPrim_Wedge_NumDir1(d3); if (( i1/2 == i2/2 ) || ( i2/2 == i3/2 ) || ( i3/2 == i1/2 )) Standard_DomainError::Raise(); @@ -87,11 +97,11 @@ static Standard_Integer Primitives_Wedge_NumDir3 } //======================================================================= -//function : Primitives_Wedge_Check +//function : BRepPrim_Wedge_Check //purpose : raise Standard_DomainError if something was built //======================================================================= -static void Primitives_Wedge_Check(const Standard_Boolean V[], +static void BRepPrim_Wedge_Check(const Standard_Boolean V[], const Standard_Boolean E[], const Standard_Boolean W[], const Standard_Boolean F[]) @@ -108,11 +118,11 @@ static void Primitives_Wedge_Check(const Standard_Boolean V[], } //======================================================================= -//function : Primitives_Wedge_Init +//function : BRepPrim_Wedge_Init //purpose : Set arrays to Standard_False //======================================================================= -static void Primitives_Wedge_Init(Standard_Boolean& S, +static void BRepPrim_Wedge_Init(Standard_Boolean& S, Standard_Boolean V[], Standard_Boolean E[], Standard_Boolean W[], @@ -131,11 +141,11 @@ static void Primitives_Wedge_Init(Standard_Boolean& S, } //======================================================================= -//function : Primitives_Wedge +//function : BRepPrim_GWedge //purpose : build a box //======================================================================= -Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, +BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, @@ -158,16 +168,16 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, ( dy <= Precision::Confusion() ) || ( dz <= Precision::Confusion() ) ) Standard_DomainError::Raise(); - Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, + BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, WiresBuilt,FacesBuilt); } //======================================================================= -//function : Primitives_Wedge +//function : BRepPrim_GWedge //purpose : build a STEP wedge //======================================================================= -Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, +BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real dx, const Standard_Real dy, @@ -192,16 +202,16 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, ( dz <= Precision::Confusion() ) || ( ltx < 0 ) ) Standard_DomainError::Raise(); - Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, + BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, WiresBuilt,FacesBuilt); } //======================================================================= -//function : Primitives_Wedge +//function : BRepPrim_GWedge //purpose : build a wedge by giving all the fields //======================================================================= -Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, +BRepPrim_GWedge::BRepPrim_GWedge (const BRepPrim_Builder& B, const gp_Ax2& Axes, const Standard_Real xmin, const Standard_Real ymin, @@ -233,7 +243,7 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, ( Z2Max-Z2Min < 0 ) || ( X2Max-X2Min < 0 ) ) Standard_DomainError::Raise(); - Primitives_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, + BRepPrim_Wedge_Init(ShellBuilt,VerticesBuilt,EdgesBuilt, WiresBuilt,FacesBuilt); } @@ -244,27 +254,27 @@ Primitives_Wedge::Primitives_Wedge (const TheBuilder& B, //purpose : trivial //======================================================================= -gp_Ax2 Primitives_Wedge::Axes () const { return myAxes; } -Standard_Real Primitives_Wedge::GetXMin () const { return XMin; } -Standard_Real Primitives_Wedge::GetYMin () const { return YMin; } -Standard_Real Primitives_Wedge::GetZMin () const { return ZMin; } -Standard_Real Primitives_Wedge::GetZ2Min () const { return Z2Min; } -Standard_Real Primitives_Wedge::GetX2Min () const { return X2Min; } -Standard_Real Primitives_Wedge::GetXMax () const { return XMax; } -Standard_Real Primitives_Wedge::GetYMax () const { return YMax; } -Standard_Real Primitives_Wedge::GetZMax () const { return ZMax; } -Standard_Real Primitives_Wedge::GetZ2Max () const { return Z2Max; } -Standard_Real Primitives_Wedge::GetX2Max () const { return X2Max; } +gp_Ax2 BRepPrim_GWedge::Axes () const { return myAxes; } +Standard_Real BRepPrim_GWedge::GetXMin () const { return XMin; } +Standard_Real BRepPrim_GWedge::GetYMin () const { return YMin; } +Standard_Real BRepPrim_GWedge::GetZMin () const { return ZMin; } +Standard_Real BRepPrim_GWedge::GetZ2Min () const { return Z2Min; } +Standard_Real BRepPrim_GWedge::GetX2Min () const { return X2Min; } +Standard_Real BRepPrim_GWedge::GetXMax () const { return XMax; } +Standard_Real BRepPrim_GWedge::GetYMax () const { return YMax; } +Standard_Real BRepPrim_GWedge::GetZMax () const { return ZMax; } +Standard_Real BRepPrim_GWedge::GetZ2Max () const { return Z2Max; } +Standard_Real BRepPrim_GWedge::GetX2Max () const { return X2Max; } //======================================================================= //function : Open //purpose : trivial //======================================================================= -void Primitives_Wedge::Open (const Primitives_Direction d1) +void BRepPrim_GWedge::Open (const BRepPrim_Direction d1) { - Primitives_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); - myInfinite[Primitives_Wedge_NumDir1(d1)] = Standard_True; + BRepPrim_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + myInfinite[BRepPrim_Wedge_NumDir1(d1)] = Standard_True; } //======================================================================= @@ -272,10 +282,10 @@ void Primitives_Wedge::Open (const Primitives_Direction d1) //purpose : trivial //======================================================================= -void Primitives_Wedge::Close (const Primitives_Direction d1) +void BRepPrim_GWedge::Close (const BRepPrim_Direction d1) { - Primitives_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); - myInfinite[Primitives_Wedge_NumDir1(d1)] = Standard_False; + BRepPrim_Wedge_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + myInfinite[BRepPrim_Wedge_NumDir1(d1)] = Standard_False; } //======================================================================= @@ -283,30 +293,30 @@ void Primitives_Wedge::Close (const Primitives_Direction d1) //purpose : true if it is open in the given direction //======================================================================= -Standard_Boolean Primitives_Wedge::IsInfinite (const Primitives_Direction d1) const -{ return myInfinite[Primitives_Wedge_NumDir1(d1)]; } +Standard_Boolean BRepPrim_GWedge::IsInfinite (const BRepPrim_Direction d1) const +{ return myInfinite[BRepPrim_Wedge_NumDir1(d1)]; } //======================================================================= //function : Shell //purpose : //======================================================================= -const TheShell& Primitives_Wedge::Shell() { +const TopoDS_Shell& BRepPrim_GWedge::Shell() { if (!ShellBuilt) { myBuilder.MakeShell(myShell); - if (HasFace(Primitives_XMin)) - myBuilder.AddShellFace(myShell,Face(Primitives_XMin)); - if (HasFace(Primitives_XMax)) - myBuilder.AddShellFace(myShell,Face(Primitives_XMax)); - if (HasFace(Primitives_YMin)) - myBuilder.AddShellFace(myShell,Face(Primitives_YMin)); - if (HasFace(Primitives_YMax)) - myBuilder.AddShellFace(myShell,Face(Primitives_YMax)); - if (HasFace(Primitives_ZMin)) - myBuilder.AddShellFace(myShell,Face(Primitives_ZMin)); - if (HasFace(Primitives_ZMax)) - myBuilder.AddShellFace(myShell,Face(Primitives_ZMax)); + if (HasFace(BRepPrim_XMin)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_XMin)); + if (HasFace(BRepPrim_XMax)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_XMax)); + if (HasFace(BRepPrim_YMin)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_YMin)); + if (HasFace(BRepPrim_YMax)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_YMax)); + if (HasFace(BRepPrim_ZMin)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_ZMin)); + if (HasFace(BRepPrim_ZMax)) + myBuilder.AddShellFace(myShell,Face(BRepPrim_ZMax)); myBuilder.CompleteShell(myShell); ShellBuilt = Standard_True; @@ -319,10 +329,10 @@ const TheShell& Primitives_Wedge::Shell() { //purpose : true if the face exist in one direction //======================================================================= -Standard_Boolean Primitives_Wedge::HasFace (const Primitives_Direction d1) const +Standard_Boolean BRepPrim_GWedge::HasFace (const BRepPrim_Direction d1) const { - Standard_Boolean state = !myInfinite[Primitives_Wedge_NumDir1(d1)]; - if ( d1 == Primitives_YMax ) state = state && ( Z2Max != Z2Min ) + Standard_Boolean state = !myInfinite[BRepPrim_Wedge_NumDir1(d1)]; + if ( d1 == BRepPrim_YMax ) state = state && ( Z2Max != Z2Min ) && ( X2Max != X2Min ); return state; } @@ -332,10 +342,10 @@ Standard_Boolean Primitives_Wedge::HasFace (const Primitives_Direction d1) const //purpose : //======================================================================= -gp_Pln Primitives_Wedge::Plane(const Primitives_Direction d1) +gp_Pln BRepPrim_GWedge::Plane(const BRepPrim_Direction d1) { - Standard_Integer i = Primitives_Wedge_NumDir1(d1); + Standard_Integer i = BRepPrim_Wedge_NumDir1(d1); gp_Dir D; gp_Vec VX = myAxes.XDirection(); @@ -422,11 +432,11 @@ gp_Pln Primitives_Wedge::Plane(const Primitives_Direction d1) //purpose : the face in one direction //======================================================================= -const TheFace& Primitives_Wedge::Face - (const Primitives_Direction d1) +const TopoDS_Face& BRepPrim_GWedge::Face + (const BRepPrim_Direction d1) { - Standard_Integer i = Primitives_Wedge_NumDir1(d1); + Standard_Integer i = BRepPrim_Wedge_NumDir1(d1); if (!FacesBuilt[i]) { gp_Pln P = Plane(d1); @@ -436,33 +446,33 @@ const TheFace& Primitives_Wedge::Face // pcurves - Primitives_Direction dd1 = Primitives_ZMin, dd2 = Primitives_YMax, - dd3 = Primitives_ZMax,dd4 = Primitives_YMin; + BRepPrim_Direction dd1 = BRepPrim_ZMin, dd2 = BRepPrim_YMax, + dd3 = BRepPrim_ZMax,dd4 = BRepPrim_YMin; switch (i/2) { case 0 : // XMin XMax - dd1 = Primitives_ZMin; - dd2 = Primitives_YMax; - dd3 = Primitives_ZMax; - dd4 = Primitives_YMin; + dd1 = BRepPrim_ZMin; + dd2 = BRepPrim_YMax; + dd3 = BRepPrim_ZMax; + dd4 = BRepPrim_YMin; break; case 1 : // YMin YMax - dd1 = Primitives_XMin; - dd2 = Primitives_ZMax; - dd3 = Primitives_XMax; - dd4 = Primitives_ZMin; + dd1 = BRepPrim_XMin; + dd2 = BRepPrim_ZMax; + dd3 = BRepPrim_XMax; + dd4 = BRepPrim_ZMin; break; case 2 : // ZMin ZMax - dd1 = Primitives_YMin; - dd2 = Primitives_XMax; - dd3 = Primitives_YMax; - dd4 = Primitives_XMin; + dd1 = BRepPrim_YMin; + dd2 = BRepPrim_XMax; + dd3 = BRepPrim_YMax; + dd4 = BRepPrim_XMin; break; }; @@ -476,7 +486,7 @@ const TheFace& Primitives_Wedge::Face ElSLib::Parameters(P,L.Location(),U,V); DU = L.Direction() * DX; DV = L.Direction() * DY; - myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd4)], + myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd4)], myFaces[i], gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); } @@ -485,7 +495,7 @@ const TheFace& Primitives_Wedge::Face ElSLib::Parameters(P,L.Location(),U,V); DU = L.Direction() * DX; DV = L.Direction() * DY; - myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd3)], + myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd3)], myFaces[i], gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); } @@ -495,7 +505,7 @@ const TheFace& Primitives_Wedge::Face ElSLib::Parameters(P,L.Location(),U,V); DU = L.Direction() * DX; DV = L.Direction() * DY; - myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd2)], + myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd2)], myFaces[i], gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); } @@ -505,7 +515,7 @@ const TheFace& Primitives_Wedge::Face ElSLib::Parameters(P,L.Location(),U,V); DU = L.Direction() * DX; DV = L.Direction() * DY; - myBuilder.SetPCurve(myEdges[Primitives_Wedge_NumDir2(d1,dd1)], + myBuilder.SetPCurve(myEdges[BRepPrim_Wedge_NumDir2(d1,dd1)], myFaces[i], gp_Lin2d(gp_Pnt2d(U,V),gp_Dir2d(DU,DV))); } @@ -524,37 +534,37 @@ const TheFace& Primitives_Wedge::Face //purpose : trivial //======================================================================= -Standard_Boolean Primitives_Wedge::HasWire (const Primitives_Direction d1) const +Standard_Boolean BRepPrim_GWedge::HasWire (const BRepPrim_Direction d1) const { - Standard_Integer i = Primitives_Wedge_NumDir1(d1); + Standard_Integer i = BRepPrim_Wedge_NumDir1(d1); if (myInfinite[i]) return Standard_False; - Primitives_Direction dd1 = Primitives_XMin,dd2 = Primitives_YMax,dd3 = Primitives_XMax ,dd4 = Primitives_ZMin; + BRepPrim_Direction dd1 = BRepPrim_XMin,dd2 = BRepPrim_YMax,dd3 = BRepPrim_XMax ,dd4 = BRepPrim_ZMin; switch (i/2) { case 0 : // XMin XMax - dd1 = Primitives_ZMin; - dd2 = Primitives_YMax; - dd3 = Primitives_ZMax; - dd4 = Primitives_YMin; + dd1 = BRepPrim_ZMin; + dd2 = BRepPrim_YMax; + dd3 = BRepPrim_ZMax; + dd4 = BRepPrim_YMin; break; case 1 : // YMin YMax - dd1 = Primitives_XMin; - dd2 = Primitives_ZMax; - dd3 = Primitives_XMax; - dd4 = Primitives_ZMin; + dd1 = BRepPrim_XMin; + dd2 = BRepPrim_ZMax; + dd3 = BRepPrim_XMax; + dd4 = BRepPrim_ZMin; break; case 2 : // ZMin ZMax - dd1 = Primitives_YMin; - dd2 = Primitives_XMax; - dd3 = Primitives_YMax; - dd4 = Primitives_XMin; + dd1 = BRepPrim_YMin; + dd2 = BRepPrim_XMax; + dd3 = BRepPrim_YMax; + dd4 = BRepPrim_XMin; break; #ifndef DEB default: @@ -571,12 +581,12 @@ Standard_Boolean Primitives_Wedge::HasWire (const Primitives_Direction d1) const //purpose : trivial //======================================================================= -const TheWire& Primitives_Wedge::Wire - (const Primitives_Direction d1) +const TopoDS_Wire& BRepPrim_GWedge::Wire + (const BRepPrim_Direction d1) { - Standard_Integer i = Primitives_Wedge_NumDir1(d1); + Standard_Integer i = BRepPrim_Wedge_NumDir1(d1); - Primitives_Direction dd1 = Primitives_XMin,dd2 = Primitives_YMax,dd3 = Primitives_XMax ,dd4 = Primitives_ZMin; + BRepPrim_Direction dd1 = BRepPrim_XMin,dd2 = BRepPrim_YMax,dd3 = BRepPrim_XMax ,dd4 = BRepPrim_ZMin; if (!WiresBuilt[i]) { @@ -584,26 +594,26 @@ const TheWire& Primitives_Wedge::Wire case 0 : // XMin XMax - dd1 = Primitives_ZMin; - dd2 = Primitives_YMax; - dd3 = Primitives_ZMax; - dd4 = Primitives_YMin; + dd1 = BRepPrim_ZMin; + dd2 = BRepPrim_YMax; + dd3 = BRepPrim_ZMax; + dd4 = BRepPrim_YMin; break; case 1 : // YMin YMax - dd1 = Primitives_XMin; - dd2 = Primitives_ZMax; - dd3 = Primitives_XMax; - dd4 = Primitives_ZMin; + dd1 = BRepPrim_XMin; + dd2 = BRepPrim_ZMax; + dd3 = BRepPrim_XMax; + dd4 = BRepPrim_ZMin; break; case 2 : // ZMin ZMax - dd1 = Primitives_YMin; - dd2 = Primitives_XMax; - dd3 = Primitives_YMax; - dd4 = Primitives_XMin; + dd1 = BRepPrim_YMin; + dd2 = BRepPrim_XMax; + dd3 = BRepPrim_YMax; + dd4 = BRepPrim_XMin; break; default: break; @@ -633,12 +643,12 @@ const TheWire& Primitives_Wedge::Wire //purpose : trivial //======================================================================= -Standard_Boolean Primitives_Wedge::HasEdge (const Primitives_Direction d1, - const Primitives_Direction d2) const +Standard_Boolean BRepPrim_GWedge::HasEdge (const BRepPrim_Direction d1, + const BRepPrim_Direction d2) const { - Standard_Boolean state = !(myInfinite[Primitives_Wedge_NumDir1(d1)] || - myInfinite[Primitives_Wedge_NumDir1(d2)]); - Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); + Standard_Boolean state = !(myInfinite[BRepPrim_Wedge_NumDir1(d1)] || + myInfinite[BRepPrim_Wedge_NumDir1(d2)]); + Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2); if ( i == 6 || i == 7 ) state = state && ( X2Max != X2Min ); else if ( i == 1 || i == 3 ) state = state && ( Z2Max != Z2Min ); return state; @@ -649,13 +659,13 @@ Standard_Boolean Primitives_Wedge::HasEdge (const Primitives_Direction d1, //purpose : trivial //======================================================================= -gp_Lin Primitives_Wedge::Line - (const Primitives_Direction d1, - const Primitives_Direction d2) +gp_Lin BRepPrim_GWedge::Line + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2) { if (!HasEdge(d1,d2)) Standard_DomainError::Raise(); - Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); + Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2); Standard_Real X =0., Y =0., Z =0.; @@ -790,33 +800,33 @@ gp_Lin Primitives_Wedge::Line //purpose : trivial //======================================================================= -const TheEdge& Primitives_Wedge::Edge - (const Primitives_Direction d1, - const Primitives_Direction d2) +const TopoDS_Edge& BRepPrim_GWedge::Edge + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2) { if (!HasEdge(d1,d2)) Standard_DomainError::Raise(); - Standard_Integer i = Primitives_Wedge_NumDir2(d1,d2); + Standard_Integer i = BRepPrim_Wedge_NumDir2(d1,d2); if (!EdgesBuilt[i]) { - Primitives_Direction dd1 = Primitives_XMin ,dd2 = Primitives_XMax; + BRepPrim_Direction dd1 = BRepPrim_XMin ,dd2 = BRepPrim_XMax; switch (i/4) { case 0 : - dd1 = Primitives_ZMin; - dd2 = Primitives_ZMax; + dd1 = BRepPrim_ZMin; + dd2 = BRepPrim_ZMax; break; case 1 : - dd1 = Primitives_XMin; - dd2 = Primitives_XMax; + dd1 = BRepPrim_XMin; + dd2 = BRepPrim_XMax; break; case 2 : - dd1 = Primitives_YMin; - dd2 = Primitives_YMax; + dd1 = BRepPrim_YMin; + dd2 = BRepPrim_YMax; break; default: @@ -871,27 +881,27 @@ const TheEdge& Primitives_Wedge::Edge //purpose : trivial //======================================================================= -Standard_Boolean Primitives_Wedge::HasVertex - (const Primitives_Direction d1, - const Primitives_Direction d2, - const Primitives_Direction d3) const -{ return !(myInfinite[Primitives_Wedge_NumDir1(d1)] || - myInfinite[Primitives_Wedge_NumDir1(d2)] || - myInfinite[Primitives_Wedge_NumDir1(d3)]); } +Standard_Boolean BRepPrim_GWedge::HasVertex + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2, + const BRepPrim_Direction d3) const +{ return !(myInfinite[BRepPrim_Wedge_NumDir1(d1)] || + myInfinite[BRepPrim_Wedge_NumDir1(d2)] || + myInfinite[BRepPrim_Wedge_NumDir1(d3)]); } //======================================================================= //function : Point //purpose : trivial //======================================================================= -gp_Pnt Primitives_Wedge::Point - (const Primitives_Direction d1, - const Primitives_Direction d2, - const Primitives_Direction d3) +gp_Pnt BRepPrim_GWedge::Point + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2, + const BRepPrim_Direction d3) { if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise(); - Standard_Integer i = Primitives_Wedge_NumDir3(d1,d2,d3); + Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3); Standard_Real X =0., Y =0., Z =0.; @@ -959,14 +969,14 @@ gp_Pnt Primitives_Wedge::Point //purpose : trivial //======================================================================= -const TheVertex& Primitives_Wedge::Vertex - (const Primitives_Direction d1, - const Primitives_Direction d2, - const Primitives_Direction d3) +const TopoDS_Vertex& BRepPrim_GWedge::Vertex + (const BRepPrim_Direction d1, + const BRepPrim_Direction d2, + const BRepPrim_Direction d3) { if (!HasVertex(d1,d2,d3)) Standard_DomainError::Raise(); - Standard_Integer i = Primitives_Wedge_NumDir3(d1,d2,d3); + Standard_Integer i = BRepPrim_Wedge_NumDir3(d1,d2,d3); if (!VerticesBuilt[i]) { diff --git a/src/Primitives/Primitives_OneAxis.cdl b/src/BRepPrim/BRepPrim_OneAxis.cdl similarity index 84% rename from src/Primitives/Primitives_OneAxis.cdl rename to src/BRepPrim/BRepPrim_OneAxis.cdl index 0364a0d0b3..a4d1782763 100644 --- a/src/Primitives/Primitives_OneAxis.cdl +++ b/src/BRepPrim/BRepPrim_OneAxis.cdl @@ -14,13 +14,7 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -deferred generic class OneAxis from Primitives( - TheShell as any; - TheFace as any; - TheWire as any; - TheEdge as any; - TheVertex as any; - TheBuilder as any) +deferred class OneAxis from BRepPrim ---Purpose: Algorithm to build primitives with one axis of -- revolution. @@ -59,8 +53,14 @@ deferred generic class OneAxis from Primitives( uses - Ax2 from gp, - Pnt2d from gp + Ax2 from gp, + Pnt2d from gp, + Shell from TopoDS, + Face from TopoDS, + Wire from TopoDS, + Edge from TopoDS, + Vertex from TopoDS, + Builder from BRepPrim raises DomainError, @@ -70,7 +70,7 @@ is Delete(me:out) is virtual ; ---C++: alias ~ - Initialize(B : TheBuilder; + Initialize(B : Builder from BRepPrim; A : Ax2 from gp; VMin, VMax : Real from Standard); ---Purpose: Creates a OneAxis algorithm. is used to build @@ -120,7 +120,7 @@ is -- They should be redefined in inherited classes -- - MakeEmptyLateralFace(me) returns TheFace + MakeEmptyLateralFace(me) returns Face from TopoDS ---Purpose: Returns a face with no edges. The surface is the -- lateral surface with normals pointing outward. The -- U parameter is the angle with the origin on the X @@ -128,13 +128,13 @@ is -- meridian. is deferred; - MakeEmptyMeridianEdge(me; Ang : Real) returns TheEdge + MakeEmptyMeridianEdge(me; Ang : Real) returns Edge from TopoDS ---Purpose: Returns an edge with a 3D curve made from the -- meridian in the XZ plane rotated by around -- the Z-axis. Ang may be 0 or myAngle. is deferred; - SetMeridianPCurve(me; E : in out TheEdge; F : TheFace) + SetMeridianPCurve(me; E : in out Edge from TopoDS; F : Face from TopoDS) ---Purpose: Sets the parametric curve of the edge in the -- face to be the 2d representation of the -- meridian. @@ -199,7 +199,7 @@ is -- -- the shell - Shell(me : in out) returns TheShell + Shell(me : in out) returns Shell from TopoDS ---Purpose: Returns the Shell containing all the Faces of the -- primitive. -- @@ -208,14 +208,14 @@ is -- the Faces - LateralFace(me : in out) returns TheFace + LateralFace(me : in out) returns Face from TopoDS ---Purpose: Returns the lateral Face. It is oriented toward -- the outside of the primitive. -- ---C++: return const & is static; - TopFace(me : in out) returns TheFace + TopFace(me : in out) returns Face from TopoDS ---Purpose: Returns the top planar Face. It is Oriented -- toward the +Z axis (outside). -- @@ -223,7 +223,7 @@ is raises DomainError -- if !HasTop() is static; - BottomFace(me : in out) returns TheFace + BottomFace(me : in out) returns Face from TopoDS ---Purpose: Returns the Bottom planar Face. It is Oriented -- toward the -Z axis (outside). -- @@ -231,7 +231,7 @@ is raises DomainError -- if !HasBottom() is static; - StartFace(me : in out) returns TheFace + StartFace(me : in out) returns Face from TopoDS ---Purpose: Returns the Face starting the slice, it is -- oriented toward the exterior of the primitive. -- @@ -239,7 +239,7 @@ is raises DomainError -- if !HasSides() is static; - EndFace(me : in out) returns TheFace + EndFace(me : in out) returns Face from TopoDS ---Purpose: Returns the Face ending the slice, it is oriented -- toward the exterior of the primitive. -- @@ -249,14 +249,14 @@ is -- Wires - LateralWire(me : in out) returns TheWire + LateralWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the lateral face. -- ---C++: return const & raises DomainError -- if VMinInfinite() && VMaxInfinite() is static; - LateralStartWire(me : in out) returns TheWire + LateralStartWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the lateral face with the -- start edge. -- @@ -264,7 +264,7 @@ is raises DomainError -- if ! (VMinInfinite() && VMaxInfinite()) is static; - LateralEndWire(me : in out) returns TheWire + LateralEndWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire with in lateral face with the end -- edge. -- @@ -272,28 +272,28 @@ is raises DomainError -- if ! (VMinInfinite() && VMaxInfinite()) is static; - TopWire(me : in out) returns TheWire + TopWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the top face. -- ---C++: return const & raises DomainError -- if !HasTop() is static; - BottomWire(me : in out) returns TheWire + BottomWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the bottom face. -- ---C++: return const & raises DomainError -- if !HasBottom() is static; - StartWire(me : in out) returns TheWire + StartWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the start face. -- ---C++: return const & raises DomainError -- if !HasSides() is static; - AxisStartWire(me : in out) returns TheWire + AxisStartWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the wire in the start face with the -- AxisEdge. -- @@ -301,14 +301,14 @@ is raises DomainError -- if !HasSides() ! (VMinInfinite() && VMaxInfinite()) is static; - EndWire(me : in out) returns TheWire + EndWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the Wire in the end face. -- ---C++: return const & raises DomainError -- if !HasSides() is static; - AxisEndWire(me : in out) returns TheWire + AxisEndWire(me : in out) returns Wire from TopoDS ---Purpose: Returns the Wire in the end face with the -- AxisEdge. -- @@ -319,7 +319,7 @@ is -- Edges - AxisEdge(me : in out) returns TheEdge + AxisEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the Edge built along the Axis and oriented -- on +Z of the Axis. -- @@ -327,20 +327,20 @@ is raises DomainError -- if ! (MeridianOnAxis(VMin) || MeridianOnAxis(VMax)) is static; - StartEdge(me : in out) returns TheEdge + StartEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the Edge at angle 0. -- ---C++: return const & is static; - EndEdge(me : in out) returns TheEdge + EndEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the Edge at angle Angle. If !HasSides() -- the StartEdge and the EndEdge are the same edge. -- ---C++: return const & is static; - StartTopEdge(me : in out) returns TheEdge + StartTopEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the linear Edge between start Face and top -- Face. -- @@ -348,7 +348,7 @@ is raises DomainError -- if ! (HasTop() && HasSides()) is static; - StartBottomEdge(me : in out) returns TheEdge + StartBottomEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the linear Edge between start Face and -- bottom Face. -- @@ -356,7 +356,7 @@ is raises DomainError -- if ! (HasBottom() && HasSides()) is static; - EndTopEdge(me : in out) returns TheEdge + EndTopEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the linear Edge between end Face and top -- Face. -- @@ -364,7 +364,7 @@ is raises DomainError -- if ! (HasTop() && HasSides()) is static; - EndBottomEdge(me : in out) returns TheEdge + EndBottomEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the linear Edge between end Face and -- bottom Face. -- @@ -372,7 +372,7 @@ is raises DomainError -- if ! (HasBottom() && HasSides()) is static; - TopEdge(me : in out) returns TheEdge + TopEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the edge at VMax. If MeridianClosed() the -- TopEdge and the BottomEdge are the same edge. -- @@ -380,7 +380,7 @@ is raises DomainError -- if VMaxInfinite() is static; - BottomEdge(me : in out) returns TheEdge + BottomEdge(me : in out) returns Edge from TopoDS ---Purpose: Returns the edge at VMin. If MeridianClosed() the -- TopEdge and the BottomEdge are the same edge. -- @@ -390,14 +390,14 @@ is -- Vertices - AxisTopVertex(me : in out) returns TheVertex + AxisTopVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the Vertex at the Top altitude on the axis. -- ---C++: return const & raises DomainError -- if !MeridianOnAxis(VMax) is static; - AxisBottomVertex(me : in out) returns TheVertex + AxisBottomVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the Vertex at the Bottom altitude on the -- axis. -- @@ -405,28 +405,28 @@ is raises DomainError -- if !MeridianOnAxis(VMin) is static; - TopStartVertex(me : in out) returns TheVertex + TopStartVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the vertex (0,VMax) -- ---C++: return const & raises DomainError -- if VMaxInfinite() is static; - TopEndVertex(me : in out) returns TheVertex + TopEndVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the vertex (angle,VMax) -- ---C++: return const & raises DomainError -- if VMaxInfinite() is static; - BottomStartVertex(me : in out) returns TheVertex + BottomStartVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the vertex (0,VMin) -- ---C++: return const & raises DomainError -- if VMinInfinite() is static; - BottomEndVertex(me : in out) returns TheVertex + BottomEndVertex(me : in out) returns Vertex from TopoDS ---Purpose: Returns the vertex (angle,VMax) -- ---C++: return const & @@ -434,7 +434,7 @@ is is static; fields - myBuilder : TheBuilder is protected; + myBuilder : Builder from BRepPrim is protected; myAxes : Ax2 from gp; myAngle : Real from Standard; @@ -444,10 +444,10 @@ fields -- the Topology - myShell : TheShell; + myShell : Shell from TopoDS; ShellBuilt : Boolean; - myVertices : TheVertex [6]; + myVertices : Vertex from TopoDS [6]; -- 0 : Vertex on top of the axis -- 1 : on bottom of the axis -- 2 : top, start @@ -456,7 +456,7 @@ fields -- 5 : bottom, end VerticesBuilt : Boolean [6]; - myEdges : TheEdge [9]; + myEdges : Edge from TopoDS [9]; -- 0 : Edge on the Axis -- 1 : Start Edge -- 2 : End Edge @@ -468,7 +468,7 @@ fields -- 8 : Bottom EdgesBuilt : Boolean [9]; - myWires : TheWire [9]; + myWires : Wire from TopoDS [9]; -- 0 : wire Lateral -- 1 : Lateral Start -- 2 : Lateral End @@ -480,7 +480,7 @@ fields -- 8 : Axis End WiresBuilt : Boolean [9]; - myFaces : TheFace [5]; + myFaces : Face from TopoDS [5]; -- 0 : Lateral Face -- 1 : Top -- 2 : Bottom diff --git a/src/Primitives/Primitives_OneAxis.gxx b/src/BRepPrim/BRepPrim_OneAxis.cxx similarity index 89% rename from src/Primitives/Primitives_OneAxis.gxx rename to src/BRepPrim/BRepPrim_OneAxis.cxx index 325b33256f..b7bace22a4 100644 --- a/src/Primitives/Primitives_OneAxis.gxx +++ b/src/BRepPrim/BRepPrim_OneAxis.cxx @@ -14,8 +14,18 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include +#include +#include +#include +#include +#include +#include +#include + #include #include #include @@ -68,11 +78,11 @@ #define FEND 4 //======================================================================= -//function : Primitives_OneAxis_Check +//function : BRepPrim_OneAxis_Check //purpose : raise Standard_DomainError if something was built //======================================================================= -static void Primitives_OneAxis_Check(const Standard_Boolean V[], +static void BRepPrim_OneAxis_Check(const Standard_Boolean V[], const Standard_Boolean E[], const Standard_Boolean W[], const Standard_Boolean F[]) @@ -89,11 +99,11 @@ static void Primitives_OneAxis_Check(const Standard_Boolean V[], } //======================================================================= -//function : Primitives_OneAxis +//function : BRepPrim_OneAxis //purpose : //======================================================================= -Primitives_OneAxis::Primitives_OneAxis(const TheBuilder& B, +BRepPrim_OneAxis::BRepPrim_OneAxis(const BRepPrim_Builder& B, const gp_Ax2& A, const Standard_Real VMin, const Standard_Real VMax) : @@ -119,7 +129,7 @@ Primitives_OneAxis::Primitives_OneAxis(const TheBuilder& B, } -void Primitives_OneAxis::Delete() +void BRepPrim_OneAxis::Delete() {} //======================================================================= @@ -127,7 +137,7 @@ void Primitives_OneAxis::Delete() //purpose : //======================================================================= -void Primitives_OneAxis::SetMeridianOffset(const Standard_Real O) +void BRepPrim_OneAxis::SetMeridianOffset(const Standard_Real O) { myMeridianOffset = O; } @@ -137,47 +147,47 @@ void Primitives_OneAxis::SetMeridianOffset(const Standard_Real O) //purpose : //======================================================================= -const gp_Ax2& Primitives_OneAxis::Axes () const +const gp_Ax2& BRepPrim_OneAxis::Axes () const { return myAxes; } -void Primitives_OneAxis::Axes (const gp_Ax2& A) +void BRepPrim_OneAxis::Axes (const gp_Ax2& A) { - Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); myAxes = A; } -Standard_Real Primitives_OneAxis::Angle () const +Standard_Real BRepPrim_OneAxis::Angle () const { return myAngle; } -void Primitives_OneAxis::Angle (const Standard_Real A) +void BRepPrim_OneAxis::Angle (const Standard_Real A) { - Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); myAngle = A; } -Standard_Real Primitives_OneAxis::VMin () const +Standard_Real BRepPrim_OneAxis::VMin () const { return myVMin; } -void Primitives_OneAxis::VMin (const Standard_Real V) +void BRepPrim_OneAxis::VMin (const Standard_Real V) { - Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); myVMin = V; } -Standard_Real Primitives_OneAxis::VMax () const +Standard_Real BRepPrim_OneAxis::VMax () const { return myVMax; } -void Primitives_OneAxis::VMax (const Standard_Real V) +void BRepPrim_OneAxis::VMax (const Standard_Real V) { - Primitives_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); + BRepPrim_OneAxis_Check(VerticesBuilt,EdgesBuilt,WiresBuilt,FacesBuilt); myVMax = V; } @@ -186,7 +196,7 @@ void Primitives_OneAxis::VMax (const Standard_Real V) //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::MeridianOnAxis +Standard_Boolean BRepPrim_OneAxis::MeridianOnAxis (const Standard_Real V) const { return Abs(MeridianValue(V).X()) < Precision::Confusion(); @@ -197,7 +207,7 @@ Standard_Boolean Primitives_OneAxis::MeridianOnAxis //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::MeridianClosed() const +Standard_Boolean BRepPrim_OneAxis::MeridianClosed() const { if (VMaxInfinite()) return Standard_False; if (VMinInfinite()) return Standard_False; @@ -210,7 +220,7 @@ Standard_Boolean Primitives_OneAxis::MeridianClosed() const //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::VMaxInfinite() const +Standard_Boolean BRepPrim_OneAxis::VMaxInfinite() const { return Precision::IsPositiveInfinite(myVMax); } @@ -220,7 +230,7 @@ Standard_Boolean Primitives_OneAxis::VMaxInfinite() const //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::VMinInfinite() const +Standard_Boolean BRepPrim_OneAxis::VMinInfinite() const { return Precision::IsNegativeInfinite(myVMin); } @@ -230,7 +240,7 @@ Standard_Boolean Primitives_OneAxis::VMinInfinite() const //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::HasTop() const +Standard_Boolean BRepPrim_OneAxis::HasTop() const { if (VMaxInfinite()) return Standard_False; if (MeridianClosed()) return Standard_False; @@ -243,7 +253,7 @@ Standard_Boolean Primitives_OneAxis::HasTop() const //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::HasBottom() const +Standard_Boolean BRepPrim_OneAxis::HasBottom() const { if (VMinInfinite()) return Standard_False; if (MeridianClosed()) return Standard_False; @@ -256,7 +266,7 @@ Standard_Boolean Primitives_OneAxis::HasBottom() const //purpose : //======================================================================= -Standard_Boolean Primitives_OneAxis::HasSides() const +Standard_Boolean BRepPrim_OneAxis::HasSides() const { return 2*M_PI - myAngle > Precision::Angular(); } @@ -266,7 +276,7 @@ Standard_Boolean Primitives_OneAxis::HasSides() const //purpose : //======================================================================= -const TheShell& Primitives_OneAxis::Shell() +const TopoDS_Shell& BRepPrim_OneAxis::Shell() { if (!ShellBuilt) { myBuilder.MakeShell(myShell); @@ -292,7 +302,7 @@ const TheShell& Primitives_OneAxis::Shell() //purpose : build the lateral face //======================================================================= -const TheFace& Primitives_OneAxis::LateralFace () +const TopoDS_Face& BRepPrim_OneAxis::LateralFace () { // do it if not done if (!FacesBuilt[FLATERAL]) { @@ -365,13 +375,13 @@ const TheFace& Primitives_OneAxis::LateralFace () //purpose : build and return the TopFace //======================================================================= -const TheFace& Primitives_OneAxis::TopFace () +const TopoDS_Face& BRepPrim_OneAxis::TopFace () { // do it if not done if (!FacesBuilt[FTOP]) { Standard_DomainError_Raise_if(!HasTop(), - "Primitives_OneAxis::TopFace:No top face"); + "BRepPrim_OneAxis::TopFace:No top face"); // make the empty face by translating the axes Standard_Real z = MeridianValue(myVMax).Y(); @@ -405,13 +415,13 @@ const TheFace& Primitives_OneAxis::TopFace () //purpose : //======================================================================= -const TheFace& Primitives_OneAxis::BottomFace () +const TopoDS_Face& BRepPrim_OneAxis::BottomFace () { // do it if not done if (!FacesBuilt[FBOTTOM]) { Standard_DomainError_Raise_if(!HasBottom(), - "Primitives_OneAxis::BottomFace:No bottom face"); + "BRepPrim_OneAxis::BottomFace:No bottom face"); // make the empty face by translating the axes Standard_Real z = MeridianValue(myVMin).Y(); @@ -446,13 +456,13 @@ const TheFace& Primitives_OneAxis::BottomFace () //purpose : //======================================================================= -const TheFace& Primitives_OneAxis::StartFace () +const TopoDS_Face& BRepPrim_OneAxis::StartFace () { // do it if not done if (!FacesBuilt[FSTART]) { Standard_DomainError_Raise_if(!HasSides(), - "Primitives_OneAxes::StartFace:No side faces"); + "BRepPrim_OneAxes::StartFace:No side faces"); // build the empty face, perpendicular to myTool.Axes() gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection()); @@ -489,13 +499,13 @@ const TheFace& Primitives_OneAxis::StartFace () //purpose : //======================================================================= -const TheFace& Primitives_OneAxis::EndFace () +const TopoDS_Face& BRepPrim_OneAxis::EndFace () { // do it if not done if (!FacesBuilt[FEND]) { Standard_DomainError_Raise_if(!HasSides(), - "Primitives_OneAxes::EndFace:No side faces"); + "BRepPrim_OneAxes::EndFace:No side faces"); // build the empty face, perpendicular to myTool.Axes() gp_Ax2 axes(myAxes.Location(),myAxes.YDirection().Reversed(),myAxes.XDirection()); @@ -533,7 +543,7 @@ const TheFace& Primitives_OneAxis::EndFace () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::LateralWire () +const TopoDS_Wire& BRepPrim_OneAxis::LateralWire () { // do it if not done if (!WiresBuilt[WLATERAL]) { @@ -560,7 +570,7 @@ const TheWire& Primitives_OneAxis::LateralWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::LateralStartWire () +const TopoDS_Wire& BRepPrim_OneAxis::LateralStartWire () { // do it if not done if (!WiresBuilt[WLATERALSTART]) { @@ -582,7 +592,7 @@ const TheWire& Primitives_OneAxis::LateralStartWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::LateralEndWire () +const TopoDS_Wire& BRepPrim_OneAxis::LateralEndWire () { // do it if not done if (!WiresBuilt[WLATERALEND]) { @@ -603,13 +613,13 @@ const TheWire& Primitives_OneAxis::LateralEndWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::TopWire () +const TopoDS_Wire& BRepPrim_OneAxis::TopWire () { // do it if not done if (!WiresBuilt[WTOP]) { Standard_DomainError_Raise_if(!HasTop(), - "Primitives_OneAxis::TopWire: no top"); + "BRepPrim_OneAxis::TopWire: no top"); myBuilder.MakeWire(myWires[WTOP]); @@ -630,13 +640,13 @@ const TheWire& Primitives_OneAxis::TopWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::BottomWire () +const TopoDS_Wire& BRepPrim_OneAxis::BottomWire () { // do it if not done if (!WiresBuilt[WBOTTOM]) { Standard_DomainError_Raise_if(!HasBottom(), - "Primitives_OneAxis::BottomWire: no bottom"); + "BRepPrim_OneAxis::BottomWire: no bottom"); myBuilder.MakeWire(myWires[WBOTTOM]); @@ -658,13 +668,13 @@ const TheWire& Primitives_OneAxis::BottomWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::StartWire () +const TopoDS_Wire& BRepPrim_OneAxis::StartWire () { // do it if not done if (!WiresBuilt[WSTART]) { Standard_DomainError_Raise_if(!HasSides(), - "Primitives_OneAxes::StartWire:no sides"); + "BRepPrim_OneAxes::StartWire:no sides"); myBuilder.MakeWire(myWires[WSTART]); @@ -692,22 +702,22 @@ const TheWire& Primitives_OneAxis::StartWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::AxisStartWire () +const TopoDS_Wire& BRepPrim_OneAxis::AxisStartWire () { // do it if not done if (!WiresBuilt[WAXISSTART]) { Standard_DomainError_Raise_if (!HasSides(), - "Primitives_OneAxes::AxisStartWire:no sides"); + "BRepPrim_OneAxes::AxisStartWire:no sides"); Standard_DomainError_Raise_if (!VMaxInfinite() || !VMinInfinite(), - "Primitives_OneAxes::AxisStartWire:not infinite"); + "BRepPrim_OneAxes::AxisStartWire:not infinite"); Standard_DomainError_Raise_if (MeridianClosed(), - "Primitives_OneAxes::AxisStartWire:meridian closed"); + "BRepPrim_OneAxes::AxisStartWire:meridian closed"); myBuilder.MakeWire(myWires[WAXISSTART]); @@ -725,13 +735,13 @@ const TheWire& Primitives_OneAxis::AxisStartWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::EndWire () +const TopoDS_Wire& BRepPrim_OneAxis::EndWire () { // do it if not done if (!WiresBuilt[WEND]) { Standard_DomainError_Raise_if(!HasSides(), - "Primitives_OneAxes::EndWire:no sides"); + "BRepPrim_OneAxes::EndWire:no sides"); myBuilder.MakeWire(myWires[WEND]); @@ -757,22 +767,22 @@ const TheWire& Primitives_OneAxis::EndWire () //purpose : //======================================================================= -const TheWire& Primitives_OneAxis::AxisEndWire () +const TopoDS_Wire& BRepPrim_OneAxis::AxisEndWire () { // do it if not done if (!WiresBuilt[WAXISEND]) { Standard_DomainError_Raise_if (!HasSides(), - "Primitives_OneAxes::AxisEndWire:no sides"); + "BRepPrim_OneAxes::AxisEndWire:no sides"); Standard_DomainError_Raise_if (!VMaxInfinite() || !VMinInfinite(), - "Primitives_OneAxes::AxisEndWire:not infinite"); + "BRepPrim_OneAxes::AxisEndWire:not infinite"); Standard_DomainError_Raise_if (MeridianClosed(), - "Primitives_OneAxes::AxisEndWire:meridian closed"); + "BRepPrim_OneAxes::AxisEndWire:meridian closed"); myBuilder.MakeWire(myWires[WAXISEND]); @@ -789,15 +799,15 @@ const TheWire& Primitives_OneAxis::AxisEndWire () //purpose : make the edge on the axis, oriented +Z //======================================================================= -const TheEdge& Primitives_OneAxis::AxisEdge () +const TopoDS_Edge& BRepPrim_OneAxis::AxisEdge () { // do it if not done if (!EdgesBuilt[EAXIS]) { Standard_DomainError_Raise_if(!HasSides(), - "Primitives_OneAxis::AxisEdge:no sides"); + "BRepPrim_OneAxis::AxisEdge:no sides"); Standard_DomainError_Raise_if(MeridianClosed(), - "Primitives_OneAxis::AxisEdge:closed"); + "BRepPrim_OneAxis::AxisEdge:closed"); // build the empty edge. myBuilder.MakeEdge(myEdges[EAXIS],gp_Lin(myAxes.Axis())); @@ -821,7 +831,7 @@ const TheEdge& Primitives_OneAxis::AxisEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::StartEdge () +const TopoDS_Edge& BRepPrim_OneAxis::StartEdge () { // do it if not done if (!EdgesBuilt[ESTART]) { @@ -871,7 +881,7 @@ const TheEdge& Primitives_OneAxis::StartEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::EndEdge () +const TopoDS_Edge& BRepPrim_OneAxis::EndEdge () { // do it if not done if (!EdgesBuilt[EEND]) { @@ -921,14 +931,14 @@ const TheEdge& Primitives_OneAxis::EndEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::StartTopEdge () +const TopoDS_Edge& BRepPrim_OneAxis::StartTopEdge () { // do it if not done if (!EdgesBuilt[ETOPSTART]) { Standard_DomainError_Raise_if (!HasTop() || !HasSides(), - "Primitives_OneAxis::StartTopEdge:no sides or no top"); + "BRepPrim_OneAxis::StartTopEdge:no sides or no top"); // build the empty Edge gp_Vec V = myAxes.Direction(); @@ -953,14 +963,14 @@ const TheEdge& Primitives_OneAxis::StartTopEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::StartBottomEdge () +const TopoDS_Edge& BRepPrim_OneAxis::StartBottomEdge () { // do it if not done if (!EdgesBuilt[EBOTSTART]) { Standard_DomainError_Raise_if (!HasBottom() || !HasSides(), - "Primitives_OneAxis::StartBottomEdge:no sides or no top"); + "BRepPrim_OneAxis::StartBottomEdge:no sides or no top"); // build the empty Edge gp_Vec V = myAxes.Direction(); @@ -985,14 +995,14 @@ const TheEdge& Primitives_OneAxis::StartBottomEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::EndTopEdge () +const TopoDS_Edge& BRepPrim_OneAxis::EndTopEdge () { // do it if not done if (!EdgesBuilt[ETOPEND]) { Standard_DomainError_Raise_if (!HasTop() || !HasSides(), - "Primitives_OneAxis::EndTopEdge:no sides or no top"); + "BRepPrim_OneAxis::EndTopEdge:no sides or no top"); // build the empty Edge gp_Vec V = myAxes.Direction(); @@ -1019,7 +1029,7 @@ const TheEdge& Primitives_OneAxis::EndTopEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::EndBottomEdge () +const TopoDS_Edge& BRepPrim_OneAxis::EndBottomEdge () { // do it if not done if (!EdgesBuilt[EBOTEND]) { @@ -1027,7 +1037,7 @@ const TheEdge& Primitives_OneAxis::EndBottomEdge () Standard_DomainError_Raise_if (!HasBottom() || !HasSides(), - "Primitives_OneAxis::EndBottomEdge:no sides or no bottom"); + "BRepPrim_OneAxis::EndBottomEdge:no sides or no bottom"); // build the empty Edge gp_Vec V = myAxes.Direction(); @@ -1054,7 +1064,7 @@ const TheEdge& Primitives_OneAxis::EndBottomEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::TopEdge () +const TopoDS_Edge& BRepPrim_OneAxis::TopEdge () { // do it if not done if (!EdgesBuilt[ETOP]) { @@ -1108,7 +1118,7 @@ const TheEdge& Primitives_OneAxis::TopEdge () //purpose : //======================================================================= -const TheEdge& Primitives_OneAxis::BottomEdge () +const TopoDS_Edge& BRepPrim_OneAxis::BottomEdge () { // do it if not done if (!EdgesBuilt[EBOTTOM]) { @@ -1163,7 +1173,7 @@ const TheEdge& Primitives_OneAxis::BottomEdge () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::AxisTopVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::AxisTopVertex () { // do it if not done if (!VerticesBuilt[VAXISTOP]) { @@ -1177,9 +1187,9 @@ const TheVertex& Primitives_OneAxis::AxisTopVertex () else { Standard_DomainError_Raise_if(MeridianClosed(), - "Primitives_OneAxis::AxisTopVertex"); + "BRepPrim_OneAxis::AxisTopVertex"); Standard_DomainError_Raise_if(VMaxInfinite(), - "Primitives_OneAxis::AxisTopVertex"); + "BRepPrim_OneAxis::AxisTopVertex"); gp_Vec V = myAxes.Direction(); V.Multiply(MeridianValue(myVMax).Y()); @@ -1198,7 +1208,7 @@ const TheVertex& Primitives_OneAxis::AxisTopVertex () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::AxisBottomVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::AxisBottomVertex () { // do it if not done if (!VerticesBuilt[VAXISBOT]) { @@ -1212,9 +1222,9 @@ const TheVertex& Primitives_OneAxis::AxisBottomVertex () else { Standard_DomainError_Raise_if(MeridianClosed(), - "Primitives_OneAxis::AxisBottomVertex"); + "BRepPrim_OneAxis::AxisBottomVertex"); Standard_DomainError_Raise_if(VMinInfinite(), - "Primitives_OneAxis::AxisBottomVertex"); + "BRepPrim_OneAxis::AxisBottomVertex"); gp_Vec V = myAxes.Direction(); V.Multiply(MeridianValue(myVMin).Y()); @@ -1233,7 +1243,7 @@ const TheVertex& Primitives_OneAxis::AxisBottomVertex () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::TopStartVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::TopStartVertex () { // do it if not done if (!VerticesBuilt[VTOPSTART]) { @@ -1270,7 +1280,7 @@ const TheVertex& Primitives_OneAxis::TopStartVertex () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::TopEndVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::TopEndVertex () { // do it if not done if (!VerticesBuilt[VTOPEND]) { @@ -1309,7 +1319,7 @@ const TheVertex& Primitives_OneAxis::TopEndVertex () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::BottomStartVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::BottomStartVertex () { // do it if not done if (!VerticesBuilt[VBOTSTART]) { @@ -1346,7 +1356,7 @@ const TheVertex& Primitives_OneAxis::BottomStartVertex () //purpose : //======================================================================= -const TheVertex& Primitives_OneAxis::BottomEndVertex () +const TopoDS_Vertex& BRepPrim_OneAxis::BottomEndVertex () { // do it if not done if (!VerticesBuilt[VBOTEND]) { diff --git a/src/BRepPrim/BRepPrim_OneAxis.hxx b/src/BRepPrim/BRepPrim_OneAxis.hxx deleted file mode 100644 index 9643943ee6..0000000000 --- a/src/BRepPrim/BRepPrim_OneAxis.hxx +++ /dev/null @@ -1,164 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _BRepPrim_OneAxis_HeaderFile -#define _BRepPrim_OneAxis_HeaderFile - -#include -#include -#include -#include -#include -#include -#include - -class Standard_DomainError; -class Standard_OutOfRange; -class TopoDS_Shell; -class TopoDS_Face; -class TopoDS_Wire; -class TopoDS_Edge; -class TopoDS_Vertex; -class BRepPrim_Builder; -class gp_Ax2; -class gp_Pnt2d; - - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_DefineAlloc_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - -class BRepPrim_OneAxis { - -public: - - DEFINE_STANDARD_ALLOC - - // Methods PUBLIC - // -Standard_EXPORT virtual void Delete() ; -Standard_EXPORT virtual ~BRepPrim_OneAxis() -//Standard_EXPORT virtual ~() -{ - Delete(); -} - -Standard_EXPORT void SetMeridianOffset(const Standard_Real MeridianOffset = 0) ; -Standard_EXPORT const gp_Ax2& Axes() const; -Standard_EXPORT void Axes(const gp_Ax2& A) ; -Standard_EXPORT Standard_Real Angle() const; -Standard_EXPORT void Angle(const Standard_Real A) ; -Standard_EXPORT Standard_Real VMin() const; -Standard_EXPORT void VMin(const Standard_Real V) ; -Standard_EXPORT Standard_Real VMax() const; -Standard_EXPORT void VMax(const Standard_Real V) ; -Standard_EXPORT virtual TopoDS_Face MakeEmptyLateralFace() const = 0; -Standard_EXPORT virtual TopoDS_Edge MakeEmptyMeridianEdge(const Standard_Real Ang) const = 0; -Standard_EXPORT virtual void SetMeridianPCurve(TopoDS_Edge& E,const TopoDS_Face& F) const = 0; -Standard_EXPORT virtual gp_Pnt2d MeridianValue(const Standard_Real V) const = 0; -Standard_EXPORT virtual Standard_Boolean MeridianOnAxis(const Standard_Real V) const; -Standard_EXPORT virtual Standard_Boolean MeridianClosed() const; -Standard_EXPORT virtual Standard_Boolean VMaxInfinite() const; -Standard_EXPORT virtual Standard_Boolean VMinInfinite() const; -Standard_EXPORT virtual Standard_Boolean HasTop() const; -Standard_EXPORT virtual Standard_Boolean HasBottom() const; -Standard_EXPORT virtual Standard_Boolean HasSides() const; -Standard_EXPORT const TopoDS_Shell& Shell() ; -Standard_EXPORT const TopoDS_Face& LateralFace() ; -Standard_EXPORT const TopoDS_Face& TopFace() ; -Standard_EXPORT const TopoDS_Face& BottomFace() ; -Standard_EXPORT const TopoDS_Face& StartFace() ; -Standard_EXPORT const TopoDS_Face& EndFace() ; -Standard_EXPORT const TopoDS_Wire& LateralWire() ; -Standard_EXPORT const TopoDS_Wire& LateralStartWire() ; -Standard_EXPORT const TopoDS_Wire& LateralEndWire() ; -Standard_EXPORT const TopoDS_Wire& TopWire() ; -Standard_EXPORT const TopoDS_Wire& BottomWire() ; -Standard_EXPORT const TopoDS_Wire& StartWire() ; -Standard_EXPORT const TopoDS_Wire& AxisStartWire() ; -Standard_EXPORT const TopoDS_Wire& EndWire() ; -Standard_EXPORT const TopoDS_Wire& AxisEndWire() ; -Standard_EXPORT const TopoDS_Edge& AxisEdge() ; -Standard_EXPORT const TopoDS_Edge& StartEdge() ; -Standard_EXPORT const TopoDS_Edge& EndEdge() ; -Standard_EXPORT const TopoDS_Edge& StartTopEdge() ; -Standard_EXPORT const TopoDS_Edge& StartBottomEdge() ; -Standard_EXPORT const TopoDS_Edge& EndTopEdge() ; -Standard_EXPORT const TopoDS_Edge& EndBottomEdge() ; -Standard_EXPORT const TopoDS_Edge& TopEdge() ; -Standard_EXPORT const TopoDS_Edge& BottomEdge() ; -Standard_EXPORT const TopoDS_Vertex& AxisTopVertex() ; -Standard_EXPORT const TopoDS_Vertex& AxisBottomVertex() ; -Standard_EXPORT const TopoDS_Vertex& TopStartVertex() ; -Standard_EXPORT const TopoDS_Vertex& TopEndVertex() ; -Standard_EXPORT const TopoDS_Vertex& BottomStartVertex() ; -Standard_EXPORT const TopoDS_Vertex& BottomEndVertex() ; - - - - - -protected: - - // Methods PROTECTED - // -Standard_EXPORT BRepPrim_OneAxis(const BRepPrim_Builder& B,const gp_Ax2& A,const Standard_Real VMin,const Standard_Real VMax); - - - // Fields PROTECTED - // -BRepPrim_Builder myBuilder; - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // -gp_Ax2 myAxes; -Standard_Real myAngle; -Standard_Real myVMin; -Standard_Real myVMax; -Standard_Real myMeridianOffset; -TopoDS_Shell myShell; -Standard_Boolean ShellBuilt; -TopoDS_Vertex myVertices[6]; -Standard_Boolean VerticesBuilt[6]; -TopoDS_Edge myEdges[9]; -Standard_Boolean EdgesBuilt[9]; -TopoDS_Wire myWires[9]; -Standard_Boolean WiresBuilt[9]; -TopoDS_Face myFaces[5]; -Standard_Boolean FacesBuilt[5]; - - -}; - - - - - -// other Inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/BRepPrim/BRepPrim_Replace.tcl b/src/BRepPrim/BRepPrim_Replace.tcl deleted file mode 100644 index 5df2b73e5c..0000000000 --- a/src/BRepPrim/BRepPrim_Replace.tcl +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 1999-2014 OPEN CASCADE SAS -# -# This file is part of Open CASCADE Technology software library. -# -# This library is free software; you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License version 2.1 as published -# by the Free Software Foundation, with special exception defined in the file -# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -# distribution for complete text of the license and disclaimer of any warranty. -# -# Alternatively, this file may be used under the terms of Open CASCADE -# commercial license or contractual agreement. - -proc BRepPrim_Replace:AdmFileType {} { - return "dbadmfile"; -} - -proc BRepPrim_Replace:OutputDirTypeName {} { - return "dbtmpfile"; -} - - -proc BRepPrim_Replace:HandleInputFile { ID } { - - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - - switch $name { - BRepPrim_OneAxis.hxx {return 1;} - default { - return 0; - } - } -} - -proc BRepPrim_Replace:Execute { unit args } { - - global tcl_interactive - - set tcl_interactive 1 - package require Wokutils - - msgprint -i -c "BRepPrim_Replace:Execute" "Copying of BRepPrim includes" - - if { [wokparam -e %Station $unit] != "wnt" } { - set copycmd "cp -p " - set replstr "/" - } { - set copycmd "cmd /c copy" - set replstr "\\\\\\\\" - } - - foreach file $args { - scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name - - regsub ".hxx" $name ".hxx" sourcename - - set source [woklocate -p BRepPrim:source:$sourcename [wokinfo -N $unit]] - set vistarget [woklocate -p BRepPrim:pubinclude:$name [wokinfo -N $unit]] - set target [wokinfo -p pubinclude:$name $unit] - - regsub -all "/" " $source $target" $replstr TheArgs - - msgprint -i -c "BRepPrim_Replace:Execute" "Copy $source to $target" - if { [file exist $target] && [wokparam -e %Station] != "wnt" } { - eval exec "chmod u+w $target" - } - eval exec "$copycmd $TheArgs" - - } - return 0; -} diff --git a/src/BRepPrim/BRepPrim_WOKSteps.edl b/src/BRepPrim/BRepPrim_WOKSteps.edl deleted file mode 100644 index 382fab8fb5..0000000000 --- a/src/BRepPrim/BRepPrim_WOKSteps.edl +++ /dev/null @@ -1,26 +0,0 @@ --- Created by: JR --- Copyright (c) 1999 Matra Datavision --- Copyright (c) 1999-2014 OPEN CASCADE SAS --- --- This file is part of Open CASCADE Technology software library. --- --- This library is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License version 2.1 as published --- by the Free Software Foundation, with special exception defined in the file --- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT --- distribution for complete text of the license and disclaimer of any warranty. --- --- Alternatively, this file may be used under the terms of Open CASCADE --- commercial license or contractual agreement. - -@ifnotdefined ( %BRepPrim_WOKSteps_EDL) then - - @set %BRepPrim_WOKSteps_EDL = ""; - - @string %WOKSteps_XcppGroup += " xcpp.repl "; - @set %WOKSteps_xcpp_repl = "*BRepPrim_Replace(xcpp.header)"; - - @set %BRepPrim_UseSourceInclude = ""; - -@endif; - diff --git a/src/BRepPrim/FILES b/src/BRepPrim/FILES deleted file mode 100755 index b521a3f188..0000000000 --- a/src/BRepPrim/FILES +++ /dev/null @@ -1,3 +0,0 @@ -BRepPrim_OneAxis.hxx -BRepPrim_Replace.tcl -BRepPrim_WOKSteps.edl diff --git a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx index cebba52718..7e49b55e3e 100644 --- a/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx +++ b/src/BRepPrimAPI/BRepPrimAPI_MakeBox.cxx @@ -17,7 +17,7 @@ #include #include #include -#include +#include inline gp_Pnt pmin(const gp_Pnt& p, @@ -171,7 +171,7 @@ BRepPrimAPI_MakeBox::operator TopoDS_Solid() const TopoDS_Face& BRepPrimAPI_MakeBox::BottomFace () { - return myWedge.Face (Primitives_ZMin); + return myWedge.Face (BRepPrim_ZMin); } @@ -183,7 +183,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::BottomFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::BackFace () { - return myWedge.Face (Primitives_XMin); + return myWedge.Face (BRepPrim_XMin); } @@ -194,7 +194,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::BackFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::FrontFace () { - return myWedge.Face (Primitives_XMax); + return myWedge.Face (BRepPrim_XMax); } @@ -205,7 +205,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::FrontFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::LeftFace () { - return myWedge.Face (Primitives_YMin); + return myWedge.Face (BRepPrim_YMin); } @@ -216,7 +216,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::LeftFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::RightFace () { - return myWedge.Face (Primitives_YMax); + return myWedge.Face (BRepPrim_YMax); } @@ -227,7 +227,7 @@ const TopoDS_Face& BRepPrimAPI_MakeBox::RightFace () { const TopoDS_Face& BRepPrimAPI_MakeBox::TopFace () { - return myWedge.Face (Primitives_ZMax); + return myWedge.Face (BRepPrim_ZMax); } diff --git a/src/BRepSweep/BRepSweep.cdl b/src/BRepSweep/BRepSweep.cdl index 344c4e4c76..d727f43fe6 100644 --- a/src/BRepSweep/BRepSweep.cdl +++ b/src/BRepSweep/BRepSweep.cdl @@ -46,19 +46,8 @@ is class Iterator; ---Purpose: Iterator on the subShapes of a shape. - - deferred class NumLinearRegularSweep - instantiates LinearRegularSweep from Sweep( - Shape from TopoDS, -- Resulting topological objects. - Shape from TopoDS, -- Generating Shape. - NumShape from Sweep, -- Directing Wire. - Builder from BRepSweep, - Tool from BRepSweep, -- GenTool - NumShapeTool from Sweep, -- DirTool - Iterator from BRepSweep, -- Resulting objects Iterator - Iterator from BRepSweep, -- GenIterator - NumShapeIterator from Sweep); -- DirSubEdgeIterator + deferred class NumLinearRegularSweep; deferred class Trsf; --- This class is inherited from LinearRegularSweep to implement diff --git a/src/Sweep/Sweep_LinearRegularSweep.cdl b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cdl similarity index 65% rename from src/Sweep/Sweep_LinearRegularSweep.cdl rename to src/BRepSweep/BRepSweep_NumLinearRegularSweep.cdl index ee66137989..82688becc3 100644 --- a/src/Sweep/Sweep_LinearRegularSweep.cdl +++ b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cdl @@ -14,33 +14,23 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -deferred generic class LinearRegularSweep from Sweep ( - TheShape as any; -- resulting topological objects. - TheGenShape as any; -- Generating topological objects. - TheDirShape as any; -- Directing topological objects. - TheBuilder as any; - TheGenShapeTool as any; - TheDirShapeTool as any; - TheShapeIterator as any; - TheGenShapeIterator as any; - TheDirShapeIterator as any) - +deferred class NumLinearRegularSweep from BRepSweep ---Purpose: This a generic class is used to build Sweept -- primitives with a generating "shape" and a -- directing "line". -- -- The indexation and type analysis services required - -- for the generatrix are given by . + -- for the generatrix are given by . -- -- The indexation and type analysis services required - -- for the directrix are given by . + -- for the directrix are given by . -- -- The iteration services required for the generatrix - -- are given by . + -- are given by . -- -- The iteration services required for the directrix - -- are given by . + -- are given by . -- -- The topology is like a grid of shapes. Each shape -- of the grid must be addressable without confusion @@ -67,7 +57,16 @@ deferred generic class LinearRegularSweep from Sweep ( uses Orientation from TopAbs, - Array2OfBoolean from TColStd + Array2OfBoolean from TColStd, + Shape from TopoDS, + NumShape from Sweep, + Builder from BRepSweep, + Tool from BRepSweep, + NumShapeTool from Sweep, + Iterator from BRepSweep, + NumShapeIterator from Sweep, + Array2OfShape from TopTools, + SequenceOfShape from TopTools raises @@ -75,13 +74,7 @@ raises NoSuchObject from Standard, RangeError from Standard, DomainError from Standard - --- Nested classes - - class Array2OfShapes - instantiates Array2 from TCollection (TheShape); - class SequenceOfShapes - instantiates Sequence from TCollection (TheShape); + is @@ -91,10 +84,10 @@ is Delete(me:out) is virtual ; ---C++: alias ~ - Initialize(aBuilder : TheBuilder; - aGenShape : TheGenShape; - aDirWire : TheDirShape); - ---Purpose: Creates a LinearRegularSweep. gives + Initialize(aBuilder : Builder from BRepSweep; + aGenShape : Shape from TopoDS; + aDirWire : NumShape from Sweep); + ---Purpose: Creates a NumLinearRegularSweep. gives -- basic topological services. @@ -103,61 +96,61 @@ is -- """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - MakeEmptyVertex(me : in out; aGenV: TheGenShape; aDirV: TheDirShape) - returns TheShape + MakeEmptyVertex(me : in out; aGenV: Shape from TopoDS; aDirV: NumShape from Sweep) + returns Shape from TopoDS ---Purpose: Builds the vertex addressed by [aGenV,aDirV], with its -- geometric part, but without subcomponents. is deferred; - MakeEmptyDirectingEdge(me: in out; aGenV: TheGenShape; aDirE: TheDirShape) - returns TheShape + MakeEmptyDirectingEdge(me: in out; aGenV: Shape from TopoDS; aDirE: NumShape from Sweep) + returns Shape from TopoDS ---Purpose: Builds the edge addressed by [aGenV,aDirE], with its -- geometric part, but without subcomponents. is deferred; - MakeEmptyGeneratingEdge(me: in out; aGenE: TheGenShape; aDirV: TheDirShape) - returns TheShape + MakeEmptyGeneratingEdge(me: in out; aGenE: Shape from TopoDS; aDirV: NumShape from Sweep) + returns Shape from TopoDS ---Purpose: Builds the edge addressed by [aGenE,aDirV], with its -- geometric part, but without subcomponents. is deferred; SetParameters(me : in out; - aNewFace : TheShape; - aNewVertex : in out TheShape; - aGenF : TheGenShape; - aGenV : TheGenShape; - aDirV : TheDirShape) + aNewFace : Shape from TopoDS; + aNewVertex : in out Shape from TopoDS; + aGenF : Shape from TopoDS; + aGenV : Shape from TopoDS; + aDirV : NumShape from Sweep) ---Purpose: Sets the parameters of the new vertex on the new -- face. The new face and new vertex where generated -- from aGenF, aGenV and aDirV . is deferred; SetDirectingParameter(me : in out; - aNewEdge : TheShape; - aNewVertex : in out TheShape; - aGenV : TheGenShape; - aDirE : TheDirShape; - aDirV : TheDirShape) + aNewEdge : Shape from TopoDS; + aNewVertex : in out Shape from TopoDS; + aGenV : Shape from TopoDS; + aDirE : NumShape from Sweep; + aDirV : NumShape from Sweep) ---Purpose: Sets the parameter of the new vertex on the new -- edge. The new edge and new vertex where generated -- from aGenV aDirE, and aDirV. is deferred; SetGeneratingParameter(me : in out; - aNewEdge : TheShape; - aNewVertex : in out TheShape; - aGenE : TheGenShape; - aGenV : TheGenShape; - aDirV : TheDirShape) + aNewEdge : Shape from TopoDS; + aNewVertex : in out Shape from TopoDS; + aGenE : Shape from TopoDS; + aGenV : Shape from TopoDS; + aDirV : NumShape from Sweep) ---Purpose: Sets the parameter of the new vertex on the new -- edge. The new edge and new vertex where generated -- from aGenE, aGenV and aDirV . is deferred; MakeEmptyFace(me : in out; - aGenS : TheGenShape; - aDirS : TheDirShape) - returns TheShape + aGenS : Shape from TopoDS; + aDirS : NumShape from Sweep) + returns Shape from TopoDS ---Purpose: Builds the face addressed by [aGenS,aDirS], with -- its geometric part, but without subcomponents. The -- couple aGenS, aDirS can be a "generating face and @@ -166,11 +159,11 @@ is is deferred; SetPCurve(me : in out; - aNewFace : TheShape; - aNewEdge : in out TheShape; - aGenF : TheGenShape; - aGenE : TheGenShape; - aDirV : TheDirShape; + aNewFace : Shape from TopoDS; + aNewEdge : in out Shape from TopoDS; + aGenF : Shape from TopoDS; + aGenE : Shape from TopoDS; + aDirV : NumShape from Sweep; orien : Orientation from TopAbs) ---Purpose: Sets the PCurve for a new edge on a new face. The -- new edge and the new face were generated using @@ -178,11 +171,11 @@ is is deferred; SetGeneratingPCurve(me : in out; - aNewFace : TheShape; - aNewEdge : in out TheShape; - aGenE : TheGenShape; - aDirE : TheDirShape; - aDirV : TheDirShape; + aNewFace : Shape from TopoDS; + aNewEdge : in out Shape from TopoDS; + aGenE : Shape from TopoDS; + aDirE : NumShape from Sweep; + aDirV : NumShape from Sweep; orien : Orientation from TopAbs) ---Purpose: Sets the PCurve for a new edge on a new face. The @@ -191,11 +184,11 @@ is is deferred; SetDirectingPCurve(me : in out; - aNewFace : TheShape; - aNewEdge : in out TheShape; - aGenE : TheGenShape; - aGenV : TheGenShape; - aDirE : TheDirShape; + aNewFace : Shape from TopoDS; + aNewEdge : in out Shape from TopoDS; + aGenE : Shape from TopoDS; + aGenV : Shape from TopoDS; + aDirE : NumShape from Sweep; orien : Orientation from TopAbs) ---Purpose: Sets the PCurve for a new edge on a new face. The @@ -204,8 +197,8 @@ is is deferred; DirectSolid(me : in out; - aGenS : TheGenShape; - aDirS : TheDirShape) + aGenS : Shape from TopoDS; + aDirS : NumShape from Sweep) returns Orientation from TopAbs ---Purpose: Returns the Orientation of the shell in the solid -- generated by the face aGenS with the edge aDirS. @@ -214,11 +207,11 @@ is is deferred; GGDShapeIsToAdd (me; - aNewShape : TheShape; - aNewSubShape : TheShape; - aGenS : TheGenShape; - aSubGenS : TheGenShape; - aDirS : TheDirShape) + aNewShape : Shape from TopoDS; + aNewSubShape : Shape from TopoDS; + aGenS : Shape from TopoDS; + aSubGenS : Shape from TopoDS; + aDirS : NumShape from Sweep) returns Boolean from Standard ---Purpose: Returns true if aNewSubShape (addressed by -- aSubGenS and aDirS) must be added in aNewShape @@ -226,11 +219,11 @@ is is deferred; GDDShapeIsToAdd (me; - aNewShape : TheShape; - aNewSubShape : TheShape; - aGenS : TheGenShape; - aDirS : TheDirShape; - aSubDirS : TheDirShape) + aNewShape : Shape from TopoDS; + aNewSubShape : Shape from TopoDS; + aGenS : Shape from TopoDS; + aDirS : NumShape from Sweep; + aSubDirS : NumShape from Sweep) returns Boolean from Standard ---Purpose: Returns true if aNewSubShape (addressed by -- aGenS and aSubDirS) must be added in aNewShape @@ -239,11 +232,11 @@ is SeparatedWires (me; - aNewShape : TheShape; - aNewSubShape : TheShape; - aGenS : TheGenShape; - aSubGenS : TheGenShape; - aDirS : TheDirShape) + aNewShape : Shape from TopoDS; + aNewSubShape : Shape from TopoDS; + aGenS : Shape from TopoDS; + aSubGenS : Shape from TopoDS; + aDirS : NumShape from Sweep) returns Boolean from Standard ---Purpose: In some particular cases the topology of a -- generated face must be composed of independant @@ -252,8 +245,8 @@ is is deferred; - SplitShell (me; aNewShape : TheShape) - returns TheShape + SplitShell (me; aNewShape : Shape from TopoDS) + returns Shape from TopoDS ---Purpose: In some particular cases the topology of a -- generated Shell must be composed of independant -- closed Shells, in this case this function returns @@ -264,7 +257,7 @@ is -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -- Method coding the continuities on the edges between 2 faces -- """""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" - SetContinuity(me : in out; aGenS : TheGenShape; aDirS : TheDirShape) + SetContinuity(me : in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep) ---Purpose: Called to propagate the continuity of every vertex -- between two edges of the generating wire aGenS on -- the generated edge and faces. @@ -279,7 +272,7 @@ is -- Shapes -- """""" - HasShape(me; aGenS : TheGenShape; aDirS : TheDirShape) + HasShape(me; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep) returns Boolean from Standard ---Purpose: Returns true if aDirS and aGenS addresses a -- resulting Shape. In some specific cases the shape @@ -287,46 +280,46 @@ is -- function returns false. is deferred; - Shape(me: in out; aGenS : TheGenShape; aDirS : TheDirShape) - returns TheShape + Shape(me: in out; aGenS : Shape from TopoDS; aDirS : NumShape from Sweep) + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by aDirS and -- aGenS. is static; - Shape(me: in out; aGenS : TheGenShape) - returns TheShape + Shape(me: in out; aGenS : Shape from TopoDS) + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by myDirWire -- and aGenS. is static; Shape(me: in out) - returns TheShape + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by myDirWire -- and myGenShape. is static; FirstShape(me: in out) - returns TheShape + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by the first -- Vertex of myDirWire and myGenShape. is static; LastShape(me: in out) - returns TheShape + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by the last -- Vertex of myDirWire and myGenShape. is static; - FirstShape(me: in out; aGenS : TheGenShape) - returns TheShape + FirstShape(me: in out; aGenS : Shape from TopoDS) + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by the first -- Vertex of myDirWire and aGenS. is static; - LastShape(me: in out; aGenS : TheGenShape) - returns TheShape + LastShape(me: in out; aGenS : Shape from TopoDS) + returns Shape from TopoDS ---Purpose: Returns the resulting Shape indexed by the last -- Vertex of myDirWire and aGenS. is static; @@ -339,25 +332,25 @@ fields -- Topology builder. - myBuilder : TheBuilder is protected; + myBuilder : Builder from BRepSweep is protected; -- Generating shape - myGenShape : TheGenShape is protected; + myGenShape : Shape from TopoDS is protected; -- Directing line - myDirWire : TheDirShape is protected; + myDirWire : NumShape from Sweep is protected; -- shape tools. - myGenShapeTool : TheGenShapeTool is protected; - myDirShapeTool : TheDirShapeTool is protected; + myGenShapeTool : Tool from BRepSweep is protected; + myDirShapeTool : NumShapeTool from Sweep is protected; -- Array of built objects (NbGShapes,NbDShapes). - myShapes : Array2OfShapes is protected; + myShapes : Array2OfShape from TopTools is protected; -- Array of built objects flags (NbGShapes,NbDShapes). myBuiltShapes : Array2OfBoolean from TColStd is protected; -end LinearRegularSweep; +end NumLinearRegularSweep; diff --git a/src/Sweep/Sweep_LinearRegularSweep.gxx b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx similarity index 87% rename from src/Sweep/Sweep_LinearRegularSweep.gxx rename to src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx index 8ca4710fda..8b4566f478 100644 --- a/src/Sweep/Sweep_LinearRegularSweep.gxx +++ b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.cxx @@ -14,23 +14,34 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include + #include #include //======================================================================= -//function : Sweep_LinearRegularSweep +//function : BRepSweep_NumLinearRegularSweep //purpose : Create a Regular Sweep. //======================================================================= -Sweep_LinearRegularSweep::Sweep_LinearRegularSweep - (const TheBuilder& aBuilder, - const TheGenShape& aGenShape, - const TheDirShape& aDirShape): +BRepSweep_NumLinearRegularSweep::BRepSweep_NumLinearRegularSweep + (const BRepSweep_Builder& aBuilder, + const TopoDS_Shape& aGenShape, + const Sweep_NumShape& aDirShape): myBuilder(aBuilder), myGenShape(aGenShape), @@ -51,7 +62,7 @@ Sweep_LinearRegularSweep::Sweep_LinearRegularSweep myBuiltShapes.Init(Standard_False); } -void Sweep_LinearRegularSweep::Delete() +void BRepSweep_NumLinearRegularSweep::Delete() {} //======================================================================= @@ -59,11 +70,11 @@ void Sweep_LinearRegularSweep::Delete() //purpose : Returns the global Shape. //======================================================================= -TheShape Sweep_LinearRegularSweep::Shape () +TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape () { if (HasShape(myGenShape,myDirWire)) return Shape(myGenShape,myDirWire); else { - TheShape bidon; + TopoDS_Shape bidon; return bidon; } } @@ -74,12 +85,12 @@ TheShape Sweep_LinearRegularSweep::Shape () //purpose : Returns the Shape generated with aGenS. //======================================================================= -TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS) +TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS) { if (myGenShapeTool.Index(aGenS) != 0 && HasShape(aGenS,myDirWire)) return Shape(aGenS,myDirWire); else { - TheShape bidon; + TopoDS_Shape bidon; return bidon; } } @@ -90,18 +101,18 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS) //purpose : Returns the Shape indexed by the arguments. //======================================================================= -TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, - const TheDirShape& aDirS) +TopoDS_Shape BRepSweep_NumLinearRegularSweep::Shape (const TopoDS_Shape& aGenS, + const Sweep_NumShape& aDirS) { Standard_Integer iGenS = myGenShapeTool.Index(aGenS); Standard_Integer iDirS = myDirShapeTool.Index(aDirS); if (!myBuiltShapes(iGenS,iDirS)){ - TheShape newShape; - TheGenShape bGenS,cGenS,subGenS,subsubGenS; - TheDirShape bDirS,subDirS; - TheGenShapeIterator It; - TheDirShapeIterator Kt; - TheShapeIterator Lt; + TopoDS_Shape newShape; + TopoDS_Shape bGenS,cGenS,subGenS,subsubGenS; + Sweep_NumShape bDirS,subDirS; + BRepSweep_Iterator It; + Sweep_NumShapeIterator Kt; + BRepSweep_Iterator Lt; TopAbs_Orientation Or,Pr; if (myDirShapeTool.Type(aDirS)==TopAbs_VERTEX){ //Ici on construit les "planchers" du Shape. @@ -162,14 +173,14 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, aGenS,subGenS,aDirS,Or); } else if(subGenSType==TopAbs_WIRE){ - TheGenShapeIterator Jt; + BRepSweep_Iterator Jt; cGenS = subGenS; myGenShapeTool.SetOrientation(cGenS,TopAbs_FORWARD); for (Jt.Init(cGenS);Jt.More();Jt.Next()){ subsubGenS = Jt.Value(); Pr = Jt.Orientation(); if(HasShape(subsubGenS,aDirS)){ - TheShape newsubEdge = Shape(subsubGenS,aDirS); + TopoDS_Shape newsubEdge = Shape(subsubGenS,aDirS); SetPCurve(myShapes(iGenS,iDirS),newsubEdge, aGenS,subsubGenS,aDirS,Pr); } @@ -187,8 +198,8 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, else if (myDirShapeTool.Type(aDirS)==TopAbs_EDGE){ //Ici on construit les murs du Shape. TopAbs_ShapeEnum aGenSType = myGenShapeTool.Type(aGenS); - TheShape newWire,newShell; - Sweep_SequenceOfShapes WireSeq; + TopoDS_Shape newWire,newShell; + TopTools_SequenceOfShape WireSeq; Standard_Boolean sepwires = Standard_False; switch (aGenSType){ case TopAbs_VERTEX : @@ -242,7 +253,7 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, if (SeparatedWires(myShapes(iGenS,iDirS),newShape, aGenS,subGenS,aDirS)){ sepwires = Standard_True; - TheShape wi; + TopoDS_Shape wi; myBuilder.MakeWire(wi); myBuilder.Add(wi,newShape,Or); WireSeq.Append(wi); @@ -326,7 +337,7 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, SetContinuity(aGenS,aDirS); } if (aGenSType==TopAbs_FACE){ - TheShape temp = SplitShell(newShell); + TopoDS_Shape temp = SplitShell(newShell); TopAbs_Orientation Or = DirectSolid(aGenS,aDirS); Lt.Init(temp); if(Lt.More()) Lt.Next(); @@ -390,9 +401,9 @@ TheShape Sweep_LinearRegularSweep::Shape (const TheGenShape& aGenS, //purpose : Returns the Shape indexed by the arguments. //======================================================================= -TheShape Sweep_LinearRegularSweep::FirstShape () +TopoDS_Shape BRepSweep_NumLinearRegularSweep::FirstShape () { - TheShape result; + TopoDS_Shape result; if (myDirShapeTool.HasFirstVertex()){ if(HasShape(myGenShape,myDirShapeTool.FirstVertex())) result = Shape(myGenShape,myDirShapeTool.FirstVertex()); @@ -406,9 +417,9 @@ TheShape Sweep_LinearRegularSweep::FirstShape () //purpose : Returns the Shape indexed by the arguments. //======================================================================= -TheShape Sweep_LinearRegularSweep::LastShape () +TopoDS_Shape BRepSweep_NumLinearRegularSweep::LastShape () { - TheShape result; + TopoDS_Shape result; if (myDirShapeTool.HasLastVertex()){ if(HasShape(myGenShape,myDirShapeTool.LastVertex())) result = Shape(myGenShape,myDirShapeTool.LastVertex()); @@ -422,9 +433,9 @@ TheShape Sweep_LinearRegularSweep::LastShape () //purpose : Returns the Shape indexed by the arguments. //======================================================================= -TheShape Sweep_LinearRegularSweep::FirstShape (const TheGenShape& aGenS) +TopoDS_Shape BRepSweep_NumLinearRegularSweep::FirstShape (const TopoDS_Shape& aGenS) { - TheShape result; + TopoDS_Shape result; if (myDirShapeTool.HasFirstVertex()){ if(HasShape(aGenS,myDirShapeTool.FirstVertex())) result = Shape(aGenS,myDirShapeTool.FirstVertex()); @@ -438,9 +449,9 @@ TheShape Sweep_LinearRegularSweep::FirstShape (const TheGenShape& aGenS) //purpose : Returns the Shape indexed by the arguments. //======================================================================= -TheShape Sweep_LinearRegularSweep::LastShape (const TheGenShape& aGenS) +TopoDS_Shape BRepSweep_NumLinearRegularSweep::LastShape (const TopoDS_Shape& aGenS) { - TheShape result; + TopoDS_Shape result; if (myDirShapeTool.HasLastVertex()){ if(HasShape(aGenS,myDirShapeTool.LastVertex())) result = Shape(aGenS,myDirShapeTool.LastVertex()); @@ -453,7 +464,7 @@ TheShape Sweep_LinearRegularSweep::LastShape (const TheGenShape& aGenS) //purpose : //======================================================================= -Standard_Boolean Sweep_LinearRegularSweep::Closed()const +Standard_Boolean BRepSweep_NumLinearRegularSweep::Closed()const { return myDirWire.Closed(); } @@ -463,9 +474,9 @@ Standard_Boolean Sweep_LinearRegularSweep::Closed()const //purpose : //======================================================================= -TheShape Sweep_LinearRegularSweep::SplitShell(const TheShape& aNewShape)const +TopoDS_Shape BRepSweep_NumLinearRegularSweep::SplitShell(const TopoDS_Shape& aNewShape)const { - TheShape comp; + TopoDS_Shape comp; myBuilder.MakeCompound(comp); myBuilder.Add(comp,aNewShape); return comp; diff --git a/src/BRepSweep/BRepSweep_NumLinearRegularSweep.hxx b/src/BRepSweep/BRepSweep_NumLinearRegularSweep.hxx deleted file mode 100644 index 1678938e5b..0000000000 --- a/src/BRepSweep/BRepSweep_NumLinearRegularSweep.hxx +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) 1999-2014 OPEN CASCADE SAS -// -// This file is part of Open CASCADE Technology software library. -// -// This library is free software; you can redistribute it and/or modify it under -// the terms of the GNU Lesser General Public License version 2.1 as published -// by the Free Software Foundation, with special exception defined in the file -// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -// distribution for complete text of the license and disclaimer of any warranty. -// -// Alternatively, this file may be used under the terms of Open CASCADE -// commercial license or contractual agreement. - -#ifndef _BRepSweep_NumLinearRegularSweep_HeaderFile -#define _BRepSweep_NumLinearRegularSweep_HeaderFile - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -class Standard_NoMoreObject; -class Standard_NoSuchObject; -class Standard_RangeError; -class Standard_DomainError; -class TopoDS_Shape; -class Sweep_NumShape; -class BRepSweep_Builder; -class BRepSweep_Tool; -class Sweep_NumShapeTool; -class BRepSweep_Iterator; -class Sweep_NumShapeIterator; -class BRepSweep_Array2OfShapesOfNumLinearRegularSweep; -class BRepSweep_SequenceOfShapesOfNumLinearRegularSweep; -class BRepSweep_SequenceNodeOfSequenceOfShapesOfNumLinearRegularSweep; - - -#ifndef _Standard_HeaderFile -#include -#endif -#ifndef _Standard_DefineAlloc_HeaderFile -#include -#endif -#ifndef _Standard_Macro_HeaderFile -#include -#endif - -class BRepSweep_NumLinearRegularSweep { - -public: - - DEFINE_STANDARD_ALLOC - - // Methods PUBLIC - // -Standard_EXPORT virtual void Delete() ; -Standard_EXPORT virtual ~BRepSweep_NumLinearRegularSweep() -{ - Delete(); -} - -Standard_EXPORT virtual TopoDS_Shape MakeEmptyVertex(const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0; -Standard_EXPORT virtual TopoDS_Shape MakeEmptyDirectingEdge(const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE) = 0; -Standard_EXPORT virtual TopoDS_Shape MakeEmptyGeneratingEdge(const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirV) = 0; -Standard_EXPORT virtual void SetParameters(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenF,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0; -Standard_EXPORT virtual void SetDirectingParameter(const TopoDS_Shape& aNewEdge,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE,const Sweep_NumShape& aDirV) = 0; -Standard_EXPORT virtual void SetGeneratingParameter(const TopoDS_Shape& aNewEdge,TopoDS_Shape& aNewVertex,const TopoDS_Shape& aGenE,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirV) = 0; -Standard_EXPORT virtual TopoDS_Shape MakeEmptyFace(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0; -Standard_EXPORT virtual void SetPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenF,const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirV,const TopAbs_Orientation orien) = 0; -Standard_EXPORT virtual void SetGeneratingPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenE,const Sweep_NumShape& aDirE,const Sweep_NumShape& aDirV,const TopAbs_Orientation orien) = 0; -Standard_EXPORT virtual void SetDirectingPCurve(const TopoDS_Shape& aNewFace,TopoDS_Shape& aNewEdge,const TopoDS_Shape& aGenE,const TopoDS_Shape& aGenV,const Sweep_NumShape& aDirE,const TopAbs_Orientation orien) = 0; -Standard_EXPORT virtual TopAbs_Orientation DirectSolid(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0; -Standard_EXPORT virtual Standard_Boolean GGDShapeIsToAdd(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const TopoDS_Shape& aSubGenS,const Sweep_NumShape& aDirS) const = 0; -Standard_EXPORT virtual Standard_Boolean GDDShapeIsToAdd(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS,const Sweep_NumShape& aSubDirS) const = 0; -Standard_EXPORT virtual Standard_Boolean SeparatedWires(const TopoDS_Shape& aNewShape,const TopoDS_Shape& aNewSubShape,const TopoDS_Shape& aGenS,const TopoDS_Shape& aSubGenS,const Sweep_NumShape& aDirS) const = 0; -Standard_EXPORT virtual TopoDS_Shape SplitShell(const TopoDS_Shape& aNewShape) const; -Standard_EXPORT virtual void SetContinuity(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) = 0; -Standard_EXPORT virtual Standard_Boolean HasShape(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) const = 0; -Standard_EXPORT TopoDS_Shape Shape(const TopoDS_Shape& aGenS,const Sweep_NumShape& aDirS) ; -Standard_EXPORT TopoDS_Shape Shape(const TopoDS_Shape& aGenS) ; -Standard_EXPORT TopoDS_Shape Shape() ; -Standard_EXPORT TopoDS_Shape FirstShape() ; -Standard_EXPORT TopoDS_Shape LastShape() ; -Standard_EXPORT TopoDS_Shape FirstShape(const TopoDS_Shape& aGenS) ; -Standard_EXPORT TopoDS_Shape LastShape(const TopoDS_Shape& aGenS) ; -Standard_EXPORT Standard_Boolean Closed() const; - - - - - -protected: - - // Methods PROTECTED - // -Standard_EXPORT BRepSweep_NumLinearRegularSweep(const BRepSweep_Builder& aBuilder,const TopoDS_Shape& aGenShape,const Sweep_NumShape& aDirWire); - - - // Fields PROTECTED - // -BRepSweep_Builder myBuilder; -TopoDS_Shape myGenShape; -Sweep_NumShape myDirWire; -BRepSweep_Tool myGenShapeTool; -Sweep_NumShapeTool myDirShapeTool; -BRepSweep_Array2OfShapesOfNumLinearRegularSweep myShapes; -TColStd_Array2OfBoolean myBuiltShapes; - - -private: - - // Methods PRIVATE - // - - - // Fields PRIVATE - // - - -}; - - - - - -// other Inline functions and methods (like "C++: function call" methods) -// - - -#endif diff --git a/src/BRepSweep/BRepSweep_Replace.tcl b/src/BRepSweep/BRepSweep_Replace.tcl deleted file mode 100644 index eebe2c0bdc..0000000000 --- a/src/BRepSweep/BRepSweep_Replace.tcl +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright (c) 1999-2014 OPEN CASCADE SAS -# -# This file is part of Open CASCADE Technology software library. -# -# This library is free software; you can redistribute it and/or modify it under -# the terms of the GNU Lesser General Public License version 2.1 as published -# by the Free Software Foundation, with special exception defined in the file -# OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT -# distribution for complete text of the license and disclaimer of any warranty. -# -# Alternatively, this file may be used under the terms of Open CASCADE -# commercial license or contractual agreement. - -proc BRepSweep_Replace:AdmFileType {} { - return "dbadmfile"; -} - -proc BRepSweep_Replace:OutputDirTypeName {} { - return "dbtmpfile"; -} - - -proc BRepSweep_Replace:HandleInputFile { ID } { - - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - - switch $name { - BRepSweep_NumLinearRegularSweep.hxx {return 1;} - default { - return 0; - } - } -} - -proc BRepSweep_Replace:Execute { unit args } { - - global tcl_interactive - - set tcl_interactive 1 - package require Wokutils - - msgprint -i -c "BRepSweep_Replace:Execute" "Copying of BRepSweep includes" - - if { [wokparam -e %Station $unit] != "wnt" } { - set copycmd "cp -p " - set replstr "/" - } { - set copycmd "cmd /c copy" - set replstr "\\\\\\\\" - } - - foreach file $args { - scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name - - regsub ".hxx" $name ".hxx" sourcename - - set source [woklocate -p BRepSweep:source:$sourcename [wokinfo -N $unit]] - set vistarget [woklocate -p BRepSweep:pubinclude:$name [wokinfo -N $unit]] - set target [wokinfo -p pubinclude:$name $unit] - - regsub -all "/" " $source $target" $replstr TheArgs - - msgprint -i -c "BRepSweep_Replace:Execute" "Copy $source to $target" - if { [file exist $target] && [wokparam -e %Station $unit] != "wnt" } { - eval exec "chmod u+w $target" - } - eval exec "$copycmd $TheArgs" - - } - return 0; -} diff --git a/src/BRepSweep/BRepSweep_WOKSteps.edl b/src/BRepSweep/BRepSweep_WOKSteps.edl deleted file mode 100644 index 2f34084d21..0000000000 --- a/src/BRepSweep/BRepSweep_WOKSteps.edl +++ /dev/null @@ -1,24 +0,0 @@ --- Created by: JR --- Copyright (c) 1999 Matra Datavision --- Copyright (c) 1999-2014 OPEN CASCADE SAS --- --- This file is part of Open CASCADE Technology software library. --- --- This library is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License version 2.1 as published --- by the Free Software Foundation, with special exception defined in the file --- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT --- distribution for complete text of the license and disclaimer of any warranty. --- --- Alternatively, this file may be used under the terms of Open CASCADE --- commercial license or contractual agreement. - -@ifnotdefined ( %BRepSweep_WOKSteps_EDL) then - - @set %BRepSweep_WOKSteps_EDL = ""; - - @string %WOKSteps_XcppGroup += " xcpp.repl "; - @set %WOKSteps_xcpp_repl = "*BRepSweep_Replace(xcpp.header)"; - -@endif; - diff --git a/src/BRepSweep/FILES b/src/BRepSweep/FILES deleted file mode 100755 index 2167d09be8..0000000000 --- a/src/BRepSweep/FILES +++ /dev/null @@ -1,3 +0,0 @@ -BRepSweep_NumLinearRegularSweep.hxx -BRepSweep_WOKSteps.edl -BRepSweep_Replace.tcl diff --git a/src/Geom2dLProp/Geom2dLProp.cdl b/src/Geom2dLProp/Geom2dLProp.cdl index b6392c645d..78ea1c0640 100644 --- a/src/Geom2dLProp/Geom2dLProp.cdl +++ b/src/Geom2dLProp/Geom2dLProp.cdl @@ -30,22 +30,21 @@ is class Curve2dTool; - class CLProps2d from Geom2dLProp - instantiates CLProps from LProp(Curve from Geom2d, - Vec2d from gp, - Pnt2d from gp, - Dir2d from gp, - Curve2dTool from Geom2dLProp); + class CLProps2d from Geom2dLProp instantiates + CLProps from LProp(Curve from Geom2d, + Vec2d from gp, + Pnt2d from gp, + Dir2d from gp, + Curve2dTool from Geom2dLProp); class CurAndInf2d; - - private class NumericCurInf2d instantiates NumericCurInf from LProp( - Curve from Geom2d, - Vec2d from gp, - Pnt2d from gp, - Dir2d from gp, - Curve2dTool from Geom2dLProp); - -end Geom2dLProp; + + private class FuncCurExt; + private class FuncCurNul; + class NumericCurInf2d; + ---Purpose: Computes the locals extremas of curvature and the + -- inflections of a bounded curve in 2d. + +end Geom2dLProp; diff --git a/src/LProp/LProp_FuncCurExt.cdl b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cdl similarity index 76% rename from src/LProp/LProp_FuncCurExt.cdl rename to src/Geom2dLProp/Geom2dLProp_FuncCurExt.cdl index 1efec722cc..d2c69576c3 100644 --- a/src/LProp/LProp_FuncCurExt.cdl +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cdl @@ -14,16 +14,17 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -private generic class FuncCurExt from LProp (Curve as any; - Vec as any; -- as Vec or Vec2d - Pnt as any; -- as Pnt or Pnt2d - Dir as any; -- as Dir or Dir2d Vec - Tool as any) -- as Tool(Curve, Pnt, Vec) -inherits FunctionWithDerivative from math +private class FuncCurExt from Geom2dLProp inherits FunctionWithDerivative from math ---Purpose: Function used to find the extremas of curvature in 2d. - + +uses Curve from Geom2d, + Vec2d from gp, + Pnt2d from gp, + Dir2d from gp, + Curve2dTool from Geom2dLProp + is - Create ( C : Curve ; Tol : Real) returns FuncCurExt from LProp; + Create ( C : Curve from Geom2d ; Tol : Real) returns FuncCurExt from Geom2dLProp; Value (me : in out; X : Real; F : out Real) ---Purpose: Returns the value for the variable . @@ -44,7 +45,7 @@ is returns Boolean; fields - theCurve : Curve; + theCurve : Curve from Geom2d; epsX : Real from Standard; end FuncCurExt; diff --git a/src/LProp/LProp_FuncCurExt.gxx b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx similarity index 70% rename from src/LProp/LProp_FuncCurExt.gxx rename to src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx index 9fa76c97c4..ad3a97bb02 100644 --- a/src/LProp/LProp_FuncCurExt.gxx +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurExt.cxx @@ -14,6 +14,11 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + +#include +#include + #include #include @@ -21,9 +26,9 @@ //function : // purpose : //============================================================================= -LProp_FuncCurExt::LProp_FuncCurExt(const Curve& C, - const Standard_Real Tol) -:theCurve(C) +Geom2dLProp_FuncCurExt::Geom2dLProp_FuncCurExt(const Handle(Geom2d_Curve)& C, + const Standard_Real Tol) + :theCurve(C) { epsX = Tol; } @@ -33,13 +38,13 @@ LProp_FuncCurExt::LProp_FuncCurExt(const Curve& C, // purpose : KC = (V1^V2.Z) / ||V1||^3 avec V1 tangente etV2 derivee seconde. // F = d KC/ dU. //============================================================================= -Standard_Boolean LProp_FuncCurExt::Value (const Standard_Real X, - Standard_Real& F) +Standard_Boolean Geom2dLProp_FuncCurExt::Value (const Standard_Real X, + Standard_Real& F) { - Pnt P1; - Vec V1,V2,V3; + gp_Pnt2d P1; + gp_Vec2d V1,V2,V3; - Tool::D3(theCurve,X,P1,V1,V2,V3); + Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3); Standard_Real CPV1V2 = V1.Crossed(V2); Standard_Real CPV1V3 = V1.Crossed(V3); Standard_Real V1V2 = V1.Dot(V2); @@ -60,8 +65,8 @@ Standard_Boolean LProp_FuncCurExt::Value (const Standard_Real X, //function : Derivative // purpose : //============================================================================= -Standard_Boolean LProp_FuncCurExt::Derivative(const Standard_Real X, - Standard_Real& D) +Standard_Boolean Geom2dLProp_FuncCurExt::Derivative(const Standard_Real X, + Standard_Real& D) { Standard_Real F; return Values (X,F,D) ; @@ -71,14 +76,14 @@ Standard_Boolean LProp_FuncCurExt::Derivative(const Standard_Real X, //function : Values // purpose : //============================================================================= -Standard_Boolean LProp_FuncCurExt::Values (const Standard_Real X, - Standard_Real& F, - Standard_Real& D) +Standard_Boolean Geom2dLProp_FuncCurExt::Values (const Standard_Real X, + Standard_Real& F, + Standard_Real& D) { Standard_Real F2; Standard_Real Dx= epsX/100.; - if (X+Dx > Tool::LastParameter(theCurve)) {Dx = - Dx;} + if (X+Dx > Geom2dLProp_Curve2dTool::LastParameter(theCurve)) {Dx = - Dx;} Value (X,F); Value (X+Dx,F2); @@ -93,14 +98,14 @@ Standard_Boolean LProp_FuncCurExt::Values (const Standard_Real X, // purpose : Teste si le parametere coorespond a un minimum du rayon de courbure // par comparaison avec un point voisin. //============================================================================= -Standard_Boolean LProp_FuncCurExt::IsMinKC (const Standard_Real X) const +Standard_Boolean Geom2dLProp_FuncCurExt::IsMinKC (const Standard_Real X) const { - Pnt P1; - Vec V1,V2,V3; + gp_Pnt2d P1; + gp_Vec2d V1,V2,V3; Standard_Real Dx= epsX; Standard_Real KC,KP; - Tool::D3(theCurve,X,P1,V1,V2,V3); + Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3); Standard_Real CPV1V2 = V1.Crossed(V2); Standard_Real V1V1 = V1.SquareMagnitude(); Standard_Real NV1 = Sqrt(V1V1); @@ -110,14 +115,14 @@ Standard_Boolean LProp_FuncCurExt::IsMinKC (const Standard_Real X) const KC = CPV1V2/V13; - if (X+Dx > Tool::LastParameter(theCurve)) {Dx = - Dx;} + if (X+Dx > Geom2dLProp_Curve2dTool::LastParameter(theCurve)) {Dx = - Dx;} - Tool::D3(theCurve,X+Dx,P1,V1,V2,V3); + Geom2dLProp_Curve2dTool::D3(theCurve,X+Dx,P1,V1,V2,V3); CPV1V2 = V1.Crossed(V2); V1V1 = V1.SquareMagnitude(); NV1 = Sqrt(V1V1); V13 = V1V1*NV1; - + if (V13 < gp::Resolution()) { return Standard_False;} KP = CPV1V2/V13; diff --git a/src/LProp/LProp_FuncCurNul.cdl b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cdl similarity index 74% rename from src/LProp/LProp_FuncCurNul.cdl rename to src/Geom2dLProp/Geom2dLProp_FuncCurNul.cdl index f6b66614d8..e11f912a9c 100644 --- a/src/LProp/LProp_FuncCurNul.cdl +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cdl @@ -14,16 +14,18 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -private generic class FuncCurNul from LProp (Curve as any; - Vec as any; -- as Vec or Vec2d - Pnt as any; -- as Pnt or Pnt2d - Dir as any; -- as Dir or Dir2d Vec - Tool as any) -- as Tool(Curve, Pnt, Vec) -inherits FunctionWithDerivative from math +private class FuncCurNul from Geom2dLProp inherits FunctionWithDerivative from math ---Purpose: Function used to find the inflections in 2d. +uses + Curve from Geom2d, + Vec2d from gp, + Pnt2d from gp, + Dir2d from gp, + Curve2dTool from Geom2dLProp + is - Create ( C : Curve) returns FuncCurNul from LProp; + Create ( C : Curve from Geom2d) returns FuncCurNul from Geom2dLProp; Value (me : in out; X : Real; F : out Real) ---Purpose: Returns the value for the variable . @@ -39,7 +41,7 @@ is returns Boolean; fields - theCurve : Curve; + theCurve : Curve from Geom2d; end FuncCurNul; diff --git a/src/LProp/LProp_FuncCurNul.gxx b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx similarity index 83% rename from src/LProp/LProp_FuncCurNul.gxx rename to src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx index c82d480403..50347c9635 100644 --- a/src/LProp/LProp_FuncCurNul.gxx +++ b/src/Geom2dLProp/Geom2dLProp_FuncCurNul.cxx @@ -14,6 +14,11 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + +#include +#include + #include #include @@ -21,7 +26,7 @@ //function : // purpose : //============================================================================= -LProp_FuncCurNul::LProp_FuncCurNul(const Curve& C) +Geom2dLProp_FuncCurNul::Geom2dLProp_FuncCurNul(const Handle(Geom2d_Curve)& C) :theCurve(C) { } @@ -30,7 +35,7 @@ LProp_FuncCurNul::LProp_FuncCurNul(const Curve& C) //function : Value // purpose : F = (V1^V2.Z)/||V1||*||V2|| //============================================================================= -Standard_Boolean LProp_FuncCurNul::Value (const Standard_Real X, +Standard_Boolean Geom2dLProp_FuncCurNul::Value (const Standard_Real X, Standard_Real& F) { Standard_Real D; @@ -41,7 +46,7 @@ Standard_Boolean LProp_FuncCurNul::Value (const Standard_Real X, //function : Derivative // purpose : //============================================================================= -Standard_Boolean LProp_FuncCurNul::Derivative(const Standard_Real X, +Standard_Boolean Geom2dLProp_FuncCurNul::Derivative(const Standard_Real X, Standard_Real& D) { Standard_Real F; @@ -52,13 +57,13 @@ Standard_Boolean LProp_FuncCurNul::Derivative(const Standard_Real X, //function : Values // purpose : F = (V1^V2.Z)/||V1||*||V2|| //============================================================================= -Standard_Boolean LProp_FuncCurNul::Values (const Standard_Real X, +Standard_Boolean Geom2dLProp_FuncCurNul::Values (const Standard_Real X, Standard_Real& F, Standard_Real& D) { - Pnt P1; - Vec V1,V2,V3; - Tool::D3(theCurve,X,P1,V1,V2,V3); + gp_Pnt2d P1; + gp_Vec2d V1,V2,V3; + Geom2dLProp_Curve2dTool::D3(theCurve,X,P1,V1,V2,V3); Standard_Real CP1 = V1.Crossed(V2); Standard_Real CP2 = V1.Crossed(V3); Standard_Real V1V2 = V1.Dot(V2); diff --git a/src/LProp/LProp_NumericCurInf.cdl b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cdl similarity index 65% rename from src/LProp/LProp_NumericCurInf.cdl rename to src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cdl index 7c035670de..58a576f4d2 100644 --- a/src/LProp/LProp_NumericCurInf.cdl +++ b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cdl @@ -14,34 +14,33 @@ -- Alternatively, this file may be used under the terms of Open CASCADE -- commercial license or contractual agreement. -generic class NumericCurInf from LProp (Curve as any; - Vec as any; -- as Vec or Vec2d - Pnt as any; -- as Pnt or Pnt2d - Dir as any; -- as Dir or Dir2d Vec - Tool as any) -- as Tool(Curve, Pnt, Vec) - - ---Purpose: Computes the locals extremas of curvature and the - -- inflections of a bounded curve in 2d. +class NumericCurInf2d from Geom2dLProp + + ---Purpose: Computes the locals extremas of curvature and the + -- inflections of a bounded curve in 2d. uses - CurAndInf from LProp + CurAndInf from LProp, + Curve from Geom2d, + Vec2d from gp, + Pnt2d from gp, + Dir2d from gp, + Curve2dTool from Geom2dLProp -private class FCurExt instantiates FuncCurExt from LProp (Curve,Vec,Pnt,Dir,Tool); -private class FCurNul instantiates FuncCurNul from LProp (Curve,Vec,Pnt,Dir,Tool); - is + Create; - PerformCurExt (me : in out; C : Curve; Result : in out CurAndInf) + PerformCurExt (me : in out; C : Curve from Geom2d; Result : in out CurAndInf) ---Purpose: Computes the locals extremas of curvature. is static; - PerformInf (me : in out; C : Curve; Result : in out CurAndInf) + PerformInf (me : in out; C : Curve from Geom2d; Result : in out CurAndInf) ---Purpose: Computes the inflections. is static; PerformCurExt (me : in out; - C : Curve ; + C : Curve from Geom2d ; UMin : Real; UMax : Real; Result : in out CurAndInf) @@ -50,7 +49,7 @@ is is static; PerformInf (me : in out; - C : Curve ; + C : Curve from Geom2d ; UMin : Real; UMax : Real; Result : in out CurAndInf) @@ -65,4 +64,4 @@ is fields isDone : Boolean from Standard; -end NumericCurInf; +end NumericCurInf2d; diff --git a/src/LProp/LProp_NumericCurInf.gxx b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx similarity index 68% rename from src/LProp/LProp_NumericCurInf.gxx rename to src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx index 7991a6ff0e..7f2449abd8 100644 --- a/src/LProp/LProp_NumericCurInf.gxx +++ b/src/Geom2dLProp/Geom2dLProp_NumericCurInf2d.cxx @@ -14,6 +14,12 @@ // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. +#include + +#include +#include + +#include #include #include #include @@ -22,26 +28,26 @@ //function : //purpose : //======================================================================= -LProp_NumericCurInf::LProp_NumericCurInf() +Geom2dLProp_NumericCurInf2d::Geom2dLProp_NumericCurInf2d() { } //======================================================================= //function : PerformCurExt //purpose : //======================================================================= -void LProp_NumericCurInf::PerformCurExt (const Curve& C,LProp_CurAndInf& Result) +void Geom2dLProp_NumericCurInf2d::PerformCurExt (const Handle(Geom2d_Curve)& C,LProp_CurAndInf& Result) { - PerformCurExt(C,Tool::FirstParameter(C),Tool::LastParameter(C),Result); + PerformCurExt(C,Geom2dLProp_Curve2dTool::FirstParameter(C),Geom2dLProp_Curve2dTool::LastParameter(C),Result); } //======================================================================= //function : PerformCurExt //purpose : //======================================================================= -void LProp_NumericCurInf::PerformCurExt (const Curve& C, - const Standard_Real UMin, - const Standard_Real UMax, - LProp_CurAndInf& Result) +void Geom2dLProp_NumericCurInf2d::PerformCurExt (const Handle(Geom2d_Curve)& C, + const Standard_Real UMin, + const Standard_Real UMax, + LProp_CurAndInf& Result) { isDone = Standard_True; @@ -51,7 +57,7 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C, // la premiere recherce se fait avec une tolerance assez grande // car la derivee de la fonction est estimee assez grossierement. - LProp_FCurExt F(C,EpsH); + Geom2dLProp_FuncCurExt F(C,EpsH); Standard_Integer NbSamples = 100; Standard_Boolean SolType; @@ -62,9 +68,9 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C, Standard_Real Param = SolRoot.Value(j); // la solution est affinee. math_BracketedRoot BS (F, - Param - EpsH, - Param + EpsH, - Tol); + Param - EpsH, + Param + EpsH, + Tol); if (BS.IsDone()) {Param = BS.Root();} SolType = F.IsMinKC(Param); Result.AddExtCur(Param,SolType); @@ -79,22 +85,22 @@ void LProp_NumericCurInf::PerformCurExt (const Curve& C, //function : PerformInf //purpose : //======================================================================= -void LProp_NumericCurInf::PerformInf(const Curve& C,LProp_CurAndInf& Result) +void Geom2dLProp_NumericCurInf2d::PerformInf(const Handle(Geom2d_Curve)& C,LProp_CurAndInf& Result) { - PerformInf(C,Tool::FirstParameter(C),Tool::LastParameter(C),Result); + PerformInf(C,Geom2dLProp_Curve2dTool::FirstParameter(C),Geom2dLProp_Curve2dTool::LastParameter(C),Result); } //======================================================================= //function : PerformInf //purpose : //======================================================================= -void LProp_NumericCurInf::PerformInf(const Curve& C, - const Standard_Real UMin, - const Standard_Real UMax, - LProp_CurAndInf& Result) +void Geom2dLProp_NumericCurInf2d::PerformInf(const Handle(Geom2d_Curve)& C, + const Standard_Real UMin, + const Standard_Real UMax, + LProp_CurAndInf& Result) { isDone = Standard_True; - LProp_FCurNul F(C); + Geom2dLProp_FuncCurNul F(C); Standard_Real EpsX = 1.e-6; Standard_Real EpsF = 1.e-6; Standard_Integer NbSamples = 30; @@ -115,7 +121,7 @@ void LProp_NumericCurInf::PerformInf(const Curve& C, //function : IsDone //purpose : //======================================================================= -Standard_Boolean LProp_NumericCurInf::IsDone() const +Standard_Boolean Geom2dLProp_NumericCurInf2d::IsDone() const { return isDone; } diff --git a/src/LProp/LProp.cdl b/src/LProp/LProp.cdl index ec14e0db21..261c2a8480 100644 --- a/src/LProp/LProp.cdl +++ b/src/LProp/LProp.cdl @@ -72,12 +72,6 @@ is class AnalyticCurInf; ---Purpose: Computes the locals extremas of curvature of a gp curve. - private generic class FuncCurExt; - private generic class FuncCurNul; - generic class NumericCurInf, FCurExt, FCurNul; - ---Purpose: Computes the locals extremas of curvature and the - -- inflections of a bounded curve in 2d. - private class SequenceOfCIType instantiates Sequence from TCollection (CIType from LProp); diff --git a/src/Primitives/Primitives.cdl b/src/Primitives/Primitives.cdl deleted file mode 100644 index 72e58a5403..0000000000 --- a/src/Primitives/Primitives.cdl +++ /dev/null @@ -1,50 +0,0 @@ --- Created on: 1991-07-23 --- Created by: Christophe MARION --- Copyright (c) 1991-1999 Matra Datavision --- Copyright (c) 1999-2014 OPEN CASCADE SAS --- --- This file is part of Open CASCADE Technology software library. --- --- This library is free software; you can redistribute it and/or modify it under --- the terms of the GNU Lesser General Public License version 2.1 as published --- by the Free Software Foundation, with special exception defined in the file --- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT --- distribution for complete text of the license and disclaimer of any warranty. --- --- Alternatively, this file may be used under the terms of Open CASCADE --- commercial license or contractual agreement. - -package Primitives - - ---Purpose: This package describes algorithms to build - -- topological primitives. - -- - -- The algorithms in this package are generic. It - -- contains : - -- - -- * The Builder signature class. Describes the - -- services required from the Topology Data - -- Structure to build the following primitives. - -- - -- * The OneAxis generic class. Algorithm used to - -- build rotational primitives. - -- - -- * The Wedge generic class. Algorithm to build - -- boxes and wedges. - -uses - gp -- gp provides all geometrical information - -is - - - enumeration Direction is - ---Purpose: - XMin, XMax, YMin, YMax, ZMin, ZMax - end Direction; - - deferred generic class OneAxis; - - generic class Wedge; - -end Primitives; diff --git a/src/Sweep/Sweep.cdl b/src/Sweep/Sweep.cdl index 42560fdc16..11d91e24f3 100644 --- a/src/Sweep/Sweep.cdl +++ b/src/Sweep/Sweep.cdl @@ -28,11 +28,6 @@ uses is - deferred generic class LinearRegularSweep, - Array2OfShapes, - SequenceOfShapes; - - -- -- The following classes provides a directing topology for the -- LinearRegularSweep. This is the topology of an open or diff --git a/src/TKPrim/PACKAGES b/src/TKPrim/PACKAGES index 0d1bb368b8..029fbfa057 100755 --- a/src/TKPrim/PACKAGES +++ b/src/TKPrim/PACKAGES @@ -1,5 +1,4 @@ BRepPrim -Primitives BRepSweep Sweep BRepPrimAPI