SALOME - SMESH
|
This class represents hypothesis for 1d algorithm. More...
#include <StdMeshers_NumberOfSegments.hxx>
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. More... | |
int | GetNumberOfSegments () const |
Get the number of segments. More... | |
void | SetDistrType (DistrType typ) throw ( SMESH_Exception ) |
Set distribution type. More... | |
DistrType | GetDistrType () const |
Get distribution type. More... | |
virtual void | SetScaleFactor (double scaleFactor) throw ( SMESH_Exception ) |
Set scale factor for scale distribution. More... | |
double | GetScaleFactor () const throw ( SMESH_Exception ) |
Get scale factor for scale distribution. More... | |
void | SetTableFunction (const std::vector< double > &table) throw ( SMESH_Exception ) |
Set table function for distribution DT_TabFunc. More... | |
const std::vector< double > & | GetTableFunction () const throw ( SMESH_Exception ) |
Get table function for distribution DT_TabFunc. More... | |
void | SetExpressionFunction (const char *expr) throw ( SMESH_Exception ) |
Set expression function for distribution DT_ExprFunc. More... | |
const char * | GetExpressionFunction () const throw ( SMESH_Exception ) |
Get expression function for distribution DT_ExprFunc. More... | |
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) More... | |
int | ConversionMode () const throw ( SMESH_Exception ) |
Returns conversion mode. More... | |
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. More... | |
virtual bool | SetParametersByDefaults (const TDefaults &dflts, const SMESH_Mesh *theMesh=0) |
Initialize my parameter values by default parameters. More... | |
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. More... | |
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 More... | |
DistrType | _distrType |
the type of distribution of density function More... | |
double | _scaleFactor |
the scale parameter for DT_Scale More... | |
std::vector< double > | _table |
std::vector< double > | _distr |
the table for DT_TabFunc, a sequence of pairs of numbers More... | |
std::string | _func |
the expression of the function for DT_ExprFunc More... | |
int | _convMode |
flag of conversion mode: 0=exponent, 1=cut negative More... | |
std::vector< int > | _edgeIDs |
list of reversed edges ids More... | |
std::string | _objEntry |
Entry of the main object to reverse edges. More... | |
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) |
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.
This enumeration presents available types of distribution.
Definition at line 69 of file StdMeshers_NumberOfSegments.hxx.
|
inherited |
Definition at line 50 of file SMESH_Hypothesis.hxx.
|
inherited |
Enumerator | |
---|---|
PARAM_ALGO | |
ALGO_0D | |
ALGO_1D | |
ALGO_2D | |
ALGO_3D |
Definition at line 49 of file SMESHDS_Hypothesis.hxx.
StdMeshers_NumberOfSegments::StdMeshers_NumberOfSegments | ( | int | hypId, |
int | studyId, | ||
SMESH_Gen * | gen | ||
) |
|
virtual |
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 | |
) |
void StdMeshers_NumberOfSegments::SetNumberOfSegments | ( | int | segmentsNumber | ) | |
throw | ( | SMESH_Exception | |||
) |
Set the number of segments.
segmentsNumber | - must be greater than zero |
int StdMeshers_NumberOfSegments::GetNumberOfSegments | ( | ) | const |
Get the number of segments.
void StdMeshers_NumberOfSegments::SetDistrType | ( | DistrType | typ | ) | |
throw | ( | SMESH_Exception | |||
) |
Set distribution type.
DistrType StdMeshers_NumberOfSegments::GetDistrType | ( | ) | const |
Get distribution type.
|
virtual |
Set scale factor for scale distribution.
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 | ( | SMESH_Exception | ||
) |
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.
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
void StdMeshers_NumberOfSegments::SetExpressionFunction | ( | const char * | expr | ) | |
throw | ( | SMESH_Exception | |||
) |
Set expression function for distribution DT_ExprFunc.
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 | ( | SMESH_Exception | ||
) |
Get expression function for distribution DT_ExprFunc.
Throws SALOME_Exception if distribution type is not DT_ExprFunc
void StdMeshers_NumberOfSegments::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)
Throws SALOME_Exception if distribution type is not functional
int StdMeshers_NumberOfSegments::ConversionMode | ( | ) | const | |
throw | ( | SMESH_Exception | ||
) |
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 char* StdMeshers_NumberOfSegments::GetObjectEntry | ( | ) |
Definition at line 168 of file StdMeshers_NumberOfSegments.hxx.
const std::vector<int>& StdMeshers_NumberOfSegments::GetReversedEdges | ( | ) | const |
Definition at line 170 of file StdMeshers_NumberOfSegments.hxx.
References SMESHDS_Hypothesis::LoadFrom(), SMESHDS_Hypothesis::SaveTo(), SMESH_Hypothesis::SetParametersByDefaults(), and SMESH_Hypothesis::SetParametersByMesh().
|
virtual |
Initialize number of segments by the mesh built on the geometry.
theMesh | - the built mesh |
theShape | - the geometry of interest |
bool | - true if parameter values have been successfully defined |
Implements SMESH_Hypothesis.
|
virtual |
Initialize my parameter values by default parameters.
bool | - true if parameter values have been successfully defined |
Implements SMESH_Hypothesis.
|
virtual |
Implements SMESHDS_Hypothesis.
|
virtual |
Implements SMESHDS_Hypothesis.
|
staticinherited |
Definition at line 68 of file SMESH_Hypothesis.hxx.
|
virtualinherited |
|
inherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
virtualinherited |
Return true if me is an auxiliary hypothesis.
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.
|
inherited |
|
inherited |
|
inherited |
|
friend |
|
friend |
|
protected |
an edge will be split on to this number of segments
Definition at line 192 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
the type of distribution of density function
Definition at line 193 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
the scale parameter for DT_Scale
Definition at line 194 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
Definition at line 195 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
the table for DT_TabFunc, a sequence of pairs of numbers
Definition at line 195 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
the expression of the function for DT_ExprFunc
Definition at line 196 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
flag of conversion mode: 0=exponent, 1=cut negative
Definition at line 197 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
list of reversed edges ids
Definition at line 198 of file StdMeshers_NumberOfSegments.hxx.
|
protected |
Entry of the main object to reverse edges.
Definition at line 199 of file StdMeshers_NumberOfSegments.hxx.
|
protectedinherited |
Definition at line 118 of file SMESH_Hypothesis.hxx.
|
protectedinherited |
Definition at line 119 of file SMESH_Hypothesis.hxx.
|
protectedinherited |
Definition at line 120 of file SMESH_Hypothesis.hxx.
|
protectedinherited |
Definition at line 121 of file SMESH_Hypothesis.hxx.
|
protectedinherited |
Definition at line 52 of file SMESHDS_Hypothesis.hxx.
|
protectedinherited |
Definition at line 53 of file SMESHDS_Hypothesis.hxx.
|
protectedinherited |
Definition at line 54 of file SMESHDS_Hypothesis.hxx.