Salome HOME
Temporary comment (somehow inform the user about the scale of the view: line lenght...
authornds <nds@opencascade.com>
Mon, 11 Jul 2016 12:19:00 +0000 (15:19 +0300)
committernds <nds@opencascade.com>
Mon, 11 Jul 2016 12:19:00 +0000 (15:19 +0300)
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Line.h
src/SketchPlugin/plugin-Sketch.xml

index 1952e97aa5402b832d221b5bc2adbb57e249ee13..3c4e19a1a369fe247dc140a81cc63c6815924cc3 100644 (file)
@@ -32,7 +32,9 @@ void SketchPlugin_Line::initDerivedClassAttributes()
   data()->addAttribute(START_ID(), GeomDataAPI_Point2D::typeId());
   data()->addAttribute(END_ID(), GeomDataAPI_Point2D::typeId());
   data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::typeId());
+#ifndef LINE_LENGHT_BLOCKED
   data()->addAttribute(LENGTH_ID(), ModelAPI_AttributeDouble::typeId());
+#endif
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
 }
 
@@ -135,6 +137,7 @@ void SketchPlugin_Line::attributeChanged(const std::string& theID) {
 
 void SketchPlugin_Line::updateLenghtValue()
 {
+#ifndef LINE_LENGHT_BLOCKED
   std::shared_ptr<GeomDataAPI_Point2D> aStartAttr = std::dynamic_pointer_cast<
       GeomDataAPI_Point2D>(data()->attribute(START_ID()));
   std::shared_ptr<GeomDataAPI_Point2D> anEndAttr = std::dynamic_pointer_cast<
@@ -143,4 +146,5 @@ void SketchPlugin_Line::updateLenghtValue()
     double aDistance = aStartAttr->pnt()->distance(anEndAttr->pnt());
     data()->real(LENGTH_ID())->setValue(aDistance);
   }
+#endif
 }
index 8891b3e3492c406f2b0ae2cb034092bb65ce07bf..0ff8e6b71ec3e2a2f3069733735df538eb35ed1a 100644 (file)
@@ -12,6 +12,7 @@
 #include <SketchPlugin_Sketch.h>
 #include <list>
 
+#define LINE_LENGHT_BLOCKED
 class GeomAPI_Pnt2d;
 
 /**\class SketchPlugin_Line
@@ -41,12 +42,13 @@ class SketchPlugin_Line : public SketchPlugin_SketchEntity
   }
 
   /// Line length.
+#ifndef LINE_LENGHT_BLOCKED
   static const std::string& LENGTH_ID()
   {
     static const std::string MY_LENGTH("LineLength");
     return MY_LENGTH;
   }
-
+#endif
   /// Returns the kind of a feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getKind();
 
index 282c142eb4c880009d50c2db3aeb67de84f52f42..0d2eb9c05d5115cd62df5e95864cb1d78c2d707e 100644 (file)
@@ -31,8 +31,9 @@
                                  enable_value="enable_by_preferences"/>
         <sketch-2dpoint_selector id="EndPoint" accept_expressions="0" title="End point" tooltip="End point coordinates"
                                  enable_value="enable_by_preferences"/>
+        <!--LINE_LENGHT_BLOCKED
         <doublevalue id="LineLength" accept_expressions="0" label="Length:" default="computed" icon="icons/Sketch/distance_value.png"
-                     tooltip="Line length" obligatory="0" enable_value="false"/>
+                     tooltip="Line length" obligatory="0" enable_value="false"/> -->
         <boolvalue id="Auxiliary" label="Auxiliary" default="false" tooltip="Construction element" obligatory="0"/>
         <validator id="GeomValidators_Different" parameters="StartPoint,EndPoint"/>
       </feature>