Salome HOME
6d0a3f2e5187b66c3a7344e565b86a406ddcd2a9
[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_AISObject : public GeomAPI_Interface
26 {
27  public:
28   /// \brief Creation of empty AIS object
29   GEOMAPI_EXPORT 
30   GeomAPI_AISObject();
31
32   GEOMAPI_EXPORT 
33   ~GeomAPI_AISObject();
34
35   /// \brief Creates AIS_Shape object using specified shape
36   GEOMAPI_EXPORT 
37   void createShape(std::shared_ptr<GeomAPI_Shape> theShape);
38
39   /** \brief Creates AIS_LengthDimension object
40    *  \param[in] theStartPoint  first point for dimension
41    *  \param[in] theEndPoint    second point for dimension
42    *  \param[in] theFlyoutPoint the flyout of dimension relative to the measured line
43    *  \param[in] thePlane       the plane which contains all points above
44    *  \param[in] theDistance    value of the distance to be shown
45    */
46   GEOMAPI_EXPORT 
47   void createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
48                       std::shared_ptr<GeomAPI_Pnt> theEndPoint,
49                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
50                       std::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   GEOMAPI_EXPORT 
58   void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
59                     std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
60
61   /** \brief Creates AIS_ParallelRelation object for two lines
62    *  \param[in] theLine1       first parallel line
63    *  \param[in] theLine2       second parallel line
64    *  \param[in] theFlyoutPoint the flyout point for relation
65    *  \param[in] thePlane       the plane which contains the lines
66    */
67   GEOMAPI_EXPORT 
68   void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
69                       std::shared_ptr<GeomAPI_Shape> theLine2,
70                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
71                       std::shared_ptr<GeomAPI_Pln> thePlane);
72
73   /** \brief Creates AIS_PerpendicularRelation object for two lines
74    *  \param[in] theLine1       first parallel line
75    *  \param[in] theLine2       second parallel line
76    *  \param[in] thePlane       the plane which contains the lines
77    */
78   GEOMAPI_EXPORT 
79   void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
80                            std::shared_ptr<GeomAPI_Shape> theLine2,
81                            std::shared_ptr<GeomAPI_Pln> thePlane);
82
83   /** \brief Creates AIS_FixedRelation object for an object
84    *  \param[in] theShape       the object
85    *  \param[in] thePlane       the plane which contains the lines
86    */
87   GEOMAPI_EXPORT 
88   void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
89                    std::shared_ptr<GeomAPI_Pln> thePlane);
90
91   /** \brief Assigns the color for the shape
92    *  \param[in] theColor index of the color
93    */
94   GEOMAPI_EXPORT 
95   void setColor(const int& theColor);
96
97   /** \brief Assigns the color for the shape
98    *  \param[in] theR value of the red component
99    *  \param[in] theG value of the green component
100    *  \param[in] theB value of the blue component
101    *  \returns true if the presentation color is changed
102    */
103   GEOMAPI_EXPORT 
104   bool setColor(int theR, int theG, int theB);
105
106   /** \brief Returns the color for the shape
107    *  \param[in] theR value of the red component
108    *  \param[in] theG value of the green component
109    *  \param[in] theB value of the blue component
110    */
111   GEOMAPI_EXPORT 
112   void getColor(int& theR, int& theG, int& theB);
113
114   /// \brief Assigns the width of the lines of shape
115   GEOMAPI_EXPORT 
116   bool setWidth(const double& theWidth);
117
118   /// \brief Checks if the object is empty
119   GEOMAPI_EXPORT 
120   bool empty() const;
121
122   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
123   /// Otherwise returns -1
124   GEOMAPI_EXPORT 
125   int getShapeType() const;
126
127   /// Sets marker type for vertex.
128   /// The type has to be defined according to Acpect_TypeOfMarker
129   GEOMAPI_EXPORT 
130   void setPointMarker(int theType, double theScale);
131
132   /// Set line type of edges
133   /// Has to be defined according to Aspect_TypeOfLine
134   /// \returns true if the object value differs from the current
135   GEOMAPI_EXPORT 
136   bool setLineStyle(int theStyle);
137
138   /// Set transparency of the presentation (theVal = 0 ... 1)
139   /// \returns true if the object value differs from the current
140   GEOMAPI_EXPORT 
141   bool setTransparensy(double theVal);
142 };
143
144 //! Pointer on attribute object
145 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
146
147 #endif
148