From: nds Date: Mon, 11 Jul 2016 12:19:00 +0000 (+0300) Subject: Temporary comment (somehow inform the user about the scale of the view: line lenght... X-Git-Tag: V_2.5.0~208 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b8265eb1918e29aadefe3978767790de77e919c7;p=modules%2Fshaper.git Temporary comment (somehow inform the user about the scale of the view: line lenght) To correct issues concerned to previous saved studies. --- diff --git a/src/SketchPlugin/SketchPlugin_Line.cpp b/src/SketchPlugin/SketchPlugin_Line.cpp index 1952e97aa..3c4e19a1a 100644 --- a/src/SketchPlugin/SketchPlugin_Line.cpp +++ b/src/SketchPlugin/SketchPlugin_Line.cpp @@ -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 aStartAttr = std::dynamic_pointer_cast< GeomDataAPI_Point2D>(data()->attribute(START_ID())); std::shared_ptr 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 } diff --git a/src/SketchPlugin/SketchPlugin_Line.h b/src/SketchPlugin/SketchPlugin_Line.h index 8891b3e34..0ff8e6b71 100644 --- a/src/SketchPlugin/SketchPlugin_Line.h +++ b/src/SketchPlugin/SketchPlugin_Line.h @@ -12,6 +12,7 @@ #include #include +#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(); diff --git a/src/SketchPlugin/plugin-Sketch.xml b/src/SketchPlugin/plugin-Sketch.xml index 282c142eb..0d2eb9c05 100644 --- a/src/SketchPlugin/plugin-Sketch.xml +++ b/src/SketchPlugin/plugin-Sketch.xml @@ -31,8 +31,9 @@ enable_value="enable_by_preferences"/> +