0030346: Modeling Algorithms - BRepPrimAPI_MakeRevol throws "BRepSweep_Translation...
[occt.git] / src / BRepPrimAPI / BRepPrimAPI_MakePrism.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_MakePrism_HeaderFile
18#define _BRepPrimAPI_MakePrism_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <BRepSweep_Prism.hxx>
25#include <BRepPrimAPI_MakeSweep.hxx>
26#include <Standard_Boolean.hxx>
27#include <TopTools_ListOfShape.hxx>
28class TopoDS_Shape;
29class gp_Vec;
30class gp_Dir;
31class BRepSweep_Prism;
32
33
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.
51class BRepPrimAPI_MakePrism : public BRepPrimAPI_MakeSweep
52{
53public:
54
55 DEFINE_STANDARD_ALLOC
56
57
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);
62
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);
70
71 //! Returns the internal sweeping algorithm.
72 Standard_EXPORT const BRepSweep_Prism& Prism() const;
73
74 //! Builds the resulting shape (redefined from MakeShape).
75 Standard_EXPORT virtual void Build() Standard_OVERRIDE;
76
77 //! Returns the TopoDS Shape of the bottom of the prism.
79104795 78 Standard_EXPORT TopoDS_Shape FirstShape() Standard_OVERRIDE;
42cf5bc1 79
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.
79104795 86 Standard_EXPORT TopoDS_Shape LastShape() Standard_OVERRIDE;
42cf5bc1 87
88 //! Returns ListOfShape from TopTools.
89 Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S) Standard_OVERRIDE;
80eeb3ce 90
91 //! Returns true if the shape S has been deleted.
92 Standard_EXPORT virtual Standard_Boolean IsDeleted(const TopoDS_Shape& S) Standard_OVERRIDE;
93
42cf5bc1 94 //! Returns the TopoDS Shape of the bottom of the prism.
95 //! generated with theShape (subShape of the generating shape).
96 Standard_EXPORT TopoDS_Shape FirstShape (const TopoDS_Shape& theShape);
97
98 //! Returns the TopoDS Shape of the top of the prism.
99 //! generated with theShape (subShape of the generating shape).
100 Standard_EXPORT TopoDS_Shape LastShape (const TopoDS_Shape& theShape);
101
42cf5bc1 102protected:
103
104
105
106
107
108private:
109
110
111
112 BRepSweep_Prism myPrism;
113
114
115};
116
117
118
119
120
121
122
123#endif // _BRepPrimAPI_MakePrism_HeaderFile