]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
add icons. Rectangle: link start/center and end points to picked points
authorrraphael <raphael.raphael@c-s.fr>
Wed, 20 Jan 2021 11:12:21 +0000 (12:12 +0100)
committerrraphael <raphael.raphael@c-s.fr>
Wed, 20 Jan 2021 11:12:21 +0000 (12:12 +0100)
src/CollectionPlugin/doc/images/group_shape.png [new file with mode: 0644]
src/CollectionPlugin/doc/images/group_shape_property_panel.png [new file with mode: 0644]
src/CollectionPlugin/icons/group_shape.png [new file with mode: 0644]
src/CollectionPlugin/icons/svg/group_shape.svg [new file with mode: 0644]
src/SketchPlugin/SketchPlugin_MacroRectangle.cpp
src/SketchPlugin/SketchPlugin_MacroRectangle.h
src/SketchPlugin/icons/rectangle_center_end.png [new file with mode: 0644]
src/SketchPlugin/icons/rectangle_start_end.png [new file with mode: 0644]
src/SketchPlugin/icons/svg/rectangle_center_end.svg [new file with mode: 0644]
src/SketchPlugin/icons/svg/rectangle_start_end.svg [new file with mode: 0644]
src/SketchPlugin/plugin-Sketch.xml

diff --git a/src/CollectionPlugin/doc/images/group_shape.png b/src/CollectionPlugin/doc/images/group_shape.png
new file mode 100644 (file)
index 0000000..73b474f
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_shape.png differ
diff --git a/src/CollectionPlugin/doc/images/group_shape_property_panel.png b/src/CollectionPlugin/doc/images/group_shape_property_panel.png
new file mode 100644 (file)
index 0000000..1355fc0
Binary files /dev/null and b/src/CollectionPlugin/doc/images/group_shape_property_panel.png differ
diff --git a/src/CollectionPlugin/icons/group_shape.png b/src/CollectionPlugin/icons/group_shape.png
new file mode 100644 (file)
index 0000000..73b474f
Binary files /dev/null and b/src/CollectionPlugin/icons/group_shape.png differ
diff --git a/src/CollectionPlugin/icons/svg/group_shape.svg b/src/CollectionPlugin/icons/svg/group_shape.svg
new file mode 100644 (file)
index 0000000..640ad13
--- /dev/null
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="16px"
+   height="16px"
+   viewBox="0 0 16 16"
+   version="1.1"
+   id="SVGRoot"
+   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   sodipodi:docname="group_shape.svg">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="16"
+     inkscape:cx="-2.6875"
+     inkscape:cy="10.5"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1848"
+     inkscape:window-height="1016"
+     inkscape:window-x="72"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:grid-bbox="true"
+     inkscape:snap-grids="false">
+    <inkscape:grid
+       type="xygrid"
+       id="grid878" />
+  </sodipodi:namedview>
+  <defs
+     id="defs468">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 8.5 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="16 : 8 : 1"
+       inkscape:persp3d-origin="8 : 5.3333333 : 1"
+       id="perspective638" />
+  </defs>
+  <metadata
+     id="metadata471">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Calque 1">
+    <g
+       sodipodi:type="inkscape:box3d"
+       id="g808"
+       style="fill:#fe0000;fill-opacity:1;stroke:#fe0000;stroke-width:1.574;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       inkscape:perspectiveID="#perspective638"
+       inkscape:corner0="5.7368421 : -0.026807018 : 0 : 1"
+       inkscape:corner7="5.7368421 : -0.026807018 : 0.25 : 1"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744">
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path810"
+         style="fill:#353564;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="6"
+         d="m 1.1875,11.949219 v 0 L 1.7175141,11.80791 v 0 z"
+         points="1.1875,11.949219 1.7175141,11.80791 1.7175141,11.80791 1.1875,11.949219 " />
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path818"
+         style="fill:#afafde;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="13"
+         d="m 1.1875,11.949219 v 0 L 1.7175141,11.80791 v 0 z"
+         points="1.1875,11.949219 1.7175141,11.80791 1.7175141,11.80791 1.1875,11.949219 " />
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path820"
+         style="fill:#e9e9ff;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="11"
+         d="m 1.7175141,11.80791 v 0 0 z"
+         points="1.7175141,11.80791 1.7175141,11.80791 " />
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path812"
+         style="fill:#4d4d9f;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="5"
+         d="m 1.1875,11.949219 v 0 L 1.7175141,11.80791 v 0 z"
+         points="1.1875,11.949219 1.7175141,11.80791 1.7175141,11.80791 1.1875,11.949219 " />
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path816"
+         style="fill:#d7d7ff;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="14"
+         d="m 1.1875,11.949219 v 0 L 1.7175141,11.80791 v 0 z"
+         points="1.1875,11.949219 1.7175141,11.80791 1.7175141,11.80791 1.1875,11.949219 " />
+      <path
+         sodipodi:type="inkscape:box3dside"
+         id="path814"
+         style="fill:#8686bf;fill-rule:evenodd;stroke:none;stroke-linejoin:round"
+         inkscape:box3dsidetype="3"
+         d="m 1.1875,11.949219 v 0 0 z"
+         points="1.1875,11.949219 1.1875,11.949219 " />
+    </g>
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 35.625,-8.375 Z"
+       id="path1709"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 11.875,4.75 V 7.9375 L 9.0625,6.125 9,3.0625 Z"
+       id="path1711"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 23.375,-12.0625 Z"
+       id="path1807"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#26535f;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 2.875,13.9375 h 7.0625 v -4 h -7 v 4 z"
+       id="path1829"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#315d69;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 9.9375,13.9375 5,-2.0625 -0.0625,-3.8125 -4.9375,1.875"
+       id="path1831"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#24515d;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 2.9375,9.9375 5.0625,-2 6.875,0.125"
+       id="path1833"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#295561;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+       d="M 0.9375,3.125 1,7.9375 5,9.0625 M 0.9375,3.125 l 8,1.75 v 3.0625"
+       id="path1835"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cccccc"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#345f6c;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 12.0625,3.0625 V 7 m 0,0 L 10.5,8"
+       id="path1837"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#305c68;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 8.9375,4.875 3.125,-1.8125"
+       id="path1839"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:0.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 28.0625,0.5 Z"
+       id="path1841"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#2f5b67;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.99607843"
+       d="M 0.9375,3.125 4,1.125"
+       id="path1843"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#35616e;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 4,1.125 8.0625,1.9375"
+       id="path1845"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#305b68;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 11.875,4.75 H 15.5 V 1.875 H 7.9375"
+       id="path1851"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#305a67;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 10.125,0.0625 H 14"
+       id="path1853"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#305a67;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 7.9375,1.875 10.125,0.0625"
+       id="path1855"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+    <path
+       style="fill:none;stroke:#2c5862;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:0.99607843;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 15.5,1.875 14,0.0625"
+       id="path1857"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="103.34744"
+       inkscape:export-ydpi="103.34744" />
+  </g>
+</svg>
index cd3a06c26a628354089fc51364021f67bf0f9cad..ff1c97321320d37b57f3afb311d3ce6c7249f30c 100644 (file)
@@ -21,6 +21,7 @@
 #include "SketchPlugin_Rectangle.h"
 #include "SketchPlugin_Sketch.h"
 #include "SketchPlugin_Tools.h"
