Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[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 <boost/shared_ptr.hpp>
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(boost::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(boost::shared_ptr<GeomAPI_Pnt> theStartPoint,
48                       boost::shared_ptr<GeomAPI_Pnt> theEndPoint,
49                       boost::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
50                       boost::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(boost::shared_ptr<GeomAPI_Circ> theCircle,
58                     boost::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(boost::shared_ptr<GeomAPI_Shape> theLine1,
67                       boost::shared_ptr<GeomAPI_Shape> theLine2,
68                       boost::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
69                       boost::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(boost::shared_ptr<GeomAPI_Shape> theLine1,
77                            boost::shared_ptr<GeomAPI_Shape> theLine2,
78                            boost::shared_ptr<GeomAPI_Pln> thePlane);
79
80   /** \brief Assigns the color for the shape
81    *  \param[in] theColor index of the color
82    */
83   void setColor(const int& theColor);
84
85   /** \brief Assigns the color for the shape
86    *  \param[in] theR value of the red component
87    *  \param[in] theG value of the green component
88    *  \param[in] theB value of the blue component
89    */
90   void setColor(int theR, int theG, int theB);
91
92   /// \brief Assigns the width of the lines of shape
93   void setWidth(const double& theWidth);
94
95   /// \brief Checks if the object is empty
96   bool empty() const;
97 };
98
99 //! Pointer on attribute object
100 typedef boost::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
101
102 #endif
103