Salome HOME
Merge from V6_main (04/10/2012)
[modules/geom.git] / src / GEOM_I / GEOM_IBlocksOperations_i.hh
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21
22 #ifndef _GEOM_IBlocksOperations_i_HeaderFile
23 #define _GEOM_IBlocksOperations_i_HeaderFile
24
25 #include "GEOMImpl_Gen.hxx"
26
27 #include <SALOMEconfig.h>
28
29 #include CORBA_SERVER_HEADER(GEOM_Gen)
30 #include "GEOM_IOperations_i.hh"
31 #include "GEOM_Object_i.hh"
32
33 #include "GEOMImpl_IBlocksOperations.hxx"
34
35 class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
36     public virtual POA_GEOM::GEOM_IBlocksOperations,
37     public virtual GEOM_IOperations_i
38 {
39  public:
40   GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
41                             ::GEOMImpl_IBlocksOperations* theImpl);
42   ~GEOM_IBlocksOperations_i();
43
44   // Creation of blocks and block faces
45   GEOM::GEOM_Object_ptr MakeQuad (GEOM::GEOM_Object_ptr theEdge1,
46                                   GEOM::GEOM_Object_ptr theEdge2,
47                                   GEOM::GEOM_Object_ptr theEdge3,
48                                   GEOM::GEOM_Object_ptr theEdge4);
49
50   GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
51                                         GEOM::GEOM_Object_ptr theEdge2);
52
53   GEOM::GEOM_Object_ptr MakeQuad4Vertices (GEOM::GEOM_Object_ptr thePnt1,
54                                            GEOM::GEOM_Object_ptr thePnt2,
55                                            GEOM::GEOM_Object_ptr thePnt3,
56                                            GEOM::GEOM_Object_ptr thePnt4);
57
58   GEOM::GEOM_Object_ptr MakeHexa (GEOM::GEOM_Object_ptr theFace1,
59                                   GEOM::GEOM_Object_ptr theFace2,
60                                   GEOM::GEOM_Object_ptr theFace3,
61                                   GEOM::GEOM_Object_ptr theFace4,
62                                   GEOM::GEOM_Object_ptr theFace5,
63                                   GEOM::GEOM_Object_ptr theFace6);
64
65   GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
66                                         GEOM::GEOM_Object_ptr theFace2);
67
68   GEOM::GEOM_Object_ptr MakeBlockCompound (GEOM::GEOM_Object_ptr theCompound);
69
70   // Extract elements of blocks and blocks compounds
71   GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
72                                   CORBA::Double   theX,
73                                   CORBA::Double   theY,
74                                   CORBA::Double   theZ,
75                                   CORBA::Double   theEpsilon);
76
77   GEOM::GEOM_Object_ptr GetVertexNearPoint (GEOM::GEOM_Object_ptr theShape,
78                                             GEOM::GEOM_Object_ptr thePoint);
79
80   GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
81                                  GEOM::GEOM_Object_ptr thePoint1,
82                                  GEOM::GEOM_Object_ptr thePoint2);
83
84   GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
85                                           GEOM::GEOM_Object_ptr thePoint);
86
87   GEOM::GEOM_Object_ptr GetFaceByPoints (GEOM::GEOM_Object_ptr theShape,
88                                          GEOM::GEOM_Object_ptr thePoint1,
89                                          GEOM::GEOM_Object_ptr thePoint2,
90                                          GEOM::GEOM_Object_ptr thePoint3,
91                                          GEOM::GEOM_Object_ptr thePoint4);
92
93   GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
94                                         GEOM::GEOM_Object_ptr theEdge1,
95                                         GEOM::GEOM_Object_ptr theEdge2);
96
97   GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
98                                          GEOM::GEOM_Object_ptr theFace);
99
100   GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
101                                           GEOM::GEOM_Object_ptr thePoint);
102
103   GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
104                                           GEOM::GEOM_Object_ptr theVector);
105
106   GEOM::GEOM_Object_ptr GetShapesNearPoint (GEOM::GEOM_Object_ptr theShape,
107                                             GEOM::GEOM_Object_ptr thePoint,
108                                             CORBA::Long           theShapeType,
109                                             CORBA::Double         theTolerance);
110
111   // Check blocks compound
112   CORBA::Boolean IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
113                                      CORBA::Long           theMinNbFaces,
114                                      CORBA::Long           theMaxNbFaces,
115                                      CORBA::Long&          theNbBlocks);
116
117   CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
118                                         GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
119
120   char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
121                        const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
122
123   GEOM::GEOM_Object_ptr GetNonBlocks (GEOM::GEOM_Object_ptr theShape,
124                                       GEOM::GEOM_Object_out theNonQuads);
125
126   GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape,
127                                           CORBA::Long           theOptimumNbFaces);
128
129   GEOM::GEOM_Object_ptr CheckAndImprove (GEOM::GEOM_Object_ptr theCompound);
130
131   // Extract blocks from blocks compounds
132   GEOM::ListOfGO* ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
133                                            CORBA::Long     theMinNbFaces,
134                                            CORBA::Long     theMaxNbFaces);
135
136   GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
137                                            GEOM::GEOM_Object_ptr thePoint);
138
139   GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
140                                          const GEOM::ListOfGO& theParts);
141
142   GEOM::ListOfGO* GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
143                                     const GEOM::ListOfGO& theParts);
144
145   // Operations on blocks with gluing of result
146   GEOM::GEOM_Object_ptr MakeMultiTransformation1D (GEOM::GEOM_Object_ptr theBlock,
147                                                    CORBA::Long     theDirFace1,
148                                                    CORBA::Long     theDirFace2,
149                                                    CORBA::Long     theNbTimes);
150
151   GEOM::GEOM_Object_ptr MakeMultiTransformation2D (GEOM::GEOM_Object_ptr theBlock,
152                                                    CORBA::Long     theDirFace1U,
153                                                    CORBA::Long     theDirFace2U,
154                                                    CORBA::Long     theNbTimesU,
155                                                    CORBA::Long     theDirFace1V,
156                                                    CORBA::Long     theDirFace2V,
157                                                    CORBA::Long     theNbTimesV);
158
159   // Build groups for Propagation of 1D hypotheses
160   GEOM::ListOfGO* Propagate (GEOM::GEOM_Object_ptr theShape);
161
162   ::GEOMImpl_IBlocksOperations* GetOperations()
163   { return (::GEOMImpl_IBlocksOperations*)GetImpl(); }
164 };
165
166 #endif