]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1462: temporary patch for performance
authorasl <asl@opencascade.com>
Fri, 1 Dec 2017 10:19:30 +0000 (13:19 +0300)
committerasl <asl@opencascade.com>
Fri, 1 Dec 2017 10:19:30 +0000 (13:19 +0300)
src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx
src/HYDROGUI/HYDROGUI_BathymetryPrs.h
src/HYDROGUI/HYDROGUI_ShapeBathymetry.cxx
src/HYDROGUI/HYDROGUI_ShapeBathymetry.h

index e8772e7a5ba1de5215efb1b1df32f82b0413ae61..eeb490123ca757d51e7eb4cfabb858fa4b4f3401 100644 (file)
@@ -260,7 +260,7 @@ void HYDROGUI_BathymetryPrs::ClearSelected()
     aSelectPrs->Clear(); 
 }
 
-void HYDROGUI_BathymetryPrs::SetTextLabels( const QList<int>& theTextIndices )
+void HYDROGUI_BathymetryPrs::SetTextLabels( const QVector<int>& theTextIndices )
 {
   myTextIndices = theTextIndices;
 }
index 1f5e0df124cc49f1ea20e80e74f99a203f9d46ed..1732016d2f3051982e16fbfcce42e62a0b738366 100644 (file)
@@ -22,7 +22,7 @@
 #include <AIS_PointCloud.hxx>
 #include <SelectMgr_EntityOwner.hxx>
 #include <Bnd_Box.hxx>
-#include <QList>
+#include <QVector>
 
 class HYDROGUI_ShapeBathymetry;
 
@@ -47,7 +47,7 @@ public:
 
   virtual void ClearSelected();
 
-  void SetTextLabels( const QList<int>& );
+  void SetTextLabels( const QVector<int>& );
 
   HYDROGUI_ShapeBathymetry* GetShape() const;
 
@@ -64,7 +64,7 @@ protected:
 private:
   const HYDROGUI_ShapeBathymetry* myShape;
   Bnd_Box myBound;
-  QList<int> myTextIndices;
+  QVector<int> myTextIndices;
 };
 
 class HYDROGUI_BathymetryPointOwner : public SelectMgr_EntityOwner
index dfc3a62cf055cb508153a1561e1ac9aa06ea9b22..4b1df859e948784af6174908d9bd15ff7c89c042 100644 (file)
@@ -27,6 +27,8 @@
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <V3d_View.hxx>
+#include <QTime>
+#include <utilities.h>
 
 HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer*                theDisplayer,
                                                     const Handle(AIS_InteractiveContext)& theContext,
@@ -183,7 +185,7 @@ void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const
 
 void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow )
 {
-  QList<int> visible;
+  QVector<int> visible;
   visible.reserve( myCoords->Size() );
 
   OCCViewer_ViewPort3d* vp = theWindow->getViewPort();
@@ -192,8 +194,16 @@ void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow
   int xp, yp;
   int w = vp->width();
   int h = vp->height();
+  int n = myCoords->Upper();
   bool isVisible;
-  for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ )
+
+#ifdef _DEBUG
+  MESSAGE("RescaleByVisible: " << n);
+  QTime t1;
+  t1.start();
+#endif
+
+  for( int i=myCoords->Lower(); i<=n; i++ )
   {
     gp_Pnt p = myCoords->Value( i );
     v->Convert( p.X(), p.Y(), p.Z(), xp, yp );
@@ -202,14 +212,20 @@ void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow
       visible.append( i );
   }
 
+#ifdef _DEBUG
+  MESSAGE("Time after visibles search:" << t1.elapsed());
+#endif
+
   //TODO: question: empty visible part produce empty bathymetry or complete bathymetry?
   // For now "complete" is implemented
   Rescale( visible, visible.isEmpty() );
+
+  MESSAGE("Time after rescale:" << t1.elapsed());
 }
 
-QList<int> HYDROGUI_ShapeBathymetry::selected() const
+QVector<int> HYDROGUI_ShapeBathymetry::selected() const
 {
-  QList<int> selected;
+  QVector<int> selected;
   selected.reserve( myCoords->Size() );
 
   Handle(AIS_InteractiveContext) c = getContext();
@@ -232,7 +248,7 @@ QList<int> HYDROGUI_ShapeBathymetry::selected() const
 
 void HYDROGUI_ShapeBathymetry::RescaleBySelection()
 {
-  QList<int> selection = selected();
+  QVector<int> selection = selected();
 
   //TODO: question: empty selection produce empty bathymetry or complete bathymetry?
   // For now "complete" is implemented
@@ -252,10 +268,10 @@ void HYDROGUI_ShapeBathymetry::Rescale( double theMin, double theMax )
 
 void HYDROGUI_ShapeBathymetry::RescaleDefault()
 {
-  Rescale( QList<int>(), true );
+  Rescale( QVector<int>(), true );
 }
 
-void HYDROGUI_ShapeBathymetry::Rescale( const QList<int>& theIndices, bool isForcedAll )
+void HYDROGUI_ShapeBathymetry::Rescale( const QVector<int>& theIndices, bool isForcedAll )
 {
   double aMin = 0, aMax = 0;
   if( !myCoords.IsNull() )
@@ -291,7 +307,7 @@ void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn )
   if( prs.IsNull() )
     return;
 
-  QList<int> selection;
+  QVector<int> selection;
   if( isOn )
     selection = selected();
 
index 814337242d44f8d159d87d5620e827d87e10fcbf..e6ee5130cf709a9881d33f3673951ef93602fd6d 100644 (file)
@@ -67,9 +67,9 @@ protected:
   virtual void displayShape( const bool theIsUpdateViewer );
 
   void setToUpdateColorScale( bool isChanged );
-  void Rescale( const QList<int>& theIndices, bool isForcedAll );
+  void Rescale( const QVector<int>& theIndices, bool isForcedAll );
 
-  QList<int> selected() const;
+  QVector<int> selected() const;
 
 private:
   HYDROGUI_OCCDisplayer* myDisplayer;