Salome HOME
1477c5a139634265678b7b0ff10b4ee31f1da515
[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    */
91   void setColor(int theR, int theG, int theB);
92
93   /// \brief Assigns the width of the lines of shape
94   void setWidth(const double& theWidth);
95
96   /// \brief Checks if the object is empty
97   bool empty() const;
98
99   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
100   /// Otherwise returns -1
101   int getShapeType() const;
102
103   /// Sets marker type for vertex.
104   /// The type has to be defined according to Acpect_TypeOfMarker
105   void setPointMarker(int theType, double theScale);
106 };
107
108 //! Pointer on attribute object
109 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
110
111 #endif
112