-// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
-//
-// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-//
+// Copyright (C) 2014-2015 EDF-R&D
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
#include <Select3D_SensitiveBox.hxx>
#include <Graphic3d_Group.hxx>
#include <Graphic3d_ArrayOfPolylines.hxx>
+#include <Graphic3d_ArrayOfPoints.hxx>
const int BATH_HIGHLIGHT_MODE = 10;
HYDROGUI_BathymetryPrs::HYDROGUI_BathymetryPrs()
{
SetHilightMode( BATH_HIGHLIGHT_MODE );
+ SetAutoHilight( Standard_True );
}
HYDROGUI_BathymetryPrs::~HYDROGUI_BathymetryPrs()
{
}
-void HYDROGUI_BathymetryPrs::SetPoints( const Handle(TColgp_HArray1OfPnt)& theCoords,
- const Handle(Quantity_HArray1OfColor)& theColors )
+void HYDROGUI_BathymetryPrs::UpdateBound()
{
+ Handle(Graphic3d_ArrayOfPoints) points = GetPoints();
myBound.SetVoid();
- if( !theCoords.IsNull() )
+ if( !points.IsNull() )
{
- int aLower = theCoords->Lower();
- int anUpper = theCoords->Upper();
+ int aLower = 1;
+ int anUpper = points->VertexNumber();
for( int i = aLower; i <= anUpper; i++ )
{
+ gp_Pnt p = points->Vertice( i );
if( i==aLower )
- myBound.Set( theCoords->Value( i ) );
+ myBound.Set( p );
else
- {
- gp_Pnt aPnt = theCoords->Value( i );
- myBound.Update( aPnt.X(), aPnt.Y(), aPnt.Z() );
- }
+ myBound.Update( p.X(), p.Y(), p.Z() );
}
}
+}
+
+void HYDROGUI_BathymetryPrs::SetPoints( const Handle(TColgp_HArray1OfPnt)& theCoords,
+ const Handle(Quantity_HArray1OfColor)& theColors )
+{
AIS_PointCloud::SetPoints( theCoords, theColors );
+ UpdateBound();
}
void HYDROGUI_BathymetryPrs::Compute( const Handle(PrsMgr_PresentationManager3d)& thePresentationManager,
if( theMode==BATH_HIGHLIGHT_MODE )
{
thePresentation->Clear();
+ if( myBound.IsVoid() )
+ UpdateBound();
+
if( myBound.IsVoid() ||
myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
myBound.IsOpenYmin() || myBound.IsOpenYmax() ||
{
if( theMode == 0 )
{
+ if( myBound.IsVoid() )
+ UpdateBound();
+
if( myBound.IsVoid() ||
myBound.IsOpenXmin() || myBound.IsOpenXmax() ||
myBound.IsOpenYmin() || myBound.IsOpenYmax() ||