0030346: Modeling Algorithms - BRepPrimAPI_MakeRevol throws "BRepSweep_Translation...
[occt.git] / src / BRepPrimAPI / BRepPrimAPI_MakeRevol.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _BRepPrimAPI_MakeRevol_HeaderFile
18#define _BRepPrimAPI_MakeRevol_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <BRepSweep_Revol.hxx>
25#include <TopTools_ListOfShape.hxx>
26#include <BRepPrimAPI_MakeSweep.hxx>
7e4ff648 27#include <BRepTools_History.hxx>
42cf5bc1 28#include <Standard_Real.hxx>
29#include <Standard_Boolean.hxx>
30class TopoDS_Shape;
31class gp_Ax1;
32class BRepSweep_Revol;
33
34
35//! Class to make revolved sweep topologies.
36//!
37//! a revolved sweep is defined by :
38//!
39//! * A basis topology which is swept.
40//!
41//! The basis topology must not contain solids
42//! (neither composite solids.).
43//!
44//! The basis topology may be copied or shared in
45//! the result.
46//!
47//! * A rotation axis and angle :
48//!
49//! - The axis is an Ax1 from gp.
50//!
51//! - The angle is in [0, 2*Pi].
52//!
53//! - The angle default value is 2*Pi.
54//!
55//! The result is a topology with a higher dimension :
56//!
57//! - Vertex -> Edge.
58//! - Edge -> Face.
59//! - Wire -> Shell.
60//! - Face -> Solid.
61//! - Shell -> CompSolid.
62//!
63//! Sweeping a Compound sweeps the elements of the
64//! compound and creates a compound with the
65//! results.
66class BRepPrimAPI_MakeRevol : public BRepPrimAPI_MakeSweep
67{
68public:
69
70 DEFINE_STANDARD_ALLOC
71
72
73 //! Builds the Revol of base S, axis A and angle D. If C
74 //! is true, S is copied.
75 Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Real D, const Standard_Boolean Copy = Standard_False);
76
77 //! Builds the Revol of base S, axis A and angle 2*Pi. If
78 //! C is true, S is copied.
79 Standard_EXPORT BRepPrimAPI_MakeRevol(const TopoDS_Shape& S, const gp_Ax1& A, const Standard_Boolean Copy = Standard_False);
80
81 //! Returns the internal sweeping algorithm.
82 Standard_EXPORT const BRepSweep_Revol& Revol() const;
83
84 //! Builds the resulting shape (redefined from MakeShape).
85 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
86
87 //! Returns the first shape of the revol (coinciding with
88 //! the generating shape).
79104795 89 Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
42cf5bc1 90
91 //! Returns the TopoDS Shape of the end of the revol.
79104795 92 Standard_EXPORT TopoDS_Shape LastShape() Standard_OVERRIDE;
42cf5bc1 93
7e4ff648 94 //! Returns list of shape generated from shape S
95 //! Warning: shape S must be shape of type VERTEX, EDGE, FACE, SOLID.
96 //! For shapes of other types method always returns empty list
42cf5bc1 97 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
80eeb3ce 98
99 //! Returns true if the shape S has been deleted.
100 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
101
42cf5bc1 102
103 //! Returns the TopoDS Shape of the beginning of the revolution,
104 //! generated with theShape (subShape of the generating shape).
105 Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
106
107 //! Returns the TopoDS Shape of the end of the revolution,
108 //! generated with theShape (subShape of the generating shape).
109 Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
110
111 //! Check if there are degenerated edges in the result.
112 Standard_EXPORT Standard_Boolean HasDegenerated() const;
113
114 Standard_EXPORT const TopTools_ListOfShape& Degenerated() const;
115
116
42cf5bc1 117protected:
118
119
120
121
122
123private:
124
125
126
127 BRepSweep_Revol myRevol;
128 TopTools_ListOfShape myDegenerated;
7e4ff648 129 Handle(BRepTools_History) myHist;
42cf5bc1 130
131
132};
133
134
135
136
137
138
139
140#endif // _BRepPrimAPI_MakeRevol_HeaderFile