return false;
}
+//================================================================================
+/*!
+ * \brief Check if any upper level sub-shape is not computed.
+ * Used to update a sub-mesh icon
+ */
+//================================================================================
+
+bool SMESH_subMesh::IsComputedPartially() const
+{
+ SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(/*includeSelf=*/true,
+ /*SolidFirst=*/true);
+ bool allComputed = true;
+ TopAbs_ShapeEnum readyType = TopAbs_VERTEX; // max value
+ while ( smIt->more() && allComputed )
+ {
+ SMESH_subMesh* sm = smIt->next();
+
+ if ( sm->GetSubShape().ShapeType() > readyType )
+ break; // lower dimension -> stop
+ if ( sm->GetComputeState() != SMESH_subMesh::NOT_READY )
+ readyType = sm->GetSubShape().ShapeType();
+
+ switch ( sm->GetComputeState() )
+ {
+ case SMESH_subMesh::READY_TO_COMPUTE:
+ case SMESH_subMesh::FAILED_TO_COMPUTE:
+ allComputed = false;// sm->IsMeshComputed();
+ break;
+ case SMESH_subMesh::NOT_READY:
+ case SMESH_subMesh::COMPUTE_OK:
+ continue;
+ }
+ }
+ return !allComputed;
+}
+
//=============================================================================
/*!
* Return true if all sub-meshes have been meshed
bool IsMeshComputed() const;
// check if _subMeshDS contains mesh elements unless _alwaysComputed==true
+ bool IsComputedPartially() const;
+ // check if any upper level sub-shape is not computed
+
/*!
* \brief Set sub-shapes that are allowed to compute at once by a multidimensional algo
*/
{
SMESH::array_of_ElementType_var elemTypes = idSrc->GetTypes();
isEmpty = ( elemTypes->length() == 0 );
+
+ if ( !isEmpty )
+ {
+ // check if all sub-shapes of sub-mesh on group are computed
+ // (pb: "Compute sub-mesh" menu is missing if a sub-mesh is partially computed)
+ SMESH::SMESH_subMesh_var subMesh = SMESH::SMESH_subMesh::_narrow( obj );
+ if ( !subMesh->_is_nil() )
+ if ( SMESH_subMesh* sm = mesh_i->GetImpl().GetSubMeshContaining( subMesh->GetId() ))
+ if ( sm->IsComputedPartially() )
+ {
+ SetPixMap( so, "ICON_SMESH_TREE_MESH_PARTIAL" );
+ continue;
+ }
+ }
}
}
+
if ( isEmpty )
SetPixMap( so, "ICON_SMESH_TREE_MESH_WARN");
else if ( !isGroup )
SetPixMap( so, "ICON_SMESH_TREE_GROUP_ON_FILTER" );
else
SetPixMap( so, "ICON_SMESH_TREE_GROUP" );
- }
- }
+
+ } // loop on sub-meshes or groups
+ } // loop on roots
}
//=======================================================================