From 5d613df7d51faeba83c5225ac9ba78e35f80094c Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 19 Jul 2016 14:51:20 +0300 Subject: [PATCH] Issue #1649: New creation of Construction Planes "Reverse" boolean attribute in plane creation in distance to other plane. --- src/ConstructionPlugin/ConstructionPlugin_Plane.cpp | 2 ++ src/ConstructionPlugin/ConstructionPlugin_Plane.h | 7 +++++++ src/ConstructionPlugin/plane_widget.xml | 8 +++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp index 1e3e98ab5..68f3e5b0a 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -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()); diff --git a/src/ConstructionPlugin/ConstructionPlugin_Plane.h b/src/ConstructionPlugin/ConstructionPlugin_Plane.h index 999e6fa65..15894a2f6 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Plane.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Plane.h @@ -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() { diff --git a/src/ConstructionPlugin/plane_widget.xml b/src/ConstructionPlugin/plane_widget.xml index fc85d1b26..8f3ed0dc5 100644 --- a/src/ConstructionPlugin/plane_widget.xml +++ b/src/ConstructionPlugin/plane_widget.xml @@ -68,7 +68,13 @@ label="Distance" tooltip="Distance from selected face to plane." icon="icons/Construction/distance_value.png" - default="0"/> + default="10"> + + +