00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _SMESH_NUMBEROFSEGMENTS_HXX_
00029 #define _SMESH_NUMBEROFSEGMENTS_HXX_
00030
00031 #include "SMESH_StdMeshers.hxx"
00032
00033 #include "SMESH_Hypothesis.hxx"
00034 #include "Utils_SALOME_Exception.hxx"
00035 #include <vector>
00036
00043 class STDMESHERS_EXPORT StdMeshers_NumberOfSegments:
00044 public SMESH_Hypothesis
00045 {
00046 public:
00047 StdMeshers_NumberOfSegments(int hypId, int studyId, SMESH_Gen* gen);
00048 virtual ~StdMeshers_NumberOfSegments();
00049
00050
00051 const std::vector<double>& BuildDistributionExpr( const char*, int, int ) throw ( SALOME_Exception );
00052 const std::vector<double>& BuildDistributionTab( const std::vector<double>&, int, int ) throw ( SALOME_Exception );
00053
00058 void SetNumberOfSegments(int segmentsNumber)
00059 throw (SALOME_Exception);
00060
00064 int GetNumberOfSegments() const;
00065
00069 enum DistrType
00070 {
00071 DT_Regular,
00072 DT_Scale,
00073 DT_TabFunc,
00074 DT_ExprFunc
00075 };
00076
00080 void SetDistrType(DistrType typ)
00081 throw (SALOME_Exception);
00082
00086 DistrType GetDistrType() const;
00087
00095 virtual void SetScaleFactor(double scaleFactor)
00096 throw (SALOME_Exception);
00097
00103 double GetScaleFactor() const
00104 throw (SALOME_Exception);
00105
00115 void SetTableFunction(const std::vector<double>& table)
00116 throw (SALOME_Exception);
00117
00123 const std::vector<double>& GetTableFunction() const
00124 throw (SALOME_Exception);
00125
00133 void SetExpressionFunction( const char* expr)
00134 throw (SALOME_Exception);
00135
00141 const char* GetExpressionFunction() const
00142 throw (SALOME_Exception);
00143
00153 void SetConversionMode( int conv )
00154 throw (SALOME_Exception);
00155
00161 int ConversionMode() const
00162 throw (SALOME_Exception);
00163
00164 void SetReversedEdges( std::vector<int>& ids);
00165
00166 void SetObjectEntry( const char* entry ) { _objEntry = entry; }
00167
00168 const char* GetObjectEntry() { return _objEntry.c_str(); }
00169
00170 const std::vector<int>& GetReversedEdges() const { return _edgeIDs; }
00171
00178 virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
00179
00184 virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
00185
00186 virtual std::ostream & SaveTo(std::ostream & save);
00187 virtual std::istream & LoadFrom(std::istream & load);
00188 friend std::ostream& operator << (std::ostream & save, StdMeshers_NumberOfSegments & hyp);
00189 friend std::istream& operator >> (std::istream & load, StdMeshers_NumberOfSegments & hyp);
00190
00191 protected:
00192 int _numberOfSegments;
00193 DistrType _distrType;
00194 double _scaleFactor;
00195 std::vector<double> _table, _distr;
00196 std::string _func;
00197 int _convMode;
00198 std::vector<int> _edgeIDs;
00199 std::string _objEntry;
00200 };
00201
00202 #endif