X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_RevolutionBoolean.cpp;h=4ef17362e7fb54b843987ddcdb946a3ad02fb743;hb=225d6f1701361554ace1069e200002c18cd83771;hp=030de04c9ca02bb04db50c84f253c42ed88dca9c;hpb=a94fc319f2aa64b43c9a73b5ff7063923648faec;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp index 030de04c9..4ef17362e 100644 --- a/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp +++ b/src/FeaturesAPI/FeaturesAPI_RevolutionBoolean.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2017 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 CEA/DEN, EDF R&D // // 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 "FeaturesAPI_RevolutionBoolean.h" @@ -89,17 +88,13 @@ void FeaturesAPI_RevolutionBoolean::setAngles(const ModelHighAPI_Double& theToAn //================================================================================================== void FeaturesAPI_RevolutionBoolean::setAngle(const ModelHighAPI_Double& theAngle) { - fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod); - fillAttribute(theAngle, mytoAngle); - fillAttribute(ModelHighAPI_Double(), myfromAngle); - - execIfBaseNotEmpty(); + setAngles(theAngle, ModelHighAPI_Double()); } //================================================================================================== void FeaturesAPI_RevolutionBoolean::setPlanesAndOffsets(const ModelHighAPI_Selection& theToObject, const ModelHighAPI_Double& theToOffset, - const ModelHighAPI_Selection& theFromObject, + const ModelHighAPI_Selection& theFromObject, const ModelHighAPI_Double& theFromOffset) { fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_PLANES(), mycreationMethod); @@ -163,6 +158,8 @@ void FeaturesAPI_RevolutionBoolean::dump(ModelHighAPI_Dumper& theDumper) const theDumper << ", " << anAttrToObject << ", " << anAttrToOffset << ", " << anAttrFromObject << ", " << anAttrFromOffset; + } else { + // Through All } AttributeSelectionListPtr anAttrBoolObjects = @@ -190,6 +187,22 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( initialize(); } +//================================================================================================== +FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +: FeaturesAPI_RevolutionBoolean(theFeature) +{ + if(initialize()) { + fillAttribute(theBaseObjects, mybaseObjects); + fillAttribute(theAxis, myaxis); + fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_THROUGH_ALL(), mycreationMethod); + setBooleanObjects(theBooleanObjects); + } +} + //================================================================================================== FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( const std::shared_ptr& theFeature, @@ -202,9 +215,7 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( if(initialize()) { fillAttribute(theBaseObjects, mybaseObjects); fillAttribute(theAxis, myaxis); - fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_BY_ANGLES(), mycreationMethod); - fillAttribute(theSize, mytoAngle); - fillAttribute(ModelHighAPI_Double(), myfromAngle); + setAngle(theSize); setBooleanObjects(theBooleanObjects); } } @@ -253,6 +264,18 @@ FeaturesAPI_RevolutionCut::FeaturesAPI_RevolutionCut( } } +//================================================================================================== +RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionCut::ID()); + return RevolutionCutPtr(new FeaturesAPI_RevolutionCut(aFeature, theBaseObjects, + theAxis, theBooleanObjects)); +} + //================================================================================================== RevolutionCutPtr addRevolutionCut(const std::shared_ptr& thePart, const std::list& theBaseObjects, @@ -315,6 +338,22 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( initialize(); } +//================================================================================================== +FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( + const std::shared_ptr& theFeature, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +: FeaturesAPI_RevolutionBoolean(theFeature) +{ + if(initialize()) { + fillAttribute(theBaseObjects, mybaseObjects); + fillAttribute(theAxis, myaxis); + fillAttribute(FeaturesPlugin_Revolution::CREATION_METHOD_THROUGH_ALL(), mycreationMethod); + setBooleanObjects(theBooleanObjects); + } +} + //================================================================================================== FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( const std::shared_ptr& theFeature, @@ -378,6 +417,18 @@ FeaturesAPI_RevolutionFuse::FeaturesAPI_RevolutionFuse( } } +//================================================================================================== +RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, + const std::list& theBaseObjects, + const ModelHighAPI_Selection& theAxis, + const std::list& theBooleanObjects) +{ + std::shared_ptr aFeature = + thePart->addFeature(FeaturesPlugin_RevolutionFuse::ID()); + return RevolutionFusePtr(new FeaturesAPI_RevolutionFuse(aFeature, theBaseObjects, + theAxis, theBooleanObjects)); +} + //================================================================================================== RevolutionFusePtr addRevolutionFuse(const std::shared_ptr& thePart, const std::list& theBaseObjects,