2 #ifndef _GEOMImpl_IBlocksOperations_HXX_
3 #define _GEOMImpl_IBlocksOperations_HXX_
5 #include "GEOM_IOperations.hxx"
7 #include <TopTools_ListOfShape.hxx>
8 #include <TColStd_HSequenceOfTransient.hxx>
13 class Handle(GEOM_Object);
14 class Handle(TColStd_HArray1OfInteger);
16 class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
18 GEOMImpl_IBlocksOperations(GEOM_Engine* theEngine, int theDocID);
19 ~GEOMImpl_IBlocksOperations();
21 // Creation of blocks and block faces
22 Handle(GEOM_Object) MakeQuad (Handle(GEOM_Object) theEdge1,
23 Handle(GEOM_Object) theEdge2,
24 Handle(GEOM_Object) theEdge3,
25 Handle(GEOM_Object) theEdge4);
27 Handle(GEOM_Object) MakeQuad2Edges (Handle(GEOM_Object) theEdge1,
28 Handle(GEOM_Object) theEdge2);
30 Handle(GEOM_Object) MakeQuad4Vertices (Handle(GEOM_Object) thePoint1,
31 Handle(GEOM_Object) thePoint2,
32 Handle(GEOM_Object) thePoint3,
33 Handle(GEOM_Object) thePoint4);
35 Handle(GEOM_Object) MakeHexa (Handle(GEOM_Object) theFace1,
36 Handle(GEOM_Object) theFace2,
37 Handle(GEOM_Object) theFace3,
38 Handle(GEOM_Object) theFace4,
39 Handle(GEOM_Object) theFace5,
40 Handle(GEOM_Object) theFace6);
42 Handle(GEOM_Object) MakeHexa2Faces (Handle(GEOM_Object) theFace1,
43 Handle(GEOM_Object) theFace2);
45 Handle(GEOM_Object) MakeBlockCompound (Handle(GEOM_Object) theCompound);
47 // Extract elements of blocks and blocks compounds
48 Handle(GEOM_Object) GetPoint (Handle(GEOM_Object) theShape,
49 const Standard_Real theX,
50 const Standard_Real theY,
51 const Standard_Real theZ,
52 const Standard_Real theEpsilon);
54 Handle(GEOM_Object) GetEdge (Handle(GEOM_Object) theShape,
55 Handle(GEOM_Object) thePoint1,
56 Handle(GEOM_Object) thePoint2);
58 Handle(GEOM_Object) GetEdgeNearPoint (Handle(GEOM_Object) theBlock,
59 Handle(GEOM_Object) thePoint);
61 Handle(GEOM_Object) GetFaceByPoints (Handle(GEOM_Object) theShape,
62 Handle(GEOM_Object) thePoint1,
63 Handle(GEOM_Object) thePoint2,
64 Handle(GEOM_Object) thePoint3,
65 Handle(GEOM_Object) thePoint4);
67 Handle(GEOM_Object) GetFaceByEdges (Handle(GEOM_Object) theShape,
68 Handle(GEOM_Object) theEdge1,
69 Handle(GEOM_Object) theEdge2);
71 Handle(GEOM_Object) GetOppositeFace (Handle(GEOM_Object) theBlock,
72 Handle(GEOM_Object) theFace);
74 Handle(GEOM_Object) GetFaceNearPoint (Handle(GEOM_Object) theBlock,
75 Handle(GEOM_Object) thePoint);
77 Handle(GEOM_Object) GetFaceByNormale (Handle(GEOM_Object) theBlock,
78 Handle(GEOM_Object) theVector);
80 // Check blocks compounds
81 Standard_Boolean IsCompoundOfBlocks (Handle(GEOM_Object) theCompound,
82 const Standard_Integer theMinNbFaces,
83 const Standard_Integer theMaxNbFaces,
84 Standard_Integer& theNbBlocks);
96 list<int> incriminated;
99 Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
100 list<BCError>& theErrors);
102 Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
103 list<BCError>& theErrors);
105 TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object) theCompound,
106 const list<BCError>& theErrors);
108 Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape);
110 Handle(GEOM_Object) CheckAndImprove (Handle(GEOM_Object) theCompound);
112 static void AddBlocksFrom (const TopoDS_Shape& theShape,
113 TopTools_ListOfShape& BLO,
114 TopTools_ListOfShape& NOT,
115 TopTools_ListOfShape& EXT);
117 // Extract blocks from blocks compounds
118 Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
119 (Handle(GEOM_Object) theCompound,
120 const Standard_Integer theMinNbFaces,
121 const Standard_Integer theMaxNbFaces);
123 Handle(GEOM_Object) GetBlockNearPoint (Handle(GEOM_Object) theCompound,
124 Handle(GEOM_Object) thePoint);
126 Handle(GEOM_Object) GetBlockByParts
127 (Handle(GEOM_Object) theCompound,
128 const Handle(TColStd_HSequenceOfTransient)& theParts);
130 Handle(TColStd_HSequenceOfTransient) GetBlocksByParts
131 (Handle(GEOM_Object) theCompound,
132 const Handle(TColStd_HSequenceOfTransient)& theParts);
134 // Operations on blocks with gluing of result
135 Handle(GEOM_Object) MakeMultiTransformation1D (Handle(GEOM_Object) theBlock,
136 const Standard_Integer theDirFace1,
137 const Standard_Integer theDirFace2,
138 const Standard_Integer theNbTimes);
140 Handle(GEOM_Object) MakeMultiTransformation2D (Handle(GEOM_Object) theBlock,
141 const Standard_Integer theDirFace1U,
142 const Standard_Integer theDirFace2U,
143 const Standard_Integer theNbTimesU,
144 const Standard_Integer theDirFace1V,
145 const Standard_Integer theDirFace2V,
146 const Standard_Integer theNbTimesV);
148 // Build groups for Propagation of 1D hypotheses
149 Handle(TColStd_HSequenceOfTransient) Propagate (Handle(GEOM_Object) theShape);