X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FHYDROGUI%2FHYDROGUI_BathymetryPrs.cxx;h=e6e427b44aad5f8f438b55adf586c5c8699466f3;hb=dfa894b758ac65080dc7185d25b7646dc45a10f4;hp=2bcc235db51e1122cf10b639a2c62d34b3c66ed7;hpb=439579ec24edd8b147cab07f688d446d59029a1e;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx index 2bcc235d..e6e427b4 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetryPrs.cxx @@ -25,39 +25,45 @@ #include #include #include +#include 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, @@ -67,6 +73,9 @@ void HYDROGUI_BathymetryPrs::Compute( const Handle(PrsMgr_PresentationManager3d) if( theMode==BATH_HIGHLIGHT_MODE ) { thePresentation->Clear(); + if( myBound.IsVoid() ) + UpdateBound(); + if( myBound.IsVoid() || myBound.IsOpenXmin() || myBound.IsOpenXmax() || myBound.IsOpenYmin() || myBound.IsOpenYmax() || @@ -117,6 +126,9 @@ void HYDROGUI_BathymetryPrs::ComputeSelection( const Handle(SelectMgr_Selection) { if( theMode == 0 ) { + if( myBound.IsVoid() ) + UpdateBound(); + if( myBound.IsVoid() || myBound.IsOpenXmin() || myBound.IsOpenXmax() || myBound.IsOpenYmin() || myBound.IsOpenYmax() ||