Salome HOME
Boost has been removed from code
[modules/shaper.git] / src / GeomAPI / GeomAPI_AISObject.h
1 // File:        GeomAPI_AISObject.hxx
2 // Created:     25 Jun 2014
3 // Author:      Artem ZHIDKOV
4
5 #ifndef GeomAPI_AISObject_H_
6 #define GeomAPI_AISObject_H_
7
8 #include <GeomAPI_Interface.h>
9
10 #include <memory>
11
12 class GeomAPI_Circ;
13 class GeomAPI_Lin;
14 class GeomAPI_Pln;
15 class GeomAPI_Pnt;
16 class GeomAPI_Shape;
17
18 struct GEOMAPI_EXPORT Colors
19 {
20   static int COLOR_BROWN;
21   static int COLOR_RED;
22   static int COLOR_GREEN;
23   static int COLOR_BLUE;
24 };
25
26 /** \class GeomAPI_AISObject
27  *  \ingroup DataModel
28  *  \brief Interface for AIS_InteractiveObject
29  */
30
31 class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface
32 {
33  public:
34   /// \brief Creation of empty AIS object
35   GeomAPI_AISObject();
36
37   /// \brief Creates AIS_Shape object using specified shape
38   void createShape(std::shared_ptr<GeomAPI_Shape> theShape);
39
40   /** \brief Creates AIS_LengthDimension object
41    *  \param[in] theStartPoint  first point for dimension
42    *  \param[in] theEndPoint    second point for dimension
43    *  \param[in] theFlyoutPoint the flyout of dimension relative to the measured line
44    *  \param[in] thePlane       the plane which contains all points above
45    *  \param[in] theDistance    value of the distance to be shown
46    */
47   void createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
48                       std::shared_ptr<GeomAPI_Pnt> theEndPoint,
49                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
50                       std::shared_ptr<GeomAPI_Pln> thePlane, double theDistance);
51
52   /** \brief Creates AIS_RadiusDimension object
53    *  \param[in] theCircle      the radius is created for this circle
54    *  \param[in] theFlyoutPoint the flyout of dimension
55    *  \param[in] theRadius      value of the radius to be shown
56    */
57   void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
58                     std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
59
60   /** \brief Creates AIS_ParallelRelation object for two lines
61    *  \param[in] theLine1       first parallel line
62    *  \param[in] theLine2       second parallel line
63    *  \param[in] theFlyoutPoint the flyout point for relation
64    *  \param[in] thePlane       the plane which contains the lines
65    */
66   void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
67                       std::shared_ptr<GeomAPI_Shape> theLine2,
68                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
69                       std::shared_ptr<GeomAPI_Pln> thePlane);
70
71   /** \brief Creates AIS_PerpendicularRelation object for two lines
72    *  \param[in] theLine1       first parallel line
73    *  \param[in] theLine2       second parallel line
74    *  \param[in] thePlane       the plane which contains the lines
75    */
76   void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
77                            std::shared_ptr<GeomAPI_Shape> theLine2,
78                            std::shared_ptr<GeomAPI_Pln> thePlane);
79
80   /** \brief Creates AIS_FixedRelation object for an object
81    *  \param[in] theShape       the object
82    *  \param[in] thePlane       the plane which contains the lines
83    */
84   void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
85                    std::shared_ptr<GeomAPI_Pln> thePlane);
86
87   /** \brief Assigns the color for the shape
88    *  \param[in] theColor index of the color
89    */
90   void setColor(const int& theColor);
91
92   /** \brief Assigns the color for the shape
93    *  \param[in] theR value of the red component
94    *  \param[in] theG value of the green component
95    *  \param[in] theB value of the blue component
96    */
97   void setColor(int theR, int theG, int theB);
98
99   /// \brief Assigns the width of the lines of shape
100   void setWidth(const double& theWidth);
101
102   /// \brief Checks if the object is empty
103   bool empty() const;
104 };
105
106 //! Pointer on attribute object
107 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
108
109 #endif
110