Salome HOME
Delete key regression corrections: in previous implementation sketch entities did...
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_LengthDimension.cpp
index 24977ecee183754414167f5ef6bf6ea5e1cd766a..f70de41f5098242d8fea4d54bd67437daa92efd4 100644 (file)
 #include <GeomAPI_Lin2d.h>
 
 #include <ModelAPI_Data.h>
+#include <ModelAPI_AttributeDouble.h>
+
+#include <AIS_DisplaySpecialSymbol.hxx>
 
 
 static const gp_Pnt MyDefStart(0,0,0);
 static const gp_Pnt MyDefEnd(1,0,0);
 static const gp_Pln MyDefPln(gp_Pnt(0,0,0), gp_Dir(0,0,1));
 
+// it is not possible to use 0x2211 as summ symbol because it is not supported by
+// debian Linux platform
+static const Standard_ExtCharacter MySummSymbol(0x03A3);
+
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension);
 
@@ -67,6 +74,13 @@ void SketcherPrs_LengthDimension::Compute(const Handle(PrsMgr_PresentationManage
   // The value of vertical aligment is sometimes changed
   myAspect->TextAspect()->SetVerticalJustification(Graphic3d_VTA_CENTER);
 
+  AttributeDoublePtr aValue = myConstraint->data()->real(SketchPlugin_Constraint::VALUE());
+  std::set<std::string> aParams = aValue->usedParameters();
+  if (aParams.size() > 0) {
+    SetSpecialSymbol(MySummSymbol);
+    SetDisplaySpecialSymbol(AIS_DSS_Before);
+  }
+
   AIS_LengthDimension::Compute(thePresentationManager, thePresentation, theMode);
 }