From dadb57d91e92a9e19871b2e46d97196e482ddc45 Mon Sep 17 00:00:00 2001 From: dbv Date: Mon, 1 Aug 2016 15:30:36 +0300 Subject: [PATCH] Commented options in Point feature; Removed fix for nested attributes not initialized. --- src/ConstructionAPI/ConstructionAPI_Point.cpp | 18 +++---- src/ConstructionAPI/ConstructionAPI_Point.h | 49 ++++++++++--------- .../ConstructionPlugin_Point.cpp | 20 ++++---- .../ConstructionPlugin_Point.h | 12 ++--- src/ConstructionPlugin/point_widget.xml | 1 + .../InitializationPlugin_Plugin.cpp | 17 +------ 6 files changed, 53 insertions(+), 64 deletions(-) diff --git a/src/ConstructionAPI/ConstructionAPI_Point.cpp b/src/ConstructionAPI/ConstructionAPI_Point.cpp index ef2ccc810..511eb42f1 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Point.cpp @@ -13,8 +13,8 @@ #include -static GeomAPI_Shape::ShapeType shapeTypeByStr(const std::string& theShapeTypeStr); -static GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection); +/*static GeomAPI_Shape::ShapeType shapeTypeByStr(const std::string& theShapeTypeStr); +static GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection);*/ //================================================================================================== ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr& theFeature) @@ -35,7 +35,7 @@ ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theEdge, const ModelHighAPI_Double& theDistanceValue, @@ -69,7 +69,7 @@ ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr& thePart, @@ -149,7 +149,7 @@ PointPtr addPoint(const std::shared_ptr& thePart, return PointPtr(new ConstructionAPI_Point(aFeature, theX, theY, theZ)); } -//================================================================================================== +/*//================================================================================================== PointPtr addPoint(const std::shared_ptr & thePart, const ModelHighAPI_Selection& theEdge, const ModelHighAPI_Double& theDistanceValue, @@ -229,4 +229,4 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection } return aShapeType; -} +}*/ diff --git a/src/ConstructionAPI/ConstructionAPI_Point.h b/src/ConstructionAPI/ConstructionAPI_Point.h index 612df3075..c27ea76d5 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.h +++ b/src/ConstructionAPI/ConstructionAPI_Point.h @@ -35,7 +35,7 @@ public: const ModelHighAPI_Double& theY, const ModelHighAPI_Double& theZ); - /// Constructor with values. + /*/// Constructor with values. CONSTRUCTIONAPI_EXPORT ConstructionAPI_Point(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theEdge, @@ -47,28 +47,33 @@ public: CONSTRUCTIONAPI_EXPORT ConstructionAPI_Point(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theObject1, - const ModelHighAPI_Selection& theObject2); + const ModelHighAPI_Selection& theObject2);*/ /// Destructor. CONSTRUCTIONAPI_EXPORT virtual ~ConstructionAPI_Point(); - INTERFACE_14(ConstructionPlugin_Point::ID(), - creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, - x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */, - y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, - z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */, - edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */, - distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */, - distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */, - reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */, - point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */, - plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */, - firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */, - secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */, - intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */, - intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */ - ) + INTERFACE_3(ConstructionPlugin_Point::ID(), + x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */, + y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, + z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */) + + //INTERFACE_14(ConstructionPlugin_Point::ID(), + // creationMethod, ConstructionPlugin_Point::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */, + // x, ConstructionPlugin_Point::X(), ModelAPI_AttributeDouble, /** X attribute */, + // y, ConstructionPlugin_Point::Y(), ModelAPI_AttributeDouble, /** Y attribute */, + // z, ConstructionPlugin_Point::Z(), ModelAPI_AttributeDouble, /** Z attribute */, + // edge, ConstructionPlugin_Point::EDGE(), ModelAPI_AttributeSelection, /** Edge attribute */, + // distanceValue, ConstructionPlugin_Point::DISTANCE_VALUE(), ModelAPI_AttributeDouble, /** Distance value attribute */, + // distancePercent, ConstructionPlugin_Point::DISTANCE_PERCENT(), ModelAPI_AttributeBoolean, /** Distance percent attribute */, + // reverse, ConstructionPlugin_Point::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse attribute */, + // point, ConstructionPlugin_Point::POINT(), ModelAPI_AttributeSelection, /** Point attribute */, + // plane, ConstructionPlugin_Point::PLANE(), ModelAPI_AttributeSelection, /** Plane attribute */, + // firstLine, ConstructionPlugin_Point::FIRST_LINE(), ModelAPI_AttributeSelection, /** First line attribute */, + // secondLine, ConstructionPlugin_Point::SECOND_LINE(), ModelAPI_AttributeSelection, /** Second line attribute */, + // intersectionLine, ConstructionPlugin_Point::INTERSECTION_LINE(), ModelAPI_AttributeSelection, /** Intersection line attribute */, + // intersectionPlane, ConstructionPlugin_Point::INTERSECTION_PLANE(), ModelAPI_AttributeSelection, /** Intersection plane attribute */ + //) /// Set point values. CONSTRUCTIONAPI_EXPORT @@ -76,7 +81,7 @@ public: const ModelHighAPI_Double & theY, const ModelHighAPI_Double & theZ); - /// Set edge and distance on it for point. + /*/// Set edge and distance on it for point. CONSTRUCTIONAPI_EXPORT void setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge, const ModelHighAPI_Double& theDistanceValue, @@ -96,7 +101,7 @@ public: /// Set line and plane for intersections. CONSTRUCTIONAPI_EXPORT void setByLineAndPlaneIntersection(const ModelHighAPI_Selection& theEdge, - const ModelHighAPI_Selection& theFace); + const ModelHighAPI_Selection& theFace);*/ }; /// Pointer on Point object. @@ -110,7 +115,7 @@ PointPtr addPoint(const std::shared_ptr & thePart, const ModelHighAPI_Double & theY, const ModelHighAPI_Double & theZ); -/// \ingroup CPPHighAPI +/*/// \ingroup CPPHighAPI /// \brief Create Point feature CONSTRUCTIONAPI_EXPORT PointPtr addPoint(const std::shared_ptr & thePart, @@ -124,6 +129,6 @@ PointPtr addPoint(const std::shared_ptr & thePart, CONSTRUCTIONAPI_EXPORT PointPtr addPoint(const std::shared_ptr & thePart, const ModelHighAPI_Selection& theObject1, - const ModelHighAPI_Selection& theObject2); + const ModelHighAPI_Selection& theObject2);*/ #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */ diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp index b3feb1999..e5d40b7c1 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.cpp +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.cpp @@ -33,14 +33,13 @@ const std::string& ConstructionPlugin_Point::getKind() //================================================================================================== void ConstructionPlugin_Point::initAttributes() { - data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId()); + //data()->addAttribute(CREATION_METHOD(), ModelAPI_AttributeString::typeId()); data()->addAttribute(X(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(Y(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(Z(), ModelAPI_AttributeDouble::typeId()); -/* - data()->addAttribute(EDGE(), ModelAPI_AttributeSelection::typeId()); + /*data()->addAttribute(EDGE(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(DISTANCE_VALUE(), ModelAPI_AttributeDouble::typeId()); data()->addAttribute(DISTANCE_PERCENT(), ModelAPI_AttributeBoolean::typeId()); data()->addAttribute(REVERSE(), ModelAPI_AttributeBoolean::typeId()); @@ -52,16 +51,15 @@ void ConstructionPlugin_Point::initAttributes() data()->addAttribute(SECOND_LINE(), ModelAPI_AttributeSelection::typeId()); data()->addAttribute(INTERSECTION_LINE(), ModelAPI_AttributeSelection::typeId()); - data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId()); -*/ - string("creation_method")->setValue("by_xyz"); + data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId());*/ } //================================================================================================== void ConstructionPlugin_Point::execute() { GeomShapePtr aShape = createByXYZ(); -/* GeomShapePtr aShape; + + /*GeomShapePtr aShape; std::string aCreationMethod = string(CREATION_METHOD())->value(); if(aCreationMethod == CREATION_METHOD_BY_XYZ()) { @@ -74,8 +72,8 @@ void ConstructionPlugin_Point::execute() aShape = createByLinesIntersection(); } else if(aCreationMethod == CREATION_METHOD_BY_LINE_AND_PLANE_INTERSECTION()) { aShape = createByLineAndPlaneIntersection(); - } - */ + }*/ + if(!aShape.get()) { return; } @@ -104,7 +102,7 @@ std::shared_ptr ConstructionPlugin_Point::createByXYZ() real(Z())->value()); } -//================================================================================================== +/*//================================================================================================== std::shared_ptr ConstructionPlugin_Point::createByDistanceOnEdge() { // Get edge. @@ -189,4 +187,4 @@ std::shared_ptr ConstructionPlugin_Point::createByLineAndPlaneIn std::shared_ptr aFace(new GeomAPI_Face(aPlaneShape)); return GeomAlgoAPI_PointBuilder::vertexByIntersection(anEdge, aFace); -} +}*/ diff --git a/src/ConstructionPlugin/ConstructionPlugin_Point.h b/src/ConstructionPlugin/ConstructionPlugin_Point.h index 0881e97fc..2c1282492 100644 --- a/src/ConstructionPlugin/ConstructionPlugin_Point.h +++ b/src/ConstructionPlugin/ConstructionPlugin_Point.h @@ -31,7 +31,7 @@ public: return CONSTRUCTION_POINT_KIND; } - /// Attribute name for creation method. + /*/// Attribute name for creation method. inline static const std::string& CREATION_METHOD() { static const std::string MY_CREATION_METHOD_ID("creation_method"); @@ -71,7 +71,7 @@ public: { static const std::string MY_CREATION_METHOD_ID("by_line_and_plane_intersection"); return MY_CREATION_METHOD_ID; - } + }*/ /// Attribute name for X coordinate. inline static const std::string& X() @@ -94,7 +94,7 @@ public: return POINT_ATTR_Z; } - /// Attribute name for selected edge. + /*/// Attribute name for selected edge. inline static const std::string& EDGE() { static const std::string ATTR_ID("edge"); @@ -162,7 +162,7 @@ public: { static const std::string ATTR_ID("intersection_plane"); return ATTR_ID; - } + }*/ /// Creates a new part document if needed. CONSTRUCTIONPLUGIN_EXPORT virtual void execute(); @@ -182,10 +182,10 @@ public: private: std::shared_ptr createByXYZ(); - std::shared_ptr createByDistanceOnEdge(); + /*std::shared_ptr createByDistanceOnEdge(); std::shared_ptr createByProjection(); std::shared_ptr createByLinesIntersection(); - std::shared_ptr createByLineAndPlaneIntersection(); + std::shared_ptr createByLineAndPlaneIntersection();*/ }; diff --git a/src/ConstructionPlugin/point_widget.xml b/src/ConstructionPlugin/point_widget.xml index 192bbd88b..0deb69aeb 100644 --- a/src/ConstructionPlugin/point_widget.xml +++ b/src/ConstructionPlugin/point_widget.xml @@ -4,6 +4,7 @@ +