StdMeshers_NumberOfSegments Class Reference

This class represents hypothesis for 1d algorithm. More...

#include <StdMeshers_NumberOfSegments.hxx>

Inheritance diagram for StdMeshers_NumberOfSegments:

Inheritance graph

Public Types

enum  DistrType { DT_Regular, DT_Scale, DT_TabFunc, DT_ExprFunc }
 This enumeration presents available types of distribution. More...
enum  Hypothesis_Status {
  HYP_OK, HYP_MISSING, HYP_CONCURENT, HYP_BAD_PARAMETER,
  HYP_UNKNOWN_FATAL, HYP_INCOMPATIBLE, HYP_NOTCONFORM, HYP_ALREADY_EXIST,
  HYP_BAD_DIM, HYP_BAD_SUBSHAPE
}
enum  hypothesis_type {
  PARAM_ALGO, ALGO, ALGO_1D, ALGO_2D,
  ALGO_3D
}

Public Member Functions

 StdMeshers_NumberOfSegments (int hypId, int studyId, SMESH_Gen *gen)
virtual ~StdMeshers_NumberOfSegments ()
const std::vector< double > & BuildDistributionExpr (const char *, int, int) throw ( SALOME_Exception )
const std::vector< double > & BuildDistributionTab (const std::vector< double > &, int, int) throw ( SALOME_Exception )
void SetNumberOfSegments (int segmentsNumber) throw (SALOME_Exception)
 Set the number of segments.
int GetNumberOfSegments () const
 Get the number of segments.
void SetDistrType (DistrType typ) throw (SALOME_Exception)
 Set distribution type.
DistrType GetDistrType () const
 Get distribution type.
virtual void SetScaleFactor (double scaleFactor) throw (SALOME_Exception)
 Set scale factor for scale distribution.
double GetScaleFactor () const throw (SALOME_Exception)
 Get scale factor for scale distribution.
void SetTableFunction (const std::vector< double > &table) throw (SALOME_Exception)
 Set table function for distribution DT_TabFunc.
const std::vector< double > & GetTableFunction () const throw (SALOME_Exception)
 Get table function for distribution DT_TabFunc.
void SetExpressionFunction (const char *expr) throw (SALOME_Exception)
 Set expression function for distribution DT_ExprFunc.
const char * GetExpressionFunction () const throw (SALOME_Exception)
 Get expression function for distribution DT_ExprFunc.
void SetConversionMode (int conv) throw (SALOME_Exception)
 Set conversion mode. When it is 0, it means "exponent mode": the function of distribution of density is used as an exponent of 10, i,e, 10^f(t). When it is 1, it means "cut negative mode". The function of distribution is used as F(t), where F(t0)=f(t0), if f(t0)>=0, otherwise F(t0) = 0. This mode is sensible only when function distribution is used (DT_TabFunc or DT_ExprFunc).
int ConversionMode () const throw (SALOME_Exception)
 Returns conversion mode.
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize number of segments by the mesh built on the geometry.
virtual std::ostream & SaveTo (std::ostream &save)
virtual std::istream & LoadFrom (std::istream &load)
virtual int GetDim () const
int GetStudyId () const
virtual void NotifySubMeshesHypothesisModification ()
virtual int GetShapeType () const
virtual const char * GetLibName () const
void SetLibName (const char *theLibName)
virtual bool IsAuxiliary () const
 Return true if me is an auxiliary hypothesis.
const char * GetName () const
int GetID () const
int GetType () const

Static Public Member Functions

static bool IsStatusFatal (Hypothesis_Status theStatus)

Protected Attributes

int _numberOfSegments
 an edge will be split on to this number of segments
DistrType _distrType
 the type of distribution of density function
double _scaleFactor
 the scale parameter for DT_Scale
std::vector< double > _table
std::vector< double > _distr
 the table for DT_TabFunc, a sequence of pairs of numbers
std::string _func
 the expression of the function for DT_ExprFunc
int _convMode
 flag of conversion mode: 0=exponent, 1=cut negative
SMESH_Gen_gen
int _studyId
int _shapeType
int _param_algo_dim
std::string _name
int _hypId
int _type

Friends

std::ostream & operator<< (std::ostream &save, StdMeshers_NumberOfSegments &hyp)
std::istream & operator>> (std::istream &load, StdMeshers_NumberOfSegments &hyp)

Detailed Description

It provides parameters for subdivision an edge by various distribution types, considering the given number of resulting segments


Member Enumeration Documentation

enum StdMeshers_NumberOfSegments::DistrType
 

Enumerator:
DT_Regular  equidistant distribution
DT_Scale  scale distribution
DT_TabFunc  distribution with density function presented by table
DT_ExprFunc  distribution with density function presented by expression

enum SMESH_Hypothesis::Hypothesis_Status [inherited]
 

Enumerator:
HYP_OK 
HYP_MISSING 
HYP_CONCURENT 
HYP_BAD_PARAMETER 
HYP_UNKNOWN_FATAL 
HYP_INCOMPATIBLE 
HYP_NOTCONFORM 
HYP_ALREADY_EXIST 
HYP_BAD_DIM 
HYP_BAD_SUBSHAPE 

enum SMESHDS_Hypothesis::hypothesis_type [inherited]
 

Enumerator:
PARAM_ALGO 
ALGO 
ALGO_1D 
ALGO_2D 
ALGO_3D 


Constructor & Destructor Documentation

StdMeshers_NumberOfSegments.StdMeshers_NumberOfSegments int  hypId,
int  studyId,
SMESH_Gen gen
 

virtual StdMeshers_NumberOfSegments.~StdMeshers_NumberOfSegments  )  [virtual]
 


Member Function Documentation

