]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #1649: New creation of Construction Planes
authornds <nds@opencascade.com>
Tue, 19 Jul 2016 11:51:20 +0000 (14:51 +0300)
committernds <nds@opencascade.com>
Tue, 19 Jul 2016 11:51:20 +0000 (14:51 +0300)
"Reverse" boolean attribute in plane creation in distance to other plane.

src/ConstructionPlugin/ConstructionPlugin_Plane.cpp
src/ConstructionPlugin/ConstructionPlugin_Plane.h
src/ConstructionPlugin/plane_widget.xml

index 1e3e98ab54e81fdbc241b85ff02e128d9015cb30..68f3e5b0a732aa1a05f3026b072696f912c4be85 100644 (file)
@@ -24,6 +24,7 @@
 #include <ModelAPI_AttributeIntArray.h>
 #include <ModelAPI_AttributeSelection.h>
 #include <ModelAPI_AttributeString.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_Session.h>
 #include <ModelAPI_Validator.h>
@@ -67,6 +68,7 @@ void ConstructionPlugin_Plane::initAttributes()
   data()->addAttribute(CREATION_METHOD_BY_OTHER_PLANE_OPTION(), ModelAPI_AttributeString::typeId());
   data()->addAttribute(PLANE(), ModelAPI_AttributeSelection::typeId());
   data()->addAttribute(DISTANCE(), ModelAPI_AttributeDouble::typeId());
+  data()->addAttribute(DISTANCE_REVERSE(), ModelAPI_AttributeBoolean::typeId());
   data()->addAttribute(COINCIDENT_POINT(), ModelAPI_AttributeSelection::typeId());
   data()->addAttribute(AXIS(), ModelAPI_AttributeSelection::typeId());
   data()->addAttribute(ANGLE(), ModelAPI_AttributeDouble::typeId());
index 999e6fa65fd49f69b06127590e0a0a9083485869..15894a2f6ee7d34b13cdacf068e5c92e75fc287c 100644 (file)
@@ -159,6 +159,13 @@ public:
     return ATTR_ID;
   }
 
+  /// Attribute name for reverse in distance from other case
+  inline static const std::string& DISTANCE_REVERSE()
+  {
+    static const std::string ATTR_DISTANCE_REVERSE_ID("distance_reverse");
+    return ATTR_DISTANCE_REVERSE_ID;
+  }
+
   /// Attribute name for coincident point.
   inline static const std::string& COINCIDENT_POINT()
   {
index fc85d1b26b5f00f1b0f2a58544fb76344a82a27d..8f3ed0dc541f34d5dd5ac90a54345ddf5e5b536e 100644 (file)
                        label="Distance"
                        tooltip="Distance from selected face to plane."
                        icon="icons/Construction/distance_value.png"
-                       default="0"/>
+                       default="10">
+            <validator id="GeomValidators_Positive"/>
+          </doublevalue>
+          <boolvalue id="distance_reverse"
+                     label="Reverse"
+                     tooltip="Distance from plane."
+                     default="false"/>
         </box>
         <box id="by_coincident_to_point"
              title="By coincident to point"