Salome HOME
Updated copyright comment
[plugins/ghs3dplugin.git] / src / GHS3DPlugin / GHS3DPlugin_OptimizerHypothesis.hxx
1 // Copyright (C) 2004-2024  CEA, EDF
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 // File      : GHS3DPlugin_OptimizerHypothesis.hxx
20 // Created   : Tue Nov  1 17:03:17 2016
21
22 #ifndef __GHS3DPlugin_OptimizerHypothesis_HXX__
23 #define __GHS3DPlugin_OptimizerHypothesis_HXX__
24
25 #include "GHS3DPlugin_Hypothesis.hxx"
26
27
28 class GHS3DPlugin_OptimizerHypothesis : public GHS3DPlugin_Hypothesis
29 {
30 public:
31   GHS3DPlugin_OptimizerHypothesis(int hypId, SMESH_Gen * gen);
32
33   // inherited params:
34   // 1 - create new nodes
35   // 2 - optimization level
36   // 3 - init and max memory
37   // 4 - work dir
38   // 5 - verbosity
39   // 6 - log to file
40   // 7 - keep work files
41   // 8 - remove log file
42   // 9 - advanced options
43
44   enum PThreadsMode { SAFE, AGGRESSIVE, NONE };
45   enum Mode { NO, YES, ONLY };
46
47   void SetOptimization( Mode isOnly );
48   Mode GetOptimization() const;
49
50   void SetSplitOverConstrained( Mode mode );
51   Mode GetSplitOverConstrained() const;
52
53   void SetSmoothOffSlivers( bool toSmooth );
54   bool GetSmoothOffSlivers() const;
55
56   void SetPThreadsMode( PThreadsMode mode );
57   PThreadsMode GetPThreadsMode() const;
58
59   void SetMaximalNumberOfThreads( int nb );
60   int  GetMaximalNumberOfThreads() const;
61
62   static const char* GetHypType() { return "MG-Tetra Optimization Parameters"; }
63
64   // Persistence
65   virtual std::ostream & SaveTo(std::ostream & save);
66   virtual std::istream & LoadFrom(std::istream & load);
67
68   /*!
69    * \brief Does nothing
70    */
71   virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
72   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
73
74   static std::string CommandToRun(const GHS3DPlugin_OptimizerHypothesis* hyp);
75
76 private:
77
78   Mode myOptimization; // no, yes, only
79   Mode mySplitOverConstrained; // no, yes, only
80   bool mySmoothOffSlivers;
81   int  myMaximalNumberOfThreads;
82   PThreadsMode myPThreadsMode; // safe, aggressive, none
83
84 };
85
86 #endif