#include <StdMeshers_Arithmetic1D.hxx>

Public Types | |
| 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_Arithmetic1D (int hypId, int studyId, SMESH_Gen *gen) | |
| virtual | ~StdMeshers_Arithmetic1D () |
| void | SetLength (double length, bool isStartLength) throw (SALOME_Exception) |
| double | GetLength (bool isStartLength) const |
| void | SetReversedEdges (std::vector< int > &ids) |
| void | SetObjectEntry (const char *entry) |
| const char * | GetObjectEntry () |
| const std::vector< int > & | GetReversedEdges () const |
| virtual std::ostream & | SaveTo (std::ostream &save) |
| virtual std::istream & | LoadFrom (std::istream &load) |
| virtual bool | SetParametersByMesh (const SMESH_Mesh *theMesh, const TopoDS_Shape &theShape) |
| Initialize start and end length 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 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. | |
| SMESH_Mesh * | GetMeshByPersistentID (int id) |
| Find a mesh with given persistent ID. | |
| const char * | GetName () const |
| int | GetID () const |
| int | GetType () const |
| virtual bool | operator== (const SMESHDS_Hypothesis &other) const |
| Equality. | |
| bool | operator!= (const SMESHDS_Hypothesis &other) const |
Static Public Member Functions | |
| static bool | IsStatusFatal (Hypothesis_Status theStatus) |
Protected Attributes | |
| double | _begLength |
| double | _endLength |
| std::vector< int > | _edgeIDs |
| std::string | _objEntry |
| 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_Arithmetic1D &hyp) |
| std::istream & | operator>> (std::istream &load, StdMeshers_Arithmetic1D &hyp) |
Definition at line 40 of file StdMeshers_Arithmetic1D.hxx.
enum SMESH_Hypothesis::Hypothesis_Status [inherited] |
Definition at line 50 of file SMESH_Hypothesis.hxx.
{
HYP_OK = 0,
HYP_MISSING, // algo misses a hypothesis
HYP_CONCURENT, // several applicable hypotheses
HYP_BAD_PARAMETER,// hypothesis has a bad parameter value
HYP_HIDDEN_ALGO, // an algo is hidden by an upper dim algo generating all-dim elements
HYP_HIDING_ALGO, // an algo hides lower dim algos by generating all-dim elements
HYP_UNKNOWN_FATAL,// --- all statuses below should be considered as fatal
// for Add/RemoveHypothesis operations
HYP_INCOMPATIBLE, // hypothesis does not fit algo
HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis
HYP_ALREADY_EXIST,// such hypothesis already exist
HYP_BAD_DIM, // bad dimension
HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group
HYP_BAD_GEOMETRY, // shape geometry mismatches algorithm's expectation
HYP_NEED_SHAPE // algorithm can work on shape only
};
enum SMESHDS_Hypothesis::hypothesis_type [inherited] |
Definition at line 53 of file SMESHDS_Hypothesis.hxx.
{PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D};
Definition at line 51 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, _endLength, SMESHDS_Hypothesis._name, and SMESH_Hypothesis._param_algo_dim.
:SMESH_Hypothesis(hypId, studyId, gen) { _begLength = 1.; _endLength = 10.; _name = "Arithmetic1D"; _param_algo_dim = 1; }
| StdMeshers_Arithmetic1D::~StdMeshers_Arithmetic1D | ( | ) | [virtual] |
Definition at line 66 of file StdMeshers_Arithmetic1D.cxx.
{
}
| void SMESH_Hypothesis.ClearParameters | ( | ) | [inherited] |
| int SMESH_Hypothesis::GetDim | ( | ) | const [virtual, inherited] |
Definition at line 74 of file SMESH_Hypothesis.cxx.
{
int dim = 0;
switch (_type)
{
case ALGO_1D: dim = 1; break;
case ALGO_2D: dim = 2; break;
case ALGO_3D: dim = 3; break;
case PARAM_ALGO:
dim = ( _param_algo_dim < 0 ) ? -_param_algo_dim : _param_algo_dim; break;
}
return dim;
}
| int SMESHDS_Hypothesis::GetID | ( | ) | const [inherited] |
Definition at line 73 of file SMESHDS_Hypothesis.cxx.
Referenced by SMESHDS_Document.AddHypothesis(), and SMESH_Mesh_i.GetHypothesisList().
{
return _hypId;
}
| char* SMESH_Hypothesis.GetLastParameters | ( | ) | const [inherited] |
| double StdMeshers_Arithmetic1D::GetLength | ( | bool | isStartLength | ) | const |
Definition at line 97 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, and _endLength.
{
return isStartLength ? _begLength : _endLength;
}
| virtual const char* SMESH_Hypothesis.GetLibName | ( | ) | const [virtual, inherited] |
| SMESH_Mesh * SMESH_Hypothesis::GetMeshByPersistentID | ( | int | id | ) | [inherited] |
Find a mesh with given persistent ID.
Definition at line 160 of file SMESH_Hypothesis.cxx.
References studyContextStruct.mapMesh, and PAL_MESH_041_mesh.mesh.
{
StudyContextStruct* myStudyContext = _gen->GetStudyContext(_studyId);
map<int, SMESH_Mesh*>::iterator itm = itm = myStudyContext->mapMesh.begin();
for ( ; itm != myStudyContext->mapMesh.end(); itm++)
{
SMESH_Mesh* mesh = (*itm).second;
if ( mesh->GetMeshDS()->GetPersistentId() == id )
return mesh;
}
return 0;
}
| const char * SMESHDS_Hypothesis::GetName | ( | ) | const [inherited] |
Definition at line 62 of file SMESHDS_Hypothesis.cxx.
Referenced by SMESH_DimHyp.checkAlgo(), StdMeshers_Quadrangle_2D.CheckHypothesis(), and StdMeshers_Projection_3D.CheckHypothesis().
{
return _name.c_str();
}
| const char* StdMeshers_Arithmetic1D.GetObjectEntry | ( | ) |
Definition at line 55 of file StdMeshers_Arithmetic1D.hxx.
{ return _objEntry.c_str(); }
| char* SMESH_Hypothesis.GetParameters | ( | ) | const [inherited] |
| const std::vector<int>& StdMeshers_Arithmetic1D.GetReversedEdges | ( | ) | const |
Definition at line 57 of file StdMeshers_Arithmetic1D.hxx.
{ return _edgeIDs; }
| int SMESH_Hypothesis::GetShapeType | ( | ) | const [virtual, inherited] |
Definition at line 94 of file SMESH_Hypothesis.cxx.
{
return _shapeType;
}
| int SMESH_Hypothesis.GetStudyId | ( | ) | const [inherited] |
| int SMESHDS_Hypothesis::GetType | ( | ) | const [inherited] |
Definition at line 84 of file SMESHDS_Hypothesis.cxx.
Referenced by SMESH_DimHyp.checkAlgo(), checkConformIgnoredAlgos(), SMESH_Hypothesis.IsAuxiliary(), and SMESH_Mesh.IsUsedHypothesis().
{
return _type;
}
| virtual bool SMESH_Hypothesis.IsAuxiliary | ( | ) | const [virtual, inherited] |
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.
References SMESHDS_Hypothesis.GetType().
{ return GetType() == PARAM_ALGO && _param_algo_dim < 0; }
| static bool SMESH_Hypothesis.IsStatusFatal | ( | Hypothesis_Status | theStatus | ) | [static, inherited] |
Definition at line 68 of file SMESH_Hypothesis.hxx.
References SMESH.HYP_UNKNOWN_FATAL.
Referenced by SMESH_Mesh_i.addHypothesis(), SMESH_Mesh_i.AddHypothesis(), SMESH_Mesh.AddHypothesis(), SMESH_subMesh.AlgoStateEngine(), SMESH_Mesh_i.RemoveHypothesis(), and SMESH_Mesh.RemoveHypothesis().
{ return theStatus >= HYP_UNKNOWN_FATAL; }
| istream & StdMeshers_Arithmetic1D::LoadFrom | ( | std::istream & | load | ) | [virtual] |
Implements SMESHDS_Hypothesis.
Definition at line 143 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, _edgeIDs, _endLength, and _objEntry.
Referenced by operator>>().
{
bool isOK = true;
int intVal;
isOK = (load >> _begLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
isOK = (load >> _endLength);
if (!isOK)
load.clear(ios::badbit | load.rdstate());
isOK = (load >> intVal);
if (isOK && intVal > 0) {
_edgeIDs.reserve( intVal );
for (int i = 0; i < _edgeIDs.capacity() && isOK; i++) {
isOK = (load >> intVal);
if ( isOK ) _edgeIDs.push_back( intVal );
}
isOK = (load >> _objEntry);
}
return load;
}
| virtual void SMESH_Hypothesis.NotifySubMeshesHypothesisModification | ( | ) | [virtual, inherited] |
| bool SMESHDS_Hypothesis.operator!= | ( | const SMESHDS_Hypothesis & | other | ) | const [inherited] |
Definition at line 51 of file SMESHDS_Hypothesis.hxx.
{ return !(*this==other); }
| bool SMESHDS_Hypothesis::operator== | ( | const SMESHDS_Hypothesis & | other | ) | const [virtual, inherited] |
Equality.
Definition at line 95 of file SMESHDS_Hypothesis.cxx.
References SMESHDS_Hypothesis._name.
{
if ( this == &other )
return true;
if ( _name != other._name )
return false;
ostringstream mySave, otherSave;
((SMESHDS_Hypothesis*)this )->SaveTo(mySave);
((SMESHDS_Hypothesis*)&other)->SaveTo(otherSave);
return mySave.str() == otherSave.str();
}
| ostream & StdMeshers_Arithmetic1D::SaveTo | ( | std::ostream & | save | ) | [virtual] |
Implements SMESHDS_Hypothesis.
Definition at line 123 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, _edgeIDs, _endLength, and _objEntry.
Referenced by operator<<().
{
int listSize = _edgeIDs.size();
save << _begLength << " " << _endLength << " " << listSize;
if ( listSize > 0 ) {
for ( int i = 0; i < listSize; i++)
save << " " << _edgeIDs[i];
save << " " << _objEntry;
}
return save;
}
| void SMESH_Hypothesis::SetLastParameters | ( | const char * | theParameters | ) | [inherited] |
Definition at line 224 of file SMESH_Hypothesis.cxx.
{
_lastParameters = string(theParameters);
}
| void StdMeshers_Arithmetic1D::SetLength | ( | double | length, |
| bool | isStartLength | ||
| ) | throw (SALOME_Exception) |
Definition at line 76 of file StdMeshers_Arithmetic1D.cxx.
{
if ( (isStartLength ? _begLength : _endLength) != length ) {
if (length <= 0)
throw SALOME_Exception(LOCALIZED("length must be positive"));
if ( isStartLength )
_begLength = length;
else
_endLength = length;
NotifySubMeshesHypothesisModification();
}
}
| void SMESH_Hypothesis.SetLibName | ( | const char * | theLibName | ) | [inherited] |
| void StdMeshers_Arithmetic1D.SetObjectEntry | ( | const char * | entry | ) |
Definition at line 53 of file StdMeshers_Arithmetic1D.hxx.
{ _objEntry = entry; }
| void SMESH_Hypothesis::SetParameters | ( | const char * | theParameters | ) | [inherited] |
Definition at line 178 of file SMESH_Hypothesis.cxx.
{
string aNewParameters(theParameters);
if(aNewParameters.size()==0 && _parameters.size()==0)
aNewParameters = " ";
if(_parameters.size()>0)
_parameters +="|";
_parameters +=aNewParameters;
SetLastParameters(theParameters);
}
| bool StdMeshers_Arithmetic1D::SetParametersByDefaults | ( | const TDefaults & | dflts, |
| const SMESH_Mesh * | theMesh = 0 |
||
| ) | [virtual] |
Initialize my parameter values by default parameters.
| bool | - true if parameter values have been successfully defined |
Implements SMESH_Hypothesis.
Definition at line 243 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, SMESH_Hypothesis.TDefaults._elemLength, and _endLength.
{
return ( _begLength = _endLength = dflts._elemLength );
}
| bool StdMeshers_Arithmetic1D::SetParametersByMesh | ( | const SMESH_Mesh * | theMesh, |
| const TopoDS_Shape & | theShape | ||
| ) | [virtual] |
Initialize start and end length 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.
Definition at line 199 of file StdMeshers_Arithmetic1D.cxx.
References _begLength, _endLength, SMESH_test.edge, SMESH_Algo.GetNodeParamOnEdge(), and Handle().
{
if ( !theMesh || theShape.IsNull() )
return false;
_begLength = _endLength = 0.;
Standard_Real UMin, UMax;
TopLoc_Location L;
int nbEdges = 0;
TopTools_IndexedMapOfShape edgeMap;
TopExp::MapShapes( theShape, TopAbs_EDGE, edgeMap );
for ( int i = 1; i <= edgeMap.Extent(); ++i )
{
const TopoDS_Edge& edge = TopoDS::Edge( edgeMap( i ));
Handle(Geom_Curve) C = BRep_Tool::Curve(edge, L, UMin, UMax);
GeomAdaptor_Curve AdaptCurve(C);
vector< double > params;
SMESHDS_Mesh* aMeshDS = const_cast< SMESH_Mesh* >( theMesh )->GetMeshDS();
if ( SMESH_Algo::GetNodeParamOnEdge( aMeshDS, edge, params ))
{
nbEdges++;
_begLength += GCPnts_AbscissaPoint::Length( AdaptCurve, params[0], params[1]);
int nb = params.size();
_endLength += GCPnts_AbscissaPoint::Length( AdaptCurve, params[nb-2], params[nb-1]);
}
}
if ( nbEdges ) {
_begLength /= nbEdges;
_endLength /= nbEdges;
}
return nbEdges;
}
| void StdMeshers_Arithmetic1D::SetReversedEdges | ( | std::vector< int > & | ids | ) |
Definition at line 108 of file StdMeshers_Arithmetic1D.cxx.
References _edgeIDs, SMESH_test.ids, and SMESH_Hypothesis.NotifySubMeshesHypothesisModification().
{
if ( ids != _edgeIDs ) {
_edgeIDs = ids;
NotifySubMeshesHypothesisModification();
}
}
| std::ostream& operator<< | ( | std::ostream & | save, |
| StdMeshers_Arithmetic1D & | hyp | ||
| ) | [friend] |
Definition at line 174 of file StdMeshers_Arithmetic1D.cxx.
{
return hyp.SaveTo( save );
}
| std::istream& operator>> | ( | std::istream & | load, |
| StdMeshers_Arithmetic1D & | hyp | ||
| ) | [friend] |
Definition at line 185 of file StdMeshers_Arithmetic1D.cxx.
{
return hyp.LoadFrom( load );
}
double StdMeshers_Arithmetic1D._begLength [protected] |
Definition at line 79 of file StdMeshers_Arithmetic1D.hxx.
Referenced by GetLength(), LoadFrom(), SaveTo(), SetParametersByDefaults(), SetParametersByMesh(), and StdMeshers_Arithmetic1D().
std::vector<int> StdMeshers_Arithmetic1D._edgeIDs [protected] |
Definition at line 80 of file StdMeshers_Arithmetic1D.hxx.
Referenced by LoadFrom(), SaveTo(), and SetReversedEdges().
double StdMeshers_Arithmetic1D._endLength [protected] |
Definition at line 79 of file StdMeshers_Arithmetic1D.hxx.
Referenced by GetLength(), LoadFrom(), SaveTo(), SetParametersByDefaults(), SetParametersByMesh(), and StdMeshers_Arithmetic1D().
SMESH_Gen* SMESH_Hypothesis._gen [protected, inherited] |
Definition at line 123 of file SMESH_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis().
int SMESHDS_Hypothesis._hypId [protected, inherited] |
Definition at line 57 of file SMESHDS_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis().
std::string SMESHDS_Hypothesis._name [protected, inherited] |
Definition at line 56 of file SMESHDS_Hypothesis.hxx.
Referenced by SMESHDS_Hypothesis.operator==(), StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength.StdMeshers_AutomaticLength(), StdMeshers_Deflection1D.StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D.StdMeshers_FixedPoints1D(), StdMeshers_ImportSource1D.StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D.StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution.StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D.StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges.StdMeshers_LengthFromEdges(), StdMeshers_LocalLength.StdMeshers_LocalLength(), StdMeshers_MaxElementArea.StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume.StdMeshers_MaxElementVolume(), StdMeshers_MaxLength.StdMeshers_MaxLength(), StdMeshers_NotConformAllowed.StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers.StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D.StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments.StdMeshers_NumberOfSegments(), StdMeshers_ProjectionSource1D.StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D.StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D.StdMeshers_ProjectionSource3D(), StdMeshers_Propagation.StdMeshers_Propagation(), StdMeshers_QuadrangleParams.StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference.StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh.StdMeshers_QuadraticMesh(), StdMeshers_StartEndLength.StdMeshers_StartEndLength(), StdMeshers_TrianglePreference.StdMeshers_TrianglePreference(), and StdMeshers_ViscousLayers.StdMeshers_ViscousLayers().
std::string StdMeshers_Arithmetic1D._objEntry [protected] |
Definition at line 81 of file StdMeshers_Arithmetic1D.hxx.
Referenced by LoadFrom(), and SaveTo().
int SMESH_Hypothesis._param_algo_dim [protected, inherited] |
Definition at line 126 of file SMESH_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis(), StdMeshers_Arithmetic1D(), StdMeshers_AutomaticLength.StdMeshers_AutomaticLength(), StdMeshers_Deflection1D.StdMeshers_Deflection1D(), StdMeshers_FixedPoints1D.StdMeshers_FixedPoints1D(), StdMeshers_ImportSource1D.StdMeshers_ImportSource1D(), StdMeshers_ImportSource2D.StdMeshers_ImportSource2D(), StdMeshers_LayerDistribution.StdMeshers_LayerDistribution(), StdMeshers_LayerDistribution2D.StdMeshers_LayerDistribution2D(), StdMeshers_LengthFromEdges.StdMeshers_LengthFromEdges(), StdMeshers_LocalLength.StdMeshers_LocalLength(), StdMeshers_MaxElementArea.StdMeshers_MaxElementArea(), StdMeshers_MaxElementVolume.StdMeshers_MaxElementVolume(), StdMeshers_MaxLength.StdMeshers_MaxLength(), StdMeshers_NotConformAllowed.StdMeshers_NotConformAllowed(), StdMeshers_NumberOfLayers.StdMeshers_NumberOfLayers(), StdMeshers_NumberOfLayers2D.StdMeshers_NumberOfLayers2D(), StdMeshers_NumberOfSegments.StdMeshers_NumberOfSegments(), StdMeshers_ProjectionSource1D.StdMeshers_ProjectionSource1D(), StdMeshers_ProjectionSource2D.StdMeshers_ProjectionSource2D(), StdMeshers_ProjectionSource3D.StdMeshers_ProjectionSource3D(), StdMeshers_Propagation.StdMeshers_Propagation(), StdMeshers_QuadrangleParams.StdMeshers_QuadrangleParams(), StdMeshers_QuadranglePreference.StdMeshers_QuadranglePreference(), StdMeshers_QuadraticMesh.StdMeshers_QuadraticMesh(), StdMeshers_StartEndLength.StdMeshers_StartEndLength(), StdMeshers_TrianglePreference.StdMeshers_TrianglePreference(), and StdMeshers_ViscousLayers.StdMeshers_ViscousLayers().
int SMESH_Hypothesis._shapeType [protected, inherited] |
Definition at line 125 of file SMESH_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis().
int SMESH_Hypothesis._studyId [protected, inherited] |
Definition at line 124 of file SMESH_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis().
int SMESHDS_Hypothesis._type [protected, inherited] |
Definition at line 58 of file SMESHDS_Hypothesis.hxx.
Referenced by SMESH_Hypothesis.SMESH_Hypothesis().