Salome HOME
d6c73665574c85e2b38341bf9060e37f425bd348
[tools/medcoupling.git] / src / INTERP_KERNEL / BoxSplittingOptions.hxx
1 // Copyright (C) 2007-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay
20
21 #ifndef __BOXSPLITTINGOPTIONS_HXX__
22 #define __BOXSPLITTINGOPTIONS_HXX__
23
24 #include "INTERPKERNELDefines.hxx"
25
26 #include <string>
27
28 namespace INTERP_KERNEL
29
30   /*!
31    * \class BoxSplittingOptions
32    * Class defining the options for box splitting used for AMR algorithm like creation of patches following a criterion.
33    */
34   class INTERPKERNEL_EXPORT BoxSplittingOptions
35   {
36   private:
37     double _efficiency_goal;
38     double _efficiency_threshold;
39     int _min_patch_length;
40     int _max_patch_length;
41     int _max_nb_cells_in_patch;
42   public:
43     BoxSplittingOptions() { init(); }
44     void init();
45     double getEfficiencyGoal() const { return _efficiency_goal; }
46     void setEfficiencyGoal(double efficiency) { _efficiency_goal=efficiency; }
47     double getEfficiencyThreshold() const { return _efficiency_threshold; }
48     void setEfficiencyThreshold(double efficiencyThreshold) { _efficiency_threshold=efficiencyThreshold; }
49     int getMinimumPatchLength() const { return _min_patch_length; }
50     void setMinimumPatchLength(int minPatchLength) { _min_patch_length=minPatchLength; }
51     int getMaximumPatchLength() const { return _max_patch_length; }
52     void setMaximumPatchLength(int maxNbCellPatch) { _max_patch_length=maxNbCellPatch; }
53     int getMaximumNbOfCellsInPatch() const { return _max_nb_cells_in_patch; }
54     void setMaximumNbOfCellsInPatch(int maxNbCellsInPatch) { _max_nb_cells_in_patch=maxNbCellsInPatch; }
55     void copyOptions(const BoxSplittingOptions & other) { *this=other; }
56     std::string printOptions() const;
57   private:
58     static const int DFT_MIN_PATCH_LENGTH=1;
59     static const int DFT_MAX_PATCH_LENGTH=2147483647;
60     static const int DFT_MAX_PATCH_MEASURE=2147483647;
61     static const double DFT_EFFICIENCY_GOAL;
62     static const double DFT_EFFICIENCY_THRESHOLD;
63   public:
64     static const char PRECISION_STR[];
65   };
66 }
67
68 #endif