+//================================================================================
+/*!
+ * \brief check compatibility of the geometry
+ * \param theAlgoData - to select hypos able to be used by this algo
+ * \param theCurrentGeomToSelect - the current name of the selected geometry
+ * \param theGeomVar - currently selected geometry
+ * \retval bool - check result
+ */
+//================================================================================
+bool SMESHGUI_MeshOp::isCompatibleToGeometry(HypothesisData* theAlgoData,
+ QString theCurrentGeomToSelect,
+ GEOM::GEOM_Object_var theGeomVar)
+{
+ if ( theGeomVar->_is_nil() )
+ return true;
+
+ bool isApplicable = false;
+ if ( theCurrentGeomToSelect == myLastGeomToSelect && !theCurrentGeomToSelect.isEmpty() ) {
+ THypLabelIsAppMap::const_iterator iter = myHypMapIsApplicable.find( theAlgoData->Label );
+ if ( iter != myHypMapIsApplicable.end() && iter.key() == theAlgoData->Label ) {
+ isApplicable = iter.value();
+ return isApplicable;
+ }
+ }
+ bool toCheckIsApplicableToAll = !myIsMesh;
+ if ( toCheckIsApplicableToAll )
+ toCheckIsApplicableToAll = ( theGeomVar->GetType() == GEOM_GROUP );
+ isApplicable = SMESH::IsApplicable( theAlgoData->TypeName, theGeomVar, toCheckIsApplicableToAll );
+ myHypMapIsApplicable.insert( theAlgoData->Label, isApplicable );
+ return isApplicable;
+}
+
+//================================================================================
+/*!
+ * \brief check compatibility of the mesh type
+ * \param theAlgoData - to select hypos able to be used by this algo
+ * \param theMeshType - type of mesh for filtering algorithms
+ * \retval bool - check result
+ */
+//================================================================================
+bool SMESHGUI_MeshOp::isCompatibleToMeshType(HypothesisData* theAlgoData,
+ QString theMeshType)
+{
+ bool isAvailableAlgo = ( theAlgoData->OutputTypes.count() == 0 );
+ QStringList::const_iterator inElemType = theAlgoData->OutputTypes.begin();
+ for ( ; inElemType != theAlgoData->OutputTypes.end(); inElemType++ ) {
+ if ( *inElemType == theMeshType ) {
+ isAvailableAlgo = true;
+ break;
+ }
+ }
+ return isAvailableAlgo;
+}
+