+/*
+ Class : SMESHGUI_FacesFilter
+ Description : Verify whether selected cell is any face
+*/
+
+
+//=======================================================================
+// name : SMESHGUI_FacesFilter::SMESHGUI_FacesFilter
+// Purpose : Constructor
+//=======================================================================
+SMESHGUI_FacesFilter::SMESHGUI_FacesFilter()
+: SMESHGUI_Filter()
+{
+}
+
+SMESHGUI_FacesFilter::~SMESHGUI_FacesFilter()
+{
+}
+
+//=======================================================================
+// name : SMESHGUI_FacesFilter::IsValid
+// Purpose : Verify whether selected cell is face
+//=======================================================================
+bool SMESHGUI_FacesFilter::IsValid( const int theCellId ) const
+{
+ if ( myActor == 0 )
+ return false;
+
+ SMESH_Actor* anActor = ( SMESH_Actor* )myActor;
+ if ( anActor->GetObject() == 0 )
+ return false;
+
+ SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
+ const SMDS_MeshElement* anElem = aMesh->FindElement( anActor->GetElemObjId( theCellId ) );
+
+ return anElem && anElem->GetType() == SMDSAbs_Face;
+}
+
+//=======================================================================
+// name : SMESHGUI_FacesFilter::IsValid
+// Purpose : Verify whether selected cell is face
+//=======================================================================
+bool SMESHGUI_FacesFilter::IsObjValid( const int theObjId ) const
+{
+ if ( myActor == 0 )
+ return false;
+
+ SMESH_Actor* anActor = ( SMESH_Actor* )myActor;
+ if ( anActor->GetObject() == 0 )
+ return false;
+
+ SMDS_Mesh* aMesh = anActor->GetObject()->GetMesh();
+ const SMDS_MeshElement* anElem = aMesh->FindElement( theObjId );
+
+ return anElem && anElem->GetType() == SMDSAbs_Face;
+}
+
+//=======================================================================
+// name : SMESHGUI_FacesFilter::GetId
+// Purpose : Get ID of the filter. Must return value from SMESHGUI_FilterType
+// enumeration. All filters must have different ids
+//=======================================================================
+int SMESHGUI_FacesFilter::GetId() const
+{
+ return SMESH::FaceFilter;
+}
+
+//=======================================================================
+// name : SMESHGUI_FacesFilter::IsNodeFilter
+// Purpose : Returns true if filter is intended for nodes
+//=======================================================================
+bool SMESHGUI_FacesFilter::IsNodeFilter() const
+{
+ return false;
+}
+