#include <SMESH_ControlsDef.hxx>

Public Member Functions | |
| virtual double | GetValue (long theElementId) |
| virtual double | GetBadRate (double Value, int nbNodes) const |
| virtual SMDSAbs_ElementType | GetType () const |
| virtual void | SetMesh (const SMDS_Mesh *theMesh) |
| virtual double | GetValue (const TSequenceOfXYZ &thePoints) |
| void | GetHistogram (int nbIntervals, std::vector< int > &nbEvents, std::vector< double > &funValues, const std::vector< int > &elements, const double *minmax=0) |
| long | GetPrecision () const |
| void | SetPrecision (const long thePrecision) |
| double | Round (const double &value) |
| bool | GetPoints (const int theId, TSequenceOfXYZ &theRes) const |
Static Public Member Functions | |
| static bool | GetPoints (const SMDS_MeshElement *theElem, TSequenceOfXYZ &theRes) |
Protected Attributes | |
| const SMDS_Mesh * | myMesh |
| const SMDS_MeshElement * | myCurrElement |
| long | myPrecision |
| double | myPrecisionValue |
Definition at line 170 of file SMESH_ControlsDef.hxx.
| double MaxElementLength2D::GetBadRate | ( | double | Value, |
| int | nbNodes | ||
| ) | const [virtual] |
Implements SMESH.Controls.NumericalFunctor.
Definition at line 491 of file SMESH_Controls.cxx.
{
return Value;
}
| void SMESH.Controls.NumericalFunctor.GetHistogram | ( | int | nbIntervals, |
| std::vector< int > & | nbEvents, | ||
| std::vector< double > & | funValues, | ||
| const std::vector< int > & | elements, | ||
| const double * | minmax = 0 |
||
| ) | [inherited] |
Referenced by SaveDistribution().
| bool NumericalFunctor::GetPoints | ( | const int | theId, |
| TSequenceOfXYZ & | theRes | ||
| ) | const [inherited] |
Definition at line 228 of file SMESH_Controls.cxx.
References SMESH.Controls.TSequenceOfXYZ.clear(), SMDS_Mesh.FindElement(), and SMESH.Controls.NumericalFunctor.myMesh.
Referenced by getAngle(), SMESH.Controls.Length2D.GetValue(), SMESH.Controls.AspectRatio3D.GetValue(), SMESH.Controls.MaxElementLength3D.GetValue(), SMESH.Controls.MaxElementLength2D.GetValue(), SMESH.Controls.NumericalFunctor.GetValue(), and StdMeshers_MaxElementArea.SetParametersByMesh().
{
theRes.clear();
if ( myMesh == 0 )
return false;
return GetPoints( myMesh->FindElement( theId ), theRes );
}
| bool NumericalFunctor::GetPoints | ( | const SMDS_MeshElement * | theElem, |
| TSequenceOfXYZ & | theRes | ||
| ) | [static, inherited] |
Definition at line 239 of file SMESH_Controls.cxx.
References SMESH.Controls.TSequenceOfXYZ.clear(), SMDS_MeshElement.GetType(), SMDS_MeshElement.IsQuadratic(), SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), SMESH.Controls.TSequenceOfXYZ.push_back(), SMESH.Controls.TSequenceOfXYZ.reserve(), SMDSAbs_Edge, SMDSAbs_Face, SMDS_MeshNode.X(), SMDS_MeshNode.Y(), and SMDS_MeshNode.Z().
{
theRes.clear();
if ( anElem == 0)
return false;
theRes.reserve( anElem->NbNodes() );
// Get nodes of the element
SMDS_ElemIteratorPtr anIter;
if ( anElem->IsQuadratic() ) {
switch ( anElem->GetType() ) {
case SMDSAbs_Edge:
anIter = dynamic_cast<const SMDS_VtkEdge*>
(anElem)->interlacedNodesElemIterator();
break;
case SMDSAbs_Face:
anIter = dynamic_cast<const SMDS_VtkFace*>
(anElem)->interlacedNodesElemIterator();
break;
default:
anIter = anElem->nodesIterator();
//return false;
}
}
else {
anIter = anElem->nodesIterator();
}
if ( anIter ) {
while( anIter->more() ) {
if ( const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( anIter->next() ))
theRes.push_back( gp_XYZ( aNode->X(), aNode->Y(), aNode->Z() ) );
}
}
return true;
}
| long NumericalFunctor::GetPrecision | ( | ) | const [inherited] |
Definition at line 281 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myPrecision.
{
return myPrecision;
}
| SMDSAbs_ElementType MaxElementLength2D::GetType | ( | ) | const [virtual] |
Implements SMESH.Controls.NumericalFunctor.
Definition at line 496 of file SMESH_Controls.cxx.
References SMDSAbs_Face.
{
return SMDSAbs_Face;
}
| virtual double SMESH.Controls.NumericalFunctor.GetValue | ( | const TSequenceOfXYZ & | thePoints | ) | [virtual, inherited] |
Reimplemented in SMESH.Controls.MinimumAngle, SMESH.Controls.AspectRatio, SMESH.Controls.AspectRatio3D, SMESH.Controls.Warping, SMESH.Controls.Taper, SMESH.Controls.Skew, SMESH.Controls.Area, SMESH.Controls.Length, SMESH.Controls.MultiConnection, and SMESH.Controls.MultiConnection2D.
Definition at line 129 of file SMESH_ControlsDef.hxx.
{ return -1.0;};
| double MaxElementLength2D::GetValue | ( | long | theElementId | ) | [virtual] |
Reimplemented from SMESH.Controls.NumericalFunctor.
Definition at line 435 of file SMESH_Controls.cxx.
References SMDS_Mesh.FindElement(), SMESH.Controls.NumericalFunctor.GetPoints(), SMDS_MeshElement.GetType(), Max(), SMESH.Controls.NumericalFunctor.myMesh, SMESH.Controls.NumericalFunctor.myPrecision, SMESH.Controls.TSequenceOfXYZ.size(), and SMDSAbs_Face.
{
TSequenceOfXYZ P;
if( GetPoints( theElementId, P ) ) {
double aVal = 0;
const SMDS_MeshElement* aElem = myMesh->FindElement( theElementId );
SMDSAbs_ElementType aType = aElem->GetType();
int len = P.size();
switch( aType ) {
case SMDSAbs_Face:
if( len == 3 ) { // triangles
double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 1 ));
aVal = Max(L1,Max(L2,L3));
break;
}
else if( len == 4 ) { // quadrangles
double L1 = getDistance(P( 1 ),P( 2 ));
double L2 = getDistance(P( 2 ),P( 3 ));
double L3 = getDistance(P( 3 ),P( 4 ));
double L4 = getDistance(P( 4 ),P( 1 ));
double D1 = getDistance(P( 1 ),P( 3 ));
double D2 = getDistance(P( 2 ),P( 4 ));
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2));
break;
}
else if( len == 6 ) { // quadratic triangles
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
aVal = Max(L1,Max(L2,L3));
break;
}
else if( len == 8 ) { // quadratic quadrangles
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
double D1 = getDistance(P( 1 ),P( 5 ));
double D2 = getDistance(P( 3 ),P( 7 ));
aVal = Max(Max(Max(L1,L2),Max(L3,L4)),Max(D1,D2));
break;
}
}
if( myPrecision >= 0 )
{
double prec = pow( 10., (double)myPrecision );
aVal = floor( aVal * prec + 0.5 ) / prec;
}
return aVal;
}
return 0.;
}
| double NumericalFunctor::Round | ( | const double & | value | ) | [inherited] |
Definition at line 305 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myPrecision, and SMESH.Controls.NumericalFunctor.myPrecisionValue.
Referenced by SMESH.Controls.AspectRatio3D.GetValue(), and SMESH.Controls.NumericalFunctor.GetValue().
{
return ( myPrecision >= 0 ) ? floor( aVal * myPrecisionValue + 0.5 ) / myPrecisionValue : aVal;
}
| void NumericalFunctor::SetMesh | ( | const SMDS_Mesh * | theMesh | ) | [virtual, inherited] |
Implements SMESH.Controls.Functor.
Definition at line 223 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myMesh.
{
myMesh = theMesh;
}
| void NumericalFunctor::SetPrecision | ( | const long | thePrecision | ) | [inherited] |
Definition at line 286 of file SMESH_Controls.cxx.
References SMESH.Controls.NumericalFunctor.myPrecision, and SMESH.Controls.NumericalFunctor.myPrecisionValue.
Referenced by SMESH_ActorDef.SetControlMode().
{
myPrecision = thePrecision;
myPrecisionValue = pow( 10., (double)( myPrecision ) );
}
const SMDS_MeshElement* SMESH.Controls.NumericalFunctor.myCurrElement [protected, inherited] |
Definition at line 147 of file SMESH_ControlsDef.hxx.
Referenced by SMESH.Controls.AspectRatio3D.GetValue(), and SMESH.Controls.NumericalFunctor.GetValue().
const SMDS_Mesh* SMESH.Controls.NumericalFunctor.myMesh [protected, inherited] |
Definition at line 146 of file SMESH_ControlsDef.hxx.
Referenced by SMESH.Controls.BadOrientedVolume.BadOrientedVolume(), SMESH.Controls.FreeBorders.FreeBorders(), SMESH.Controls.FreeEdges.FreeEdges(), SMESH.Controls.NumericalFunctor.GetPoints(), SMESH.Controls.MultiConnection2D.GetValue(), SMESH.Controls.MultiConnection.GetValue(), SMESH.Controls.Length2D.GetValue(), SMESH.Controls.AspectRatio3D.GetValue(), SMESH.Controls.MaxElementLength3D.GetValue(), SMESH.Controls.MaxElementLength2D.GetValue(), SMESH.Controls.Volume.GetValue(), SMESH.Controls.NumericalFunctor.GetValue(), SMESH.Controls.MultiConnection2D.GetValues(), SMESH.Controls.Length2D.GetValues(), SMESH.Controls.FreeEdges.IsSatisfy(), SMESH.Controls.FreeBorders.IsSatisfy(), SMESH.Controls.OverConstrainedFace.IsSatisfy(), SMESH.Controls.OverConstrainedVolume.IsSatisfy(), SMESH.Controls.BareBorderFace.IsSatisfy(), SMESH.Controls.BareBorderVolume.IsSatisfy(), SMESH.Controls.BadOrientedVolume.IsSatisfy(), SMESH.Controls.FreeEdges.SetMesh(), SMESH.Controls.FreeBorders.SetMesh(), SMESH.Controls.BadOrientedVolume.SetMesh(), and SMESH.Controls.NumericalFunctor.SetMesh().
long SMESH.Controls.NumericalFunctor.myPrecision [protected, inherited] |
Definition at line 148 of file SMESH_ControlsDef.hxx.
Referenced by SMESH.Controls.NumericalFunctor.GetPrecision(), SMESH.Controls.Length2D.GetValue(), SMESH.Controls.MaxElementLength3D.GetValue(), SMESH.Controls.MaxElementLength2D.GetValue(), SMESH.Controls.NumericalFunctor.NumericalFunctor(), SMESH.Controls.NumericalFunctor.Round(), and SMESH.Controls.NumericalFunctor.SetPrecision().
double SMESH.Controls.NumericalFunctor.myPrecisionValue [protected, inherited] |
Definition at line 149 of file SMESH_ControlsDef.hxx.
Referenced by SMESH.Controls.NumericalFunctor.Round(), and SMESH.Controls.NumericalFunctor.SetPrecision().