1 // Created on: 1993-10-14
2 // Created by: Remi LEQUETTE
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.
17 // Modified by skv - Fri Mar 4 15:50:09 2005
18 // Add methods for supporting history.
20 #include <BRepLib.hxx>
21 #include <BRepPrimAPI_MakePrism.hxx>
22 #include <BRepSweep_Prism.hxx>
25 #include <TopoDS_Shape.hxx>
27 // perform checks on the argument
28 static const TopoDS_Shape& check(const TopoDS_Shape& S)
30 BRepLib::BuildCurves3d(S);
34 //=======================================================================
35 //function : BRepPrimAPI_MakePrism
37 //=======================================================================
39 BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S,
41 const Standard_Boolean Copy,
42 const Standard_Boolean Canonize) :
43 myPrism(check(S),V,Copy,Canonize)
49 //=======================================================================
50 //function : BRepPrimAPI_MakePrism
52 //=======================================================================
54 BRepPrimAPI_MakePrism::BRepPrimAPI_MakePrism(const TopoDS_Shape& S,
56 const Standard_Boolean Inf,
57 const Standard_Boolean Copy,
58 const Standard_Boolean Canonize) :
59 myPrism(check(S),D,Inf,Copy,Canonize)
65 //=======================================================================
68 //=======================================================================
70 const BRepSweep_Prism& BRepPrimAPI_MakePrism::Prism()const
76 //=======================================================================
79 //=======================================================================
81 void BRepPrimAPI_MakePrism::Build()
83 myShape = myPrism.Shape();
87 //=======================================================================
88 //function : FirstShape
90 //=======================================================================
92 TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape()
94 return myPrism.FirstShape();
98 //=======================================================================
99 //function : LastShape
101 //=======================================================================
103 TopoDS_Shape BRepPrimAPI_MakePrism::LastShape()
105 return myPrism.LastShape();
109 //=======================================================================
110 //function : Generated
112 //=======================================================================
114 const TopTools_ListOfShape& BRepPrimAPI_MakePrism::Generated (const TopoDS_Shape& S)
117 if (myPrism.IsUsed(S) && myPrism.GenIsUsed(S))
119 myGenerated.Append(myPrism.Shape(S));
126 // Modified by skv - Fri Mar 4 15:50:09 2005 Begin
128 //=======================================================================
129 //function : FirstShape
130 //purpose : This method returns the bottom shape of the prism, generated
131 // with theShape (subShape of the generating shape)
132 //=======================================================================
134 TopoDS_Shape BRepPrimAPI_MakePrism::FirstShape(const TopoDS_Shape &theShape)
136 return myPrism.FirstShape(theShape);
140 //=======================================================================
141 //function : LastShape
142 //purpose : This method returns the top shape of the prism, generated
143 // with theShape (subShape of the generating shape)
144 //=======================================================================
146 TopoDS_Shape BRepPrimAPI_MakePrism::LastShape(const TopoDS_Shape &theShape)
148 return myPrism.LastShape(theShape);
151 // Modified by skv - Fri Mar 4 15:50:09 2005 End
153 //=======================================================================
154 //function : IsDeleted
156 //=======================================================================
157 Standard_Boolean BRepPrimAPI_MakePrism::IsDeleted(const TopoDS_Shape& S)
159 return !myPrism.IsUsed(S);