]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Commented options in Point feature;
authordbv <dbv@opencascade.com>
Mon, 1 Aug 2016 12:30:36 +0000 (15:30 +0300)
committerdbv <dbv@opencascade.com>
Mon, 1 Aug 2016 12:33:11 +0000 (15:33 +0300)
Removed fix for nested attributes not initialized.

src/ConstructionAPI/ConstructionAPI_Point.cpp
src/ConstructionAPI/ConstructionAPI_Point.h
src/ConstructionPlugin/ConstructionPlugin_Point.cpp
src/ConstructionPlugin/ConstructionPlugin_Point.h
src/ConstructionPlugin/point_widget.xml
src/InitializationPlugin/InitializationPlugin_Plugin.cpp

index ef2ccc8100f05a2b888c5aa240aa8b23197d84e3..511eb42f1546313dbd42cf29440542eddbc9f865 100644 (file)
@@ -13,8 +13,8 @@
 
 #include <algorithm>
 
-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<ModelAPI_Feature>& theFeature)
@@ -35,7 +35,7 @@ ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feat
   }
 }
 
-//==================================================================================================
+/*//==================================================================================================
 ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& theFeature,
                                              const ModelHighAPI_Selection& theEdge,
                                              const ModelHighAPI_Double& theDistanceValue,
@@ -69,7 +69,7 @@ ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feat
       setByLineAndPlaneIntersection(theObject1, theObject2);
     }
   }
-}
+}*/
 
 //==================================================================================================
 ConstructionAPI_Point::~ConstructionAPI_Point()
@@ -82,7 +82,7 @@ void ConstructionAPI_Point::setByXYZ(const ModelHighAPI_Double& theX,
                                      const ModelHighAPI_Double& theY,
                                      const ModelHighAPI_Double& theZ)
 {
-  fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod);
+  //fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod);
   fillAttribute(theX, myx);
   fillAttribute(theY, myy);
   fillAttribute(theZ, myz);
@@ -90,7 +90,7 @@ void ConstructionAPI_Point::setByXYZ(const ModelHighAPI_Double& theX,
   execute();
 }
 
-//==================================================================================================
+/*//==================================================================================================
 void ConstructionAPI_Point::setByDistanceOnEdge(const ModelHighAPI_Selection& theEdge,
                                                 const ModelHighAPI_Double& theDistanceValue,
                                                 const bool theDistancePercent,
@@ -136,7 +136,7 @@ void ConstructionAPI_Point::setByLineAndPlaneIntersection(const ModelHighAPI_Sel
   fillAttribute(theFace, myintersectionPlane);
 
   execute();
-}
+}*/
 
 //==================================================================================================
 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document>& thePart,
@@ -149,7 +149,7 @@ PointPtr addPoint(const std::shared_ptr<ModelAPI_Document>& thePart,
   return PointPtr(new ConstructionAPI_Point(aFeature, theX, theY, theZ));
 }
 
-//==================================================================================================
+/*//==================================================================================================
 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
                   const ModelHighAPI_Selection& theEdge,
                   const ModelHighAPI_Double& theDistanceValue,
@@ -229,4 +229,4 @@ GeomAPI_Shape::ShapeType getShapeType(const ModelHighAPI_Selection& theSelection
   }
 
   return aShapeType;
-}
+}*/
index 612df30753685f73857ca68f134df08d0aeb6b68..c27ea76d57357a658a4d41070016fa19022c5ba5 100644 (file)
@@ -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<ModelAPI_Feature>& theFeature,
                         const ModelHighAPI_Selection& theEdge,
@@ -47,28 +47,33 @@ public:
   CONSTRUCTIONAPI_EXPORT
   ConstructionAPI_Point(const std::shared_ptr<ModelAPI_Feature>& 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<ModelAPI_Document> & 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<ModelAPI_Document> & thePart,
@@ -124,6 +129,6 @@ PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
 CONSTRUCTIONAPI_EXPORT
 PointPtr addPoint(const std::shared_ptr<ModelAPI_Document> & thePart,
                   const ModelHighAPI_Selection& theObject1,
-                  const ModelHighAPI_Selection& theObject2);
+                  const ModelHighAPI_Selection& theObject2);*/
 
 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_POINT_H_ */ 
index b3feb1999331399f2f074f7d7cc394f388c18fef..e5d40b7c1e163eca0c1890103248da3cf7acd62f 100644 (file)
@@ -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<GeomAPI_Vertex> ConstructionPlugin_Point::createByXYZ()
                                           real(Z())->value());
 }
 
