Salome HOME
0021208: Performance issue when loading SMESH with an hdf file containing a big mesh
authoreap <eap@opencascade.com>
Fri, 24 Feb 2012 10:39:58 +0000 (10:39 +0000)
committereap <eap@opencascade.com>
Fri, 24 Feb 2012 10:39:58 +0000 (10:39 +0000)
     rename private methods to start from lower-case letters

+  void Load();

src/SMESH/SMESH_Mesh.cxx
src/SMESH/SMESH_Mesh.hxx

index 45d541b7a1a123b18a16a0612ba752660fd7ea98..2e09dcd860c1c5388e310909c346fe1d431008f8 100644 (file)
@@ -108,7 +108,7 @@ SMESH_Mesh::SMESH_Mesh(int               theLocalId,
   _isAutoColor   = false;
   _isModified    = false;
   _shapeDiagonal = 0.0;
-  _rmGroupCallUp = 0;
+  _callUp = 0;
   _myMeshDS->ShapeToMesh( PseudoShape() );
 }
 
@@ -131,7 +131,7 @@ SMESH_Mesh::SMESH_Mesh():
   _isAutoColor( false ),
   _isModified( false ),
   _shapeDiagonal( 0.0 ),
-  _rmGroupCallUp( 0 )
+  _callUp( 0 )
 {
 }
 
@@ -176,8 +176,8 @@ SMESH_Mesh::~SMESH_Mesh()
   }
   _mapSubMesh.clear();
 
-  if ( _rmGroupCallUp) delete _rmGroupCallUp;
-  _rmGroupCallUp = 0;
+  if ( _callUp) delete _callUp;
+  _callUp = 0;
 
   // remove self from studyContext
   if ( _gen )
@@ -326,6 +326,18 @@ double SMESH_Mesh::GetShapeDiagonalSize() const
   return _shapeDiagonal;
 }
 
+//================================================================================
+/*!
+ * \brief Load mesh from study file
+ */
+//================================================================================
+
+void SMESH_Mesh::Load()
+{
+  if (_callUp)
+    _callUp->Load();
+}
+
 //=======================================================================
 /*!
  * \brief Remove all nodes and elements
@@ -1043,6 +1055,9 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h
   if ( !GetMeshDS()->IsUsedHypothesis( hyp ))
     return;
 
+  if (_callUp)
+    _callUp->HypothesisModified();
+
   const SMESH_Algo *foundAlgo = 0;
   SMESH_HypoFilter algoKind, compatibleHypoKind;
   list <const SMESHDS_Hypothesis * > usedHyps;
@@ -1684,15 +1699,15 @@ list<int> SMESH_Mesh::GetGroupIds() const
 
 //================================================================================
 /*!
- * \brief Set a caller of RemoveGroup() at level of CORBA API implementation.
+ * \brief Set a caller of methods at level of CORBA API implementation.
  * The set upCaller will be deleted by SMESH_Mesh
  */
 //================================================================================
 
-void SMESH_Mesh::SetRemoveGroupCallUp( TRmGroupCallUp* upCaller )
+void SMESH_Mesh::SetCallUp( TCallUp* upCaller )
 {
-  if ( _rmGroupCallUp ) delete _rmGroupCallUp;
-  _rmGroupCallUp = upCaller;
+  if ( _callUp ) delete _callUp;
+  _callUp = upCaller;
 }
 
 //=============================================================================
@@ -1708,8 +1723,8 @@ bool SMESH_Mesh::RemoveGroup (const int theGroupID)
   GetMeshDS()->RemoveGroup( _mapGroup[theGroupID]->GetGroupDS() );
   delete _mapGroup[theGroupID];
   _mapGroup.erase (theGroupID);
-  if (_rmGroupCallUp)
-    _rmGroupCallUp->RemoveGroup( theGroupID );
+  if (_callUp)
+    _callUp->RemoveGroup( theGroupID );
   return true;
 }
 
index 2546d7fbff1730c79673c506febb6e57b24f53fc..f569156b4bf291a630b1feda81dcc939a3784ae3 100644 (file)
@@ -98,11 +98,14 @@ public:
    */
   static const TopoDS_Solid& PseudoShape();
 
+  /*!
+   * \brief Load mesh from study file
+   */
+  void Load();
   /*!
    * \brief Remove all nodes and elements
    */
   void Clear();
-
   /*!
    * \brief Remove all nodes and elements of indicated shape
    */
@@ -295,12 +298,14 @@ public:
 
   SMESH_Group* ConvertToStandalone ( int theGroupID );
 
-  struct TRmGroupCallUp
+  struct TCallUp // callback from SMESH to SMESH_I level
   {
     virtual void RemoveGroup (const int theGroupID)=0;
-    virtual ~TRmGroupCallUp() {}
+    virtual void HypothesisModified ()=0;
+    virtual void Load ()=0;
+    virtual ~TCallUp() {}
   };
-  void SetRemoveGroupCallUp( TRmGroupCallUp * upCaller );
+  void SetCallUp( TCallUp * upCaller );
 
   bool SynchronizeGroups();
 
@@ -351,10 +356,11 @@ protected:
 
   TListOfListOfInt           _mySubMeshOrder;
 
-  // Struct calling RemoveGroup at CORBA API implementation level, used
-  // to make an upper level be consistent with a lower one when group removal
-  // is invoked by hyp modification 
-  TRmGroupCallUp*            _rmGroupCallUp;
+  // Struct calling methods at CORBA API implementation level, used to
+  // 1) make an upper level be consistent with a lower one when group removal
+  // is invoked by hyp modification (issue 0020918)
+  // 2) to forget not loaded mesh data at hyp modification
+  TCallUp*                    _callUp;
 
 protected:
   SMESH_Mesh();