Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/geom.git] / src / GEOM_I / GEOM_IBlocksOperations_i.hh
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 _GEOM_IBlocksOperations_i_HeaderFile
22 #define _GEOM_IBlocksOperations_i_HeaderFile
23
24 #include "GEOMImpl_Gen.hxx"
25
26 #include <SALOMEconfig.h>
27
28 #include CORBA_SERVER_HEADER(GEOM_Gen)
29 #include "GEOM_IOperations_i.hh"
30 #include "GEOM_Object_i.hh"
31
32 #include "GEOMImpl_IBlocksOperations.hxx"
33
34 class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
35     public virtual POA_GEOM::GEOM_IBlocksOperations,
36     public virtual GEOM_IOperations_i
37 {
38  public:
39   GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
40                             ::GEOMImpl_IBlocksOperations* theImpl);
41   ~GEOM_IBlocksOperations_i();
42
43   // Creation of blocks and block faces
44   GEOM::GEOM_Object_ptr MakeQuad (GEOM::GEOM_Object_ptr theEdge1,
45                                   GEOM::GEOM_Object_ptr theEdge2,
46                                   GEOM::GEOM_Object_ptr theEdge3,
47                                   GEOM::GEOM_Object_ptr theEdge4);
48
49   GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
50                                         GEOM::GEOM_Object_ptr theEdge2);
51
52   GEOM::GEOM_Object_ptr MakeQuad4Vertices (GEOM::GEOM_Object_ptr thePnt1,
53                                            GEOM::GEOM_Object_ptr thePnt2,
54                                            GEOM::GEOM_Object_ptr thePnt3,
55                                            GEOM::GEOM_Object_ptr thePnt4);
56
57   GEOM::GEOM_Object_ptr MakeHexa (GEOM::GEOM_Object_ptr theFace1,
58                                   GEOM::GEOM_Object_ptr theFace2,
59                                   GEOM::GEOM_Object_ptr theFace3,
60                                   GEOM::GEOM_Object_ptr theFace4,
61                                   GEOM::GEOM_Object_ptr theFace5,
62                                   GEOM::GEOM_Object_ptr theFace6);
63
64   GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
65                                         GEOM::GEOM_Object_ptr theFace2);
66
67   GEOM::GEOM_Object_ptr MakeBlockCompound (GEOM::GEOM_Object_ptr theCompound);
68
69   // Extract elements of blocks and blocks compounds
70   GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
71                                   CORBA::Double   theX,
72                                   CORBA::Double   theY,
73                                   CORBA::Double   theZ,
74                                   CORBA::Double   theEpsilon);
75
76   GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
77                                  GEOM::GEOM_Object_ptr thePoint1,
78                                  GEOM::GEOM_Object_ptr thePoint2);
79
80   GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
81                                           GEOM::GEOM_Object_ptr thePoint);
82
83   GEOM::GEOM_Object_ptr GetFaceByPoints (GEOM::GEOM_Object_ptr theShape,
84                                          GEOM::GEOM_Object_ptr thePoint1,
85                                          GEOM::GEOM_Object_ptr thePoint2,
86                                          GEOM::GEOM_Object_ptr thePoint3,
87                                          GEOM::GEOM_Object_ptr thePoint4);
88
89   GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
90                                         GEOM::GEOM_Object_ptr theEdge1,
91                                         GEOM::GEOM_Object_ptr theEdge2);
92
93   GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
94                                          GEOM::GEOM_Object_ptr theFace);
95
96   GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
97                                           GEOM::GEOM_Object_ptr thePoint);
98
99   GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
100                                           GEOM::GEOM_Object_ptr theVector);
101
102   // Check blocks compound
103   CORBA::Boolean IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
104                                      CORBA::Long     theMinNbFaces,
105                                      CORBA::Long     theMaxNbFaces,
106                                      CORBA::Long&          theNbBlocks);
107
108   CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
109                                         GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
110
111   char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
112                        const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
113
114   GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape);
115
116   GEOM::GEOM_Object_ptr CheckAndImprove (GEOM::GEOM_Object_ptr theCompound);
117
118   // Extract blocks from blocks compounds
119   GEOM::ListOfGO* ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
120                                            CORBA::Long     theMinNbFaces,
121                                            CORBA::Long     theMaxNbFaces);
122
123   GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
124                                            GEOM::GEOM_Object_ptr thePoint);
125
126   GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
127                                          const GEOM::ListOfGO& theParts);
128
129   GEOM::ListOfGO* GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
130                                     const GEOM::ListOfGO& theParts);
131
132   // Operations on blocks with gluing of result
133   GEOM::GEOM_Object_ptr MakeMultiTransformation1D (GEOM::GEOM_Object_ptr theBlock,
134                                                    CORBA::Long     theDirFace1,
135                                                    CORBA::Long     theDirFace2,
136                                                    CORBA::Long     theNbTimes);
137
138   GEOM::GEOM_Object_ptr MakeMultiTransformation2D (GEOM::GEOM_Object_ptr theBlock,
139                                                    CORBA::Long     theDirFace1U,
140                                                    CORBA::Long     theDirFace2U,
141                                                    CORBA::Long     theNbTimesU,
142                                                    CORBA::Long     theDirFace1V,
143                                                    CORBA::Long     theDirFace2V,
144                                                    CORBA::Long     theNbTimesV);
145
146   // Build groups for Propagation of 1D hypotheses
147   GEOM::ListOfGO* Propagate (GEOM::GEOM_Object_ptr theShape);
148
149   ::GEOMImpl_IBlocksOperations* GetOperations()
150   { return (::GEOMImpl_IBlocksOperations*)GetImpl(); }
151 };
152
153 #endif