1 // Copyright (C) 2004-2016 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // File : GHS3DPlugin_OptimizerHypothesis.hxx
20 // Created : Tue Nov 1 17:03:17 2016
22 #ifndef __GHS3DPlugin_OptimizerHypothesis_HXX__
23 #define __GHS3DPlugin_OptimizerHypothesis_HXX__
25 #include "GHS3DPlugin_Hypothesis.hxx"
28 class GHS3DPlugin_OptimizerHypothesis : public GHS3DPlugin_Hypothesis
31 GHS3DPlugin_OptimizerHypothesis(int hypId, SMESH_Gen * gen);
34 // 1 - create new nodes
35 // 2 - optimization level
36 // 3 - init and max memory
40 // 7 - keep work files
41 // 8 - remove log file
42 // 9 - advanced options
44 enum PThreadsMode { SAFE, AGGRESSIVE, NONE };
45 enum Mode { NO, YES, ONLY };
47 void SetOptimization( Mode isOnly );
48 Mode GetOptimization() const;
50 void SetSplitOverConstrained( Mode mode );
51 Mode GetSplitOverConstrained() const;
53 void SetSmoothOffSlivers( bool toSmooth );
54 bool GetSmoothOffSlivers() const;
56 void SetPThreadsMode( PThreadsMode mode );
57 PThreadsMode GetPThreadsMode() const;
59 void SetMaximalNumberOfThreads( int nb );
60 int GetMaximalNumberOfThreads() const;
62 static const char* GetHypType() { return "MG-Tetra Optimization Parameters"; }
65 virtual std::ostream & SaveTo(std::ostream & save);
66 virtual std::istream & LoadFrom(std::istream & load);
71 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
72 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
74 static std::string CommandToRun(const GHS3DPlugin_OptimizerHypothesis* hyp);
78 Mode myOptimization; // no, yes, only
79 Mode mySplitOverConstrained; // no, yes, only
80 bool mySmoothOffSlivers;
81 int myMaximalNumberOfThreads;
82 PThreadsMode myPThreadsMode; // safe, aggressive, none