SALOME - SMESH
|
00001 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE 00002 // 00003 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, 00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 00005 // 00006 // This library is free software; you can redistribute it and/or 00007 // modify it under the terms of the GNU Lesser General Public 00008 // License as published by the Free Software Foundation; either 00009 // version 2.1 of the License. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00019 // 00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00021 // 00022 // SMESH SMESH : implementaion of SMESH idl descriptions 00023 // File : StdMeshers_Regular_1D.hxx 00024 // Moved here from SMESH_Regular_1D.hxx 00025 // Author : Paul RASCLE, EDF 00026 // Module : SMESH 00027 00028 #ifndef _SMESH_REGULAR_1D_HXX_ 00029 #define _SMESH_REGULAR_1D_HXX_ 00030 00031 #include "SMESH_StdMeshers.hxx" 00032 00033 #include "SMESH_1D_Algo.hxx" 00034 00035 #include "StdMeshers_FixedPoints1D.hxx" 00036 00037 class Adaptor3d_Curve; 00038 class TopoDS_Vertex; 00039 class StdMeshers_SegmentLengthAroundVertex; 00040 00041 class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo 00042 { 00043 public: 00044 StdMeshers_Regular_1D(int hypId, int studyId, SMESH_Gen* gen); 00045 virtual ~StdMeshers_Regular_1D(); 00046 00047 virtual bool CheckHypothesis(SMESH_Mesh& aMesh, 00048 const TopoDS_Shape& aShape, 00049 SMESH_Hypothesis::Hypothesis_Status& aStatus); 00050 00051 virtual bool Compute(SMESH_Mesh& aMesh, 00052 const TopoDS_Shape& aShape); 00053 00054 virtual bool Evaluate(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, 00055 MapShapeNbElems& aResMap); 00056 00057 virtual const std::list <const SMESHDS_Hypothesis *> & 00058 GetUsedHypothesis(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, const bool=true); 00059 00067 virtual void SetEventListener(SMESH_subMesh* subMesh); 00068 00075 void SubmeshRestored(SMESH_subMesh* subMesh); 00076 00077 protected: 00078 00079 virtual bool computeInternalParameters (SMESH_Mesh & theMesh, 00080 Adaptor3d_Curve & theC3d, 00081 double theLength, 00082 double theFirstU, 00083 double theLastU, 00084 std::list<double> & theParameters, 00085 const bool theReverse, 00086 bool theConsiderPropagation = false); 00087 00088 virtual void redistributeNearVertices (SMESH_Mesh & theMesh, 00089 Adaptor3d_Curve & theC3d, 00090 double theLength, 00091 std::list< double > & theParameters, 00092 const TopoDS_Vertex & theVf, 00093 const TopoDS_Vertex & theVl); 00094 00098 static const 00099 StdMeshers_SegmentLengthAroundVertex* getVertexHyp(SMESH_Mesh & theMesh, 00100 const TopoDS_Vertex & theV); 00101 00102 enum HypothesisType { LOCAL_LENGTH, MAX_LENGTH, NB_SEGMENTS, BEG_END_LENGTH, DEFLECTION, ARITHMETIC_1D, FIXED_POINTS_1D, NONE }; 00103 00104 enum ValueIndex { 00105 SCALE_FACTOR_IND = 0, 00106 BEG_LENGTH_IND = 0, 00107 END_LENGTH_IND = 1, 00108 DEFLECTION_IND = 0, 00109 PRECISION_IND = 1 00110 }; 00111 00112 enum IValueIndex { 00113 NB_SEGMENTS_IND = 0, 00114 DISTR_TYPE_IND = 1, 00115 CONV_MODE_IND = 2 00116 }; 00117 00118 enum VValueIndex { 00119 TAB_FUNC_IND = 0 00120 }; 00121 00122 enum SValueIndex { 00123 EXPR_FUNC_IND = 0 00124 }; 00125 00126 HypothesisType _hypType; 00127 00128 const StdMeshers_FixedPoints1D* _fpHyp; 00129 00130 double _value[2]; 00131 int _ivalue[3]; 00132 std::vector<double> _vvalue[1]; 00133 std::string _svalue[1]; 00134 std::vector<int> _revEdgesIDs; 00135 00136 // a source of propagated hypothesis, is set by CheckHypothesis() 00137 // always called before Compute() 00138 TopoDS_Shape _mainEdge; 00139 }; 00140 00141 #endif