]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx
Salome HOME
Implementation of NPAL16149 (EDF 442 GEOM : Create a shell from a compound containing...
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IBlocksOperations.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 //
20
21 #ifndef _GEOMImpl_IBlocksOperations_HXX_
22 #define _GEOMImpl_IBlocksOperations_HXX_
23
24 using namespace std;
25
26 #include "GEOM_IOperations.hxx"
27
28 #include <TopTools_ListOfShape.hxx>
29 #include <TColStd_HSequenceOfTransient.hxx>
30
31 #include <list>
32
33 class GEOM_Engine;
34 class Handle(GEOM_Object);
35 class Handle(TColStd_HArray1OfInteger);
36
37 class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
38  public:
39   Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
40   Standard_EXPORT ~GEOMImpl_IBlocksOperations();
41
42   // Creation of blocks and block faces
43   Standard_EXPORT Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
44                                 Handle(GEOM_Object) theEdge2,
45                                 Handle(GEOM_Object) theEdge3,
46                                 Handle(GEOM_Object) theEdge4);
47
48   Standard_EXPORT Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
49                                       Handle(GEOM_Object) theEdge2);
50
51   Standard_EXPORT Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
52                                          Handle(GEOM_Object) thePoint2,
53                                          Handle(GEOM_Object) thePoint3,
54                                          Handle(GEOM_Object) thePoint4);
55
56   Standard_EXPORT Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
57                                 Handle(GEOM_Object) theFace2,
58                                 Handle(GEOM_Object) theFace3,
59                                 Handle(GEOM_Object) theFace4,
60                                 Handle(GEOM_Object) theFace5,
61                                 Handle(GEOM_Object) theFace6);
62
63   Standard_EXPORT Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
64                                       Handle(GEOM_Object) theFace2);
65
66   Standard_EXPORT Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
67
68   // Extract elements of blocks and blocks compounds
69   Standard_EXPORT Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
70                                 const Standard_Real theX,
71                                 const Standard_Real theY,
72                                 const Standard_Real theZ,
73                                 const Standard_Real theEpsilon);
74
75   Standard_EXPORT Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
76                                Handle(GEOM_Object) thePoint1,
77                                Handle(GEOM_Object) thePoint2);
78
79   Standard_EXPORT Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
80                                         Handle(GEOM_Object) thePoint);
81
82   Standard_EXPORT Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
83                                        Handle(GEOM_Object) thePoint1,
84                                        Handle(GEOM_Object) thePoint2,
85                                        Handle(GEOM_Object) thePoint3,
86                                        Handle(GEOM_Object) thePoint4);
87
88   Standard_EXPORT Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
89                                       Handle(GEOM_Object) theEdge1,
90                                       Handle(GEOM_Object) theEdge2);
91
92   Standard_EXPORT Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
93                                        Handle(GEOM_Object) theFace);
94
95   Standard_EXPORT Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
96                                         Handle(GEOM_Object) thePoint);
97
98   Standard_EXPORT Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
99                                         Handle(GEOM_Object) theVector);
100
101   // Check blocks compounds
102   Standard_EXPORT Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object)    theCompound,
103                                        const Standard_Integer theMinNbFaces,
104                                        const Standard_Integer theMaxNbFaces,
105                                        Standard_Integer&      theNbBlocks);
106
107   enum BCErrorType {
108     NOT_BLOCK,
109     EXTRA_EDGE,
110     INVALID_CONNECTION,
111     NOT_CONNECTED,
112     NOT_GLUED
113   };
114
115   struct BCError {
116     BCErrorType error;
117     list<int>   incriminated;
118   };
119
120   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
121                                              list<BCError>&      theErrors);
122
123   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
124                                           list<BCError>&      theErrors);
125
126   Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object)  theCompound,
127                                          const list<BCError>& theErrors);
128
129   Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape);
130
131   Standard_EXPORT Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound);
132
133   Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape&   theShape,
134                              TopTools_ListOfShape& BLO,
135                              TopTools_ListOfShape& NOT,
136                              TopTools_ListOfShape& EXT);
137
138   // Extract blocks from blocks compounds
139   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
140                                       (Handle(GEOM_Object)    theCompound,
141                                        const Standard_Integer theMinNbFaces,
142                                        const Standard_Integer theMaxNbFaces);
143
144   Standard_EXPORT Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
145                                          Handle(GEOM_Object) thePoint);
146
147   Standard_EXPORT Handle(GEOM_Object) GetBlockByParts
148                      (Handle(GEOM_Object)                         theCompound,
149                       const Handle(TColStd_HSequenceOfTransient)& theParts);
150
151   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
152                      (Handle(GEOM_Object)                         theCompound,
153                       const Handle(TColStd_HSequenceOfTransient)& theParts);
154
155   // Operations on blocks with gluing of result
156   Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object)    theBlock,
157                                                  const Standard_Integer theDirFace1,
158                                                  const Standard_Integer theDirFace2,
159                                                  const Standard_Integer theNbTimes);
160
161   Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object)    theBlock,
162                                                  const Standard_Integer theDirFace1U,
163                                                  const Standard_Integer theDirFace2U,
164                                                  const Standard_Integer theNbTimesU,
165                                                  const Standard_Integer theDirFace1V,
166                                                  const Standard_Integer theDirFace2V,
167                                                  const Standard_Integer theNbTimesV);
168
169   // Build groups for Propagation of 1D hypotheses
170   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape);
171 };
172
173 #endif