From: eap Date: Sat, 6 May 2006 06:29:15 +0000 (+0000) Subject: Fix Quadrangle and Triangle filters for quadratic elements X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d3af61ce33655f3d283a90bb7a4954d1aed3e133;p=modules%2Fsmesh.git Fix Quadrangle and Triangle filters for quadratic elements --- diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index 19b3fcb1a..e1c486fd7 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -225,7 +225,8 @@ bool SMESHGUI_QuadrangleFilter::IsValid( const int theCellId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 4; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 8 : 4 )); } //======================================================================= @@ -244,7 +245,8 @@ bool SMESHGUI_QuadrangleFilter::IsObjValid( const int theObjId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 4; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 8 : 4 )); } //======================================================================= @@ -302,7 +304,8 @@ bool SMESHGUI_TriangleFilter::IsValid( const int theCellId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 3; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 6 : 3 )); } //======================================================================= @@ -321,7 +324,8 @@ bool SMESHGUI_TriangleFilter::IsObjValid( const int theObjId ) const SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh(); const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId ); - return anElem && anElem->GetType() == SMDSAbs_Face && anElem->NbNodes() == 3; + return anElem && anElem->GetType() == SMDSAbs_Face && + ( anElem->NbNodes() == ( anElem->IsQuadratic() ? 6 : 3 )); } //=======================================================================