X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHexoticPlugin%2FHexoticPlugin_Hypothesis.hxx;h=ec844f0288d765c1f791a425f0ecb896d5589597;hb=e45bf25e416ed842419d0cdb8178e69a6f68324f;hp=d9b20ba0c768bb2ab8a775f156639e57cb057a67;hpb=db79ac22b38c00654a8d33c7dffb2bfe0811579e;p=plugins%2Fhexoticplugin.git diff --git a/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx index d9b20ba..ec844f0 100644 --- a/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx +++ b/src/HexoticPlugin/HexoticPlugin_Hypothesis.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2022 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 @@ -31,6 +31,7 @@ #include "Utils_SALOME_Exception.hxx" #include +#include #include // class HexoticSizeMap @@ -67,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; } @@ -91,17 +95,39 @@ public: void SetHexoticMaxMemory(int theVal); int GetHexoticMaxMemory() const { return _hexoticMaxMemory; } - void SetAdvancedOption(const std::string& theOptions); - std::string GetAdvancedOption() const { return _textOptions; } - void SetTextOptions(const std::string& theOptions); // obsolete - std::string GetTextOptions() const { return _textOptions; } + 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 THexoticSizeMaps; - + // For the GUI HexoticPluginGUI_HypothesisCreator::storeParamToHypo - THexoticSizeMaps GetSizeMaps() const { return _sizeMaps; }; - + 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); @@ -119,16 +145,17 @@ public: double GetGrowth() const { return _growth; } bool SetFacesWithLayers(const std::vector& theVal); - std::vector GetFacesWithLayers() const { return _facesWithLayers; } + const std::vector& GetFacesWithLayers() const { return _facesWithLayers; } bool SetImprintedFaces(const std::vector& theVal); - std::vector GetImprintedFaces() const { return _imprintedFaces; } + const std::vector& 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(); @@ -145,6 +172,9 @@ public: static double GetDefaultGrowth(); static std::vector GetDefaultFacesWithLayers(); static std::vector GetDefaultImprintedFaces(); + static bool GetDefaultStandardOutputLog() { return false; } + static bool GetDefaultRemoveLogOnSuccess() { return false; } + static bool GetDefaultKeepFiles() { return false; } // Persistence virtual std::ostream& SaveTo(std::ostream& save); @@ -166,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; @@ -178,9 +209,17 @@ private: int _hexoticSdMode; int _hexoticVerbosity; int _hexoticMaxMemory; - std::string _textOptions; THexoticSizeMaps _sizeMaps; + + 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;