]> SALOME platform Git repositories - plugins/hexoticplugin.git/blobdiff - src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx
Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits
[plugins/hexoticplugin.git] / src / HexoticPlugin / HexoticPlugin_Hypothesis.hxx
index 6dd9941540ee861c97216b4c8bff72a73013bc48..b8b6c3220c289efd7b7865d2dd8a6344ae4bfcae 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2021  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.
+// 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
@@ -31,6 +31,8 @@
 #include "Utils_SALOME_Exception.hxx"
 
 #include <map>
+#include <set>
+#include <vector>
 
 // class HexoticSizeMap
 // {
 //   TopoDS_Shape shape;
 //   double size;
 // }
-//  Parameters for work of Hexotic
+//  Parameters for work of MG-Hexa
 //
 
 class HEXOTICPLUGIN_EXPORT HexoticPlugin_Hypothesis: public SMESH_Hypothesis
 {
 public:
 
-  HexoticPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen* gen);
+  HexoticPlugin_Hypothesis(int hypId, SMESH_Gen* gen);
+
+  static const char* GetHypType() { return "MG-Hexa Parameters"; }
 
   void SetHexesMinLevel(int theVal);
   int GetHexesMinLevel() const { return _hexesMinLevel; }
@@ -64,6 +68,9 @@ public:
   void SetMaxSize(double theVal);
   double GetMaxSize() const { return _maxSize; }
 
+  void SetGeomApproxAngle(double angle);
+  double GetGeomApproxAngle() const { return _approxAngle; }
+
   void SetHexoticIgnoreRidges(bool theVal);
   bool GetHexoticIgnoreRidges() const { return _hexoticIgnoreRidges; }
 
@@ -88,21 +95,67 @@ public:
   void SetHexoticMaxMemory(int theVal);
   int GetHexoticMaxMemory() const { return _hexoticMaxMemory; }
   
+  void SetKeepFiles(bool toKeep);
+  bool GetKeepFiles() const  { return _keepFiles; }
+  void SetStandardOutputLog(bool logInStandardOutput);
+  bool GetStandardOutputLog() const { return _logInStandardOutput; }
+  void SetRemoveLogOnSuccess(bool removeLogOnSuccess);
+  bool GetRemoveLogOnSuccess() const  { return _removeLogOnSuccess; }
+
+
+  typedef std::map< std::string, std::string > TOptionValues;
+  typedef std::set< std::string >              TOptionNames;
+
+  void SetOptionValue(const std::string& optionName,
+                      const std::string& optionValue);
+  std::string GetOptionValue(const std::string& optionName,
+                             bool*              isDefault=0) const;
+  bool HasOptionDefined( const std::string& optionName ) const;
+  void ClearOption(const std::string& optionName);
+  TOptionValues        GetOptionValues()       const;
+  const TOptionValues& GetCustomOptionValues() const { return _customOption2value; }
+  std::string GetAdvancedOption( bool customOnly = false ) const;
+  void SetAdvancedOption(const std::string& theOptions); // obsolete
+
+  static bool  ToBool(const std::string& str, bool* isOk=0);
+  static double ToDbl(const std::string& str, bool* isOk=0);
+  static int    ToInt(const std::string& str, bool* isOk=0);
+
+
   // Size Maps
   typedef std::map<std::string,double> THexoticSizeMaps;
-  
+
   // For the GUI HexoticPluginGUI_HypothesisCreator::storeParamToHypo
-  THexoticSizeMaps GetSizeMaps() const { return _sizeMaps; }; 
-  void ClearSizeMaps();
-  
+  const THexoticSizeMaps& GetSizeMaps() const { return _sizeMaps; }
+
   // Add one size map to the collection of size maps (user interface)
   bool AddSizeMap(std::string theEntry, double theSize);
+  bool UnsetSizeMap(std::string theEntry);
+
+  void SetNbLayers(int theVal);
+  int GetNbLayers() const { return _nbLayers; }
+
+  void SetFirstLayerSize(double theVal);
+  double GetFirstLayerSize() const { return _firstLayerSize; }
+
+  void SetDirection(bool theVal);
+  bool GetDirection() const { return _direction; }
+
+  void SetGrowth(double theVal);
+  double GetGrowth() const { return _growth; }
+
+  bool SetFacesWithLayers(const std::vector<int>& theVal);
+  const std::vector<int>& GetFacesWithLayers() const { return _facesWithLayers; }
+
+  bool SetImprintedFaces(const std::vector<int>& theVal);
+  const std::vector<int>& GetImprintedFaces() const { return _imprintedFaces; }
 
   // the parameters default values 
   static int GetDefaultHexesMinLevel();
   static int GetDefaultHexesMaxLevel();
   static double GetDefaultMinSize();
   static double GetDefaultMaxSize();
+  static double GetDefaultGeomApproxAngle() { return 0; }
   static bool GetDefaultHexoticIgnoreRidges();
   static bool GetDefaultHexoticInvalidElements();
   static double GetDefaultHexoticSharpAngleThreshold();
@@ -111,7 +164,17 @@ public:
   static int GetDefaultHexoticSdMode();
   static int GetDefaultHexoticVerbosity();
   static int GetDefaultHexoticMaxMemory();
+  static std::string GetDefaultTextOptions();
   static THexoticSizeMaps GetDefaultHexoticSizeMaps();
+  static int GetDefaultNbLayers();
+  static double GetDefaultFirstLayerSize();
+  static bool GetDefaultDirection();
+  static double GetDefaultGrowth();
+  static std::vector<int> GetDefaultFacesWithLayers();
+  static std::vector<int> GetDefaultImprintedFaces();
+  static bool   GetDefaultStandardOutputLog() { return false; }
+  static bool   GetDefaultRemoveLogOnSuccess() { return false; }
+  static bool   GetDefaultKeepFiles() { return false; }
 
   // Persistence
   virtual std::ostream& SaveTo(std::ostream& save);
@@ -133,11 +196,12 @@ public:
    */
   virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
 
-private:
+ private:
   int    _hexesMinLevel;
   int    _hexesMaxLevel;
   double _minSize;
   double _maxSize;
+  double _approxAngle;
   bool   _hexoticIgnoreRidges;
   bool   _hexoticInvalidElements;
   double _hexoticSharpAngleThreshold;
@@ -146,7 +210,22 @@ private:
   int    _hexoticVerbosity;
   int    _hexoticMaxMemory;
   THexoticSizeMaps _sizeMaps;
-  std::string _hexoticWorkingDirectory ;
+
+  TOptionValues _option2value, _customOption2value;         // user defined values
+  TOptionValues _defaultOptionValues;                       // default values
+  TOptionNames  _doubleOptions, _charOptions, _boolOptions; // to find a type of option
+
+  std::string _hexoticWorkingDirectory;
+  bool   _logInStandardOutput;
+  bool   _removeLogOnSuccess;
+  bool   _keepFiles;
+
+  int    _nbLayers;
+  double _firstLayerSize;
+  bool   _direction;
+  double _growth;
+  std::vector<int> _facesWithLayers;
+  std::vector<int> _imprintedFaces;
 };
 
 #endif