X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_Hypothesis_2D.hxx;h=525bcf8f037630b5db3a91b573eb979b2d363352;hb=8842f99357e260edb5c31a19f1e8f9b987ae989e;hp=77382b05efb71fada1f65fff3a3aec002780a84d;hpb=b8fc64c6d71bf196b76b855ca89dd86267bd7478;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx index 77382b0..525bcf8 100644 --- a/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx +++ b/src/NETGENPlugin/NETGENPlugin_Hypothesis_2D.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -6,7 +6,7 @@ // 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 @@ -35,7 +35,9 @@ #include "NETGENPlugin_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -// Parameters for work of NETGEN. +class SMESH_Group; + +// Parameters of NETGEN. // This class is just to give 2D dimension, actually // it inherits all behaviour of the parent @@ -43,18 +45,133 @@ class NETGENPLUGIN_EXPORT NETGENPlugin_Hypothesis_2D: public NETGENPlugin_Hypot { public: - NETGENPlugin_Hypothesis_2D(int hypId, int studyId, SMESH_Gen * gen); - - // void SetQuadAllowed(bool theVal); - // bool GetQuadAllowed() const { return _quadAllowed; } - // static bool GetDefaultQuadAllowed(); - - // Persistence - // virtual ostream & SaveTo(ostream & save); - // virtual istream & LoadFrom(istream & load); + NETGENPlugin_Hypothesis_2D(int hypId, SMESH_Gen * gen); // private: // bool _quadAllowed; }; + +// Parameters of NETGEN remesher +// + +class NETGENPLUGIN_EXPORT NETGENPlugin_RemesherHypothesis_2D: public NETGENPlugin_Hypothesis +{ + public: + + NETGENPlugin_RemesherHypothesis_2D(int hypId, SMESH_Gen * gen); + + void SetRidgeAngle( double angle ); + double GetRidgeAngle() const{ return _ridgeAngle; } + + void SetEdgeCornerAngle( double angle ); + double GetEdgeCornerAngle() const { return _edgeCornerAngle; } + + void SetChartAngle( double angle ); + double GetChartAngle() const { return _chartAngle; } + + void SetOuterChartAngle( double angle ); + double GetOuterChartAngle() const { return _outerChartAngle; } + + void SetRestHChartDistFactor( double f ); + double GetRestHChartDistFactor() const { return _restHChartDistFactor; } + + void SetRestHChartDistEnable( bool enable ); + bool GetRestHChartDistEnable() const { return _restHChartDistEnable; } + + void SetRestHLineLengthFactor( double f ); + double GetRestHLineLengthFactor() const { return _restHLineLengthFactor; } + + void SetRestHLineLengthEnable( bool enable ); + bool GetRestHLineLengthEnable() const { return _restHLineLengthEnable; } + + void SetRestHCloseEdgeFactor( double f ); + double GetRestHCloseEdgeFactor() const { return _restHCloseEdgeFactor; } + + void SetRestHCloseEdgeEnable( bool enable ); + bool GetRestHCloseEdgeEnable() const { return _restHCloseEdgeEnable; } + + void SetRestHSurfCurvFactor( double f ); + double GetRestHSurfCurvFactor() const { return _restHSurfCurvFactor; } + + void SetRestHSurfCurvEnable( bool enable ); + bool GetRestHSurfCurvEnable() const { return _restHSurfCurvEnable; } + + void SetRestHEdgeAngleFactor( double f ); + double GetRestHEdgeAngleFactor() const { return _restHEdgeAngleFactor; } + + void SetRestHEdgeAngleEnable( bool enable ); + bool GetRestHEdgeAngleEnable() const { return _restHEdgeAngleEnable; } + + void SetRestHSurfMeshCurvFactor( double f ); + double GetRestHSurfMeshCurvFactor() const { return _restHSurfMeshCurvFactor; } + + void SetRestHSurfMeshCurvEnable( bool enable ); + bool GetRestHSurfMeshCurvEnable() const { return _restHSurfMeshCurvEnable; } + + void SetKeepExistingEdges( bool toKeep ); + bool GetKeepExistingEdges() const { return _keepExistingEdges; } + + void SetMakeGroupsOfSurfaces( bool toMake ); + bool GetMakeGroupsOfSurfaces() const { return _makeGroupsOfSurfaces; } + + void SetFixedEdgeGroup( const SMESH_Group* edgeGroup ); + int GetFixedEdgeGroupID() const { return _fixedEdgeGroupID; } + SMESH_Group* GetFixedEdgeGroup( const SMESH_Mesh& mesh ) const; + + void SetLoadMeshOnCancel( bool toLoad ); + bool GetLoadMeshOnCancel() const { return _loadOnCancel; } + + static double DefaultRidgeAngle() { return 30.; } + static double DefaultEdgeCornerAngle() { return 60.; } + static double DefaultChartAngle() { return 15.; } + static double DefaultOuterChartAngle() { return 70.; } + static double DefaultRestHChartDistFactor() { return 1.2; } + static bool DefaultRestHChartDistEnable() { return true; } + static double DefaultRestHLineLengthFactor() { return 0.5; } + static bool DefaultRestHLineLengthEnable() { return true; } + static double DefaultRestHCloseEdgeFactor() { return 1.; } + static bool DefaultRestHCloseEdgeEnable() { return true; } + static double DefaultRestHSurfCurvFactor() { return 1.; } + static bool DefaultRestHSurfCurvEnable() { return false; } + static double DefaultRestHEdgeAngleFactor() { return 1.; } + static bool DefaultRestHEdgeAngleEnable() { return false; } + static double DefaultRestHSurfMeshCurvFactor() { return 1.; } + static bool DefaultRestHSurfMeshCurvEnable() { return false; } + static bool DefaultKeepExistingEdges() { return false; } + static bool DefaultMakeGroupsOfSurfaces() { return false; } + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + + private: + + // STL charts + double _ridgeAngle; // yellow edges angle (in degrees) + double _edgeCornerAngle; + double _chartAngle; + double _outerChartAngle; + + // Mesh size: restrict h due to ... + double _restHChartDistFactor; // chart distance + bool _restHChartDistEnable; + double _restHLineLengthFactor; // line length + bool _restHLineLengthEnable; + double _restHCloseEdgeFactor; // close edges + bool _restHCloseEdgeEnable; + double _restHSurfCurvFactor; // surface curvature + bool _restHSurfCurvEnable; + double _restHEdgeAngleFactor; // edge angle + bool _restHEdgeAngleEnable; + double _restHSurfMeshCurvFactor; // surface mesh curv + bool _restHSurfMeshCurvEnable; + + // SALOME features + bool _keepExistingEdges; + bool _makeGroupsOfSurfaces; + int _fixedEdgeGroupID; + bool _loadOnCancel; + +}; + #endif