Salome HOME
Issue #555 Make a number of shifted/rotated copies - selected object does not appear...
[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   ~GeomAPI_AISObject();
32
33   /// \brief Creates AIS_Shape object using specified shape
34   void createShape(std::shared_ptr<GeomAPI_Shape> theShape);
35
36   /** \brief Creates AIS_LengthDimension object
37    *  \param[in] theStartPoint  first point for dimension
38    *  \param[in] theEndPoint    second point for dimension
39    *  \param[in] theFlyoutPoint the flyout of dimension relative to the measured line
40    *  \param[in] thePlane       the plane which contains all points above
41    *  \param[in] theDistance    value of the distance to be shown
42    */
43   void createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
44                       std::shared_ptr<GeomAPI_Pnt> theEndPoint,
45                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
46                       std::shared_ptr<GeomAPI_Pln> thePlane, double theDistance);
47
48   /** \brief Creates AIS_RadiusDimension object
49    *  \param[in] theCircle      the radius is created for this circle
50    *  \param[in] theFlyoutPoint the flyout of dimension
51    *  \param[in] theRadius      value of the radius to be shown
52    */
53   void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
54                     std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
55
56   /** \brief Creates AIS_ParallelRelation object for two lines
57    *  \param[in] theLine1       first parallel line
58    *  \param[in] theLine2       second parallel line
59    *  \param[in] theFlyoutPoint the flyout point for relation
60    *  \param[in] thePlane       the plane which contains the lines
61    */
62   void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
63                       std::shared_ptr<GeomAPI_Shape> theLine2,
64                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
65                       std::shared_ptr<GeomAPI_Pln> thePlane);
66
67   /** \brief Creates AIS_PerpendicularRelation object for two lines
68    *  \param[in] theLine1       first parallel line
69    *  \param[in] theLine2       second parallel line
70    *  \param[in] thePlane       the plane which contains the lines
71    */
72   void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
73                            std::shared_ptr<GeomAPI_Shape> theLine2,
74                            std::shared_ptr<GeomAPI_Pln> thePlane);
75
76   /** \brief Creates AIS_FixedRelation object for an object
77    *  \param[in] theShape       the object
78    *  \param[in] thePlane       the plane which contains the lines
79    */
80   void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
81                    std::shared_ptr<GeomAPI_Pln> thePlane);
82
83   /** \brief Assigns the color for the shape
84    *  \param[in] theColor index of the color
85    */
86   void setColor(const int& theColor);
87
88   /** \brief Assigns the color for the shape
89    *  \param[in] theR value of the red component
90    *  \param[in] theG value of the green component
91    *  \param[in] theB value of the blue component
92    *  \returns true if the presentation color is changed
93    */
94   bool setColor(int theR, int theG, int theB);
95
96   /** \brief Returns the color for the shape
97    *  \param[in] theR value of the red component
98    *  \param[in] theG value of the green component
99    *  \param[in] theB value of the blue component
100    */
101   void getColor(int& theR, int& theG, int& theB);
102
103   /// \brief Assigns the width of the lines of shape
104   bool setWidth(const double& theWidth);
105
106   /// \brief Checks if the object is empty
107   bool empty() const;
108
109   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
110   /// Otherwise returns -1
111   int getShapeType() const;
112
113   /// Sets marker type for vertex.
114   /// The type has to be defined according to Acpect_TypeOfMarker
115   void setPointMarker(int theType, double theScale);
116
117   /// Set line type of edges
118   /// Has to be defined according to Aspect_TypeOfLine
119   /// \returns true if the object value differs from the current
120   bool setLineStyle(int theStyle);
121
122   //! Sets the infinite state flag aFlage.
123   //! considered as infinite, i.e. its graphic presentations
124   //! are not taken in account for View FitAll...
125   //! \param theState a state
126   /// \returns true if the object value differs from the current
127   bool setInfiniteState(const bool theState);
128
129   /// Set transparency of the presentation (theVal = 0 ... 1)
130   /// \returns true if the object value differs from the current
131   bool setTransparensy(double theVal);
132 };
133
134 //! Pointer on attribute object
135 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
136
137 #endif
138