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 /// Reyirns shape used for the presentation creation (can be NULL)
40 GEOMAPI_EXPORT std::shared_ptr<GeomAPI_Shape> getShape() const;
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
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);
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
61 bool isEmptyDistanceGeometry();
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
69 void createRadius(std::shared_ptr<GeomAPI_Circ> theCircle,
70 std::shared_ptr<GeomAPI_Pnt> theFlyoutPoint, double theRadius);
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
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);
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
90 void createPerpendicular(std::shared_ptr<GeomAPI_Shape> theLine1,
91 std::shared_ptr<GeomAPI_Shape> theLine2,
92 std::shared_ptr<GeomAPI_Pln> thePlane);
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
99 void createFixed(std::shared_ptr<GeomAPI_Shape> theShape,
100 std::shared_ptr<GeomAPI_Pln> thePlane);
102 /** \brief Assigns the color for the shape
103 * \param[in] theColor index of the color
106 void setColor(const int& theColor);
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
115 bool setColor(int theR, int theG, int theB);
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
123 void getColor(int& theR, int& theG, int& theB);
125 /// \return Current width of the lines of shape
129 /// \brief Assigns the width of the lines of shape
131 bool setWidth(const double& theWidth);
133 /// \brief Checks if the object is empty
137 /// Return shape type according to TopAbs_ShapeEnum if the AIS is AIS_Shape
138 /// Otherwise returns -1
140 int getShapeType() const;
142 /// Sets marker type for vertex.
143 /// The type has to be defined according to Acpect_TypeOfMarker
145 void setPointMarker(int theType, double theScale);
147 /// Set line type of edges
148 /// Has to be defined according to Aspect_TypeOfLine
149 /// \returns true if the object value differs from the current
151 bool setLineStyle(int theStyle);
153 /// Set transparency of the presentation (theVal = 0 ... 1)
154 /// \returns true if the object value differs from the current
156 bool setTransparensy(double theVal);
159 //! Pointer on attribute object
160 typedef std::shared_ptr<GeomAPI_AISObject> AISObjectPtr;