X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FFeaturesPlugin%2FFeaturesPlugin_Symmetry.h;h=d03cc141bcc3c9b447c566a5d60efcff3723e1de;hb=0325db75534c99a962d6c03f2619e1fcc04491b6;hp=efa462156c464a8e4ecf09e90590a676e56b7c1c;hpb=698a1c427ab2537e7a96b5206d6987087b78f54f;p=modules%2Fshaper.git diff --git a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h index efa462156..d03cc141b 100644 --- a/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h +++ b/src/FeaturesPlugin/FeaturesPlugin_Symmetry.h @@ -1,8 +1,22 @@ -// Copyright (C) 2014-2016 CEA/DEN, EDF R&D - -// File: FeaturesPlugin_Symmetry.h -// Created: 30 Nov 2016 -// Author: Clarisse Genrault (CEA) +// 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 FEATURESPLUGIN_SYMMETRY_H_ #define FEATURESPLUGIN_SYMMETRY_H_ @@ -12,6 +26,9 @@ #include #include +#include + +class GeomAPI_Trsf; /** \class FeaturesPlugin_Symmetry * \ingroup Plugins @@ -83,6 +100,13 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature return MY_PLANE_OBJECT_ID; } + /// Attribute name of keeping original shape. + inline static const std::string& KEEP_ORIGINAL_RESULT() + { + static const std::string MY_KEEP_ORIGINAL_RESULT_ID("keep_original"); + return MY_KEEP_ORIGINAL_RESULT_ID; + } + /// \return the kind of a feature. FEATURESPLUGIN_EXPORT virtual const std::string& getKind() { @@ -100,6 +124,10 @@ class FeaturesPlugin_Symmetry : public ModelAPI_Feature FeaturesPlugin_Symmetry(); private: + /// Obtain list of source objects of the mirror + bool collectSourceObjects(ListOfShape& theSourceShapes, + std::list>& theSourceResults); + /// Perform symmetry with respect to a point. void performSymmetryByPoint(); @@ -109,10 +137,15 @@ private: /// Perform symmetry with respect to a plane. void performSymmetryByPlane(); - /// Perform the naming - void loadNamingDS(GeomAlgoAPI_Symmetry& theSymmetryAlgo, - std::shared_ptr theResultBody, - std::shared_ptr theBaseShape); + /// Create new result on given shapes and the index of result + void buildResult(std::shared_ptr& theSymmetryAlgo, + std::shared_ptr theBaseShape, + int theResultIndex); + + /// Create new result for the given part and transformation + void buildResult(std::shared_ptr theOriginal, + std::shared_ptr theTrsf, + int& theResultIndex); }; #endif // FEATURESPLUGIN_SYMMETRY_H_