X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_Translation.h;h=7fc4aa6d43410714ab0fdb6fa6fbfd7c072d55f2;hb=77ce6d35ac8d2f0fdaecb4f23e0870bf74e36103;hp=fef95b503508ccc83ec89cd385db28f7419cea2a;hpb=49aae0203d4c89a9cd5409451c3e4208b799e004;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_Translation.h b/src/FeaturesAPI/FeaturesAPI_Translation.h index fef95b503..7fc4aa6d4 100644 --- a/src/FeaturesAPI/FeaturesAPI_Translation.h +++ b/src/FeaturesAPI/FeaturesAPI_Translation.h @@ -1,8 +1,21 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> - -// File: FeaturesAPI_Translation.h -// Created: 07 June 2016 -// Author: Dmitry Bobylev +// 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 +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// 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 +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// #ifndef FeaturesAPI_Translation_H_ #define FeaturesAPI_Translation_H_ @@ -11,60 +24,113 @@ #include +#include #include #include +#include -class ModelHighAPI_Double; -class ModelHighAPI_Selection; +class ModelHighAPI_Dumper; /// \class FeaturesAPI_Translation /// \ingroup CPPHighAPI /// \brief Interface for Translation feature. -class FeaturesAPI_Translation : public ModelHighAPI_Interface +class FeaturesAPI_Translation: public ModelHighAPI_Interface { public: /// Constructor without values. FEATURESAPI_EXPORT - explicit FeaturesAPI_Translation(const std::shared_ptr & theFeature); + explicit FeaturesAPI_Translation(const std::shared_ptr& theFeature); /// Constructor with values. FEATURESAPI_EXPORT - FeaturesAPI_Translation(const std::shared_ptr & theFeature, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theAxisObject, - const ModelHighAPI_Double& theDistance); + explicit FeaturesAPI_Translation(const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theAxisObject, + const ModelHighAPI_Double& theDistance); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_Translation(const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const ModelHighAPI_Double& theDx, + const ModelHighAPI_Double& theDy, + const ModelHighAPI_Double& theDz); + + /// Constructor with values. + FEATURESAPI_EXPORT + explicit FeaturesAPI_Translation(const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theStartPoint, + const ModelHighAPI_Selection& theEndPoint); /// Destructor. FEATURESAPI_EXPORT virtual ~FeaturesAPI_Translation(); - INTERFACE_3(FeaturesPlugin_Translation::ID(), - mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */, - distance, FeaturesPlugin_Translation::DISTANCE_ID(), ModelAPI_AttributeDouble, /** Distance */) + INTERFACE_9(FeaturesPlugin_Translation::ID(), + creationMethod, FeaturesPlugin_Translation::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + mainObjects, FeaturesPlugin_Translation::OBJECTS_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + axisObject, FeaturesPlugin_Translation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis object */, + distance, FeaturesPlugin_Translation::DISTANCE_ID(), + ModelAPI_AttributeDouble, /** Distance */, + dx, FeaturesPlugin_Translation::DX_ID(), + ModelAPI_AttributeDouble, /** Dimension in X */, + dy, FeaturesPlugin_Translation::DY_ID(), + ModelAPI_AttributeDouble, /** Dimension in Y */, + dz, FeaturesPlugin_Translation::DZ_ID(), + ModelAPI_AttributeDouble, /** Dimension in Z */, + startPoint, FeaturesPlugin_Translation::START_POINT_ID(), + ModelAPI_AttributeSelection, /** Start point object */, + endPoint, FeaturesPlugin_Translation::END_POINT_ID(), + ModelAPI_AttributeSelection, /** End point object */ + ) /// Set main objects. FEATURESAPI_EXPORT void setMainObjects(const std::list& theMainObjects); - /// Set axis object. + /// Modify CreationMethod, axis_object, distance attributes of the feature. + FEATURESAPI_EXPORT + void setAxisAndDistance(const ModelHighAPI_Selection& theAxisObject, + const ModelHighAPI_Double& theDistance); + + /// Modify CreationMethod, dx, dy, dz attributes of the feature. FEATURESAPI_EXPORT - void setAxisObject(const ModelHighAPI_Selection& theAxisObject); + void setDimensions(const ModelHighAPI_Double& theDx, + const ModelHighAPI_Double& theDy, + const ModelHighAPI_Double& theDz); - /// Set distance. + /// Modify CreationMethod, start_point, end_point attributes of the feature. FEATURESAPI_EXPORT - void setDistance(const ModelHighAPI_Double& theDistance); + void setPoints(const ModelHighAPI_Selection& theStartPoint, + const ModelHighAPI_Selection& theEndPoint); + + /// Dump wrapped feature + FEATURESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on Translation object. typedef std::shared_ptr TranslationPtr; +#define DUMMY std::pair() + /// \ingroup CPPHighAPI /// \brief Create Translation feature. -FEATURESAPI_EXPORT -TranslationPtr addTranslation(const std::shared_ptr & thePart, - const std::list& theMainObjects, - const ModelHighAPI_Selection& theAxisObject, - const ModelHighAPI_Double& theDistance); +FEATURESAPI_EXPORT TranslationPtr addTranslation( + const std::shared_ptr& part, + const std::list& objects, + const std::pair& deprecated1 = DUMMY, + const std::pair& deprecated2 = DUMMY, + const std::pair& deprecated3 = DUMMY, + const ModelHighAPI_Selection& axis = ModelHighAPI_Selection(), + const ModelHighAPI_Double& distance = ModelHighAPI_Double(0.0), + const std::list& vector = std::list(), + const ModelHighAPI_Selection& startPoint = ModelHighAPI_Selection(), + const ModelHighAPI_Selection& endPoint = ModelHighAPI_Selection(), + const bool keepSubResults = false ); #endif // FeaturesAPI_Translation_H_