Salome HOME
IPAL54521: [TC-9.3.0]: Mesh information: Additinal Info tab: 'Compute' button for...
authoreap <eap@opencascade.com>
Fri, 22 Mar 2019 10:32:28 +0000 (13:32 +0300)
committereap <eap@opencascade.com>
Fri, 22 Mar 2019 10:32:28 +0000 (13:32 +0300)
  Add SMESH_GroupOnFilter::IsUpToDate()
  Redefine SMESH_GroupOnFilter::IsMeshInfoCorrect()

idl/SMESH_Group.idl
src/SMESHGUI/SMESHGUI_MeshInfo.cxx
src/SMESHGUI/SMESHGUI_SelectionProxy.cxx
src/SMESH_I/SMESH_Group_i.cxx
src/SMESH_I/SMESH_Group_i.hxx

index 9011e9f975f74672289bf098c2da60ae7af95ec0..b432423d408a475f92067a71a03e087fcce7c331 100644 (file)
@@ -178,6 +178,9 @@ module SMESH
   {
     void   SetFilter( in Filter theFilter) raises (SALOME::SALOME_Exception); 
     Filter GetFilter();
   {
     void   SetFilter( in Filter theFilter) raises (SALOME::SALOME_Exception); 
     Filter GetFilter();
+
+    //! @return True if group contents is computed
+    boolean IsUpToDate();
   };
 
 };
   };
 
 };
