X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSketchPlugin%2FSketchPlugin_MultiRotation.h;h=8e8f2b89cda187761059554349541baa2779a58c;hb=15fc1914159f4671968f56eb32d878a022edcd8b;hp=245ffb980bc37de56e07cd4483de659950a771d1;hpb=d7a4accddf64dfbe704738e6b7708164643aeba7;p=modules%2Fshaper.git diff --git a/src/SketchPlugin/SketchPlugin_MultiRotation.h b/src/SketchPlugin/SketchPlugin_MultiRotation.h index 245ffb980..8e8f2b89c 100644 --- a/src/SketchPlugin/SketchPlugin_MultiRotation.h +++ b/src/SketchPlugin/SketchPlugin_MultiRotation.h @@ -1,8 +1,22 @@ -// Copyright (C) 2014-20xx CEA/DEN, EDF R&D --> - -// File: SketchPlugin_MultiRotation.h -// Created: 21 Apr 2015 -// Author: Artem ZHIDKOV +// 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 SketchPlugin_MultiRotation_H_ #define SketchPlugin_MultiRotation_H_ @@ -19,10 +33,9 @@ * SketchPlugin_Constraint::ENTITY_A() for initial list of objects and * SketchPlugin_Constraint::ENTITY_B() for the list of created objects * - * The list of created objects contains a number of copies of each object given in - * the NUMBER_OF_COPIES_ID() attribute plus 1 (the initial objects are stored into this - * attribute too). At the start of the list, there are collected N copies - * of first object from initial list, then N copies of second object etc. + * The list of created objects contains initial and copied objects of each object given. The + * number copies is the NUMBER_OF_OBJECTS_ID() minus 1. At the start of the list, there are + * collected N copies of first object from initial list, then N copies of second object etc. */ class SketchPlugin_MultiRotation : public SketchPlugin_ConstraintBase { @@ -53,17 +66,32 @@ class SketchPlugin_MultiRotation : public SketchPlugin_ConstraintBase static const std::string MY_CENTER_ID("MultiRotationCenter"); return MY_CENTER_ID; } + /// attribute name for first point + inline static const std::string& ANGLE_TYPE() + { + static const std::string ANGLE_TYPE_ATTR("AngleType"); + return ANGLE_TYPE_ATTR; + } + /// End point of translation inline static const std::string& ANGLE_ID() { static const std::string MY_ANGLE_ID("MultiRotationAngle"); return MY_ANGLE_ID; } - /// Number of translated objects - inline static const std::string& NUMBER_OF_COPIES_ID() + + /// Total number of objects, initial and translated objects + inline static const std::string& NUMBER_OF_OBJECTS_ID() { - static const std::string MY_NUMBER_OF_COPIES_ID("MultiRotationCopies"); - return MY_NUMBER_OF_COPIES_ID; + static const std::string MY_NUMBER_OF_OBJECTS_ID("MultiRotationObjects"); + return MY_NUMBER_OF_OBJECTS_ID; + } + + /// Name of the flag to reverse rotation + inline static const std::string& REVERSED_ID() + { + static const std::string MY_REVERSED_ID("MultiRotationReversed"); + return MY_REVERSED_ID; } /// \brief Creates a new part document if needed @@ -79,13 +107,20 @@ class SketchPlugin_MultiRotation : public SketchPlugin_ConstraintBase /// Returns the AIS preview SKETCHPLUGIN_EXPORT virtual AISObjectPtr getAISObject(AISObjectPtr thePrevious); + /// removes all fields from this feature: results, data, etc + SKETCHPLUGIN_EXPORT virtual void erase(); + /// \brief Use plugin manager for features creation SketchPlugin_MultiRotation(); private: ObjectPtr copyFeature(ObjectPtr theObject); - void rotateFeature(ObjectPtr theInitial, ObjectPtr theTarget, - double theCenterX, double theCenterY, double theAngle); + //void rotateFeature(ObjectPtr theInitial, ObjectPtr theTarget, + // double theCenterX, double theCenterY, double theAngle); + + bool updateFullAngleValue(); + + bool isUpdatingAngle; }; #endif