1 // Created on: 1993-06-25
2 // Created by: Laurent BOURESCHE
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
18 #include <BRepSweep_Prism.hxx>
19 #include <BRepSweep_Translation.hxx>
21 #include <gp_Trsf.hxx>
23 #include <Precision.hxx>
24 #include <Standard_ConstructionError.hxx>
25 #include <Sweep_NumShape.hxx>
26 #include <TopLoc_Location.hxx>
27 #include <TopoDS_Shape.hxx>
29 //=======================================================================
30 //function : BRepSweep_Prism
32 //=======================================================================
33 BRepSweep_Prism::BRepSweep_Prism
34 (const TopoDS_Shape& S,
36 const Standard_Boolean C,
37 const Standard_Boolean Canonize):
45 Standard_ConstructionError_Raise_if
46 (V.Magnitude()<=Precision::Confusion(),"BRepSweep_Prism::Constructor");
49 //=======================================================================
50 //function : BRepSweep_Prism
52 //=======================================================================
54 BRepSweep_Prism::BRepSweep_Prism
55 (const TopoDS_Shape& S,
57 const Standard_Boolean Inf,
58 const Standard_Boolean C,
59 const Standard_Boolean Canonize):
70 //=======================================================================
73 //=======================================================================
75 TopoDS_Shape BRepSweep_Prism::Shape()
77 return myTranslation.Shape();
81 //=======================================================================
84 //=======================================================================
86 TopoDS_Shape BRepSweep_Prism::Shape(const TopoDS_Shape& aGenS)
88 return myTranslation.Shape(aGenS);
92 //=======================================================================
93 //function : FirstShape
95 //=======================================================================
97 TopoDS_Shape BRepSweep_Prism::FirstShape()
99 return myTranslation.FirstShape();
103 //=======================================================================
104 //function : FirstShape
106 //=======================================================================
108 TopoDS_Shape BRepSweep_Prism::FirstShape(const TopoDS_Shape& aGenS)
110 return myTranslation.FirstShape(aGenS);
114 //=======================================================================
115 //function : LastShape
117 //=======================================================================
119 TopoDS_Shape BRepSweep_Prism::LastShape()
121 return myTranslation.LastShape();
125 //=======================================================================
126 //function : LastShape
128 //=======================================================================
130 TopoDS_Shape BRepSweep_Prism::LastShape(const TopoDS_Shape& aGenS)
132 return myTranslation.LastShape(aGenS);
136 //=======================================================================
139 //=======================================================================
141 gp_Vec BRepSweep_Prism::Vec()const
143 return myTranslation.Vec();
147 //=======================================================================
148 //function : NumShape
150 //=======================================================================
152 Sweep_NumShape BRepSweep_Prism::NumShape()const
154 return Sweep_NumShape(2,TopAbs_EDGE);
158 //=======================================================================
159 //function : NumShape
161 //=======================================================================
163 Sweep_NumShape BRepSweep_Prism::NumShape(const Standard_Boolean Inf)const
167 N.Init(0,TopAbs_EDGE,Standard_False,Standard_True,Standard_True);
170 N.Init(1,TopAbs_EDGE,Standard_False,Standard_False,Standard_True);
176 //=======================================================================
177 //function : Location
179 //=======================================================================
181 TopLoc_Location BRepSweep_Prism::Location(const gp_Vec& V)const
184 gpt.SetTranslation(V);
185 TopLoc_Location L(gpt);