Salome HOME
Fix compilation warnings
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_DimensionStyle.cpp
index fb82eb40b2d564fd67c7023b7ef40df7378f1f24..4309c23db91ecda5b89aff3b88926f797c729c52 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2021  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
 
 #include <Events_Loop.h>
 
-#include <AIS_Dimension.hxx>
+#include <Locale_Convert.h>
+
+#include <PrsDim_Dimension.hxx>
 #include <TCollection_ExtendedString.hxx>
+#include <Standard_Version.hxx>
 
 //#ifndef WNT
 //  #define COMPILATION_CORRECTION
@@ -49,7 +52,7 @@ void SketcherPrs_DimensionStyle::DimensionValue::init(
 {
   myDoubleValue = theAttributeValue->value();
   myHasParameters = theAttributeValue->usedParameters().size() > 0;
-  myTextValue = theAttributeValue->text();
+  myTextValue = Locale::Convert::toString(theAttributeValue->text());
 }
 
 SketcherPrs_DimensionStyle::SketcherPrs_DimensionStyle()
@@ -60,7 +63,7 @@ SketcherPrs_DimensionStyle::~SketcherPrs_DimensionStyle()
 {
 }
 
-void SketcherPrs_DimensionStyle::updateDimensions(AIS_Dimension* theDimension,
+void SketcherPrs_DimensionStyle::updateDimensions(PrsDim_Dimension* theDimension,
           const SketcherPrs_DimensionStyle::DimensionValue& theDimensionValue)
 {
   if (!theDimension)
@@ -69,10 +72,10 @@ void SketcherPrs_DimensionStyle::updateDimensions(AIS_Dimension* theDimension,
                    theDimensionValue.myTextValue, theDimensionValue.myDoubleValue);
 }
 
-void SketcherPrs_DimensionStyle::updateDimensions(AIS_Dimension* theDimension,
-                                                          const bool theHasParameters,
-                                                          const std::string& theTextValue,
-                                                          const double theDoubleValue)
+void SketcherPrs_DimensionStyle::updateDimensions(PrsDim_Dimension* theDimension,
+                                                  const bool theHasParameters,
+                                                  const std::string& theTextValue,
+                                                  const double theDoubleValue)
 {
   if (!theDimension)
     return;
@@ -80,7 +83,11 @@ void SketcherPrs_DimensionStyle::updateDimensions(AIS_Dimension* theDimension,
   /// do not show special symbols of dimension:
   ///   previous implementation did not allow to unite them
   theDimension->SetSpecialSymbol(MyEmptySymbol);
+#if OCC_VERSION_HEX > 0x070400
+  theDimension->SetDisplaySpecialSymbol(PrsDim_DisplaySpecialSymbol_No);
+#else
   theDimension->SetDisplaySpecialSymbol(AIS_DSS_No);
+#endif
 
   TCollection_ExtendedString aCustomValue;
   if (theHasParameters) {