+#include "SketchPlugin_Line.h"
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_ResultConstruction.h>
@@ -53,12 +54,20 @@ void SketchPlugin_MacroRectangle::initAttributes()
 {
   data()->addAttribute(AUXILIARY_ID(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(START1_ID(), GeomDataAPI_Point2D::typeId());
+  data()->addAttribute(START1_REF_ID(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(END1_ID(), GeomDataAPI_Point2D::typeId());
+  data()->addAttribute(END1_REF_ID(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(END2_ID(), GeomDataAPI_Point2D::typeId());
+  data()->addAttribute(END2_REF_ID(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(CENTER_ID(), GeomDataAPI_Point2D::typeId());
+  data()->addAttribute(CENTER_REF_ID(), ModelAPI_AttributeRefAttr::typeId());
   data()->addAttribute(RECTANGLE_TYPE_ID(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(EDIT_RECTANGLE_TYPE_ID(), ModelAPI_AttributeString::typeId());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EDIT_RECTANGLE_TYPE_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), CENTER_REF_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), END2_REF_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), END1_REF_ID());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), START1_REF_ID());
 
   string(EDIT_RECTANGLE_TYPE_ID())->setValue("");
 }
@@ -131,7 +140,7 @@ void SketchPlugin_MacroRectangle::execute()
   if(myHasCenterPoint){
     std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
           myRectangleFeature->attribute(SketchPlugin_Rectangle::CENTER_ID()))->setValue(myCenterPoint->x(),
-                                                                                       myCenterPoint->y());
+                                                                                        myCenterPoint->y());
   }
 
   std::dynamic_pointer_cast<GeomDataAPI_Point2D>(
@@ -145,9 +154,32 @@ void SketchPlugin_MacroRectangle::execute()
       ->setValue(boolean(AUXILIARY_ID())->value());
   myRectangleFeature->execute();
 
+  /// create coincidences with rectangle start/center and  end points
+  AttributeRefListPtr aLinesList = myRectangleFeature->reflist(SketchPlugin_Rectangle::LINES_LIST_ID());
+  FeaturePtr aRectangleStartLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(0));
+  FeaturePtr aRectangleEndLineFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aLinesList->object(2));
+  std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointEndAttr =
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleEndLineFeature->attribute(SketchPlugin_Line::END_ID()));
+  std::shared_ptr<GeomDataAPI_Point2D> aRectanglePointStartAttr =
+      std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRectangleStartLineFeature->attribute(SketchPlugin_Line::END_ID()));
+
+  if(myHasCenterPoint){
+    FeaturePtr aCenterPointFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(myRectangleFeature->refattr(CENTER_REF_ID())->object());
+    SketchPlugin_Tools::createCoincidenceOrTangency(
+          this, CENTER_REF_ID(), AttributePtr(), aCenterPointFeature, false);
+    SketchPlugin_Tools::createCoincidenceOrTangency(
+          this, END2_REF_ID(), aRectanglePointEndAttr, ObjectPtr(), false);
+  }
+  else{
+    SketchPlugin_Tools::createCoincidenceOrTangency(
+          this, START1_REF_ID(), aRectanglePointStartAttr, ObjectPtr(), false);
+    SketchPlugin_Tools::createCoincidenceOrTangency(
+          this, END1_REF_ID(), aRectanglePointEndAttr, ObjectPtr(), false);
+  }
+
   /// Send events to update the sub-features by the solver.
   if (isUpdateFlushed)
