]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
bug #136 - problems with performance
authorasl <asl@opencascade.com>
Mon, 2 Dec 2013 06:13:10 +0000 (06:13 +0000)
committerasl <asl@opencascade.com>
Mon, 2 Dec 2013 06:13:10 +0000 (06:13 +0000)
src/HYDROCurveCreator/CurveCreator_Curve.cxx
src/HYDROCurveCreator/CurveCreator_Displayer.cxx
src/HYDROCurveCreator/CurveCreator_Displayer.h
src/HYDROCurveCreator/CurveCreator_Profile.cxx
src/HYDROGUI/HYDROGUI_PolylineOp.cxx
src/HYDROGUI/HYDROGUI_ProfileOp.cxx

index cccf4a20302532beeecfd8c54a4e79c9cc11cbc2..d0c18958846d6f6da2886283a1a2fb217d2092a6 100644 (file)
@@ -352,8 +352,8 @@ void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double&
 void CurveCreator_Curve::redisplayCurve()
 {
   if( myDisplayer ) {
-    myDisplayer->erase();
-    myDisplayer->display( constructWire() );
+    myDisplayer->erase( false );
+    myDisplayer->display( constructWire(), true );
   }
 }
 
@@ -472,7 +472,7 @@ bool CurveCreator_Curve::clearInternal()
 {
   // erase curve from the viewer
   if( myDisplayer )
-    myDisplayer->erase();
+    myDisplayer->erase( true );
   // Delete all allocated data.
   int i = 0;
   const int aNbSections = getNbSections();
index 2de7bf1240f70eb79660c1c8a75211f022121448..92df32341fd1c5c7a3a2ef54cf816dc25fc2863d 100644 (file)
@@ -8,14 +8,14 @@ CurveCreator_Displayer::CurveCreator_Displayer( Handle_AIS_InteractiveContext th
 
 CurveCreator_Displayer::~CurveCreator_Displayer(void)
 {
-  erase();
+  erase( true );
   for( int i = 0 ; i < myObjects.size() ; i++ ){
     myObjects[i].Nullify();
   }
   myObjects.clear();
 }
 
-void CurveCreator_Displayer::display( AISObjectsList theCurveObjects )
+void CurveCreator_Displayer::display( AISObjectsList theCurveObjects, bool isUpdate )
 {
   myObjects = theCurveObjects;
   if(myObjects.empty())
@@ -23,17 +23,19 @@ void CurveCreator_Displayer::display( AISObjectsList theCurveObjects )
   for( int i = 0 ; i < myObjects.size() ; i++ ){
     myContext->Display(myObjects[i], Standard_False);
   }
-  myContext->UpdateCurrentViewer();
+  if( isUpdate )
+    myContext->UpdateCurrentViewer();
 }
 
-void CurveCreator_Displayer::erase()
+void CurveCreator_Displayer::erase( bool isUpdate )
 {
   if(myObjects.empty())
     return;
   for( int i = 0 ; i < myObjects.size() ; i++ ){
     myContext->Erase(myObjects[i], Standard_False);
   }
-  myContext->UpdateCurrentViewer();
+  if( isUpdate )
+    myContext->UpdateCurrentViewer();
 }
 
 Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
index 58f667bbf95564bf59ad9554231d89f3b6017bfc..6bfc8d08e3399d8a6f9a59f622faf041728c4d4d 100644 (file)
@@ -16,8 +16,8 @@ public:
   CurveCreator_Displayer(Handle_AIS_InteractiveContext theContext );
   ~CurveCreator_Displayer(void);
 
-  void display( AISObjectsList theCurveObjects );
-  void erase();
+  void display( AISObjectsList theCurveObjects, bool isUpdate );
+  void erase( bool isUpdate );
   void highlight( const AISObjectsList& theObjects, bool isHL );
 
 protected:
index bd56d2725f8fad35d384c2c5fa2e32e35d45a3b1..0c11fc18e92643cfa9401a7717ed1c52fe2022ea 100644 (file)
@@ -71,7 +71,7 @@ bool CurveCreator_Profile::clearInternal()
 {
   // erase curve from the viewer
   if( myDisplayer )
-    myDisplayer->erase();
+    myDisplayer->erase( true );
 
   // Delete all allocated data.
   mySections[ 0 ]->myPoints.clear();
index 74cb0f6307f2bc8264dbbfcfd041ed8e4b649e90..8ff209f50dfa3105db4fe141499aa21177e8c0b8 100755 (executable)
@@ -284,7 +284,7 @@ void HYDROGUI_PolylineOp::displayPreview()
       {
         CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx );
         myCurve->setDisplayer( aDisplayer );
-        aDisplayer->display( myCurve->constructWire() );
+        aDisplayer->display( myCurve->constructWire(), true );
       }
     }
   }
@@ -300,7 +300,7 @@ void HYDROGUI_PolylineOp::erasePreview()
       Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
       if( !aCtx.IsNull() )
       {
-        aDisplayer->erase();
+        aDisplayer->erase( true );
       }
     }
   }
index 1bb26b87ac799932d4d3faef274c41073011f20e..8b11b28916738cfb9faffa666fd5bffdb303c077 100644 (file)
@@ -202,7 +202,7 @@ void HYDROGUI_ProfileOp::displayPreview()
     {
       CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx );
       myProfile->setDisplayer( aDisplayer );
-      aDisplayer->display( myProfile->constructWire() );
+      aDisplayer->display( myProfile->constructWire(), true );
     }
   }
 }
@@ -216,7 +216,7 @@ void HYDROGUI_ProfileOp::erasePreview()
     Handle(AIS_InteractiveContext) aCtx = aPanel->getAISContext();
     if( !aCtx.IsNull() )
     {
-      aDisplayer->erase();
+      aDisplayer->erase( true );
     }
   }
 }