2 #ifndef _GEOMImpl_IShapesOperations_HXX_
3 #define _GEOMImpl_IShapesOperations_HXX_
5 #include "GEOM_IOperations.hxx"
7 #include "GEOMAlgo_State.hxx"
9 #include <TopTools_ListOfShape.hxx>
10 #include <TColStd_HSequenceOfTransient.hxx>
11 #include <TColStd_HSequenceOfInteger.hxx>
14 #include <Handle_Geom_Surface.hxx>
17 class Handle(GEOM_Object);
18 class Handle(TColStd_HArray1OfInteger);
20 class GEOMImpl_IShapesOperations : public GEOM_IOperations {
22 Standard_EXPORT GEOMImpl_IShapesOperations(GEOM_Engine* theEngine, int theDocID);
23 Standard_EXPORT ~GEOMImpl_IShapesOperations();
25 Standard_EXPORT Handle(GEOM_Object) MakeEdge (Handle(GEOM_Object) thePoint1,
26 Handle(GEOM_Object) thePoint2);
28 Standard_EXPORT Handle(GEOM_Object) MakeWire (list<Handle(GEOM_Object)> theEdgesAndWires);
30 Standard_EXPORT Handle(GEOM_Object) MakeFace (Handle(GEOM_Object) theWire, const bool isPlanarWanted);
32 Standard_EXPORT Handle(GEOM_Object) MakeFaceWires (list<Handle(GEOM_Object)> theWires,
33 const bool isPlanarWanted);
35 Standard_EXPORT Handle(GEOM_Object) MakeShell (list<Handle(GEOM_Object)> theShapes);
37 Standard_EXPORT Handle(GEOM_Object) MakeSolidShell (Handle(GEOM_Object) theShell);
39 Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (list<Handle(GEOM_Object)> theShells);
41 Standard_EXPORT Handle(GEOM_Object) MakeCompound (list<Handle(GEOM_Object)> theShapes);
43 Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
44 const Standard_Real theTolerance);
46 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakeExplode (Handle(GEOM_Object) theShape,
47 const Standard_Integer theShapeType,
48 const Standard_Boolean isSorted);
50 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) SubShapeAllIDs (Handle(GEOM_Object) theShape,
51 const Standard_Integer theShapeType,
52 const Standard_Boolean isSorted);
54 Standard_EXPORT Handle(GEOM_Object) GetSubShape (Handle(GEOM_Object) theMainShape,
55 const Standard_Integer theID);
57 Standard_EXPORT Standard_Integer NumberOfFaces (Handle(GEOM_Object) theShape);
58 Standard_EXPORT Standard_Integer NumberOfEdges (Handle(GEOM_Object) theShape);
60 Standard_EXPORT Handle(GEOM_Object) ReverseShape(Handle(GEOM_Object) theShapes);
62 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetFreeFacesIDs (Handle(GEOM_Object) theShape);
64 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSharedShapes (Handle(GEOM_Object) theShape1,
65 Handle(GEOM_Object) theShape2,
66 const Standard_Integer theShapeType);
68 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnPlane (const Handle(GEOM_Object)& theShape,
69 const Standard_Integer theShapeType,
70 const Handle(GEOM_Object)& theAx1,
71 const GEOMAlgo_State theState);
73 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnCylinder (const Handle(GEOM_Object)& theShape,
74 const Standard_Integer theShapeType,
75 const Handle(GEOM_Object)& theAxis,
76 const Standard_Real theRadius,
77 const GEOMAlgo_State theState);
79 Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetShapesOnSphere (const Handle(GEOM_Object)& theShape,
80 const Standard_Integer theShapeType,
81 const Handle(GEOM_Object)& theCenter,
82 const Standard_Real theRadius,
83 const GEOMAlgo_State theState);
85 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnPlaneIDs (const Handle(GEOM_Object)& theShape,
86 const Standard_Integer theShapeType,
87 const Handle(GEOM_Object)& theAx1,
88 const GEOMAlgo_State theState);
90 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnCylinderIDs (const Handle(GEOM_Object)& theShape,
91 const Standard_Integer theShapeType,
92 const Handle(GEOM_Object)& theAxis,
93 const Standard_Real theRadius,
94 const GEOMAlgo_State theState);
96 Standard_EXPORT Handle(TColStd_HSequenceOfInteger) GetShapesOnSphereIDs (const Handle(GEOM_Object)& theShape,
97 const Standard_Integer theShapeType,
98 const Handle(GEOM_Object)& theCenter,
99 const Standard_Real theRadius,
100 const GEOMAlgo_State theState);
103 * \brief Find subshapes complying with given status about quadrangle
104 * \param theShape - the shape to explore
105 * \param theShapeType - type of subshape of theShape
106 * \param theTopLeftPoint - top left quadrangle corner
107 * \param theTopRigthPoint - top right quadrangle corner
108 * \param theBottomLeftPoint - bottom left quadrangle corner
109 * \param theBottomRigthPoint - bottom right quadrangle corner
110 * \param theState - required state
111 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
113 Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
114 GetShapesOnQuadrangle (const Handle(GEOM_Object)& theShape,
115 const Standard_Integer theShapeType,
116 const Handle(GEOM_Object)& theTopLeftPoint,
117 const Handle(GEOM_Object)& theTopRigthPoint,
118 const Handle(GEOM_Object)& theBottomLeftPoint,
119 const Handle(GEOM_Object)& theBottomRigthPoint,
120 const GEOMAlgo_State theState);
123 * \brief Find IDs of subshapes complying with given status about quadrangle
124 * \param theShape - the shape to explore
125 * \param theShapeType - type of subshape of theShape
126 * \param theTopLeftPoint - top left quadrangle corner
127 * \param theTopRigthPoint - top right quadrangle corner
128 * \param theBottomLeftPoint - bottom left quadrangle corner
129 * \param theBottomRigthPoint - bottom right quadrangle corner
130 * \param theState - required state
131 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
133 Standard_EXPORT Handle(TColStd_HSequenceOfInteger)
134 GetShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
135 const Standard_Integer theShapeType,
136 const Handle(GEOM_Object)& theTopLeftPoint,
137 const Handle(GEOM_Object)& theTopRigthPoint,
138 const Handle(GEOM_Object)& theBottomLeftPoint,
139 const Handle(GEOM_Object)& theBottomRigthPoint,
140 const GEOMAlgo_State theState);
142 Standard_EXPORT Handle(GEOM_Object) GetShapesOnCylinderOld (Handle(GEOM_Object) theShape,
143 const Standard_Integer theShapeType,
144 Handle(GEOM_Object) theAxis,
145 const Standard_Real theRadius);
147 Standard_EXPORT Handle(GEOM_Object) GetShapesOnSphereOld (Handle(GEOM_Object) theShape,
148 const Standard_Integer theShapeType,
149 Handle(GEOM_Object) theCenter,
150 const Standard_Real theRadius);
152 Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
153 Handle(GEOM_Object) theShapeWhat);
155 Standard_EXPORT static void SortShapes (TopTools_ListOfShape& SL);
158 Handle(GEOM_Object) MakeShape (list<Handle(GEOM_Object)> theShapes,
159 const Standard_Integer theObjectType,
160 const Standard_Integer theFunctionType,
161 const TCollection_AsciiString& theMethodName);
163 // ----------------------------------------------------
164 // methods common for all GetShapesOnXXX() functions
165 // ----------------------------------------------------
167 bool CheckTriangulation (const TopoDS_Shape& aShape);
170 * \brief Checks if theShapeType parameter of GetShapesOnXXX() is OK
171 * \param theShapeType - the shape type to check
172 * \retval bool - result of the check
174 bool checkTypeShapesOn(const Standard_Integer theShapeType);
177 * \brief Creates Geom_Plane
178 * \param theAx1 - edge defining plane normal
179 * \retval Handle(Geom_Surface) - resulting surface
181 Handle(Geom_Surface) makePlane(const TopoDS_Shape& theAx1);
184 * \brief Creates Geom_CylindricalSurface
185 * \param theAx1 - edge defining cylinder axis
186 * \param theRadius - cylinder radius
187 * \retval Handle(Geom_Surface) - resulting surface
189 Handle(Geom_Surface) makeCylinder(const TopoDS_Shape& theAx1,
190 const Standard_Real theRadius);
193 * \brief Find IDs of subshapes complying with given status about surface
194 * \param theSurface - the surface to check state of subshapes against
195 * \param theShape - the shape to explore
196 * \param theShapeType - type of subshape of theShape
197 * \param theState - required state
198 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
200 Handle(TColStd_HSequenceOfInteger)
201 getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
202 const TopoDS_Shape& theShape,
203 TopAbs_ShapeEnum theShapeType,
204 GEOMAlgo_State theState);
207 * \brief Find subshapes complying with given status about surface
208 * \param theSurface - the surface to check state of subshapes against
209 * \param theShape - the shape to explore
210 * \param theShapeType - type of subshape of theShape
211 * \param theState - required state
212 * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
213 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
215 Handle(TColStd_HSequenceOfTransient)
216 getShapesOnSurface(const Handle(Geom_Surface)& theSurface,
217 const Handle(GEOM_Object)& theShape,
218 TopAbs_ShapeEnum theShapeType,
219 GEOMAlgo_State theState,
220 TCollection_AsciiString & theShapeEntries
224 * \brief Find IDs of subshapes complying with given status about quadrangle
225 * \param theShape - the shape to explore
226 * \param theShapeType - type of subshape of theShape
227 * \param theTopLeftPoint - top left quadrangle corner
228 * \param theTopRigthPoint - top right quadrangle corner
229 * \param theBottomLeftPoint - bottom left quadrangle corner
230 * \param theBottomRigthPoint - bottom right quadrangle corner
231 * \param theState - required state
232 * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found subshapes
234 Handle(TColStd_HSequenceOfInteger)
235 getShapesOnQuadrangleIDs (const Handle(GEOM_Object)& theShape,
236 const Standard_Integer theShapeType,
237 const Handle(GEOM_Object)& theTopLeftPoint,
238 const Handle(GEOM_Object)& theTopRigthPoint,
239 const Handle(GEOM_Object)& theBottomLeftPoint,
240 const Handle(GEOM_Object)& theBottomRigthPoint,
241 const GEOMAlgo_State theState);
244 * \brief Find shape objects and their entries by their ids
245 * \param theShape - the main shape
246 * \param theShapeIDs - theShapeIDs - incoming shape ids
247 * \param theShapeEntries - outgoing entries like "entry1, entry2, ..."
248 * \retval Handle(TColStd_HSequenceOfTransient) - found shape objects
250 Handle(TColStd_HSequenceOfTransient)
251 getObjectsShapesOn(const Handle(GEOM_Object)& theShape,
252 const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
253 TCollection_AsciiString & theShapeEntries);