1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAlgoAPI_SketchBuilder.h
4 // Created: 02 Jun 2014
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAlgoAPI_SketchBuilder_H_
8 #define GeomAlgoAPI_SketchBuilder_H_
10 #include <GeomAlgoAPI.h>
15 #include <GeomAPI_Dir.h>
16 #include <GeomAPI_Pnt.h>
17 #include <GeomAPI_Shape.h>
19 /** \class GeomAlgoAPI_SketchBuilder
21 * \brief Creates planar faces based on the list of Sketch features
23 class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder
26 /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
27 * \param[in] theOrigin origin point of the sketch
28 * \param[in] theDirX x-direction of the sketch
29 * \param[in] theDirY y-direction of the sketch
30 * \param[in] theNorm normal of the sketch
31 * \param[in] theFeatures initial features of the sketch
32 * \param[out] theResultFaces faces based on closed wires
33 * \param[out] theResultWires unclosed wires of the sketch
35 * The algorithm searches all loops of edges surrounding lesser squares.
36 * It finds the vertex with minimal coordinates along X axis (theDirX) and then
37 * goes through the edges passing the surrounding area on the left.
39 static void createFaces(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
40 const std::shared_ptr<GeomAPI_Dir>& theDirX,
41 const std::shared_ptr<GeomAPI_Dir>& theNorm,
42 const std::list<std::shared_ptr<GeomAPI_Shape> >& theFeatures,
43 std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces,
44 std::list<std::shared_ptr<GeomAPI_Shape> >& theResultWires);
46 /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
47 * \param[in] theOrigin origin point of the sketch
48 * \param[in] theDirX x-direction of the sketch
49 * \param[in] theDirY y-direction of the sketch
50 * \param[in] theNorm normal of the sketch
51 * \param[in] theWire a wire which contains all edges
52 * \param[out] theResultFaces faces based on closed wires
54 * The algorithm searches all loops of edges surrounding lesser squares.
55 * It finds the vertex with minimal coordinates along X axis (theDirX) and then
56 * goes through the edges passing the surrounding area on the left.
58 static void createFaces(const std::shared_ptr<GeomAPI_Pnt>& theOrigin,
59 const std::shared_ptr<GeomAPI_Dir>& theDirX,
60 const std::shared_ptr<GeomAPI_Dir>& theNorm,
61 const std::shared_ptr<GeomAPI_Shape>& theWire,
62 std::list<std::shared_ptr<GeomAPI_Shape> >& theResultFaces);
64 /** \brief Searches intersections between the faces in the list
65 * and make holes in the faces to avoid intersections
66 * \param[in,out] theFaces list of faces to proccess
68 static void fixIntersections(std::list<std::shared_ptr<GeomAPI_Shape> >& theFaces);