Back to index

salome-smesh  6.5.0
Public Member Functions
SMESH::Area Interface Reference

import "SMESH_Filter.idl";

Inheritance diagram for SMESH::Area:
Inheritance graph
[legend]
Collaboration diagram for SMESH::Area:
Collaboration graph
[legend]

List of all members.

Public Member Functions

double GetValue (in long theElementId)
Histogram GetHistogram (in short nbIntervals)
 Return histogram of functor values.
void SetPrecision (in long thePrecision)
 Set precision for calculation.
long GetPrecision ()
void SetMesh (in SMESH_Mesh theMesh)
FunctorType GetFunctorType ()
ElementType GetElementType ()

Detailed Description

Definition at line 132 of file SMESH_Filter.idl.


Member Function Documentation

Here is the caller graph for this function:

void NumericalFunctor::GetHistogram ( in short  nbIntervals) [inherited]

Return histogram of functor values.

Parameters:
nbIntervals- number of intervals
nbEvents- number of mesh elements having values within i-th interval
funValues- boundaries of intervals
elements- elements to check vulue of; empty list means "of all"
minmax- boundaries of diapason of values to divide into intervals

Definition at line 323 of file SMESH_Controls.cxx.

{
  if ( nbIntervals < 1 ||
       !myMesh ||
       !myMesh->GetMeshInfo().NbElements( GetType() ))
    return;
  nbEvents.resize( nbIntervals, 0 );
  funValues.resize( nbIntervals+1 );

  // get all values sorted
  std::multiset< double > values;
  if ( elements.empty() )
  {
    SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator(GetType());
    while ( elemIt->more() )
      values.insert( GetValue( elemIt->next()->GetID() ));
  }
  else
  {
    vector<int>::const_iterator id = elements.begin();
    for ( ; id != elements.end(); ++id )
      values.insert( GetValue( *id ));
  }

  if ( minmax )
  {
    funValues[0] = minmax[0];
    funValues[nbIntervals] = minmax[1];
  }
  else
  {
    funValues[0] = *values.begin();
    funValues[nbIntervals] = *values.rbegin();
  }
  // case nbIntervals == 1
  if ( nbIntervals == 1 )
  {
    nbEvents[0] = values.size();
    return;
  }
  // case of 1 value
  if (funValues.front() == funValues.back())
  {
    nbEvents.resize( 1 );
    nbEvents[0] = values.size();
    funValues[1] = funValues.back();
    funValues.resize( 2 );
  }
  // generic case
  std::multiset< double >::iterator min = values.begin(), max;
  for ( int i = 0; i < nbIntervals; ++i )
  {
    // find end value of i-th interval
    double r = (i+1) / double( nbIntervals );
    funValues[i+1] = funValues.front() * (1-r) + funValues.back() * r;

    // count values in the i-th interval if there are any
    if ( min != values.end() && *min <= funValues[i+1] )
    {
      // find the first value out of the interval
      max = values.upper_bound( funValues[i+1] ); // max is greater than funValues[i+1], or end()
      nbEvents[i] = std::distance( min, max );
      min = max;
    }
  }
  // add values larger than minmax[1]
  nbEvents.back() += std::distance( min, values.end() );
}

Here is the call graph for this function:

long NumericalFunctor::GetPrecision ( ) [inherited]

Definition at line 283 of file SMESH_Controls.cxx.

{
  return myPrecision;
}
double NumericalFunctor::GetValue ( in long  theElementId) [inherited]

Definition at line 294 of file SMESH_Controls.cxx.

{
  double aVal = 0;

  myCurrElement = myMesh->FindElement( theId );

  TSequenceOfXYZ P;
  if ( GetPoints( theId, P ))
    aVal = Round( GetValue( P ));

  return aVal;
}

Here is the caller graph for this function:

void SMESH::Functor::SetMesh ( in SMESH_Mesh  theMesh) [inherited]
void NumericalFunctor::SetPrecision ( in long  thePrecision) [inherited]

Set precision for calculation.

It is a position after point which is used to functor value after calculation.

Definition at line 288 of file SMESH_Controls.cxx.

{
  myPrecision = thePrecision;
  myPrecisionValue = pow( 10., (double)( myPrecision ) );
}

The documentation for this interface was generated from the following file: