1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: GeomAPI_AISObject.hxx
4 // Created: 25 Jun 2014
5 // Author: Artem ZHIDKOV
7 #ifndef GeomAPI_AISObject_H_
8 #define GeomAPI_AISObject_H_
10 #include <GeomAPI_Interface.h>
20 /** \class GeomAPI_AISObject
22 * \brief Interface for AIS_InteractiveObject
25 class GeomAPI_AISObject : public GeomAPI_Interface
28 /// \brief Creation of empty AIS object
35 /// \brief Creates AIS_Shape object using specified shape
37 void createShape(std::shared_ptr<GeomAPI_Shape> theShape);
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
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);
53 * Returns validity of the AIS distance. It is invalid if set measured geometry is not valid,
54 * e.g. the distance points are equal.
55 * \return a boolean result
58 bool isEmptyDistanceGeometry();
60 /** \brief Creates AIS_RadiusDimension object
61 * \param[in] theCircle the radius is created for this circle
62 * \param[in] theFlyoutPoint the flyout of dimension
63 * \param[in] theRadius value of the radius to be shown
66 void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
67 std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
69 /** \brief Creates AIS_ParallelRelation object for two lines
70 * \param[in] theLine1 first parallel line
71 * \param[in] theLine2 second parallel line
72 * \param[in] theFlyoutPoint the flyout point for relation
73 * \param[in] thePlane the plane which contains the lines
76 void createParallel(std::shared_ptr<GeomAPI_Shape> theLine1,
77 std::shared_ptr<GeomAPI_Shape> theLine2,
78 std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint,
79 std::shared_ptr<GeomAPI_Pln> thePlane);
81 /** \brief Creates AIS_PerpendicularRelation object for two lines
82 * \param[in] theLine1 first parallel line
83 * \param[in] theLine2 second parallel line
84 * \param[in] thePlane the plane which contains the lines
87 void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
88 std::shared_ptr<GeomAPI_Shape> theLine2,
89 std::shared_ptr<GeomAPI_Pln> thePlane);
91 /** \brief Creates AIS_FixedRelation object for an object
92 * \param[in] theShape the object
93 * \param[in] thePlane the plane which contains the lines
96 void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
97 std::shared_ptr<GeomAPI_Pln> thePlane);
99 /** \brief Assigns the color for the shape
100 * \param[in] theColor index of the color
103 void setColor(const int& theColor);
105 /** \brief Assigns the color for the shape
106 * \param[in] theR value of the red component
107 * \param[in] theG value of the green component
108 * \param[in] theB value of the blue component
109 * \returns true if the presentation color is changed
112 bool setColor(int theR, int theG, int theB);
114 /** \brief Returns the color for the shape
115 * \param[in] theR value of the red component
116 * \param[in] theG value of the green component
117 * \param[in] theB value of the blue component
120 void getColor(int& theR, int& theG, int& theB);
122 /// \brief Assigns the width of the lines of shape
124 bool setWidth(const double& theWidth);
126 /// \brief Checks if the object is empty
130 /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
131 /// Otherwise returns -1
133 int getShapeType() const;
135 /// Sets marker type for vertex.
136 /// The type has to be defined according to Acpect_TypeOfMarker
138 void setPointMarker(int theType, double theScale);
140 /// Set line type of edges
141 /// Has to be defined according to Aspect_TypeOfLine
142 /// \returns true if the object value differs from the current
144 bool setLineStyle(int theStyle);
146 /// Set transparency of the presentation (theVal = 0 ... 1)
147 /// \returns true if the object value differs from the current
149 bool setTransparensy(double theVal);
152 //! Pointer on attribute object
153 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;