Salome HOME
Fix for the issue #1605 : optimization of undo/redo and abort processing
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_DimensionStyleListener.h
index cc00b23ac4e32bb29ce8491c053fd1b0d6205ebb..17a39b4660860ca273492b828feed044bb85ff6c 100755 (executable)
 */
 class SketcherPrs_DimensionStyleListener : public Events_Listener
 {
+public:
+  class DimensionValue {
+  public:
+    DimensionValue(double theDoubleValue, bool theHasParameters, const std::string& theTextValue);
+    /// Fills internal fields by the given attribute
+    /// \param theAttributeValue a model attribute
+    void init(const AttributeDoublePtr& theAttributeValue);
+
+  public:
+    double myDoubleValue; ///< the angle value to be shown as custom value of presentation
+    bool myHasParameters; ///< true if the atrribute value has used parameters
+    std::string myTextValue; ///< the angle value depending on angle type
+  };
+
 public:
   /// Constructor
   Standard_EXPORT SketcherPrs_DimensionStyleListener();
@@ -35,18 +49,22 @@ public:
   /// from the message with origin and planes
   virtual void processEvent(const std::shared_ptr<Events_Message>& theMessage);
 
-  /// Redefinition of virtual function
+  /// Visualizes the dimension text or dimension value depending on the has parameters state
+  /// \param theDimension a modified dimension
+  /// \param theDimensionValue container filled by the model double attribute
   Standard_EXPORT void updateDimensions(AIS_Dimension* theDimension,
-                                        const AttributeDoublePtr& theAttributeValue);
+                                        const DimensionValue& theDimensionValue);
 
+private:
   /// Visualizes the dimension text or dimension value depending on the has parameters state
   /// \param theDimension a modified dimension
   /// \param theHasParameters if true, the text is shown, else digit
-  /// \param theValue a dimension value
-  Standard_EXPORT void updateDimensions(AIS_Dimension* theDimension,
-                                        const bool theHasParameters,
-                                        const std::string& theValue);
-
+  /// \param theTextValue a dimension text value
+  /// \param theDoubleValue a dimension digit value
+  void updateDimensions(AIS_Dimension* theDimension,
+                        const bool theHasParameters,
+                        const std::string& theTextValue,
+                        const double theDoubleValue);
 private:
   /// Style how the parameter of dimension should be visualized
   SketcherPrs_ParameterStyleMessage::ParameterStyle myStyle;