]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Provide special symbol for parametrized dimensions
authorvsv <vitaly.smetannikov@opencascade.com>
Mon, 23 Nov 2015 09:49:06 +0000 (12:49 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Mon, 23 Nov 2015 09:49:19 +0000 (12:49 +0300)
src/SketcherPrs/SketcherPrs_LengthDimension.cpp
src/XGUI/pictures/expression.png

index 24977ecee183754414167f5ef6bf6ea5e1cd766a..8f93fd0eae6fcfd3dd7f3cd9f2e4e8a7d1662504 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));
 
+static const Standard_ExtCharacter MySummSymbol(0x2211);
+
 IMPLEMENT_STANDARD_HANDLE(SketcherPrs_LengthDimension, AIS_LengthDimension);
 IMPLEMENT_STANDARD_RTTIEXT(SketcherPrs_LengthDimension, AIS_LengthDimension);
 
@@ -67,6 +72,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);
 }
 
index d9ea77546004261d02fa1cf2bfa704a0546e349b..158678a87d07c6633fbc2ce55d17826ae90f934b 100644 (file)
Binary files a/src/XGUI/pictures/expression.png and b/src/XGUI/pictures/expression.png differ