#include <SMESH_ControlsDef.hxx>
Data Structures | |
| struct | Value |
Public Types | |
| typedef std::map< Value, int > | MValues |
Public Member Functions | |
| virtual double | GetValue (long theElementId) |
| virtual double | GetValue (const TSequenceOfXYZ &thePoints) |
| virtual double | GetBadRate (double Value, int nbNodes) const |
| virtual SMDSAbs_ElementType | GetType () const |
| void | GetValues (MValues &theValues) |
| virtual void | SetMesh (const SMDS_Mesh *theMesh) |
| 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 325 of file SMESH_ControlsDef.hxx.
| typedef std::map<Value,int> SMESH.Controls.MultiConnection2D.MValues |
Definition at line 336 of file SMESH_ControlsDef.hxx.
| double MultiConnection2D::GetBadRate | ( | double | Value, |
| int | nbNodes | ||
| ) | const [virtual] |
Implements SMESH.Controls.NumericalFunctor.
Definition at line 1842 of file SMESH_Controls.cxx.
{
// meaningless as it is not quality control functor
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 MultiConnection2D::GetType | ( | ) | const [virtual] |
Implements SMESH.Controls.NumericalFunctor.
Definition at line 1848 of file SMESH_Controls.cxx.
References SMDSAbs_Face.
{
return SMDSAbs_Face;
}
| double MultiConnection2D::GetValue | ( | const TSequenceOfXYZ & | thePoints | ) | [virtual] |
Reimplemented from SMESH.Controls.NumericalFunctor.
Definition at line 1781 of file SMESH_Controls.cxx.
{
return 0;
}
| double MultiConnection2D::GetValue | ( | long | theElementId | ) | [virtual] |
Reimplemented from SMESH.Controls.NumericalFunctor.
Definition at line 1786 of file SMESH_Controls.cxx.
References SMDS_Mesh.FindElement(), SMDS_MeshElement.GetID(), SMDS_MeshNode.GetInverseElementIterator(), SMDS_MeshElement.GetType(), Max(), SMESH.Controls.NumericalFunctor.myMesh, SMDS_MeshElement.NbNodes(), SMDS_MeshElement.nodesIterator(), and SMDSAbs_Face.
{
int aResult = 0;
const SMDS_MeshElement* aFaceElem = myMesh->FindElement(theElementId);
SMDSAbs_ElementType aType = aFaceElem->GetType();
switch (aType) {
case SMDSAbs_Face:
{
int i = 0, len = aFaceElem->NbNodes();
SMDS_ElemIteratorPtr anIter = aFaceElem->nodesIterator();
if (!anIter) break;
const SMDS_MeshNode *aNode, *aNode0;
TColStd_MapOfInteger aMap, aMapPrev;
for (i = 0; i <= len; i++) {
aMapPrev = aMap;
aMap.Clear();
int aNb = 0;
if (anIter->more()) {
aNode = (SMDS_MeshNode*)anIter->next();
} else {
if (i == len)
aNode = aNode0;
else
break;
}
if (!aNode) break;
if (i == 0) aNode0 = aNode;
SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
while (anElemIter->more()) {
const SMDS_MeshElement* anElem = anElemIter->next();
if (anElem != 0 && anElem->GetType() == SMDSAbs_Face) {
int anId = anElem->GetID();
aMap.Add(anId);
if (aMapPrev.Contains(anId)) {
aNb++;
}
}
}
aResult = Max(aResult, aNb);
}
}
break;
default:
aResult = 0;
}
return aResult;
}
| void MultiConnection2D::GetValues | ( | MValues & | theValues | ) |
Definition at line 1868 of file SMESH_Controls.cxx.
References SMDS_Mesh.facesIterator(), SMDS_MeshElement.GetID(), SMDS_MeshElement.interlacedNodesElemIterator(), SMDS_MeshElement.IsQuadratic(), SMESH.Controls.NumericalFunctor.myMesh, and SMDS_MeshElement.nodesIterator().
{
SMDS_FaceIteratorPtr anIter = myMesh->facesIterator();
for(; anIter->more(); ){
const SMDS_MeshFace* anElem = anIter->next();
SMDS_ElemIteratorPtr aNodesIter;
if ( anElem->IsQuadratic() )
aNodesIter = dynamic_cast<const SMDS_VtkFace*>
(anElem)->interlacedNodesElemIterator();
else
aNodesIter = anElem->nodesIterator();
long aNodeId[3];
//int aNbConnects=0;
const SMDS_MeshNode* aNode0;
const SMDS_MeshNode* aNode1;
const SMDS_MeshNode* aNode2;
if(aNodesIter->more()){
aNode0 = (SMDS_MeshNode*) aNodesIter->next();
aNode1 = aNode0;
const SMDS_MeshNode* aNodes = (SMDS_MeshNode*) aNode1;
aNodeId[0] = aNodeId[1] = aNodes->GetID();
}
for(; aNodesIter->more(); ) {
aNode2 = (SMDS_MeshNode*) aNodesIter->next();
long anId = aNode2->GetID();
aNodeId[2] = anId;
Value aValue(aNodeId[1],aNodeId[2]);
MValues::iterator aItr = theValues.find(aValue);
if (aItr != theValues.end()){
aItr->second += 1;
//aNbConnects = nb;
}
else {
theValues[aValue] = 1;
//aNbConnects = 1;
}
//cout << "NodeIds: "<<aNodeId[1]<<","<<aNodeId[2]<<" nbconn="<<aNbConnects<<endl;
aNodeId[1] = aNodeId[2];
aNode1 = aNode2;
}
Value aValue(aNodeId[0],aNodeId[2]);
MValues::iterator aItr = theValues.find(aValue);
if (aItr != theValues.end()) {
aItr->second += 1;
//aNbConnects = nb;
}
else {
theValues[aValue] = 1;
//aNbConnects = 1;
}
//cout << "NodeIds: "<<aNodeId[0]<<","<<aNodeId[2]<<" nbconn="<<aNbConnects<<endl;
}
}
| 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().