SALOME - SMESH
StdMeshers_NumberOfSegments Class Reference

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

#include <StdMeshers_NumberOfSegments.hxx>

Inheritance diagram for StdMeshers_NumberOfSegments:
Inheritance graph
Collaboration diagram for StdMeshers_NumberOfSegments:
Collaboration 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 = 0, HYP_MISSING, HYP_CONCURENT, HYP_BAD_PARAMETER,
  HYP_HIDDEN_ALGO, HYP_HIDING_ALGO, HYP_UNKNOWN_FATAL, HYP_INCOMPATIBLE,
  HYP_NOTCONFORM, HYP_ALREADY_EXIST, HYP_BAD_DIM, HYP_BAD_SUBSHAPE,
  HYP_BAD_GEOMETRY, HYP_NEED_SHAPE
}
enum  hypothesis_type {
  PARAM_ALGO, ALGO_0D, 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 ( SMESH_Exception )
const std::vector< double > & BuildDistributionTab (const std::vector< double > &, int, int) throw ( SMESH_Exception )
void SetNumberOfSegments (int segmentsNumber) throw ( SMESH_Exception )
 Set the number of segments.
int GetNumberOfSegments () const
 Get the number of segments.
void SetDistrType (DistrType typ) throw ( SMESH_Exception )
 Set distribution type.
DistrType GetDistrType () const
 Get distribution type.
virtual void SetScaleFactor (double scaleFactor) throw ( SMESH_Exception )
 Set scale factor for scale distribution.
double GetScaleFactor () const throw ( SMESH_Exception )
 Get scale factor for scale distribution.
void SetTableFunction (const std::vector< double > &table) throw ( SMESH_Exception )
 Set table function for distribution DT_TabFunc.
const std::vector< double > & GetTableFunction () const throw ( SMESH_Exception )
 Get table function for distribution DT_TabFunc.
void SetExpressionFunction (const char *expr) throw ( SMESH_Exception )
 Set expression function for distribution DT_ExprFunc.
const char * GetExpressionFunction () const throw ( SMESH_Exception )
 Get expression function for distribution DT_ExprFunc.
void SetConversionMode (int conv) throw ( SMESH_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 ( SMESH_Exception )
 Returns conversion mode.
void SetReversedEdges (std::vector< int > &ids)
void SetObjectEntry (const char *entry)
const char * GetObjectEntry ()
const std::vector< int > & GetReversedEdges () const
virtual bool SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape)
 Initialize number of segments by the mesh built on the geometry.
virtual bool SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0)
 Initialize my parameter values by default parameters.
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)
void SetParameters (const char *theParameters)
char * GetParameters () const
void SetLastParameters (const char *theParameters)
char * GetLastParameters () const
void ClearParameters ()
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
std::vector< int_edgeIDs
 list of reversed edges ids
std::string _objEntry
 Entry of the main object to reverse edges.
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

This class represents hypothesis for 1d algorithm.

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

Definition at line 43 of file StdMeshers_NumberOfSegments.hxx.


Member Enumeration Documentation

This enumeration presents available types of distribution.

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

Definition at line 69 of file StdMeshers_NumberOfSegments.hxx.

Enumerator:
HYP_OK 
HYP_MISSING 
HYP_CONCURENT 
HYP_BAD_PARAMETER 
HYP_HIDDEN_ALGO 
HYP_HIDING_ALGO 
HYP_UNKNOWN_FATAL 
HYP_INCOMPATIBLE 
HYP_NOTCONFORM 
HYP_ALREADY_EXIST 
HYP_BAD_DIM 
HYP_BAD_SUBSHAPE 
HYP_BAD_GEOMETRY 
HYP_NEED_SHAPE 

Definition at line 50 of file SMESH_Hypothesis.hxx.

Enumerator:
PARAM_ALGO 
ALGO_0D 
ALGO_1D 
ALGO_2D 
ALGO_3D 

Definition at line 49 of file SMESHDS_Hypothesis.hxx.


Constructor & Destructor Documentation


Member Function Documentation

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

Set the number of segments.

Parameters:
segmentsNumber- must be greater than zero

Get the number of segments.

Set distribution type.

Get distribution type.

virtual void StdMeshers_NumberOfSegments::SetScaleFactor ( double  scaleFactor) throw ( SMESH_Exception ) [virtual]

Set scale factor for scale distribution.

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

Get scale factor for scale distribution.

Throws SALOME_Exception if distribution type is not DT_Scale

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

Set table function for distribution DT_TabFunc.

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 ( SMESH_Exception )

Get table function for distribution DT_TabFunc.

Throws SALOME_Exception if distribution type is not DT_TabFunc