index df43a67f2e42a1058713c911124a63cc91114f6a..192b1440d5500d5f583e3010c9a9df3277de258b 100644 (file)
@@ -2338,6 +2338,7 @@ void InfoComputor::compute()
   if ( myProxy )
   {
     SUIT_OverrideCursor wc;
   if ( myProxy )
   {
     SUIT_OverrideCursor wc;
+    myProxy.load();
     switch ( myOperation )
     {
     case GrpSize:
     switch ( myOperation )
     {
     case GrpSize:
index e359fb8b51abac88039df54143f2ae11ef9a8dc3..c4ab63629eec39c53ed1353b70e00c33f8dbccf3 100644 (file)
@@ -1170,7 +1170,7 @@ int SMESH::SelectionProxy::size( bool autoCompute ) const
     {
       if ( type() == GroupFilter )
         // for group on filter we check if value is already computed and cached
     {
       if ( type() == GroupFilter )
         // for group on filter we check if value is already computed and cached
-        autoCompute |= group->IsNodeInfoAvailable();
+        autoCompute |= group->IsMeshInfoCorrect();
       else
         // for other groups we force autoCompute to true
         autoCompute = true;
       else
         // for other groups we force autoCompute to true
         autoCompute = true;
index b9a60ff9089b49bf9c32f0d47321a130f78fe535..a2dac404ce7426600a13c05db7fedacbe5b4e726 100644 (file)
@@ -238,7 +238,7 @@ CORBA::Boolean SMESH_GroupBase_i::IsEmpty()
 
 //=============================================================================
 /*
 
 //=============================================================================
 /*
- * Returns \c true if \c this group depends on the \a other via
+ * Return \c true if \c this group depends on the \a other via
  * FT_BelongToMeshGroup predicate or vice versa
  */
 //=============================================================================
  * FT_BelongToMeshGroup predicate or vice versa
  */
 //=============================================================================
@@ -677,7 +677,7 @@ void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color)
 
 //=============================================================================
 /*
 
 //=============================================================================
 /*
- * Returns number of mesh elements of each \a SMESH::EntityType
+ * Return number of mesh elements of each \a SMESH::EntityType
  * Result array of number of elements per \a SMESH::EntityType
  * Inherited from SMESH_IDSource
  */
  * Result array of number of elements per \a SMESH::EntityType
  * Inherited from SMESH_IDSource
  */
@@ -707,7 +707,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo()
 
 //=============================================================================
 /*
 
 //=============================================================================
 /*
- * Returns number of mesh elements of each \a ElementType
+ * Return number of mesh elements of each \a ElementType
  */
 //=============================================================================
 
  */
 //=============================================================================
 
@@ -728,7 +728,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetNbElementsByType()
 
 //=======================================================================
 //function : GetIDs
 
 //=======================================================================
 //function : GetIDs
-//purpose  : Returns ids of members
+//purpose  : Return ids of members
 //=======================================================================
 
 SMESH::long_array* SMESH_GroupBase_i::GetIDs()
 //=======================================================================
 
 SMESH::long_array* SMESH_GroupBase_i::GetIDs()
@@ -738,7 +738,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetIDs()
 
 //=======================================================================
 //function : GetTypes
 
 //=======================================================================
 //function : GetTypes
-//purpose  : Returns types of elements it contains
+//purpose  : Return types of elements it contains
 //=======================================================================
 
 SMESH::array_of_ElementType* SMESH_GroupBase_i::GetTypes()
 //=======================================================================
 
 SMESH::array_of_ElementType* SMESH_GroupBase_i::GetTypes()
@@ -754,7 +754,7 @@ SMESH::array_of_ElementType* SMESH_GroupBase_i::GetTypes()
 
 //=======================================================================
 //function : IsMeshInfoCorrect
 
 //=======================================================================
 //function : IsMeshInfoCorrect
-//purpose  : * Returns false if GetMeshInfo() returns incorrect information that may
+//purpose  : * Return false if GetMeshInfo() returns incorrect information that may
 //           * happen if mesh data is not yet fully loaded from the file of study.
 //=======================================================================
 
 //           * happen if mesh data is not yet fully loaded from the file of study.
 //=======================================================================
 
@@ -849,7 +849,7 @@ void SMESH_GroupOnFilter_i::SetFilter(SMESH::Filter_ptr theFilter)
 
 //================================================================================
 /*!
 
 //================================================================================
 /*!
- * \brief Returns the filter defining group contents
+ * \brief Return the filter defining group contents
  */
 //================================================================================
 
  */
 //================================================================================
 
@@ -860,9 +860,37 @@ SMESH::Filter_ptr SMESH_GroupOnFilter_i::GetFilter()
   return f._retn();
 }
 
   return f._retn();
 }
 
+//================================================================================
+/*!
+ * @return true if group contents is computed
+ */
+//================================================================================
+
+CORBA::Boolean SMESH_GroupOnFilter_i::IsUpToDate()
+{
+  if ( myPreMeshInfo )
+    return false;
+
+  if ( SMESHDS_GroupOnFilter* grDS = dynamic_cast< SMESHDS_GroupOnFilter*>( GetGroupDS() ))
+    return grDS->IsUpToDate();
+
+  return false;
+}
+
+//=======================================================================
+//function : IsMeshInfoCorrect
+//purpose  : Return false in two cases: 1) if mesh not loaded and GetMeshInfo() returns
+//           incorrect information 2) mesh loaded but group contents is not computed
+//=======================================================================
+
+bool SMESH_GroupOnFilter_i::IsMeshInfoCorrect()
+{
+  return myPreMeshInfo ? myPreMeshInfo->IsMeshInfoCorrect() : IsUpToDate();
+}
+
 //=======================================================================
 //function : GetIDs
 //=======================================================================
 //function : GetIDs
-//purpose  : Returns ids of members
+//purpose  : Return ids of members
 //=======================================================================
 
 SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID()
 //=======================================================================
 
 SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID()
@@ -887,7 +915,7 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID()
 
 //=============================================================================
 /*!
 
 //=============================================================================
 /*!
- * Returns statistic of mesh elements
+ * Return statistic of mesh elements
  * Result array of number enityties
  * Inherited from SMESH_IDSource
  */
  * Result array of number enityties
  * Inherited from SMESH_IDSource
  */
@@ -1052,3 +1080,4 @@ void SMESH_GroupOnFilter_i::OnBaseObjModified(NotifyerAndWaiter* filter, bool /*
   if ( SMESHDS_GroupOnFilter* grDS = dynamic_cast< SMESHDS_GroupOnFilter*>( GetGroupDS() ))
     grDS->SetPredicate( GetPredicate( myFilter )); // group resets its cache
 }
   if ( SMESHDS_GroupOnFilter* grDS = dynamic_cast< SMESHDS_GroupOnFilter*>( GetGroupDS() ))
     grDS->SetPredicate( GetPredicate( myFilter )); // group resets its cache
 }
+
index c4e11a1ad4c5c2e41bd0c1327015c61ed3731f50..952ac33a4ec578891fb00c6ac2d254f55faa0f43 100644 (file)
@@ -198,8 +198,12 @@ class SMESH_I_EXPORT SMESH_GroupOnFilter_i:
   // CORBA interface implementation
   void SetFilter(SMESH::Filter_ptr theFilter) throw (SALOME::SALOME_Exception);
   SMESH::Filter_ptr GetFilter();
   // CORBA interface implementation
   void SetFilter(SMESH::Filter_ptr theFilter) throw (SALOME::SALOME_Exception);
   SMESH::Filter_ptr GetFilter();
+  virtual CORBA::Boolean IsUpToDate();
   virtual SMESH::long_array* GetListOfID();
   virtual SMESH::long_array* GetMeshInfo();
   virtual SMESH::long_array* GetListOfID();
   virtual SMESH::long_array* GetMeshInfo();
+  //! @return false in two cases: 1) if mesh not loaded and GetMeshInfo() returns
+  //! incorrect information 2) mesh loaded but group contents is not computed.
+  virtual bool IsMeshInfoCorrect();
 
   // method of SMESH::NotifyerAndWaiter to update self when myFilter changes
   virtual void OnBaseObjModified(NotifyerAndWaiter* filter, bool);
 
   // method of SMESH::NotifyerAndWaiter to update self when myFilter changes
   virtual void OnBaseObjModified(NotifyerAndWaiter* filter, bool);