1 // File: GeomAlgoAPI_SketchBuilder.h
2 // Created: 02 Jun 2014
3 // Author: Artem ZHIDKOV
5 #ifndef GeomAlgoAPI_SketchBuilder_HeaderFile
6 #define GeomAlgoAPI_SketchBuilder_HeaderFile
8 #include <GeomAlgoAPI.h>
10 #include <boost/shared_ptr.hpp>
13 #include <GeomAPI_Dir.h>
14 #include <GeomAPI_Shape.h>
16 /** \class GeomAlgoAPI_SketchBuilder
18 * \brief Creates planar faces based on the list of Sketch features
20 class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder
23 /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
24 * \param[in] theDirX x-direction of the sketch
25 * \param[in] theDirY y-direction of the sketch
26 * \param[in] theNorm normal of the sketch
27 * \param[in] theFeatures initial features of the sketch
28 * \param[out] theResultFaces faces based on closed wires
29 * \param[out] theResultWires unclosed wires of the sketch
31 * The algorithm searches all loops of edges surrounding lesser squares.
32 * It finds the vertex with minimal coordinates along X axis (theDirX) and then
33 * goes through the edges passing the surrounding area on the left.
35 static void createFaces(const boost::shared_ptr<GeomAPI_Dir>& theDirX,
36 const boost::shared_ptr<GeomAPI_Dir>& theDirY,
37 const boost::shared_ptr<GeomAPI_Dir>& theNorm,
38 const std::list< boost::shared_ptr<GeomAPI_Shape> >& theFeatures,
39 std::list< boost::shared_ptr<GeomAPI_Shape> >& theResultFaces,
40 std::list< boost::shared_ptr<GeomAPI_Shape> >& theResultWires);
42 /** \brief Searches intersections between the faces in the list
43 * and make holes in the faces to avoid intersections
44 * \param[in,out] theFaces list of faces to proccess
46 static void fixIntersections(std::list< boost::shared_ptr<GeomAPI_Shape> >& theFaces);