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_MakeRevol_HeaderFile
18 #define _BRepPrimAPI_MakeRevol_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <BRepSweep_Revol.hxx>
25 #include <TopTools_ListOfShape.hxx>
26 #include <BRepPrimAPI_MakeSweep.hxx>
27 #include <BRepTools_History.hxx>
32 //! Class to make revolved sweep topologies.
34 //! a revolved sweep is defined by :
36 //! * A basis topology which is swept.
38 //! The basis topology must not contain solids
39 //! (neither composite solids.).
41 //! The basis topology may be copied or shared in
44 //! * A rotation axis and angle :
46 //! - The axis is an Ax1 from gp.
48 //! - The angle is in [0, 2*Pi].
50 //! - The angle default value is 2*Pi.
52 //! The result is a topology with a higher dimension :
58 //! - Shell -> CompSolid.
60 //! Sweeping a Compound sweeps the elements of the
61 //! compound and creates a compound with the
63 class BRepPrimAPI_MakeRevol : public BRepPrimAPI_MakeSweep
69 //! Builds the Revol of base S, axis A and angle D. If C
70 //! is true, S is copied.
71 Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Real D, const Standard_Boolean Copy = Standard_False);
73 //! Builds the Revol of base S, axis A and angle 2*Pi. If
74 //! C is true, S is copied.
75 Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Boolean Copy = Standard_False);
77 //! Returns the internal sweeping algorithm.
78 Standard_EXPORT const BRepSweep_Revol& Revol() const;
80 //! Builds the resulting shape (redefined from MakeShape).
81 Standard_EXPORT virtual void Build(const Message_ProgressRange& theRange = Message_ProgressRange()) Standard_OVERRIDE;
83 //! Returns the first shape of the revol (coinciding with
84 //! the generating shape).
85 Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
87 //! Returns the TopoDS Shape of the end of the revol.
88 Standard_EXPORT TopoDS_Shape LastShape() Standard_OVERRIDE;
90 //! Returns list of shape generated from shape S
91 //! Warning: shape S must be shape of type VERTEX, EDGE, FACE, SOLID.
92 //! For shapes of other types method always returns empty list
93 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
95 //! Returns true if the shape S has been deleted.
96 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
99 //! Returns the TopoDS Shape of the beginning of the revolution,
100 //! generated with theShape (subShape of the generating shape).
101 Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
103 //! Returns the TopoDS Shape of the end of the revolution,
104 //! generated with theShape (subShape of the generating shape).
105 Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
107 //! Check if there are degenerated edges in the result.
108 Standard_EXPORT Standard_Boolean HasDegenerated() const;
110 //! Returns the list of degenerated edges
111 Standard_EXPORT const TopTools_ListOfShape& Degenerated() const;
115 //! Checks possibilities of producing self-intersection surface
116 //! returns true if all surfaces are valid
117 Standard_EXPORT Standard_Boolean CheckValidity(const TopoDS_Shape& theShape, const gp_Ax1& theA);
123 BRepSweep_Revol myRevol;
124 TopTools_ListOfShape myDegenerated;
125 Handle(BRepTools_History) myHist;
126 Standard_Boolean myIsBuild;
137 #endif // _BRepPrimAPI_MakeRevol_HeaderFile