20 #ifndef GeomAlgoAPI_ShapeTools_H_
21 #define GeomAlgoAPI_ShapeTools_H_
23 #include "GeomAlgoAPI.h"
25 #include <GeomAPI_Shape.h>
26 #include <GeomAPI_Vertex.h>
27 #include <GeomAPI_Pnt.h>
52 GEOMALGOAPI_EXPORT
static double length(
const std::shared_ptr<GeomAPI_Shape> theShape);
55 GEOMALGOAPI_EXPORT
static double volume(
const std::shared_ptr<GeomAPI_Shape> theShape);
58 GEOMALGOAPI_EXPORT
static double area(
const std::shared_ptr<GeomAPI_Shape> theShape);
68 const GeomShapePtr& theFace2,
69 const GeomPointPtr& thePoint,
70 const double & theAngle,
71 std::string& theError);
77 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Pnt>
78 centreOfMass(
const std::shared_ptr<GeomAPI_Shape> theShape);
82 GEOMALGOAPI_EXPORT
static double radius(
const std::shared_ptr<GeomAPI_Face>& theCylinder);
85 GEOMALGOAPI_EXPORT
static double minimalDistance(
const GeomShapePtr& theShape1,
86 const GeomShapePtr& theShape2);
87 GEOMALGOAPI_EXPORT
static double minimalDistance(
const GeomShapePtr& theShape1,
88 const GeomShapePtr& theShape2,
89 std::array<double, 3> & fromShape1To2);
93 GEOMALGOAPI_EXPORT
static double shapeProximity(
const GeomShapePtr& theShape1,
94 const GeomShapePtr& theShape2);
100 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Shape>
combineShapes(
101 const std::shared_ptr<GeomAPI_Shape> theCompound,
107 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Shape>
121 GEOMALGOAPI_EXPORT
static
122 std::list<std::shared_ptr<GeomAPI_Pnt> >
getBoundingBox(
const ListOfShape& theShapes,
123 const double theEnlarge = 0.0);
129 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Face>
fitPlaneToBox(
130 const std::shared_ptr<GeomAPI_Shape> thePlane,
131 const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints);
139 GEOMALGOAPI_EXPORT
static void findBounds(
const std::shared_ptr<GeomAPI_Shape> theShape,
140 std::shared_ptr<GeomAPI_Vertex>& theV1,
141 std::shared_ptr<GeomAPI_Vertex>& theV2);
146 GEOMALGOAPI_EXPORT
static void makeFacesWithHoles(
const std::shared_ptr<GeomAPI_Pnt> theOrigin,
147 const std::shared_ptr<GeomAPI_Dir> theDirection,
148 const ListOfShape& theWires,
149 ListOfShape& theFaces);
154 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Pln>
findPlane(
const ListOfShape& theShapes);
161 const std::shared_ptr<GeomAPI_Shape> theSubShape,
162 const std::shared_ptr<GeomAPI_Shape> theBaseShape);
165 GEOMALGOAPI_EXPORT
static bool isShapeValid(
const std::shared_ptr<GeomAPI_Shape> theShape);
168 GEOMALGOAPI_EXPORT
static
169 std::shared_ptr<GeomAPI_Shape>
getFaceOuterWire(
const std::shared_ptr<GeomAPI_Shape> theFace);
172 GEOMALGOAPI_EXPORT
static bool isTangent(
const std::shared_ptr<GeomAPI_Edge> theEdge1,
173 const std::shared_ptr<GeomAPI_Edge> theEdge2,
174 const std::shared_ptr<GeomAPI_Vertex> theTgPoint);
177 GEOMALGOAPI_EXPORT
static bool isParallel(
const std::shared_ptr<GeomAPI_Edge> theEdge,
178 const std::shared_ptr<GeomAPI_Face> theFace);
183 GEOMALGOAPI_EXPORT
static std::list<std::shared_ptr<GeomAPI_Vertex> >
intersect(
184 const std::shared_ptr<GeomAPI_Edge> theEdge,
const std::shared_ptr<GeomAPI_Face> theFace);
186 typedef std::map<std::shared_ptr<GeomAPI_Pnt>,
187 std::pair<std::list<std::shared_ptr<GeomDataAPI_Point2D> >,
188 std::list<std::shared_ptr<ModelAPI_Object> > > > PointToRefsMap;
193 GEOMALGOAPI_EXPORT
static void splitShape(
const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
194 const PointToRefsMap& thePointsInfo,
195 std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
201 GEOMALGOAPI_EXPORT
static void splitShape_p(
const std::shared_ptr<GeomAPI_Shape>& theBaseShape,
202 const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
203 std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
205 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Shape> findShape(
206 const std::list<std::shared_ptr<GeomAPI_Pnt> >& thePoints,
207 const std::set<std::shared_ptr<GeomAPI_Shape> >& theShapes);
209 #ifdef FEATURE_MULTIROTATION_TWO_DIRECTIONS
214 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Dir> buildDirFromAxisAndShape(
215 const std::shared_ptr<GeomAPI_Shape> theBaseShape,
216 const std::shared_ptr<GeomAPI_Ax1> theAxis);
220 GEOMALGOAPI_EXPORT
static std::shared_ptr<GeomAPI_Edge>
wireToEdge(
221 const std::shared_ptr<GeomAPI_Wire>& theWire);
235 const ListOfShape& theBaseShapes,
236 const std::shared_ptr<GeomAPI_Dir> theDir,
237 double& theToSize,
double& theFromSize);
242 GEOMALGOAPI_EXPORT
static ListOfShape
getSharedFaces(
const GeomShapePtr& theShape);
The class represents an axis in 3D space.
Definition: GeomAPI_Ax1.h:31
3D direction defined by three normalized coordinates
Definition: GeomAPI_Dir.h:34
Interface to the edge object.
Definition: GeomAPI_Edge.h:38
Interface to the face object.
Definition: GeomAPI_Face.h:36
Interface to the set of edges located in one plane.
Definition: GeomAPI_PlanarEdges.h:40
\Plane in 3D place, defined by normal, center and x-direction.
Definition: GeomAPI_Pln.h:38
3D point defined by three coordinates
Definition: GeomAPI_Pnt.h:38
ShapeType
Shape type enum.
Definition: GeomAPI_Shape.h:46
Interface to the wire object.
Definition: GeomAPI_Wire.h:31
Attribute that contains 2D point coordinates.
Definition: GeomDataAPI_Point2D.h:37
Represents any object in the data model and in the object browser.
Definition: ModelAPI_Object.h:45