Salome HOME
Merge branch 'Dev_1.1.0' of newgeom:newgeom.git into Dev_1.1.0
[modules/shaper.git] / src / GeomAPI / GeomAPI_AISObject.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        GeomAPI_AISObject.hxx
4 // Created:     25 Jun 2014
5 // Author:      Artem ZHIDKOV
6
7 #ifndef GeomAPI_AISObject_H_
8 #define GeomAPI_AISObject_H_
9
10 #include <GeomAPI_Interface.h>
11
12 #include <memory>
13
14 class GeomAPI_Circ;
15 class GeomAPI_Lin;
16 class GeomAPI_Pln;
17 class GeomAPI_Pnt;
18 class GeomAPI_Shape;
19
20 /** \class GeomAPI_AISObject
21  *  \ingroup DataModel
22  *  \brief Interface for AIS_InteractiveObject
23  */
24
25 class GEOMAPI_EXPORT GeomAPI_AISObject : public GeomAPI_Interface
26 {
27  public:
28   /// \brief Creation of empty AIS object
29   GeomAPI_AISObject();
30
31   /// \brief Creates AIS_Shape object using specified shape
32   void createShape(std::shared_ptr<GeomAPI_Shape> theShape);
33
34   /** \brief Creates AIS_LengthDimension object
35    *  \param[in] theStartPoint  first point for dimension
36    *  \param[in] theEndPoint    second point for dimension
37    *  \param[in] theFlyoutPoint the flyout of dimension relative to the measured line
38    *  \param[in] thePlane       the plane which contains all points above
39    *  \param[in] theDistance    value of the distance to be shown
40    */
41   void createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
42                       std::shared_ptr<GeomAPI_Pnt> theEndPoint,
43                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
44                       std::shared_ptr<GeomAPI_Pln> thePlane, double theDistance);
45
46   /** \brief Creates AIS_RadiusDimension object
47    *  \param[in] theCircle      the radius is created for this circle
48    *  \param[in] theFlyoutPoint the flyout of dimension
49    *  \param[in] theRadius      value of the radius to be shown
50    */
51   void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
52                     std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
53
54   /** \brief Creates AIS_ParallelRelation object for two lines
55    *  \param[in] theLine1       first parallel line
56    *  \param[in] theLine2       second parallel line
57    *  \param[in] theFlyoutPoint the flyout point for relation
58    *  \param[in] thePlane       the plane which contains the lines
59    */
60   void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
61                       std::shared_ptr<GeomAPI_Shape> theLine2,
62                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
63                       std::shared_ptr<GeomAPI_Pln> thePlane);
64
65   /** \brief Creates AIS_PerpendicularRelation object for two lines
66    *  \param[in] theLine1       first parallel line
67    *  \param[in] theLine2       second parallel line
68    *  \param[in] thePlane       the plane which contains the lines
69    */
70   void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
71                            std::shared_ptr<GeomAPI_Shape> theLine2,
72                            std::shared_ptr<GeomAPI_Pln> thePlane);
73
74   /** \brief Creates AIS_FixedRelation object for an object
75    *  \param[in] theShape       the object
76    *  \param[in] thePlane       the plane which contains the lines
77    */
78   void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
79                    std::shared_ptr<GeomAPI_Pln> thePlane);
80
81   /** \brief Assigns the color for the shape
82    *  \param[in] theColor index of the color
83    */
84   void setColor(const int& theColor);
85
86   /** \brief Assigns the color for the shape
87    *  \param[in] theR value of the red component
88    *  \param[in] theG value of the green component
89    *  \param[in] theB value of the blue component
90    *  \returns true if the presentation color is changed
91    */
92   bool setColor(int theR, int theG, int theB);
93
94   /** \brief Returns the color for the shape
95    *  \param[in] theR value of the red component
96    *  \param[in] theG value of the green component
97    *  \param[in] theB value of the blue component
98    */
99   void getColor(int& theR, int& theG, int& theB);
100
101   /// \brief Assigns the width of the lines of shape
102   bool setWidth(const double& theWidth);
103
104   /// \brief Checks if the object is empty
105   bool empty() const;
106
107   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
108   /// Otherwise returns -1
109   int getShapeType() const;
110
111   /// Sets marker type for vertex.
112   /// The type has to be defined according to Acpect_TypeOfMarker
113   void setPointMarker(int theType, double theScale);
114
115   /// Set line type of edges
116   /// Has to be defined according to Aspect_TypeOfLine
117   /// \returns true if the object value differs from the current
118   bool setLineStyle(int theStyle);
119
120   /// Set transparency of the presentation (theVal = 0 ... 1)
121   /// \returns true if the object value differs from the current
122   bool setTransparensy(double theVal);
123 };
124
125 //! Pointer on attribute object
126 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
127
128 #endif
129