1 // Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef _GEOM_IBlocksOperations_i_HeaderFile
24 #define _GEOM_IBlocksOperations_i_HeaderFile
26 #include "GEOMImpl_Gen.hxx"
28 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(GEOM_Gen)
31 #include "GEOM_IOperations_i.hh"
32 #include "GEOM_Object_i.hh"
34 #include "GEOMImpl_IBlocksOperations.hxx"
36 class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
37 public virtual POA_GEOM::GEOM_IBlocksOperations,
38 public virtual GEOM_IOperations_i
41 GEOM_IBlocksOperations_i (PortableServer::POA_ptr thePOA, GEOM::GEOM_Gen_ptr theEngine,
42 ::GEOMImpl_IBlocksOperations* theImpl);
43 ~GEOM_IBlocksOperations_i();
45 // Creation of blocks and block faces
46 GEOM::GEOM_Object_ptr MakeQuad (GEOM::GEOM_Object_ptr theEdge1,
47 GEOM::GEOM_Object_ptr theEdge2,
48 GEOM::GEOM_Object_ptr theEdge3,
49 GEOM::GEOM_Object_ptr theEdge4);
51 GEOM::GEOM_Object_ptr MakeQuad2Edges (GEOM::GEOM_Object_ptr theEdge1,
52 GEOM::GEOM_Object_ptr theEdge2);
54 GEOM::GEOM_Object_ptr MakeQuad4Vertices (GEOM::GEOM_Object_ptr thePnt1,
55 GEOM::GEOM_Object_ptr thePnt2,
56 GEOM::GEOM_Object_ptr thePnt3,
57 GEOM::GEOM_Object_ptr thePnt4);
59 GEOM::GEOM_Object_ptr MakeHexa (GEOM::GEOM_Object_ptr theFace1,
60 GEOM::GEOM_Object_ptr theFace2,
61 GEOM::GEOM_Object_ptr theFace3,
62 GEOM::GEOM_Object_ptr theFace4,
63 GEOM::GEOM_Object_ptr theFace5,
64 GEOM::GEOM_Object_ptr theFace6);
66 GEOM::GEOM_Object_ptr MakeHexa2Faces (GEOM::GEOM_Object_ptr theFace1,
67 GEOM::GEOM_Object_ptr theFace2);
69 GEOM::GEOM_Object_ptr MakeBlockCompound (GEOM::GEOM_Object_ptr theCompound);
71 // Extract elements of blocks and blocks compounds
72 GEOM::GEOM_Object_ptr GetPoint (GEOM::GEOM_Object_ptr theShape,
76 CORBA::Double theEpsilon);
78 GEOM::GEOM_Object_ptr GetEdge (GEOM::GEOM_Object_ptr theShape,
79 GEOM::GEOM_Object_ptr thePoint1,
80 GEOM::GEOM_Object_ptr thePoint2);
82 GEOM::GEOM_Object_ptr GetEdgeNearPoint (GEOM::GEOM_Object_ptr theShape,
83 GEOM::GEOM_Object_ptr thePoint);
85 GEOM::GEOM_Object_ptr GetFaceByPoints (GEOM::GEOM_Object_ptr theShape,
86 GEOM::GEOM_Object_ptr thePoint1,
87 GEOM::GEOM_Object_ptr thePoint2,
88 GEOM::GEOM_Object_ptr thePoint3,
89 GEOM::GEOM_Object_ptr thePoint4);
91 GEOM::GEOM_Object_ptr GetFaceByEdges (GEOM::GEOM_Object_ptr theShape,
92 GEOM::GEOM_Object_ptr theEdge1,
93 GEOM::GEOM_Object_ptr theEdge2);
95 GEOM::GEOM_Object_ptr GetOppositeFace (GEOM::GEOM_Object_ptr theBlock,
96 GEOM::GEOM_Object_ptr theFace);
98 GEOM::GEOM_Object_ptr GetFaceNearPoint (GEOM::GEOM_Object_ptr theShape,
99 GEOM::GEOM_Object_ptr thePoint);
101 GEOM::GEOM_Object_ptr GetFaceByNormale (GEOM::GEOM_Object_ptr theBlock,
102 GEOM::GEOM_Object_ptr theVector);
104 // Check blocks compound
105 CORBA::Boolean IsCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
106 CORBA::Long theMinNbFaces,
107 CORBA::Long theMaxNbFaces,
108 CORBA::Long& theNbBlocks);
110 CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
111 GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
113 char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
114 const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
116 GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape,
117 CORBA::Long theOptimumNbFaces);
119 GEOM::GEOM_Object_ptr CheckAndImprove (GEOM::GEOM_Object_ptr theCompound);
121 // Extract blocks from blocks compounds
122 GEOM::ListOfGO* ExplodeCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
123 CORBA::Long theMinNbFaces,
124 CORBA::Long theMaxNbFaces);
126 GEOM::GEOM_Object_ptr GetBlockNearPoint (GEOM::GEOM_Object_ptr theCompound,
127 GEOM::GEOM_Object_ptr thePoint);
129 GEOM::GEOM_Object_ptr GetBlockByParts (GEOM::GEOM_Object_ptr theCompound,
130 const GEOM::ListOfGO& theParts);
132 GEOM::ListOfGO* GetBlocksByParts (GEOM::GEOM_Object_ptr theCompound,
133 const GEOM::ListOfGO& theParts);
135 // Operations on blocks with gluing of result
136 GEOM::GEOM_Object_ptr MakeMultiTransformation1D (GEOM::GEOM_Object_ptr theBlock,
137 CORBA::Long theDirFace1,
138 CORBA::Long theDirFace2,
139 CORBA::Long theNbTimes);
141 GEOM::GEOM_Object_ptr MakeMultiTransformation2D (GEOM::GEOM_Object_ptr theBlock,
142 CORBA::Long theDirFace1U,
143 CORBA::Long theDirFace2U,
144 CORBA::Long theNbTimesU,
145 CORBA::Long theDirFace1V,
146 CORBA::Long theDirFace2V,
147 CORBA::Long theNbTimesV);
149 // Build groups for Propagation of 1D hypotheses
150 GEOM::ListOfGO* Propagate (GEOM::GEOM_Object_ptr theShape);
152 ::GEOMImpl_IBlocksOperations* GetOperations()
153 { return (::GEOMImpl_IBlocksOperations*)GetImpl(); }