File: BOPAlgo_MakerVolume.hxx

package info (click to toggle)
oce 0.18.3-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 301,548 kB
  • sloc: cpp: 1,190,609; ansic: 67,225; sh: 11,630; tcl: 7,954; cs: 5,221; python: 2,867; java: 1,522; makefile: 342; xml: 292; perl: 37
file content (205 lines) | stat: -rw-r--r-- 5,607 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _BOPAlgo_MakerVolume_HeaderFile
#define _BOPAlgo_MakerVolume_HeaderFile

#include <Standard.hxx>
#include <Standard_DefineAlloc.hxx>
#include <Standard_Macro.hxx>

#include <Standard_Boolean.hxx>
#include <Bnd_Box.hxx>
#include <TopoDS_Solid.hxx>
#include <BOPCol_ListOfShape.hxx>
#include <BOPAlgo_Builder.hxx>
#include <BOPCol_BaseAllocator.hxx>
#include <BOPCol_MapOfShape.hxx>
class TopoDS_Solid;
class BOPAlgo_PaveFiller;



//! The algorithm is to build solids from set of shapes.
//! It uses the BOPAlgo_Builder algorithm to intersect the given shapes
//! and build the images of faces (if needed) and BOPAlgo_BuilderSolid
//! algorithm to build the solids.
//!
//! Steps of the algorithm:
//! 1. Collect all faces: intersect the shapes if necessary and collect
//! the images of faces, otherwise just collect the faces to the
//! <myFaces> list;
//! All faces on this step added twice, with orientation FORWARD
//! and REVERSED;
//!
//! 2. Create bounding box covering all the faces from <myFaces> and
//! create solid box from corner points of that bounding box
//! (myBBox, mySBox). Add faces from that box to <myFaces>;
//!
//! 3. Build solids from <myFaces> using BOPAlgo_BuilderSolid algorithm;
//!
//! 4. Treat the result: Eliminate solid containig faces from <mySBox>;
//!
//! 5. Fill internal shapes: add internal vertices and edges into
//! created solids;
//!
//! 6. Prepare the history.
//!
//! Fields:
//! <myIntersect> - boolean flag. It defines whether intersect shapes
//! from <myArguments> (if set to TRUE) or not (FALSE).
//! The default value is TRUE. By setting it to FALSE
//! the user should guarantee that shapes in <myArguments>
//! do not interfere with each other, otherwise the result
//! is unpredictable.
//!
//! <myBBox>      - bounding box, covering all faces from <myFaces>.
//!
//! <mySBox>      - Solid box created from the corner points of <myBBox>.
//!
//! <myFaces>     - the list is to keep the "final" faces, that will be
//! given to the BOPAlgo_BuilderSolid algorithm.
//! If the shapes have been interfered it should contain
//! the images of the source shapes, otherwise its just
//! the original faces.
//! It also contains the faces from <mySBox>.
//!
//! Fields inherited from BOPAlgo_Builder:
//!
//! <myArguments> - list of the source shapes. The source shapes can have
//! any type, but each shape must not be self-interfered.
//!
//! <myShape>     - Result shape:
//! - empty compound - if no solids were created;
//! - solid - if created only one solid;
//! - compound of solids - if created more than one solid.
//!
//! Fields inherited from BOPAlgo_Algo:
//!
//! <myRunParallel> - Defines whether the parallel processing is
//! switched on or not.
//! <myErrorStatus> - Error status of the operation:
//! 0   - operation successful;
//! 100 - no shapes to process;
//! 102 - BOPAlgo_PaveFiller algorithm has failed;
//! 103 - BOPAlgo_BuilderSolid algorithm has failed.
//!
//! Example:
//!
//! BOPAlgo_MakerVolume aMV;
//! //
//! aMV.SetArguments(aLS); //source shapes
//! aMV.SetRunParallel(bRunParallel); //parallel or single mode
//! aMV.SetIntersect(bIntersect); //intersect or not the shapes from <aLS>
//! //
//! aMV.Perform(); //perform the operation
//! if (aMV.ErrorStatus()) { //check error status
//! return;
//! }
//! //
//! const TopoDS_Shape& aResult = aMV.Shape();  //result of the operation
class BOPAlgo_MakerVolume  : public BOPAlgo_Builder
{
public:

  DEFINE_STANDARD_ALLOC

  

  //! Empty contructor.
    BOPAlgo_MakerVolume();
virtual ~BOPAlgo_MakerVolume();
  

  //! Empty contructor.
    BOPAlgo_MakerVolume(const BOPCol_BaseAllocator& theAllocator);
  

  //! Clears the data.
    virtual   void Clear() ;
  

  //! Sets the flag myIntersect:
  //! if <bIntersect> is TRUE the shapes from <myArguments> will be intersected.
  //! if <bIntersect> is FALSE no intersection will be done.
      void SetIntersect (const Standard_Boolean bIntersect) ;
  

  //! Returns the flag <myIntersect>.
      Standard_Boolean IsIntersect()  const;
  

  //! Returns the solid box <mySBox>.
     const  TopoDS_Solid& Box()  const;
  

  //! Returns the processed faces <myFaces>.
     const  BOPCol_ListOfShape& Faces()  const;
  

  //! Performs the operation.
  Standard_EXPORT virtual   void Perform() ;




protected:

  

  //! Checks the data.
  Standard_EXPORT virtual   void CheckData() ;
  

  //! Performs the operation.
  Standard_EXPORT virtual   void PerformInternal1 (const BOPAlgo_PaveFiller& thePF) ;
  

  //! Collects all faces.
  Standard_EXPORT   void CollectFaces() ;
  

  //! Makes solid box.
  Standard_EXPORT   void MakeBox (BOPCol_MapOfShape& theBoxFaces) ;
  

  //! Builds solids.
  Standard_EXPORT   void BuildSolids (BOPCol_ListOfShape& theLSR) ;
  

  //! Removes the covering box.
  Standard_EXPORT   void RemoveBox (BOPCol_ListOfShape& theLSR, const BOPCol_MapOfShape& theBoxFaces) ;
  

  //! Fills the solids with internal shapes.
  Standard_EXPORT   void FillInternalShapes (const BOPCol_ListOfShape& theLSR) ;
  

  //! Builds the result.
  Standard_EXPORT   void BuildShape (const BOPCol_ListOfShape& theLSR) ;


  Standard_Boolean myIntersect;
  Bnd_Box myBBox;
  TopoDS_Solid mySBox;
  BOPCol_ListOfShape myFaces;


private:





};


#include <BOPAlgo_MakerVolume.lxx>





#endif // _BOPAlgo_MakerVolume_HeaderFile