Salome HOME
Merge branch 'Dev_0.7.1' of newgeom:newgeom.git into Dev_0.7.1
[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 Redisplays the current AIS object in the context
82    */
83   void redisplay();
84
85   /** \brief Assigns the color for the shape
86    *  \param[in] theColor index of the color
87    */
88   void setColor(const int& theColor);
89
90   /** \brief Assigns the color for the shape
91    *  \param[in] theR value of the red component
92    *  \param[in] theG value of the green component
93    *  \param[in] theB value of the blue component
94    */
95   void setColor(int theR, int theG, int theB);
96
97   /// \brief Assigns the width of the lines of shape
98   void setWidth(const double& theWidth);
99
100   /// \brief Checks if the object is empty
101   bool empty() const;
102
103   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
104   /// Otherwise returns -1
105   int getShapeType() const;
106
107   /// Sets marker type for vertex.
108   /// The type has to be defined according to Acpect_TypeOfMarker
109   void setPointMarker(int theType, double theScale);
110
111   /// Set line type of edges
112   /// Has to be defined according to Aspect_TypeOfLine
113   void setLineStyle(int theStyle);
114
115   /// Set transparency of the presentation (theVal = 0 ... 1)
116   void setTransparensy(double theVal);
117 };
118
119 //! Pointer on attribute object
120 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
121
122 #endif
123