#include <AIS_PointCloud.hxx>
#include <SelectMgr_EntityOwner.hxx>
#include <Bnd_Box.hxx>
-#include <QList>
+#include <QVector>
class HYDROGUI_ShapeBathymetry;
virtual void ClearSelected();
- void SetTextLabels( const QList<int>& );
+ void SetTextLabels( const QVector<int>& );
HYDROGUI_ShapeBathymetry* GetShape() const;
private:
const HYDROGUI_ShapeBathymetry* myShape;
Bnd_Box myBound;
- QList<int> myTextIndices;
+ QVector<int> myTextIndices;
};
class HYDROGUI_BathymetryPointOwner : public SelectMgr_EntityOwner
#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,
void HYDROGUI_ShapeBathymetry::RescaleByVisible( OCCViewer_ViewWindow* theWindow )
{
- QList<int> visible;
+ QVector<int> visible;
visible.reserve( myCoords->Size() );
OCCViewer_ViewPort3d* vp = theWindow->getViewPort();
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 );
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();
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
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() )
if( prs.IsNull() )
return;
- QList<int> selection;
+ QVector<int> selection;
if( isOn )
selection = selected();
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;