Salome HOME
Quick correction to do not build coincidence to central point of reentrant tangent arc
[modules/shaper.git] / src / ConstructionPlugin / ConstructionPlugin_Point.cpp
index c3866c52d629e6cb054fc0606364b5ed7b9fbccb..e5d40b7c1e163eca0c1890103248da3cf7acd62f 100644 (file)
@@ -33,13 +33,13 @@ const std::string& ConstructionPlugin_Point::getKind()
 //==================================================================================================
 void ConstructionPlugin_Point::initAttributes()
 {
+  //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(CREATION_METHOD(), ModelAPI_AttributeString::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());
@@ -51,13 +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());
+  data()->addAttribute(INTERSECTION_PLANE(), ModelAPI_AttributeSelection::typeId());*/
 }
 
 //==================================================================================================
 void ConstructionPlugin_Point::execute()
 {
-  GeomShapePtr aShape;
+  GeomShapePtr aShape = createByXYZ();
+
+  /*GeomShapePtr aShape;
 
   std::string aCreationMethod = string(CREATION_METHOD())->value();
   if(aCreationMethod == CREATION_METHOD_BY_XYZ()) {
@@ -70,13 +72,15 @@ void ConstructionPlugin_Point::execute()
     aShape = createByLinesIntersection();
   } else if(aCreationMethod == CREATION_METHOD_BY_LINE_AND_PLANE_INTERSECTION()) {
     aShape = createByLineAndPlaneIntersection();
-  }
+  }*/
 
-  if(aShape.get()) {
-    std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
-    aConstr->setShape(aShape);
-    setResult(aConstr);
+  if(!aShape.get()) {
+    return;
   }
+
+  std::shared_ptr<ModelAPI_ResultConstruction> aConstr = document()->createConstruction(data());
+  aConstr->setShape(aShape);
+  setResult(aConstr);
 }
 
 //==================================================================================================
@@ -98,7 +102,7 @@ std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByXYZ()
                                           real(Z())->value());
 }
 
-//==================================================================================================
+/*//==================================================================================================
 std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByDistanceOnEdge()
 {
   // Get edge.
@@ -152,7 +156,7 @@ std::shared_ptr<GeomAPI_Vertex> ConstructionPlugin_Point::createByLinesIntersect
   }
   std::shared_ptr<GeomAPI_Edge> aFirstEdge(new GeomAPI_Edge(aFirstLineShape));
 
-  // Get first line.
+  // Get second line.
   AttributeSelectionPtr aSecondLineSelection= selection(SECOND_LINE());
   GeomShapePtr aSecondLineShape = aSecondLineSelection->value();
   if(!aSecondLineShape.get()) {
@@ -183,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);
-}
+}*/