-//==================================================================================================
+/*//==================================================================================================
 std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByDistanceOnEdge()
 {
   // Get edge.
@@ -189,4 +187,4 @@ std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByLineAndPlaneIn
   std::shared_ptr<GeomAPI_Face> aFace(new GeomAPI_Face(aPlaneShape));
 
   return GeomAlgoAPI_PointBuilder::vertexByIntersection(anEdge, aFace);
-}
+}*/
index 0881e97fc1ba65fcf044dc3a2560caca7f6e0ef5..2c1282492185a8b2cd2d391e8c45f29ab57f0fe6 100644 (file)
@@ -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<GeomAPI_Vertex> createByXYZ();
-  std::shared_ptr<GeomAPI_Vertex> createByDistanceOnEdge();
+  /*std::shared_ptr<GeomAPI_Vertex> createByDistanceOnEdge();
   std::shared_ptr<GeomAPI_Vertex> createByProjection();
   std::shared_ptr<GeomAPI_Vertex> createByLinesIntersection();
-  std::shared_ptr<GeomAPI_Vertex> createByLineAndPlaneIntersection();
+  std::shared_ptr<GeomAPI_Vertex> createByLineAndPlaneIntersection();*/
 
 };
 
index 192bbd88bcfa1057d7b54ec709a1fb6472568df0..0deb69aeb84328e78dac2a255f0ebe099f28d4d7 100644 (file)
@@ -4,6 +4,7 @@
   <doublevalue id="x" label="X " tooltip="X coordinate" default="0"/>
   <doublevalue id="y" label="Y " tooltip="Y coordinate" default="0"/>
   <doublevalue id="z" label="Z " tooltip="Z coordinate" default="0"/>
+
   <!--<toolbox id="creation_method">
     <box id="by_xyz"
          title="By X, Y, Z"
index c03eb38d1061a12cab0ef184663db345d92c0feb..c6ad9ab0c43e40e27914f95a88daaa58ee391285 100644 (file)
@@ -16,8 +16,6 @@
 
 #include <memory>
 
-#define NESTED_WIDGETS_FIX
-
 // the only created instance of this plugin
 static InitializationPlugin_Plugin* MY_INITIALIZATIONPLUGIN_INSTANCE =
     new InitializationPlugin_Plugin();
@@ -93,10 +91,6 @@ FeaturePtr InitializationPlugin_Plugin::createPlane(DocumentPtr theDoc, double t
 {
   FeaturePtr aPlane = theDoc->addFeature("Plane");
   aPlane->string("creation_method")->setValue("by_general_equation");
-#ifdef NESTED_WIDGETS_FIX
-  aPlane->string("by_other_plane_option")->setValue("by_distance_from_other");
-  aPlane->real("distance")->setValue(0);
-#endif
   aPlane->real("A")->setValue(theX);
   aPlane->real("B")->setValue(theY);
   aPlane->real("C")->setValue(theZ);
@@ -126,7 +120,7 @@ FeaturePtr InitializationPlugin_Plugin::createPoint(DocumentPtr theDoc, const st
                                                     double theX, double theY, double theZ)
 {
   std::shared_ptr<ModelAPI_Feature> aPoint = theDoc->addFeature("Point");
-  aPoint->string("creation_method")->setValue("by_xyz");
+  //aPoint->string("creation_method")->setValue("by_xyz");
   aPoint->real("x")->setValue(theX);
   aPoint->real("y")->setValue(theY);
   aPoint->real("z")->setValue(theZ);
@@ -155,15 +149,6 @@ FeaturePtr InitializationPlugin_Plugin::createAxis(DocumentPtr theDoc, FeaturePt
   aAxis->real("Y_Direction")->setValue(theY);
   aAxis->real("Z_Direction")->setValue(theZ);
 
-#ifdef NESTED_WIDGETS_FIX
-  aAxis->string("use_offset1")->setValue("");
-  aAxis->real("offset1")->setValue(0);
-  aAxis->boolean("reverse_offset1")->setValue(false);
-  aAxis->string("use_offset2")->setValue("");
-  aAxis->real("offset2")->setValue(0);
-  aAxis->boolean("reverse_offset2")->setValue(false);
-#endif
-
   if (theX != 0) {
     aAxis->data()->setName("OX");
   } else if (theY != 0) {