+ * \brief check compatibility of the geometry
+ * \param theAlgoData - to select hypos able to be used by this algo
+ * \param theDim - algo dimension
+ * \retval bool - check result
+ */
+//================================================================================
+bool SMESHGUI_MeshOp::isCompatibleToGeometry(HypothesisData* theAlgoData,
+ const int theDim)
+{
+ if ( theDim < 1 || myGeom->_is_nil() )
+ return true;
+
+ bool isApplicable = false;
+ if ( myGeomEntry == myLastGeomEntry && !myGeomEntry.isEmpty() ) {
+ THypLabelIsAppMap::const_iterator lab2isApp = myHypMapIsApplicable.find( theAlgoData->TypeName );
+ if ( lab2isApp != myHypMapIsApplicable.end() ) {
+ isApplicable = lab2isApp.value();
+ return isApplicable;
+ }
+ }
+ bool toCheckIsApplicableToAll = !myIsMesh;
+ if ( toCheckIsApplicableToAll )
+ toCheckIsApplicableToAll = ( myGeom->GetType() == GEOM_GROUP );
+
+ isApplicable = SMESH::IsApplicable( theAlgoData->TypeName, myGeom, toCheckIsApplicableToAll );
+ myHypMapIsApplicable.insert( theAlgoData->TypeName, isApplicable );
+ return isApplicable;
+}
+
+//================================================================================
+/*!
+ * \brief check compatibility of the mesh type
+ * \param theAlgoData - to select hypos able to be used by this algo
+ * \param theDim - algo dimension
+ * \retval bool - check result
+ */
+//================================================================================
+bool SMESHGUI_MeshOp::isCompatibleToMeshType(HypothesisData* theAlgoData,
+ const int theDim)
+{
+ if ( theDim < 2 )
+ return true;
+
+ QString elemType;
+ int curMeshType = myDlg->currentMeshType();
+ switch ( curMeshType ) {
+ case MT_ANY:
+ return true;
+
+ case MT_TRIANGULAR:
+ if ( theDim > 2 )
+ return false;
+ elemType = "TRIA";
+ break;
+
+ case MT_QUADRILATERAL:
+ if ( theDim > 2 )
+ return false;
+ elemType = "QUAD";
+ break;
+
+ case MT_TETRAHEDRAL:
+ if ( theDim < 3 )
+ elemType = "TRIA";
+ else
+ elemType = "TETRA";
+ break;
+
+ case MT_HEXAHEDRAL:
+ if ( theDim < 3 )
+ elemType = "QUAD";
+ else
+ elemType = "HEXA";
+ break;
+
+ default:
+ return true;
+ }
+
+ bool isAvailableAlgo = theAlgoData->OutputTypes.isEmpty();
+ QStringList::const_iterator inElemType = theAlgoData->OutputTypes.begin();
+ for ( ; inElemType != theAlgoData->OutputTypes.end(); inElemType++ )
+ {
+ if ( *inElemType == elemType )
+ {
+ isAvailableAlgo = true;
+ break;
+ }
+ }
+ return isAvailableAlgo;
+}
+
+//================================================================================
+/*!
+ * \brief Get available hypotheses or algorithms
+ * \param theDim - specifies dimension of returned hypotheses/algorifms
+ * \param theHypType - specifies whether algorims or hypotheses or additional ones
+ * are retrieved (possible values are in HypType enumeration)
+ * \param theHyps - output list of hypotheses' names
+ * \param thePrevAlgoData - to select hypos able to be used by previously algo (optional)
+ * \param theNextAlgoData - to select hypos able to be used by next algo (optional)
+ * \param theMeshType - type of mesh for filtering algorithms (optional)