Back to index

salome-smesh  6.5.0
Public Member Functions | Static Public Member Functions | Public Attributes
SMESH_DimHyp Class Reference

Internal structure used to find concurent submeshes. More...

Collaboration diagram for SMESH_DimHyp:
Collaboration graph

List of all members.

Public Member Functions

 SMESH_DimHyp (const SMESH_subMesh *theSubMesh, const int theDim, const TopoDS_Shape &theShape)
void SetShape (const int theDim, const TopoDS_Shape &theShape)
 set shape
bool IsConcurrent (const SMESH_DimHyp *theOther) const
 Check if sub-shape hypotheses are concurrent.

Static Public Member Functions

static bool isShareSubShapes (const TopTools_MapOfShape &theToCheck, const TopTools_MapOfShape &theToFind, const TopAbs_ShapeEnum theType)
 Check sharing of sub-shapes.
static bool checkAlgo (const SMESHDS_Hypothesis *theA1, const SMESHDS_Hypothesis *theA2)
 check algorithms

Public Attributes

int _dim
int _ownDim
 dimension of shape of _subMesh (>=_dim)
TopTools_MapOfShape _shapeMap
SMESH_subMesh * _subMesh
list< const SMESHDS_Hypothesis * > _hypothesises
 algo is first, then its parameters

Detailed Description

Internal structure used to find concurent submeshes.

It represents a pair < submesh, concurent dimension >, where 'concurrent dimension' is dimension of shape where the submesh can concurent with another submesh. In other words, it is dimension of a hypothesis assigned to submesh.

Definition at line 4360 of file SMESH_Mesh_i.cxx.

Constructor & Destructor Documentation

SMESH_DimHyp::SMESH_DimHyp ( const SMESH_subMesh *  theSubMesh,
const int  theDim,
const TopoDS_Shape &  theShape 
) [inline]


Definition at line 4371 of file SMESH_Mesh_i.cxx.

    _subMesh = (SMESH_subMesh*)theSubMesh;
    SetShape( theDim, theShape );

Here is the call graph for this function:

Member Function Documentation

static bool SMESH_DimHyp::checkAlgo ( const SMESHDS_Hypothesis *  theA1,
const SMESHDS_Hypothesis *  theA2 
) [inline, static]

check algorithms

Definition at line 4415 of file SMESH_Mesh_i.cxx.

    if ( theA1->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ||
         theA2->GetType() == SMESHDS_Hypothesis::PARAM_ALGO )
      return false; // one of the hypothesis is not algorithm
    // check algorithm names (should be equal)
    return strcmp( theA1->GetName(), theA2->GetName() ) == 0;

Here is the caller graph for this function:

bool SMESH_DimHyp::IsConcurrent ( const SMESH_DimHyp theOther) const [inline]

Check if sub-shape hypotheses are concurrent.

Definition at line 4427 of file SMESH_Mesh_i.cxx.

    if ( _subMesh == theOther->_subMesh )
      return false; // same sub-shape - should not be

    // if ( <own dim of either of submeshes> == <concurrent dim> &&
    //      any of the two submeshes is not on COMPOUND shape )
    //  -> no concurrency
    bool meIsCompound = (_subMesh->GetSubMeshDS() && _subMesh->GetSubMeshDS()->IsComplexSubmesh());
    bool otherIsCompound = (theOther->_subMesh->GetSubMeshDS() && theOther->_subMesh->GetSubMeshDS()->IsComplexSubmesh());
    if ( (_ownDim == _dim  || theOther->_ownDim == _dim ) && (!meIsCompound || !otherIsCompound))
      return false;

//     bool checkSubShape = ( _dim >= theOther->_dim )
//       ? isShareSubShapes( _shapeMap, theOther->_shapeMap, shapeTypeByDim(theOther->_dim) )
//       : isShareSubShapes( theOther->_shapeMap, _shapeMap, shapeTypeByDim(_dim) ) ;
    bool checkSubShape = isShareSubShapes( _shapeMap, theOther->_shapeMap, shapeTypeByDim(_dim));
    if ( !checkSubShape )
        return false;

    // check algorithms to be same
    if (!checkAlgo( _hypothesises.front(), theOther->_hypothesises.front() ))
      return true; // different algorithms
    // check hypothesises for concurrence (skip first as algorithm)
    int nbSame = 0;
    // pointers should be same, becase it is referenes from mesh hypothesis partition
    list <const SMESHDS_Hypothesis*>::const_iterator hypIt = _hypothesises.begin();
    list <const SMESHDS_Hypothesis*>::const_iterator otheEndIt = theOther->_hypothesises.end();
    for ( hypIt++ /*skip first as algo*/; hypIt != _hypothesises.end(); hypIt++ )
      if ( find( theOther->_hypothesises.begin(), otheEndIt, *hypIt ) != otheEndIt )
    // the submeshes are concurrent if their algorithms has different parameters
    return nbSame != theOther->_hypothesises.size() - 1;

Here is the call graph for this function:

Here is the caller graph for this function:

static bool SMESH_DimHyp::isShareSubShapes ( const TopTools_MapOfShape &  theToCheck,
const TopTools_MapOfShape &  theToFind,
const TopAbs_ShapeEnum  theType 
) [inline, static]

Check sharing of sub-shapes.

Definition at line 4395 of file SMESH_Mesh_i.cxx.

    bool isShared = false;
    TopTools_MapIteratorOfMapOfShape anItr( theToCheck );
    for (; !isShared && anItr.More(); anItr.Next() )
      const TopoDS_Shape aSubSh = anItr.Key();
      // check for case when concurrent dimensions are same
      isShared = theToFind.Contains( aSubSh );
      // check for sub-shape with concurrent dimension
      TopExp_Explorer anExp( aSubSh, theType );
      for ( ; !isShared && anExp.More(); anExp.Next() )
        isShared = theToFind.Contains( anExp.Current() );
    return isShared;

Here is the caller graph for this function:

void SMESH_DimHyp::SetShape ( const int  theDim,
const TopoDS_Shape &  theShape 
) [inline]

set shape

Definition at line 4380 of file SMESH_Mesh_i.cxx.

    _dim = theDim;
    _ownDim = (int)SMESH_Gen::GetShapeDim(theShape);
    if (_dim >= _ownDim)
      _shapeMap.Add( theShape );
    else {
      TopExp_Explorer anExp( theShape, shapeTypeByDim(theDim) );
      for( ; anExp.More(); anExp.Next() )
        _shapeMap.Add( anExp.Current() );

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation


a dimension the algo can build (concurrent dimension)

Definition at line 4364 of file SMESH_Mesh_i.cxx.

list<const SMESHDS_Hypothesis*> SMESH_DimHyp::_hypothesises

algo is first, then its parameters

Definition at line 4368 of file SMESH_Mesh_i.cxx.

dimension of shape of _subMesh (>=_dim)

Definition at line 4365 of file SMESH_Mesh_i.cxx.

TopTools_MapOfShape SMESH_DimHyp::_shapeMap

Definition at line 4366 of file SMESH_Mesh_i.cxx.

SMESH_subMesh* SMESH_DimHyp::_subMesh

Definition at line 4367 of file SMESH_Mesh_i.cxx.

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