1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #ifndef _GEOM_IBlocksOperations_i_HeaderFile
22 #define _GEOM_IBlocksOperations_i_HeaderFile
24 #include "GEOMImpl_Gen.hxx"
26 #include <SALOMEconfig.h>
28 #include CORBA_SERVER_HEADER(GEOM_Gen)
29 #include "GEOM_IOperations_i.hh"
30 #include "GEOM_Object_i.hh"
32 #include "GEOMImpl_IBlocksOperations.hxx"
34 class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
35 public virtual POA_GEOM::GEOM_IBlocksOperations,
36 public virtual GEOM_IOperations_i
39 GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
40 ::GEOMImpl_IBlocksOperations* theImpl);
41 ~GEOM_IBlocksOperations_i();
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);
49 GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
50 GEOM::GEOM_Object_ptr theEdge2);
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);
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);
64 GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
65 GEOM::GEOM_Object_ptr theFace2);
67 GEOM::GEOM_Object_ptr MakeBlockCompound (GEOM::GEOM_Object_ptr theCompound);
69 // Extract elements of blocks and blocks compounds
70 GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
74 CORBA::Double theEpsilon);
76 GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
77 GEOM::GEOM_Object_ptr thePoint1,
78 GEOM::GEOM_Object_ptr thePoint2);
80 GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
81 GEOM::GEOM_Object_ptr thePoint);
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);
89 GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
90 GEOM::GEOM_Object_ptr theEdge1,
91 GEOM::GEOM_Object_ptr theEdge2);
93 GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
94 GEOM::GEOM_Object_ptr theFace);
96 GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
97 GEOM::GEOM_Object_ptr thePoint);
99 GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
100 GEOM::GEOM_Object_ptr theVector);
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);
108 CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
109 GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
111 char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
112 const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
114 GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape);
116 GEOM::GEOM_Object_ptr CheckAndImprove (GEOM::GEOM_Object_ptr theCompound);
118 // Extract blocks from blocks compounds
119 GEOM::ListOfGO* ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
120 CORBA::Long theMinNbFaces,
121 CORBA::Long theMaxNbFaces);
123 GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
124 GEOM::GEOM_Object_ptr thePoint);
126 GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
127 const GEOM::ListOfGO& theParts);
129 GEOM::ListOfGO* GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
130 const GEOM::ListOfGO& theParts);
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);
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);
146 // Build groups for Propagation of 1D hypotheses
147 GEOM::ListOfGO* Propagate (GEOM::GEOM_Object_ptr theShape);
149 ::GEOMImpl_IBlocksOperations* GetOperations()
150 { return (::GEOMImpl_IBlocksOperations*)GetImpl(); }