Salome HOME
Issue #1860: fix end lines with spaces
[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   /// Reyirns shape used for the presentation creation (can be NULL)
40   GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Shape> getShape() const;
41
42   /** \brief Creates AIS_LengthDimension object
43    *  \param[in] theStartPoint  first point for dimension
44    *  \param[in] theEndPoint    second point for dimension
45    *  \param[in] theFlyoutPoint the flyout of dimension relative to the measured line
46    *  \param[in] thePlane       the plane which contains all points above
47    *  \param[in] theDistance    value of the distance to be shown
48    */
49   GEOMAPI_EXPORT
50   void createDistance(std::shared_ptr<GeomAPI_Pnt> theStartPoint,
51                       std::shared_ptr<GeomAPI_Pnt> theEndPoint,
52                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
53                       std::shared_ptr<GeomAPI_Pln> thePlane, double theDistance);
54
55   /**
56    * Returns validity of the AIS distance. It is invalid if set measured geometry is not valid,
57    * e.g. the distance points are equal.
58    * \return a boolean result
59    */
60   GEOMAPI_EXPORT
61   bool isEmptyDistanceGeometry();
62
63   /** \brief Creates AIS_RadiusDimension object
64    *  \param[in] theCircle      the radius is created for this circle
65    *  \param[in] theFlyoutPoint the flyout of dimension
66    *  \param[in] theRadius      value of the radius to be shown
67    */
68   GEOMAPI_EXPORT
69   void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
70                     std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
71
72   /** \brief Creates AIS_ParallelRelation object for two lines
73    *  \param[in] theLine1       first parallel line
74    *  \param[in] theLine2       second parallel line
75    *  \param[in] theFlyoutPoint the flyout point for relation
76    *  \param[in] thePlane       the plane which contains the lines
77    */
78   GEOMAPI_EXPORT
79   void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
80                       std::shared_ptr<GeomAPI_Shape> theLine2,
81                       std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
82                       std::shared_ptr<GeomAPI_Pln> thePlane);
83
84   /** \brief Creates AIS_PerpendicularRelation object for two lines
85    *  \param[in] theLine1       first parallel line
86    *  \param[in] theLine2       second parallel line
87    *  \param[in] thePlane       the plane which contains the lines
88    */
89   GEOMAPI_EXPORT
90   void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
91                            std::shared_ptr<GeomAPI_Shape> theLine2,
92                            std::shared_ptr<GeomAPI_Pln> thePlane);
93
94   /** \brief Creates AIS_FixedRelation object for an object
95    *  \param[in] theShape       the object
96    *  \param[in] thePlane       the plane which contains the lines
97    */
98   GEOMAPI_EXPORT
99   void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
100                    std::shared_ptr<GeomAPI_Pln> thePlane);
101
102   /** \brief Assigns the color for the shape
103    *  \param[in] theColor index of the color
104    */
105   GEOMAPI_EXPORT
106   void setColor(const int& theColor);
107
108   /** \brief Assigns the color for the shape
109    *  \param[in] theR value of the red component
110    *  \param[in] theG value of the green component
111    *  \param[in] theB value of the blue component
112    *  \returns true if the presentation color is changed
113    */
114   GEOMAPI_EXPORT
115   bool setColor(int theR, int theG, int theB);
116
117   /** \brief Returns the color for the shape
118    *  \param[in] theR value of the red component
119    *  \param[in] theG value of the green component
120    *  \param[in] theB value of the blue component
121    */
122   GEOMAPI_EXPORT
123   void getColor(int& theR, int& theG, int& theB);
124
125   /** \brief Assigns the deflection to the shape
126    *  \param[in] theDeflection value of deflection
127    */
128   GEOMAPI_EXPORT
129   bool setDeflection(const double theDeflection);
130
131   /** \brief Returns deflection for the shape
132    *  \return double value
133    */
134   GEOMAPI_EXPORT
135   double getDeflection() const;
136
137   /// \return Current width of the lines of shape
138   GEOMAPI_EXPORT
139   double width();
140
141   /// \brief Assigns the width of the lines of shape
142   GEOMAPI_EXPORT
143   bool setWidth(const double& theWidth);
144
145   /// \brief Checks if the object is empty
146   GEOMAPI_EXPORT
147   bool empty() const;
148
149   /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
150   /// Otherwise returns -1
151   GEOMAPI_EXPORT
152   int getShapeType() const;
153
154   /// Sets marker type for vertex.
155   /// The type has to be defined according to Acpect_TypeOfMarker
156   GEOMAPI_EXPORT
157   void setPointMarker(int theType, double theScale);
158
159   /// Set line type of edges
160   /// Has to be defined according to Aspect_TypeOfLine
161   /// \returns true if the object value differs from the current
162   GEOMAPI_EXPORT
163   bool setLineStyle(int theStyle);
164
165   /// Set transparency of the presentation (theVal = 0 ... 1)
166   /// \returns true if the object value differs from the current
167   GEOMAPI_EXPORT
168   bool setTransparensy(double theVal);
169 };
170
171 //! Pointer on attribute object
172 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;
173
174 #endif
175