-    Events_Loop::loop()->setFlushed(anUpdateEvent, true);  
+    Events_Loop::loop()->setFlushed(anUpdateEvent, true);
 }
 
 void SketchPlugin_MacroRectangle::attributeChanged(const std::string& theID)
@@ -157,9 +189,19 @@ void SketchPlugin_MacroRectangle::attributeChanged(const std::string& theID)
     SketchPlugin_Tools::resetAttribute(this, END1_ID());
     SketchPlugin_Tools::resetAttribute(this, CENTER_ID());
     SketchPlugin_Tools::resetAttribute(this, END2_ID());
+    SketchPlugin_Tools::resetAttribute(this, START1_REF_ID());
+    SketchPlugin_Tools::resetAttribute(this, END1_REF_ID());
+    SketchPlugin_Tools::resetAttribute(this, CENTER_REF_ID());
+    SketchPlugin_Tools::resetAttribute(this, END2_REF_ID());
+    myStartPoint.reset();
+    myEndPoint.reset();
+    myCenterPoint.reset();
+    myHasCenterPoint = false;
   }
   else if (theID == START1_ID() || theID == END1_ID() ||
-           theID == END2_ID() || theID == CENTER_ID())
+           theID == START1_REF_ID() || theID == END1_REF_ID() ||
+           theID == END2_ID() || theID == CENTER_ID() ||
+           theID == END2_REF_ID() || theID == CENTER_REF_ID())
   {
     // update points
     startPoint();
@@ -229,4 +271,3 @@ AISObjectPtr SketchPlugin_MacroRectangle::getAISObject(AISObjectPtr thePrevious)
 
   return anAIS;
 }
-
index 46208f862d709f229f41f6c8ea065001d0a2fb78..fc78a1cde845f23bab4f40744cb6000c78958a95 100644 (file)
@@ -72,12 +72,25 @@ public:
     return ID;
   }
 
+  inline static const std::string& START1_REF_ID()
+  {
+    static const std::string ID("rectangle_start_point1_ref");
+    return ID;
+  }
+
   /// 2D point - end point of the Rectangle
   inline static const std::string& END1_ID()
   {
     static const std::string ID("rectangle_end_point1");
     return ID;
   }
+
+  inline static const std::string& END1_REF_ID()
+  {
+    static const std::string ID("rectangle_end_point1_ref");
+    return ID;
+  }
+
   /// 2D point - start point of the second Rectangle type
   inline static const std::string& END2_ID()
   {
@@ -85,12 +98,24 @@ public:
     return ID;
   }
 
