1 // Created on: 1993-10-12
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 #ifndef _BRepPrimAPI_MakePrism_HeaderFile
18 #define _BRepPrimAPI_MakePrism_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepSweep_Prism.hxx>
25 #include <BRepPrimAPI_MakeSweep.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <TopTools_ListOfShape.hxx>
31 class BRepSweep_Prism;
34 //! Describes functions to build linear swept topologies, called prisms.
35 //! A prism is defined by:
36 //! - a basis shape, which is swept, and
37 //! - a sweeping direction, which is:
38 //! - a vector for finite prisms, or
39 //! - a direction for infinite or semi-infinite prisms.
40 //! The basis shape must not contain any solids.
41 //! The profile generates objects according to the following rules:
42 //! - Vertices generate Edges
43 //! - Edges generate Faces.
44 //! - Wires generate Shells.
45 //! - Faces generate Solids.
46 //! - Shells generate Composite Solids
47 //! A MakePrism object provides a framework for:
48 //! - defining the construction of a prism,
49 //! - implementing the construction algorithm, and
50 //! - consulting the result.
51 class BRepPrimAPI_MakePrism : public BRepPrimAPI_MakeSweep
58 //! Builds the prism of base S and vector V. If C is true,
59 //! S is copied. If Canonize is true then generated surfaces
60 //! are attempted to be canonized in simple types
61 Standard_EXPORT BRepPrimAPI_MakePrism(const TopoDS_Shape& S, const gp_Vec& V, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True);
63 //! Builds a semi-infinite or an infinite prism of base S.
64 //! If Inf is true the prism is infinite, if Inf is false
65 //! the prism is semi-infinite (in the direction D). If C
66 //! is true S is copied (for semi-infinite prisms).
67 //! If Canonize is true then generated surfaces
68 //! are attempted to be canonized in simple types
69 Standard_EXPORT BRepPrimAPI_MakePrism(const TopoDS_Shape& S, const gp_Dir& D, const Standard_Boolean Inf = Standard_True, const Standard_Boolean Copy = Standard_False, const Standard_Boolean Canonize = Standard_True);
71 //! Returns the internal sweeping algorithm.
72 Standard_EXPORT const BRepSweep_Prism& Prism() const;
74 //! Builds the resulting shape (redefined from MakeShape).
75 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
77 //! Returns the TopoDS Shape of the bottom of the prism.
78 Standard_EXPORT TopoDS_Shape FirstShape();
80 //! Returns the TopoDS Shape of the top of the prism.
81 //! In the case of a finite prism, FirstShape returns the
82 //! basis of the prism, in other words, S if Copy is false;
83 //! otherwise, the copy of S belonging to the prism.
84 //! LastShape returns the copy of S translated by V at the
85 //! time of construction.
86 Standard_EXPORT TopoDS_Shape LastShape();
88 //! Returns ListOfShape from TopTools.
89 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
91 //! Returns the TopoDS Shape of the bottom of the prism.
92 //! generated with theShape (subShape of the generating shape).
93 Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
95 //! Returns the TopoDS Shape of the top of the prism.
96 //! generated with theShape (subShape of the generating shape).
97 Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
112 BRepSweep_Prism myPrism;
123 #endif // _BRepPrimAPI_MakePrism_HeaderFile