Salome HOME
Sources formated according to the codeing standards
[modules/shaper.git] / src / GeomAlgoAPI / GeomAlgoAPI_SketchBuilder.h
1 // File:        GeomAlgoAPI_SketchBuilder.h
2 // Created:     02 Jun 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GeomAlgoAPI_SketchBuilder_H_
6 #define GeomAlgoAPI_SketchBuilder_H_
7
8 #include <GeomAlgoAPI.h>
9
10 #include <boost/shared_ptr.hpp>
11 #include <list>
12
13 #include <GeomAPI_Dir.h>
14 #include <GeomAPI_Pnt.h>
15 #include <GeomAPI_Shape.h>
16
17 /** \class GeomAlgoAPI_SketchBuilder
18  *  \ingroup DataAlgo
19  *  \brief Creates planar faces based on the list of Sketch features
20  */
21 class GEOMALGOAPI_EXPORT GeomAlgoAPI_SketchBuilder
22 {
23  public:
24   /** \brief Creates list of faces and unclosed wires on basis of the features of the sketch
25    *  \param[in]  theOrigin      origin point of the sketch
26    *  \param[in]  theDirX        x-direction of the sketch
27    *  \param[in]  theDirY        y-direction of the sketch
28    *  \param[in]  theNorm        normal of the sketch
29    *  \param[in]  theFeatures    initial features of the sketch
30    *  \param[out] theResultFaces faces based on closed wires
31    *  \param[out] theResultWires unclosed wires of the sketch
32    *
33    *  The algorithm searches all loops of edges surrounding lesser squares.
34    *  It finds the vertex with minimal coordinates along X axis (theDirX) and then 
35    *  goes through the edges passing the surrounding area on the left.
36    */
37   static void createFaces(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin,
38                           const boost::shared_ptr<GeomAPI_Dir>& theDirX,
39                           const boost::shared_ptr<GeomAPI_Dir>& theDirY,
40                           const boost::shared_ptr<GeomAPI_Dir>& theNorm,
41                           const std::list<boost::shared_ptr<GeomAPI_Shape> >& theFeatures,
42                           std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces,
43                           std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultWires);
44
45   /** \brief Searches intersections between the faces in the list 
46    *         and make holes in the faces to avoid intersections
47    *  \param[in,out] theFaces list of faces to proccess
48    */
49   static void fixIntersections(std::list<boost::shared_ptr<GeomAPI_Shape> >& theFaces);
50 };
51
52 #endif