0026460: Implicit cast to TopoDS_Shape compilation error due to ambiguous conversion
[occt.git] / src / BRepBuilderAPI / BRepBuilderAPI_MakeSolid.hxx
CommitLineData
42cf5bc1 1// Created on: 1993-07-21
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 _BRepBuilderAPI_MakeSolid_HeaderFile
18#define _BRepBuilderAPI_MakeSolid_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <BRepLib_MakeSolid.hxx>
25#include <BRepBuilderAPI_MakeShape.hxx>
26#include <Standard_Boolean.hxx>
27class StdFail_NotDone;
28class TopoDS_CompSolid;
29class TopoDS_Shell;
30class TopoDS_Solid;
31class TopoDS_Shape;
32
33
34//! Describes functions to build a solid from shells.
35//! A solid is made of one shell, or a series of shells, which
36//! do not intersect each other. One of these shells
37//! constitutes the outside skin of the solid. It may be closed
38//! (a finite solid) or open (an infinite solid). Other shells
39//! form hollows (cavities) in these previous ones. Each
40//! must bound a closed volume.
41//! A MakeSolid object provides a framework for:
42//! - defining and implementing the construction of a solid, and
43//! - consulting the result.
44class BRepBuilderAPI_MakeSolid : public BRepBuilderAPI_MakeShape
45{
46public:
47
48 DEFINE_STANDARD_ALLOC
49
50
51 //! Initializes the construction of a solid. An empty solid is
52 //! considered to cover the whole space. The Add function
53 //! is used to define shells to bound it.
54 Standard_EXPORT BRepBuilderAPI_MakeSolid();
55
56 //! Make a solid from a CompSolid.
57 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_CompSolid& S);
58
59 //! Make a solid from a shell.
60 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S);
61
62 //! Make a solid from two shells.
63 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2);
64
65 //! Make a solid from three shells.
66 //! Constructs a solid
67 //! - covering the whole space, or
68 //! - from shell S, or
69 //! - from two shells S1 and S2, or
70 //! - from three shells S1, S2 and S3, or
71 //! Warning
72 //! No check is done to verify the conditions of coherence
73 //! of the resulting solid. In particular, S1, S2 (and S3) must
74 //! not intersect each other.
75 //! Besides, after all shells have been added using the Add
76 //! function, one of these shells should constitute the outside
77 //! skin of the solid; it may be closed (a finite solid) or open
78 //! (an infinite solid). Other shells form hollows (cavities) in
79 //! these previous ones. Each must bound a closed volume.
80 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Shell& S1, const TopoDS_Shell& S2, const TopoDS_Shell& S3);
81
82 //! Make a solid from a solid. Usefull for adding later.
83 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So);
84
85 //! Add a shell to a solid.
86 //!
87 //! Constructs a solid:
88 //! - from the solid So, to which shells can be added, or
89 //! - by adding the shell S to the solid So.
90 //! Warning
91 //! No check is done to verify the conditions of coherence
92 //! of the resulting solid. In particular S must not intersect the solid S0.
93 //! Besides, after all shells have been added using the Add
94 //! function, one of these shells should constitute the outside
95 //! skin of the solid. It may be closed (a finite solid) or open
96 //! (an infinite solid). Other shells form hollows (cavities) in
97 //! the previous ones. Each must bound a closed volume.
98 Standard_EXPORT BRepBuilderAPI_MakeSolid(const TopoDS_Solid& So, const TopoDS_Shell& S);
99
100 //! Adds the shell to the current solid.
101 //! Warning
102 //! No check is done to verify the conditions of coherence
103 //! of the resulting solid. In particular, S must not intersect
104 //! other shells of the solid under construction.
105 //! Besides, after all shells have been added, one of
106 //! these shells should constitute the outside skin of the
107 //! solid. It may be closed (a finite solid) or open (an
108 //! infinite solid). Other shells form hollows (cavities) in
109 //! these previous ones. Each must bound a closed volume.
110 Standard_EXPORT void Add (const TopoDS_Shell& S);
111
112 //! Returns true if the solid is built.
113 //! For this class, a solid under construction is always valid.
114 //! If no shell has been added, it could be a whole-space
115 //! solid. However, no check was done to verify the
116 //! conditions of coherence of the resulting solid.
117 Standard_EXPORT virtual Standard_Boolean IsDone() const Standard_OVERRIDE;
118
119 //! Returns the new Solid.
ecac41a9 120 Standard_EXPORT const TopoDS_Solid& Solid();
121 Standard_EXPORT operator TopoDS_Solid();
42cf5bc1 122
123 Standard_EXPORT virtual Standard_Boolean IsDeleted (const TopoDS_Shape& S) Standard_OVERRIDE;
124
125
126
127
128protected:
129
130
131
132
133
134private:
135
136
137
138 BRepLib_MakeSolid myMakeSolid;
139
140
141};
142
143
144
145
146
147
148
149#endif // _BRepBuilderAPI_MakeSolid_HeaderFile