Salome HOME
Fix compilation on Linux
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_DimensionStyleListener.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
2
3 // File:        SketcherPrs_DimensionStyleListener.h
4 // Created:     31 March 2016
5 // Author:      Natalia ERMOLAEVA
6
7 #ifndef SketcherPrs_DimensionStyleListener_H
8 #define SketcherPrs_DimensionStyleListener_H
9
10 #include <Events_Listener.h>
11
12 #include <ModelAPI_AttributeDouble.h>
13
14 #include "SketcherPrs_Tools.h"
15
16 #include <Standard.hxx>
17
18 #include <string>
19
20 /**
21 * \ingroup GUI
22 * A class for representation of linear dimension constraint.
23 * It supports SketchPlugin_ConstraintLength and SketchPlugin_ConstraintDistance features.
24 */
25 class SketcherPrs_DimensionStyleListener : public Events_Listener
26 {
27 public:
28   /// Constructor
29   /// \param theConstraint a constraint feature
30   /// \param thePlane a coordinate plane of current sketch
31   Standard_EXPORT SketcherPrs_DimensionStyleListener();
32
33   /// Destructor
34   Standard_EXPORT ~SketcherPrs_DimensionStyleListener();
35
36   /// Process the ModelAPI_DocumentCreatedMessage to fulfill a document
37   /// from the message with origin and planes
38   virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
39
40   /// Redefinition of virtual function
41   Standard_EXPORT void updateDimensions(AIS_Dimension* theDimension,
42                                         const AttributeDoublePtr& theAttributeValue);
43
44   /// Visualizes the dimension text or dimension value depending on the has parameters state
45   /// \param theDimension a modified dimension
46   /// \param theHasParameters if true, the text is shown, else digit
47   /// \param theValue a dimension value
48   Standard_EXPORT void updateDimensions(AIS_Dimension* theDimension,
49                                         const bool theHasParameters,
50                                         const std::string& theValue);
51
52 private:
53   /// Style how the parameter of dimension should be visualized
54   SketcherPrs_ParameterStyleMessage::ParameterStyle myStyle;
55 };
56
57 #endif