Salome HOME
Make the external sketch segment not-movable by the user
authormpv <mpv@opencascade.com>
Wed, 24 Jun 2015 13:14:16 +0000 (16:14 +0300)
committermpv <mpv@opencascade.com>
Wed, 24 Jun 2015 13:14:16 +0000 (16:14 +0300)
src/SketchPlugin/SketchPlugin_Arc.cpp
src/SketchPlugin/SketchPlugin_Circle.cpp
src/SketchPlugin/SketchPlugin_Line.cpp
src/SketchPlugin/SketchPlugin_Point.cpp

index 5599f3b0b138ce470394780fe97d80fe7faa40de..5a922cbd1696d686d26ce8dabcffc315192e22cd 100644 (file)
@@ -214,7 +214,8 @@ void SketchPlugin_Arc::attributeChanged(const std::string& theID)
       GeomDataAPI_Point2D>(data()->attribute(START_ID()));
   std::shared_ptr<GeomDataAPI_Point2D> anEndAttr = std::dynamic_pointer_cast<
       GeomDataAPI_Point2D>(data()->attribute(END_ID()));
-  if (theID == EXTERNAL_ID()) {
+  // the second condition for unability to move external segments anywhere
+  if (theID == EXTERNAL_ID() || isFixed()) {
     std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
     // update arguments due to the selection value
     if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
index 1b74f50ee4f42b5a33db3ba991ed714e3f00af45..6bbb91c7349b38d406c4240dbb8fd18d880490d9 100644 (file)
@@ -97,7 +97,8 @@ bool SketchPlugin_Circle::isFixed() {
 }
 
 void SketchPlugin_Circle::attributeChanged(const std::string& theID) {
-  if (theID == EXTERNAL_ID()) {
+  // the second condition for unability to move external segments anywhere
+  if (theID == EXTERNAL_ID() || isFixed()) {
     std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
     // update arguments due to the selection value
     if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
index 555b8ae7f4e18e85e3d490e5537bd7a6fd2c899e..f4382e4314af3983bc7a57310c8228aa4a2128f2 100644 (file)
@@ -111,7 +111,8 @@ bool SketchPlugin_Line::isFixed() {
 }
 
 void SketchPlugin_Line::attributeChanged(const std::string& theID) {
-  if (theID == EXTERNAL_ID()) {
+  // the second condition for unability to move external segments anywhere
+  if (theID == EXTERNAL_ID() || isFixed()) {
     std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
      // update arguments due to the selection value
     if (aSelection && !aSelection->isNull() && aSelection->isEdge()) {
@@ -125,4 +126,3 @@ void SketchPlugin_Line::attributeChanged(const std::string& theID) {
     }
   }
 }
-
index 6fe1e2cfab638557a3c481b138ad00bbc603fdb6..d831982c1465bbcf4b20c395e617c07b566f39e2 100644 (file)
@@ -77,7 +77,8 @@ bool SketchPlugin_Point::isFixed() {
 }
 
 void SketchPlugin_Point::attributeChanged(const std::string& theID) {
-  if (theID == EXTERNAL_ID()) {
+  // the second condition for unability to move external point anywhere
+  if (theID == EXTERNAL_ID() || isFixed()) {
     std::shared_ptr<GeomAPI_Shape> aSelection = data()->selection(EXTERNAL_ID())->value();
      // update arguments due to the selection value
     if (aSelection && !aSelection->isNull() && aSelection->isVertex()) {