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