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 _GEOMImpl_IBlocksOperations_HXX_
22 #define _GEOMImpl_IBlocksOperations_HXX_
24 #include "GEOM_IOperations.hxx"
26 #include <TopTools_ListOfShape.hxx>
27 #include <TColStd_HSequenceOfTransient.hxx>
32 class Handle(GEOM_Object);
33 class Handle(TColStd_HArray1OfInteger);
35 class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
37 Standard_EXPORT GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
38 Standard_EXPORT ~GEOMImpl_IBlocksOperations();
40 // Creation of blocks and block faces
41 Standard_EXPORT Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
42 Handle(GEOM_Object) theEdge2,
43 Handle(GEOM_Object) theEdge3,
44 Handle(GEOM_Object) theEdge4);
46 Standard_EXPORT Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
47 Handle(GEOM_Object) theEdge2);
49 Standard_EXPORT Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
50 Handle(GEOM_Object) thePoint2,
51 Handle(GEOM_Object) thePoint3,
52 Handle(GEOM_Object) thePoint4);
54 Standard_EXPORT Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
55 Handle(GEOM_Object) theFace2,
56 Handle(GEOM_Object) theFace3,
57 Handle(GEOM_Object) theFace4,
58 Handle(GEOM_Object) theFace5,
59 Handle(GEOM_Object) theFace6);
61 Standard_EXPORT Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
62 Handle(GEOM_Object) theFace2);
64 Standard_EXPORT Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
66 // Extract elements of blocks and blocks compounds
67 Standard_EXPORT Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
68 const Standard_Real theX,
69 const Standard_Real theY,
70 const Standard_Real theZ,
71 const Standard_Real theEpsilon);
73 Standard_EXPORT Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
74 Handle(GEOM_Object) thePoint1,
75 Handle(GEOM_Object) thePoint2);
77 Standard_EXPORT Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
78 Handle(GEOM_Object) thePoint);
80 Standard_EXPORT Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
81 Handle(GEOM_Object) thePoint1,
82 Handle(GEOM_Object) thePoint2,
83 Handle(GEOM_Object) thePoint3,
84 Handle(GEOM_Object) thePoint4);
86 Standard_EXPORT Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
87 Handle(GEOM_Object) theEdge1,
88 Handle(GEOM_Object) theEdge2);
90 Standard_EXPORT Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
91 Handle(GEOM_Object) theFace);
93 Standard_EXPORT Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
94 Handle(GEOM_Object) thePoint);
96 Standard_EXPORT Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
97 Handle(GEOM_Object) theVector);
99 // Check blocks compounds
100 Standard_EXPORT Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object) theCompound,
101 const Standard_Integer theMinNbFaces,
102 const Standard_Integer theMaxNbFaces,
103 Standard_Integer& theNbBlocks);
115 list<int> incriminated;
118 Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
119 list<BCError>& theErrors);
121 Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
122 list<BCError>& theErrors);
124 Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound,
125 const list<BCError>& theErrors);
127 Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape);
129 Standard_EXPORT Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound);
131 Standard_EXPORT static void AddBlocksFrom (const TopoDS_Shape& theShape,
132 TopTools_ListOfShape& BLO,
133 TopTools_ListOfShape& NOT,
134 TopTools_ListOfShape& EXT);
136 // Extract blocks from blocks compounds
137 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
138 (Handle(GEOM_Object) theCompound,
139 const Standard_Integer theMinNbFaces,
140 const Standard_Integer theMaxNbFaces);
142 Standard_EXPORT Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
143 Handle(GEOM_Object) thePoint);
145 Standard_EXPORT Handle(GEOM_Object) GetBlockByParts
146 (Handle(GEOM_Object) theCompound,
147 const Handle(TColStd_HSequenceOfTransient)& theParts);
149 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
150 (Handle(GEOM_Object) theCompound,
151 const Handle(TColStd_HSequenceOfTransient)& theParts);
153 // Operations on blocks with gluing of result
154 Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object) theBlock,
155 const Standard_Integer theDirFace1,
156 const Standard_Integer theDirFace2,
157 const Standard_Integer theNbTimes);
159 Standard_EXPORT Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object) theBlock,
160 const Standard_Integer theDirFace1U,
161 const Standard_Integer theDirFace2U,
162 const Standard_Integer theNbTimesU,
163 const Standard_Integer theDirFace1V,
164 const Standard_Integer theDirFace2V,
165 const Standard_Integer theNbTimesV);
167 // Build groups for Propagation of 1D hypotheses
168 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape);