Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into CEA_2019
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_DimensionStyleListener.cpp
old mode 100755 (executable)
new mode 100644 (file)
index 233719d..e00f81a
@@ -1,10 +1,24 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-
-// File:        SketcherPrs_DimensionStyleListener.cpp
-// Created:     31 March 2016
-// Author:      Natalia ERMOLAEVA
+// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
 #include "SketcherPrs_DimensionStyleListener.h"
+#include <Prs3d_DimensionAspect.hxx>
 #include "SketcherPrs_Tools.h"
 
 #include <Events_Loop.h>
@@ -12,9 +26,9 @@
 #include <AIS_Dimension.hxx>
 #include <TCollection_ExtendedString.hxx>
 
-#ifndef WNT
-  #define COMPILATION_CORRECTION
-#endif
+//#ifndef WNT
+//  #define COMPILATION_CORRECTION
+//#endif
 
 // it is not possible to use 0x2211 as summ symbol because it is not supported by
 // debian Linux platform
@@ -51,7 +65,8 @@ SketcherPrs_DimensionStyleListener::~SketcherPrs_DimensionStyleListener()
   aLoop->removeListener(this);
 }
 
-void SketcherPrs_DimensionStyleListener::processEvent(const std::shared_ptr<Events_Message>& theMessage)
+void SketcherPrs_DimensionStyleListener::processEvent(
+  const std::shared_ptr<Events_Message>& theMessage)
 {
   const Events_ID kParameterStyleEvent = SketcherPrs_ParameterStyleMessage::eventId();
   if (theMessage->eventID() == kParameterStyleEvent) {
@@ -90,7 +105,8 @@ void SketcherPrs_DimensionStyleListener::updateDimensions(AIS_Dimension* theDime
       aCustomValue = theTextValue.c_str();
     else {
       // format value string using "sprintf"
-      TCollection_AsciiString aFormatStr = theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
+      TCollection_AsciiString aFormatStr =
+        theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
       char aFmtBuffer[256];
       sprintf (aFmtBuffer, aFormatStr.ToCString(), theDoubleValue);
       aCustomValue = TCollection_ExtendedString (aFmtBuffer);
@@ -100,7 +116,8 @@ void SketcherPrs_DimensionStyleListener::updateDimensions(AIS_Dimension* theDime
   }
   else {
     // format value string using "sprintf"
-    TCollection_AsciiString aFormatStr = theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
+    TCollection_AsciiString aFormatStr =
+      theDimension->Attributes()->DimensionAspect()->ValueStringFormat();
     char aFmtBuffer[256];
     sprintf (aFmtBuffer, aFormatStr.ToCString(), theDoubleValue);
     aCustomValue = TCollection_ExtendedString (aFmtBuffer);