- if ( vol != myVolume ) {
- size_t nbShared = 0;
- if ( const SMDS_VtkVolume* v = dynamic_cast< const SMDS_VtkVolume* >( vol ))
- nIt = v->uniqueNodesIterator();
- else
- nIt = vol->nodesIterator();
- while ( nIt->more() )
- if (( nbShared += nodeSet.count( nIt->next() )) == nodeSet.size() )
- {
- if ( otherVol ) *otherVol = vol;
- return !isFree;
- }
+ if ( vol != myVolume &&
+ vol->GetNodeIndex( n2 ) >= 0 &&
+ vol->GetNodeIndex( n3 ) >= 0 )
+ {
+ if ( otherVol ) *otherVol = vol;
+ return !isFree;