]> SALOME platform Git repositories - modules/geom.git/blob - src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx
Salome HOME
Add new command GetShapesOnBox.
[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 #include "GEOM_IOperations.hxx"
25
26 #include <TopTools_ListOfShape.hxx>
27 #include <TColStd_HSequenceOfTransient.hxx>
28
29 #include <list>
30
31 class GEOM_Engine;
32 class Handle(GEOM_Object);
33 class Handle(TColStd_HArray1OfInteger);
34
35 class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
36  public:
37   Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
38   Standard_EXPORT ~GEOMImpl_IBlocksOperations();
39
40   // Creation of blocks and block faces
41   Standard_EXPORT Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
42                                 Handle(GEOM_Object) theEdge2,
43                                 Handle(GEOM_Object) theEdge3,
44                                 Handle(GEOM_Object) theEdge4);
45
46   Standard_EXPORT Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
47                                       Handle(GEOM_Object) theEdge2);
48
49   Standard_EXPORT Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
50                                          Handle(GEOM_Object) thePoint2,
51                                          Handle(GEOM_Object) thePoint3,
52                                          Handle(GEOM_Object) thePoint4);
53
54   Standard_EXPORT Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
55                                 Handle(GEOM_Object) theFace2,
56                                 Handle(GEOM_Object) theFace3,
57                                 Handle(GEOM_Object) theFace4,
58                                 Handle(GEOM_Object) theFace5,
59                                 Handle(GEOM_Object) theFace6);
60
61   Standard_EXPORT Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
62                                       Handle(GEOM_Object) theFace2);
63
64   Standard_EXPORT Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
65
66   // Extract elements of blocks and blocks compounds
67   Standard_EXPORT Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
68                                 const Standard_Real theX,
69                                 const Standard_Real theY,
70                                 const Standard_Real theZ,
71                                 const Standard_Real theEpsilon);
72
73   Standard_EXPORT Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
74                                Handle(GEOM_Object) thePoint1,
75                                Handle(GEOM_Object) thePoint2);
76
77   Standard_EXPORT Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
78                                         Handle(GEOM_Object) thePoint);
79
80   Standard_EXPORT Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
81                                        Handle(GEOM_Object) thePoint1,
82                                        Handle(GEOM_Object) thePoint2,
83                                        Handle(GEOM_Object) thePoint3,
84                                        Handle(GEOM_Object) thePoint4);
85
86   Standard_EXPORT Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
87                                       Handle(GEOM_Object) theEdge1,
88                                       Handle(GEOM_Object) theEdge2);
89
90   Standard_EXPORT Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
91                                        Handle(GEOM_Object) theFace);
92
93   Standard_EXPORT Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
94                                         Handle(GEOM_Object) thePoint);
95
96   Standard_EXPORT Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
97                                         Handle(GEOM_Object) theVector);
98
99   // Check blocks compounds
100   Standard_EXPORT Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object)    theCompound,
101                                        const Standard_Integer theMinNbFaces,
102                                        const Standard_Integer theMaxNbFaces,
103                                        Standard_Integer&      theNbBlocks);
104
105   enum BCErrorType {
106     NOT_BLOCK,
107     EXTRA_EDGE,
108     INVALID_CONNECTION,
109     NOT_CONNECTED,
110     NOT_GLUED
111   };
112
113   struct BCError {
114     BCErrorType error;
115     list<int>   incriminated;
116   };
117
118   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
119                                              list<BCError>&      theErrors);
120
121   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
122                                           list<BCError>&      theErrors);
123
124   Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object)  theCompound,
125                                          const list<BCError>& theErrors);
126
127   Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape);
128
129   Standard_EXPORT Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound);
130
131   Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape&   theShape,
132                              TopTools_ListOfShape& BLO,
133                              TopTools_ListOfShape& NOT,
134                              TopTools_ListOfShape& EXT);
135
136   // Extract blocks from blocks compounds
137   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
138                                       (Handle(GEOM_Object)    theCompound,
139                                        const Standard_Integer theMinNbFaces,
140                                        const Standard_Integer theMaxNbFaces);
141
142   Standard_EXPORT Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
143                                          Handle(GEOM_Object) thePoint);
144
145   Standard_EXPORT Handle(GEOM_Object) GetBlockByParts
146                      (Handle(GEOM_Object)                         theCompound,
147                       const Handle(TColStd_HSequenceOfTransient)& theParts);
148
149   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
150                      (Handle(GEOM_Object)                         theCompound,
151                       const Handle(TColStd_HSequenceOfTransient)& theParts);
152
153   // Operations on blocks with gluing of result
154   Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object)    theBlock,
155                                                  const Standard_Integer theDirFace1,
156                                                  const Standard_Integer theDirFace2,
157                                                  const Standard_Integer theNbTimes);
158
159   Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object)    theBlock,
160                                                  const Standard_Integer theDirFace1U,
161                                                  const Standard_Integer theDirFace2U,
162                                                  const Standard_Integer theNbTimesU,
163                                                  const Standard_Integer theDirFace1V,
164                                                  const Standard_Integer theDirFace2V,
165                                                  const Standard_Integer theNbTimesV);
166
167   // Build groups for Propagation of 1D hypotheses
168   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape);
169 };
170
171 #endif