From: eap Date: Wed, 8 Jun 2011 09:06:21 +0000 (+0000) Subject: 0021294: EDF 1890 : Problem with groups on geometry when dealing with split into... X-Git-Tag: V6_3_1rc1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fd4ce1d3b0dc5b9d3a116ffb1700501ee7fd1213;p=modules%2Fsmesh.git 0021294: EDF 1890 : Problem with groups on geometry when dealing with split into tetrahedra fix "Fatal error" at attempt to select a geom object in VTK viewer when a "split into tetrahedra" dialog is open --- diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index 6c0570903..4cf3f91b0 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -107,8 +107,8 @@ bool SMESHGUI_PredicateFilter::IsObjValid( const int theObjId ) const if ( myActor == 0 || myPred->_is_nil() ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -211,8 +211,8 @@ bool SMESHGUI_QuadrangleFilter::IsValid( const int theCellId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -231,8 +231,8 @@ bool SMESHGUI_QuadrangleFilter::IsObjValid( const int theObjId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -290,8 +290,8 @@ bool SMESHGUI_TriangleFilter::IsValid( const int theCellId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -310,8 +310,8 @@ bool SMESHGUI_TriangleFilter::IsObjValid( const int theObjId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -368,8 +368,8 @@ bool SMESHGUI_FacesFilter::IsValid( const int theCellId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -387,8 +387,8 @@ bool SMESHGUI_FacesFilter::IsObjValid( const int theObjId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -442,11 +442,11 @@ SMESHGUI_VolumesFilter::~SMESHGUI_VolumesFilter() //======================================================================= bool SMESHGUI_VolumesFilter::IsValid( const int theCellId ) const { - if ( myActor == 0 ) + if ( myActor == 0 || theCellId < 1 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); @@ -464,8 +464,8 @@ bool SMESHGUI_VolumesFilter::IsObjValid( const int theObjId ) const if ( myActor == 0 ) return false; - SMESH_Actor* anActor = ( SMESH_Actor* )myActor; - if ( anActor->GetObject() == 0 ) + SMESH_Actor* anActor = dynamic_cast< SMESH_Actor* >( myActor ); + if ( !anActor || anActor->GetObject() == 0 ) return false; SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();