+  inline static const std::string& END2_REF_ID()
+  {
+    static const std::string ID("rectangle_end_point2_ref");
+    return ID;
+  }
+
   /// 2D point - center point of the second Rectangle type
   inline static const std::string& CENTER_ID()
   {
     static const std::string ID("rectangle_center_point");
     return ID;
   }
+  /// Reference for center point selection.
+  inline static const std::string& CENTER_REF_ID()
+  {
+    static const std::string ID("rectangle_center_point_ref");
+    return ID;
+  }
 
   /// Returns the kind of a feature
   SKETCHPLUGIN_EXPORT virtual const std::string& getKind()
diff --git a/src/SketchPlugin/icons/rectangle_center_end.png b/src/SketchPlugin/icons/rectangle_center_end.png
new file mode 100644 (file)
index 0000000..4472811
Binary files /dev/null and b/src/SketchPlugin/icons/rectangle_center_end.png differ
diff --git a/src/SketchPlugin/icons/rectangle_start_end.png b/src/SketchPlugin/icons/rectangle_start_end.png
new file mode 100644 (file)
index 0000000..095af86
Binary files /dev/null and b/src/SketchPlugin/icons/rectangle_start_end.png differ
diff --git a/src/SketchPlugin/icons/svg/rectangle_center_end.svg b/src/SketchPlugin/icons/svg/rectangle_center_end.svg
new file mode 100644 (file)
index 0000000..143fbe2
--- /dev/null
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   viewBox="0 0 32 32"
+   version="1.1"
+   id="SVGRoot"
+   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   sodipodi:docname="rectangle_center_end.svg"
+   inkscape:export-filename="/home/raphael/rectangle_center_end.png"
+   inkscape:export-xdpi="30.299248"
+   inkscape:export-ydpi="30.299248">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="8"
+     inkscape:cx="-11"
+     inkscape:cy="14.875"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1848"
+     inkscape:window-height="1016"
+     inkscape:window-x="72"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:grid-bbox="true" />
+  <defs
+     id="defs18" />
+  <metadata
+     id="metadata21">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Calque 1">
+    <rect
+       style="fill:none"
+       id="rect4738"
+       width="14.5"
+       height="10.8125"
+       x="-70.143501"
+       y="-23.799749" />
+    <path
+       style="fill:none;stroke:#164450;stroke-width:1.8524766px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;paint-order:stroke markers fill"
+       d="M 29.805262,6.5014883 V 25.961512 H 2.1577383 V 6.5014883 Z"
+       id="path5285"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M -70.1435,-23.79975 Z"
+       id="path5287"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#fe0000;stroke-width:1.8524766;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3.70495337, 1.85247669, 0.92623834, 1.85247669;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 2.1577383,6.5014883 29.805262,25.961513"
+       id="path935"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <path
+       style="fill:none;stroke:#fe0000;stroke-width:1.85247672;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:3.70495333, 1.85247667, 0.92623833, 1.85247667;stroke-dashoffset:0;stroke-opacity:1"
+       d="M 29.805262,6.5014883 2.1577383,25.961512"
+       id="path937"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M -67.706,-22.04975 Z"
+       id="path939"
+       inkscape:connector-curvature="0" />
+    <rect
+       style="fill:#fe0000;fill-opacity:1;stroke:#fe0000;stroke-width:2.87978911;stroke-opacity:1;paint-order:stroke markers fill"
+       id="rect5292-36-3"
+       width="2.8702109"
+       height="2.3702109"
+       x="14.282738"
+       y="15.126488"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <rect
+       style="fill:#fe0000;fill-opacity:1;stroke:#fe0000;stroke-width:2.87978911;stroke-opacity:1;paint-order:stroke markers fill"
+       id="rect5292-36-6"
+       width="2.8702109"
+       height="2.3702109"
+       x="26.935051"
+       y="23.591303"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+  </g>
+</svg>
diff --git a/src/SketchPlugin/icons/svg/rectangle_start_end.svg b/src/SketchPlugin/icons/svg/rectangle_start_end.svg
new file mode 100644 (file)
index 0000000..784d3aa
--- /dev/null
@@ -0,0 +1,102 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="32px"
+   height="32px"
+   viewBox="0 0 32 32"
+   version="1.1"
+   id="SVGRoot"
+   inkscape:version="0.92.3 (2405546, 2018-03-11)"
+   sodipodi:docname="rectangle_start_end.svg"
+   inkscape:export-filename="/home/raphael/rectangle_center_end.png"
+   inkscape:export-xdpi="30.299248"
+   inkscape:export-ydpi="30.299248">
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="8"
+     inkscape:cx="-11"
+     inkscape:cy="14.875"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1848"
+     inkscape:window-height="1016"
+     inkscape:window-x="72"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1"
+     inkscape:grid-bbox="true" />
+  <defs
+     id="defs18" />
+  <metadata
+     id="metadata21">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     id="layer1"
+     inkscape:groupmode="layer"
+     inkscape:label="Calque 1">
+    <rect
+       style="fill:none"
+       id="rect4738"
+       width="14.5"
+       height="10.8125"
+       x="-70.143501"
+       y="-23.799749" />
+    <path
+       style="fill:none;stroke:#164450;stroke-width:1.8524766px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;paint-order:stroke markers fill"
+       d="M 29.805262,6.5014883 V 25.961512 H 2.1577383 V 6.5014883 Z"
+       id="path5285"
+       inkscape:connector-curvature="0"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M -70.1435,-23.79975 Z"
+       id="path5287"
+       inkscape:connector-curvature="0" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M -67.706,-22.04975 Z"
+       id="path939"
+       inkscape:connector-curvature="0" />
+    <rect
+       style="fill:#fe0000;fill-opacity:1;stroke:#fe0000;stroke-width:2.87978911;stroke-opacity:1;paint-order:stroke markers fill"
+       id="rect5292-36-3"
+       width="2.8702109"
+       height="2.3702109"
+       x="2.1577382"
+       y="6.5014882"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+    <rect
+       style="fill:#fe0000;fill-opacity:1;stroke:#fe0000;stroke-width:2.87978911;stroke-opacity:1;paint-order:stroke markers fill"
+       id="rect5292-36-6"
+       width="2.8702109"
+       height="2.3702109"
+       x="26.935051"
+       y="23.591303"
+       inkscape:export-xdpi="131.95177"
+       inkscape:export-ydpi="131.95177" />
+  </g>
+</svg>
index 813607e5112b7f31239523d043d26dfd15761ab2..628801e6889474841b70512c596ad1131a9d1ba5 100644 (file)
         helpfile="rectangleFeature.html">
         <toolbox id="rectangle_type" modified_in_edit="edit_rectangle_type">
           <box id="rectangle_type_by_start_and_end_points"
