X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FConstructionAPI%2FConstructionAPI_Point.cpp;h=2f44c5081d1d22075f255fe22f4878e27000ed3c;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=f0a6ef0085f7e3709a19cff3e5cfc5fbf60ec494;hpb=cc8e0e85a2fe53c53a87c24ef18cdf6265599785;p=modules%2Fshaper.git diff --git a/src/ConstructionAPI/ConstructionAPI_Point.cpp b/src/ConstructionAPI/ConstructionAPI_Point.cpp index f0a6ef008..2f44c5081 100644 --- a/src/ConstructionAPI/ConstructionAPI_Point.cpp +++ b/src/ConstructionAPI/ConstructionAPI_Point.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -12,10 +12,9 @@ // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or -// email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "ConstructionAPI_Point.h" @@ -110,14 +109,15 @@ ConstructionAPI_Point::ConstructionAPI_Point(const std::shared_ptr& theFeature, const ModelHighAPI_Selection& theObject, - const bool theIsCircularEdge) + const bool theIsCircularEdge, + const bool theIsXYZSelection) : ModelHighAPI_Interface(theFeature) { if (initialize()) { if (theIsCircularEdge) { setByCenterOfCircle(theObject); - } else if (theObject.shapeType() == "VERTEX") { + } else if (theObject.shapeType() == "VERTEX" && theIsXYZSelection) { // This is tricky way to get vertex shape. fillAttribute(theObject, mypointToProject); GeomShapePtr aShape = mypointToProject->value(); @@ -166,13 +166,6 @@ void ConstructionAPI_Point::setByXYZ(const ModelHighAPI_Double& theX, const ModelHighAPI_Double& theY, const ModelHighAPI_Double& theZ) { - //fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod); - - // TODO: Fill point attribute - //fillAttribute(theX, myx); - //fillAttribute(theY, myy); - //fillAttribute(theZ, myz); - fillAttribute(ConstructionPlugin_Point::CREATION_METHOD_BY_XYZ(), mycreationMethod); fillAttribute(theX, theY, theZ, mypoint); @@ -277,6 +270,8 @@ void ConstructionAPI_Point::setByCenterOfGravity(const ModelHighAPI_Selection& t fillAttribute(ConstructionPlugin_Point::GEOMETRICAL_PROPERTY_TYPE_BY_CENTER_OF_GRAVITY(), mygeometricalPropertyType); fillAttribute(theObject, myobjectForCenterOfGravity); + + execute(); } //================================================================================================== @@ -287,6 +282,8 @@ void ConstructionAPI_Point::setByCenterOfCircle(const ModelHighAPI_Selection& th fillAttribute(ConstructionPlugin_Point::GEOMETRICAL_PROPERTY_TYPE_BY_CENTER_OF_CIRCLE(), mygeometricalPropertyType); fillAttribute(theObject, myobjectForCenterOfCircle); + + execute(); } //================================================================================================== @@ -417,3 +414,11 @@ PointPtr addPoint(const std::shared_ptr & thePart, std::shared_ptr aFeature = thePart->addFeature(ConstructionAPI_Point::ID()); return PointPtr(new ConstructionAPI_Point(aFeature, theObject, theIsCircularEdge)); } + +//================================================================================================== +PointPtr addPointXYZ(const std::shared_ptr & thePart, + const ModelHighAPI_Selection& theObject) +{ + std::shared_ptr aFeature = thePart->addFeature(ConstructionAPI_Point::ID()); + return PointPtr(new ConstructionAPI_Point(aFeature, theObject, false, true)); +}