const std::vector<double>& StdMeshers_NumberOfSegments.BuildDistributionExpr const char *  ,
int  ,
int 
throw ( SALOME_Exception )
 

const std::vector<double>& StdMeshers_NumberOfSegments.BuildDistributionTab const std::vector< double > &  ,
int  ,
int 
throw ( SALOME_Exception )
 

void StdMeshers_NumberOfSegments.SetNumberOfSegments int  segmentsNumber  )  throw (SALOME_Exception)
 

Parameters:
segmentsNumber - must be greater than zero

int StdMeshers_NumberOfSegments.GetNumberOfSegments  )  const
 

void StdMeshers_NumberOfSegments.SetDistrType DistrType  typ  )  throw (SALOME_Exception)
 

DistrType StdMeshers_NumberOfSegments.GetDistrType  )  const
 

virtual void StdMeshers_NumberOfSegments.SetScaleFactor double  scaleFactor  )  throw (SALOME_Exception) [virtual]
 

Parameters:
scaleFactor - positive value different from 1
Throws SALOME_Exception if distribution type is not DT_Scale, or scaleFactor is not a positive value different from 1

double StdMeshers_NumberOfSegments.GetScaleFactor  )  const throw (SALOME_Exception)
 

Throws SALOME_Exception if distribution type is not DT_Scale

void StdMeshers_NumberOfSegments.SetTableFunction const std::vector< double > &  table  )  throw (SALOME_Exception)
 

Parameters:
table - this vector contains the pairs (parameter, value) following each by other, so the number of elements in the vector must be even. The parameters must be in range [0,1] and sorted in increase order. The values of function must be positive.
Throws SALOME_Exception if distribution type is not DT_TabFunc

const std::vector<double>& StdMeshers_NumberOfSegments.GetTableFunction  )  const throw (SALOME_Exception)
 

Throws SALOME_Exception if distribution type is not DT_TabFunc

void StdMeshers_NumberOfSegments.SetExpressionFunction const char *  expr  )  throw (SALOME_Exception)
 

Parameters:
expr - string containing the expression of the function f(t), e.g. "sin(t)"
Throws SALOME_Exception if distribution type is not DT_ExprFunc

const char* StdMeshers_NumberOfSegments.GetExpressionFunction  )  const throw (SALOME_Exception)
 

Throws SALOME_Exception if distribution type is not DT_ExprFunc

void StdMeshers_NumberOfSegments.SetConversionMode int  conv  )  throw (SALOME_Exception)
 

Throws SALOME_Exception if distribution type is not functional

int StdMeshers_NumberOfSegments.ConversionMode  )  const throw (SALOME_Exception)
 

Throws SALOME_Exception if distribution type is not functional

virtual bool StdMeshers_NumberOfSegments.SetParametersByMesh const SMESH_Mesh theMesh,
const TopoDS_Shape theShape
[virtual]
 

Parameters:
theMesh - the built mesh
theShape - the geometry of interest
Return values:
bool - true if parameter values have been successfully defined

Implements SMESH_Hypothesis.

virtual std::ostream& StdMeshers_NumberOfSegments.SaveTo std::ostream &  save  )  [virtual]
 

Implements SMESHDS_Hypothesis.

virtual std::istream& StdMeshers_NumberOfSegments.LoadFrom std::istream &  load  )  [virtual]
 

Implements SMESHDS_Hypothesis.

static bool SMESH_Hypothesis.IsStatusFatal Hypothesis_Status  theStatus  )  [static, inherited]
 

virtual int SMESH_Hypothesis.GetDim  )  const [virtual, inherited]
 

int SMESH_Hypothesis.GetStudyId  )  const [inherited]
 

virtual void SMESH_Hypothesis.NotifySubMeshesHypothesisModification  )  [virtual, inherited]
 

virtual int SMESH_Hypothesis.GetShapeType  )  const [virtual, inherited]
 

virtual const char* SMESH_Hypothesis.GetLibName  )  const [virtual, inherited]
 

void SMESH_Hypothesis.SetLibName const char *  theLibName  )  [inherited]
 

virtual bool SMESH_Hypothesis.IsAuxiliary  )  const [virtual, inherited]
 

Return values:
bool - auxiliary or not
An auxiliary hypothesis is optional, i.e. an algorithm can work without it and another hypothesis of the same dimention can be assigned to the shape

const char * SMESHDS_Hypothesis::GetName  )  const [inherited]
 

int SMESHDS_Hypothesis::GetID  )  const [inherited]
 

int SMESHDS_Hypothesis::GetType  )  const [inherited]
 


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  save,
StdMeshers_NumberOfSegments hyp
[friend]
 

std::istream& operator>> std::istream &  load,
StdMeshers_NumberOfSegments hyp
[friend]
 


Field Documentation

int StdMeshers_NumberOfSegments._numberOfSegments [protected]
 

DistrType StdMeshers_NumberOfSegments._distrType [protected]
 

double StdMeshers_NumberOfSegments._scaleFactor [protected]
 

std::vector<double> StdMeshers_NumberOfSegments._table [protected]
 

std::vector<double> StdMeshers_NumberOfSegments._distr [protected]
 

std::string StdMeshers_NumberOfSegments._func [protected]
 

int StdMeshers_NumberOfSegments._convMode [protected]
 

SMESH_Gen* SMESH_Hypothesis._gen [protected, inherited]
 

int SMESH_Hypothesis._studyId [protected, inherited]
 

int SMESH_Hypothesis._shapeType [protected, inherited]
 

int SMESH_Hypothesis._param_algo_dim [protected, inherited]
 

std::string SMESHDS_Hypothesis._name [protected, inherited]
 

int SMESHDS_Hypothesis._hypId [protected, inherited]
 

int SMESHDS_Hypothesis._type [protected, inherited]