-               icon="icons/Sketch/rectangle_pt_rad_32x32.png"
+               icon="icons/Sketch/rectangle_start_end.png"
                title="Start and end points">
-            <sketch-2dpoint_selector id="rectangle_start_point1"                                     
+            <sketch-2dpoint_selector id="rectangle_start_point1"
+                                     reference_attribute="rectangle_start_point1_ref"
                                      accept_expressions="0"
                                      title="Rectangle start point"
                                      tooltip="Start point coordinates"
                                      enable_value="enable_by_preferences"/>
             <sketch-2dpoint_selector id="rectangle_end_point1"
                                      accept_expressions="0"
+                                     reference_attribute="rectangle_end_point1_ref"
                                      title="Rectangle end point"
                                      tooltip="End point coordinates"
                                      enable_value="enable_by_preferences"/>
-            <validator id="GeomValidators_Different" parameters="rectangle_start_point1,rectangle_end_point1"/>
+            <validator id="GeomValidators_Different" parameters="rectangle_start_point1_ref,rectangle_end_point1_ref"/>
          </box>
          <box id="rectangle_type_by_center_and_end_points"
-              icon="icons/Sketch/rectangle_pt_rad_32x32.png"
+              icon="icons/Sketch/rectangle_center_end.png"
               title="Center and end points">
            <sketch-2dpoint_selector id="rectangle_center_point"
                                     accept_expressions="0"
+                                    reference_attribute="rectangle_center_point_ref"
                                     title="Rectangle center point"
                                     tooltip="Center point coordinates"
                                     enable_value="enable_by_preferences"/>
            <sketch-2dpoint_selector id="rectangle_end_point2"
                                     accept_expressions="0"
+                                    reference_attribute="rectangle_end_point2_ref"
                                     title="Rectangle end point"
                                     tooltip="End point coordinates"
                                     enable_value="enable_by_preferences"/>
-           <validator id="GeomValidators_Different" parameters="rectangle_end_point2,rectangle_center_point"/>
+           <validator id="GeomValidators_Different" parameters="rectangle_end_point2_ref,rectangle_center_point_ref"/>
         </box>
        </toolbox>
        <boolvalue id="Auxiliary"