52447: Re-compute fails after hypothesis modification

This commit is contained in:
eap 2014-07-08 16:07:52 +04:00
parent 05bdac9259
commit bd39d7c3ed
3 changed files with 63 additions and 15 deletions

View File

@ -2299,16 +2299,31 @@ void SMESH_subMesh::setEventListener(EventListener* listener,
/*!
* \brief Return an event listener data
* \param listener - the listener whose data is
* \param myOwn - if \c true, returns a listener set by this sub-mesh,
* else returns a listener listening to events of this sub-mesh
* \retval EventListenerData* - found data, maybe NULL
*/
//================================================================================
EventListenerData* SMESH_subMesh::GetEventListenerData(EventListener* listener) const
EventListenerData* SMESH_subMesh::GetEventListenerData(EventListener* listener,
const bool myOwn) const
{
if ( myOwn )
{
list< OwnListenerData >::const_iterator d;
for ( d = _ownListeners.begin(); d != _ownListeners.end(); ++d )
{
if ( d->myListener == listener && _father->MeshExists( d->myMeshID ))
return d->mySubMesh->GetEventListenerData( listener, !myOwn );
}
}
else
{
map< EventListener*, EventListenerData* >::const_iterator l_d =
_eventListeners.find( listener );
if ( l_d != _eventListeners.end() )
return l_d->second;
}
return 0;
}
@ -2316,16 +2331,31 @@ EventListenerData* SMESH_subMesh::GetEventListenerData(EventListener* listener)
/*!
* \brief Return an event listener data
* \param listenerName - the listener name
* \param myOwn - if \c true, returns a listener set by this sub-mesh,
* else returns a listener listening to events of this sub-mesh
* \retval EventListenerData* - found data, maybe NULL
*/
//================================================================================
EventListenerData* SMESH_subMesh::GetEventListenerData(const string& listenerName) const
EventListenerData* SMESH_subMesh::GetEventListenerData(const string& listenerName,
const bool myOwn) const
{
if ( myOwn )
{
list< OwnListenerData >::const_iterator d;
for ( d = _ownListeners.begin(); d != _ownListeners.end(); ++d )
{
if ( _father->MeshExists( d->myMeshID ) && listenerName == d->myListener->GetName())
return d->mySubMesh->GetEventListenerData( listenerName, !myOwn );
}
}
else
{
map< EventListener*, EventListenerData* >::const_iterator l_d = _eventListeners.begin();
for ( ; l_d != _eventListeners.end(); ++l_d )
if ( listenerName == l_d->first->GetName() )
return l_d->second;
}
return 0;
}

View File

@ -139,16 +139,22 @@ class SMESH_EXPORT SMESH_subMesh
/*!
* \brief Return an event listener data
* \param listener - the listener whose data is
* \param myOwn - if \c true, returns a listener set by this sub-mesh,
* else returns a listener listening to events of this sub-mesh
* \retval EventListenerData* - found data, maybe NULL
*/
EventListenerData* GetEventListenerData(EventListener* listener) const;
EventListenerData* GetEventListenerData(EventListener* listener,
const bool myOwn=false) const;
/*!
* \brief Return an event listener data
* \param listenerName - the listener name
* \param myOwn - if \c true, returns a listener set by this sub-mesh,
* else returns a listener listening to events of this sub-mesh
* \retval EventListenerData* - found data, maybe NULL
*/
EventListenerData* GetEventListenerData(const std::string& listenerName) const;
EventListenerData* GetEventListenerData(const std::string& listenerName,
const bool myOwn=false) const;
/*!
* \brief Unregister the listener and delete it and it's data

View File

@ -2382,6 +2382,17 @@ void StdMeshers_ProjectionUtils::SetEventListener(SMESH_subMesh* subMesh,
}
}
else
{
if ( SMESH_subMeshEventListenerData* data =
srcShapeSM->GetEventListenerData( getSrcSubMeshListener() ))
{
bool alreadyIn =
(std::find( data->mySubMeshes.begin(),
data->mySubMeshes.end(), subMesh ) != data->mySubMeshes.end() );
if ( !alreadyIn )
data->mySubMeshes.push_back( subMesh );
}
else
{
subMesh->SetEventListener( getSrcSubMeshListener(),
SMESH_subMeshEventListenerData::MakeData( subMesh ),
@ -2390,3 +2401,4 @@ void StdMeshers_ProjectionUtils::SetEventListener(SMESH_subMesh* subMesh,
}
}
}
}