]> SALOME platform Git repositories - modules/shaper.git/blob - src/GeomAlgoAPI/GeomAlgoAPI_SketchBuilder.h
Salome HOME
Merge branch 'master' of newgeom:newgeom
[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 Creates list of faces and unclosed wires on basis of the features of the sketch
46    *  \param[in]  theOrigin      origin point of the sketch
47    *  \param[in]  theDirX        x-direction of the sketch
48    *  \param[in]  theDirY        y-direction of the sketch
49    *  \param[in]  theNorm        normal of the sketch
50    *  \param[in]  theWire        a wire which contains all edges
51    *  \param[out] theResultFaces faces based on closed wires
52    *
53    *  The algorithm searches all loops of edges surrounding lesser squares.
54    *  It finds the vertex with minimal coordinates along X axis (theDirX) and then
55    *  goes through the edges passing the surrounding area on the left.
56    */
57   static void createFaces(const boost::shared_ptr<GeomAPI_Pnt>& theOrigin,
58                           const boost::shared_ptr<GeomAPI_Dir>& theDirX,
59                           const boost::shared_ptr<GeomAPI_Dir>& theDirY,
60                           const boost::shared_ptr<GeomAPI_Dir>& theNorm,
61                           const boost::shared_ptr<GeomAPI_Shape>& theWire,
62                           std::list<boost::shared_ptr<GeomAPI_Shape> >& theResultFaces);
63
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
67    */
68   static void fixIntersections(std::list<boost::shared_ptr<GeomAPI_Shape> >& theFaces);
69 };
70
71 #endif