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
25 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(GEOM_Gen)
28 #include "GEOM_IOperations_i.hh"
29 #include "GEOM_Object_i.hh"
31 #include "GEOMImpl_IBlocksOperations.hxx"
33 class GEOM_IBlocksOperations_i :
34 public virtual POA_GEOM::GEOM_IBlocksOperations,
35 public virtual GEOM_IOperations_i
38 GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
39 ::GEOMImpl_IBlocksOperations* theImpl);
40 ~GEOM_IBlocksOperations_i();
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);
48 GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
49 GEOM::GEOM_Object_ptr theEdge2);
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);
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);
63 GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
64 GEOM::GEOM_Object_ptr theFace2);
66 GEOM::GEOM_Object_ptr MakeBlockCompound (GEOM::GEOM_Object_ptr theCompound);
68 // Extract elements of blocks and blocks compounds
69 GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
73 CORBA::Double theEpsilon);
75 GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
76 GEOM::GEOM_Object_ptr thePoint1,
77 GEOM::GEOM_Object_ptr thePoint2);
79 GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
80 GEOM::GEOM_Object_ptr thePoint);
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);
88 GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
89 GEOM::GEOM_Object_ptr theEdge1,
90 GEOM::GEOM_Object_ptr theEdge2);
92 GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
93 GEOM::GEOM_Object_ptr theFace);
95 GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
96 GEOM::GEOM_Object_ptr thePoint);
98 GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
99 GEOM::GEOM_Object_ptr theVector);
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);
107 CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
108 GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
110 char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
111 const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
113 GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape);
115 GEOM::GEOM_Object_ptr CheckAndImprove (GEOM::GEOM_Object_ptr theCompound);
117 // Extract blocks from blocks compounds
118 GEOM::ListOfGO* ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
119 CORBA::Long theMinNbFaces,
120 CORBA::Long theMaxNbFaces);
122 GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
123 GEOM::GEOM_Object_ptr thePoint);
125 GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
126 const GEOM::ListOfGO& theParts);
128 GEOM::ListOfGO* GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
129 const GEOM::ListOfGO& theParts);
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);
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);
145 // Build groups for Propagation of 1D hypotheses
146 GEOM::ListOfGO* Propagate (GEOM::GEOM_Object_ptr theShape);
148 ::GEOMImpl_IBlocksOperations* GetOperations()
149 { return (::GEOMImpl_IBlocksOperations*)GetImpl(); }