X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesAPI%2FFeaturesAPI_Rotation.h;h=47f0185a89fa6adb0ab5b03739d13fd6f7c092ad;hb=db25cb9e9be0ce3e2332141f7f2f47f088956bea;hp=0267cc94cd04b8cb53818c71e9ccc86331db3f1e;hpb=49aae0203d4c89a9cd5409451c3e4208b799e004;p=modules%2Fshaper.git diff --git a/src/FeaturesAPI/FeaturesAPI_Rotation.h b/src/FeaturesAPI/FeaturesAPI_Rotation.h index 0267cc94c..47f0185a8 100644 --- a/src/FeaturesAPI/FeaturesAPI_Rotation.h +++ b/src/FeaturesAPI/FeaturesAPI_Rotation.h @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> - -// File: FeaturesAPI_Rotation.h -// Created: 07 June 2016 -// Author: Dmitry Bobylev +// Copyright (C) 2014-2017 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 +// 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_Rotation_H_ #define FeaturesAPI_Rotation_H_ @@ -15,33 +29,54 @@ #include class ModelHighAPI_Double; +class ModelHighAPI_Dumper; class ModelHighAPI_Selection; /// \class FeaturesAPI_Rotation /// \ingroup CPPHighAPI /// \brief Interface for Rotation feature. -class FeaturesAPI_Rotation : public ModelHighAPI_Interface +class FeaturesAPI_Rotation: public ModelHighAPI_Interface { public: /// Constructor without values. FEATURESAPI_EXPORT - explicit FeaturesAPI_Rotation(const std::shared_ptr & theFeature); + explicit FeaturesAPI_Rotation(const std::shared_ptr& theFeature); /// Constructor with values. FEATURESAPI_EXPORT - FeaturesAPI_Rotation(const std::shared_ptr & theFeature, + FeaturesAPI_Rotation(const std::shared_ptr& theFeature, const std::list& theMainObjects, const ModelHighAPI_Selection& theAxisObject, const ModelHighAPI_Double& theAngle); + /// Constructor with values. + FEATURESAPI_EXPORT + FeaturesAPI_Rotation(const std::shared_ptr& theFeature, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theCenterPoint, + const ModelHighAPI_Selection& theStartPoint, + const ModelHighAPI_Selection& theEndPoint); + /// Destructor. FEATURESAPI_EXPORT virtual ~FeaturesAPI_Rotation(); - INTERFACE_3(FeaturesPlugin_Rotation::ID(), - mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), ModelAPI_AttributeSelectionList, /** Main objects */, - axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), ModelAPI_AttributeSelection, /** Axis object */, - angle, FeaturesPlugin_Rotation::ANGLE_ID(), ModelAPI_AttributeDouble, /** Angle */) + INTERFACE_7(FeaturesPlugin_Rotation::ID(), + creationMethod, FeaturesPlugin_Rotation::CREATION_METHOD(), + ModelAPI_AttributeString, /** Creation method */, + mainObjects, FeaturesPlugin_Rotation::OBJECTS_LIST_ID(), + ModelAPI_AttributeSelectionList, /** Main objects */, + axisObject, FeaturesPlugin_Rotation::AXIS_OBJECT_ID(), + ModelAPI_AttributeSelection, /** Axis object */, + angle, FeaturesPlugin_Rotation::ANGLE_ID(), + ModelAPI_AttributeDouble, /** Angle */, + centerPoint, FeaturesPlugin_Rotation::CENTER_POINT_ID(), + ModelAPI_AttributeSelection, /** Center point */, + startPoint, FeaturesPlugin_Rotation::START_POINT_ID(), + ModelAPI_AttributeSelection, /** Start point */, + endPoint, FeaturesPlugin_Rotation::END_POINT_ID(), + ModelAPI_AttributeSelection, /** End point */ + ) /// Set main objects. FEATURESAPI_EXPORT @@ -54,6 +89,16 @@ public: /// Set angle. FEATURESAPI_EXPORT void setAngle(const ModelHighAPI_Double& theAngle); + + /// Set center point, start point and end point + FEATURESAPI_EXPORT + void setPoints(const ModelHighAPI_Selection& theCenterPoint, + const ModelHighAPI_Selection& theStartPoint, + const ModelHighAPI_Selection& theEndPoint); + + /// Dump wrapped feature + FEATURESAPI_EXPORT + virtual void dump(ModelHighAPI_Dumper& theDumper) const; }; /// Pointer on Rotation object. @@ -62,9 +107,18 @@ typedef std::shared_ptr RotationPtr; /// \ingroup CPPHighAPI /// \brief Create Rotation feature. FEATURESAPI_EXPORT -RotationPtr addRotation(const std::shared_ptr & thePart, +RotationPtr addRotation(const std::shared_ptr& thePart, const std::list& theMainObjects, const ModelHighAPI_Selection& theAxisObject, - const ModelHighAPI_Double& theDistance); + const ModelHighAPI_Double& theAngle); + +/// \ingroup CPPHighAPI +/// \brief Create Rotation feature. +FEATURESAPI_EXPORT +RotationPtr addRotation(const std::shared_ptr& thePart, + const std::list& theMainObjects, + const ModelHighAPI_Selection& theCenterPoint, + const ModelHighAPI_Selection& theStartPoint, + const ModelHighAPI_Selection& theEndPoint); #endif // FeaturesAPI_Rotation_H_