Set expression function for distribution DT_ExprFunc.

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

Get expression function for distribution DT_ExprFunc.

Throws SALOME_Exception if distribution type is not DT_ExprFunc

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)

Throws SALOME_Exception if distribution type is not functional

Returns conversion mode.

Throws SALOME_Exception if distribution type is not functional

void StdMeshers_NumberOfSegments::SetReversedEdges ( std::vector< int > &  ids)
void StdMeshers_NumberOfSegments::SetObjectEntry ( const char *  entry)

Definition at line 166 of file StdMeshers_NumberOfSegments.hxx.

const std::vector<int>& StdMeshers_NumberOfSegments::GetReversedEdges ( ) const

Definition at line 170 of file StdMeshers_NumberOfSegments.hxx.

virtual bool StdMeshers_NumberOfSegments::SetParametersByMesh ( const SMESH_Mesh theMesh,
const TopoDS_Shape theShape 
) [virtual]

Initialize number of segments by the mesh built on the geometry.

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 bool StdMeshers_NumberOfSegments::SetParametersByDefaults ( const TDefaults dflts,
const SMESH_Mesh theMesh = 0 
) [virtual]

Initialize my parameter values by default parameters.

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]

Definition at line 68 of file SMESH_Hypothesis.hxx.

virtual int SMESH_Hypothesis::GetDim ( ) const [virtual, inherited]

Referenced by SMESH_Gen::TAlgoStateError::Set().

Here is the caller graph for this function:

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]
void SMESH_Hypothesis::SetParameters ( const char *  theParameters) [inherited]
char* SMESH_Hypothesis::GetParameters ( ) const [inherited]
void SMESH_Hypothesis::SetLastParameters ( const char *  theParameters) [inherited]
char* SMESH_Hypothesis::GetLastParameters ( ) const [inherited]
void SMESH_Hypothesis::ClearParameters ( ) [inherited]
virtual bool SMESH_Hypothesis::IsAuxiliary ( ) const [virtual, inherited]

Return true if me is an auxiliary hypothesis.

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

Definition at line 114 of file SMESH_Hypothesis.hxx.

References SMESHDS_Hypothesis::GetType().

Here is the call graph for this function:

const char* SMESHDS_Hypothesis::GetName ( ) const [inherited]
int SMESHDS_Hypothesis::GetID ( ) const [inherited]
int SMESHDS_Hypothesis::GetType ( ) const [inherited]

Referenced by SMESH_Hypothesis::IsAuxiliary().

Here is the caller graph for this function:


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

an edge will be split on to this number of segments

Definition at line 192 of file StdMeshers_NumberOfSegments.hxx.

the type of distribution of density function

Definition at line 193 of file StdMeshers_NumberOfSegments.hxx.

the scale parameter for DT_Scale

Definition at line 194 of file StdMeshers_NumberOfSegments.hxx.

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

Definition at line 195 of file StdMeshers_NumberOfSegments.hxx.

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

the table for DT_TabFunc, a sequence of pairs of numbers

Definition at line 195 of file StdMeshers_NumberOfSegments.hxx.

std::string StdMeshers_NumberOfSegments::_func [protected]

the expression of the function for DT_ExprFunc

Definition at line 196 of file StdMeshers_NumberOfSegments.hxx.

flag of conversion mode: 0=exponent, 1=cut negative

Definition at line 197 of file StdMeshers_NumberOfSegments.hxx.

std::vector<int> StdMeshers_NumberOfSegments::_edgeIDs [protected]

list of reversed edges ids

Definition at line 198 of file StdMeshers_NumberOfSegments.hxx.

std::string StdMeshers_NumberOfSegments::_objEntry [protected]

Entry of the main object to reverse edges.

Definition at line 199 of file StdMeshers_NumberOfSegments.hxx.

SMESH_Gen* SMESH_Hypothesis::_gen [protected, inherited]

Definition at line 118 of file SMESH_Hypothesis.hxx.

int SMESH_Hypothesis::_studyId [protected, inherited]

Definition at line 119 of file SMESH_Hypothesis.hxx.

int SMESH_Hypothesis::_shapeType [protected, inherited]

Definition at line 120 of file SMESH_Hypothesis.hxx.

int SMESH_Hypothesis::_param_algo_dim [protected, inherited]

Definition at line 121 of file SMESH_Hypothesis.hxx.

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

Definition at line 52 of file SMESHDS_Hypothesis.hxx.

int SMESHDS_Hypothesis::_hypId [protected, inherited]

Definition at line 53 of file SMESHDS_Hypothesis.hxx.

int SMESHDS_Hypothesis::_type [protected, inherited]

Definition at line 54 of file SMESHDS_Hypothesis.hxx.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines