Salome HOME
Merge with PAL/SALOME 2.1.0d
[modules/geom.git] / src / GEOMImpl / GEOMImpl_IBlocksOperations.hxx
1
2 #ifndef _GEOMImpl_IBlocksOperations_HXX_
3 #define _GEOMImpl_IBlocksOperations_HXX_
4
5 #include "GEOM_IOperations.hxx"
6
7 #include <TopTools_ListOfShape.hxx>
8 #include <TColStd_HSequenceOfTransient.hxx>
9
10 #include <list>
11
12 class GEOM_Engine;
13 class Handle(GEOM_Object);
14 class Handle(TColStd_HArray1OfInteger);
15
16 class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
17  public:
18   GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
19   ~GEOMImpl_IBlocksOperations();
20
21   // Creation of blocks and block faces
22   Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
23                                 Handle(GEOM_Object) theEdge2,
24                                 Handle(GEOM_Object) theEdge3,
25                                 Handle(GEOM_Object) theEdge4);
26
27   Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
28                                       Handle(GEOM_Object) theEdge2);
29
30   Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
31                                          Handle(GEOM_Object) thePoint2,
32                                          Handle(GEOM_Object) thePoint3,
33                                          Handle(GEOM_Object) thePoint4);
34
35   Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
36                                 Handle(GEOM_Object) theFace2,
37                                 Handle(GEOM_Object) theFace3,
38                                 Handle(GEOM_Object) theFace4,
39                                 Handle(GEOM_Object) theFace5,
40                                 Handle(GEOM_Object) theFace6);
41
42   Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
43                                       Handle(GEOM_Object) theFace2);
44
45   Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
46
47   // Extract elements of blocks and blocks compounds
48   Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
49                                 const Standard_Real theX,
50                                 const Standard_Real theY,
51                                 const Standard_Real theZ,
52                                 const Standard_Real theEpsilon);
53
54   Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
55                                Handle(GEOM_Object) thePoint1,
56                                Handle(GEOM_Object) thePoint2);
57
58   Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
59                                         Handle(GEOM_Object) thePoint);
60
61   Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
62                                        Handle(GEOM_Object) thePoint1,
63                                        Handle(GEOM_Object) thePoint2,
64                                        Handle(GEOM_Object) thePoint3,
65                                        Handle(GEOM_Object) thePoint4);
66
67   Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
68                                       Handle(GEOM_Object) theEdge1,
69                                       Handle(GEOM_Object) theEdge2);
70
71   Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
72                                        Handle(GEOM_Object) theFace);
73
74   Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
75                                         Handle(GEOM_Object) thePoint);
76
77   Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
78                                         Handle(GEOM_Object) theVector);
79
80   // Check blocks compounds
81   Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object)    theCompound,
82                                        const Standard_Integer theMinNbFaces,
83                                        const Standard_Integer theMaxNbFaces,
84                                        Standard_Integer&      theNbBlocks);
85
86   enum BCErrorType {
87     NOT_BLOCK,
88     INVALID_CONNECTION,
89     NOT_CONNECTED,
90     NOT_GLUED
91   };
92
93   struct BCError {
94     BCErrorType error;
95     list<int>   incriminated;
96   };
97
98   Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
99                                           list<BCError>&      theErrors);
100
101   TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object)  theCompound,
102                                          const list<BCError>& theErrors);
103
104   // Extract blocks from blocks compounds
105   Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
106                                       (Handle(GEOM_Object)    theCompound,
107                                        const Standard_Integer theMinNbFaces,
108                                        const Standard_Integer theMaxNbFaces);
109
110   Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
111                                          Handle(GEOM_Object) thePoint);
112
113   Handle(GEOM_Object) GetBlockByParts
114                      (Handle(GEOM_Object)                         theCompound,
115                       const Handle(TColStd_HSequenceOfTransient)& theParts);
116
117   Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
118                      (Handle(GEOM_Object)                         theCompound,
119                       const Handle(TColStd_HSequenceOfTransient)& theParts);
120
121   // Operations on blocks with gluing of result
122   Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object)    theBlock,
123                                                  const Standard_Integer theDirFace1,
124                                                  const Standard_Integer theDirFace2,
125                                                  const Standard_Integer theNbTimes);
126
127   Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object)    theBlock,
128                                                  const Standard_Integer theDirFace1U,
129                                                  const Standard_Integer theDirFace2U,
130                                                  const Standard_Integer theNbTimesU,
131                                                  const Standard_Integer theDirFace1V,
132                                                  const Standard_Integer theDirFace2V,
133                                                  const Standard_Integer theNbTimesV);
134 };
135
136 #endif