-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
// 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
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
//
#include <HYDROGUI_ShapeBathymetry.h>
+#include <HYDROGUI_OCCDisplayer.h>
+#include <HYDROGUI_BathymetryPrs.h>
#include <HYDROData_Bathymetry.h>
#include <AIS_InteractiveContext.hxx>
-#include <AIS_PointCloud.hxx>
#include <AIS_Drawer.hxx>
#include <Aspect_ColorScale.hxx>
#include <Prs3d_PointAspect.hxx>
-HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( const Handle(AIS_InteractiveContext)& theContext,
+HYDROGUI_ShapeBathymetry::HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
+ const Handle(AIS_InteractiveContext)& theContext,
const Handle_HYDROData_Bathymetry& theBathymetry,
const int theZLayer )
-: HYDROGUI_Shape( theContext, theBathymetry, theZLayer )
+: HYDROGUI_Shape( theContext, theBathymetry, theZLayer ),
+ myDisplayer( theDisplayer )
{
}
HYDROGUI_ShapeBathymetry::~HYDROGUI_ShapeBathymetry()
{
+ myDisplayer->SetToUpdateColorScale();
}
void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivateSelection )
Handle_HYDROData_Bathymetry aBath = Handle_HYDROData_Bathymetry::DownCast( getObject() );
if( !aBath.IsNull() )
{
- Handle_AIS_PointCloud aPntCloud = new AIS_PointCloud();
- aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 1.0));
+ Handle_AIS_PointCloud aPntCloud = new HYDROGUI_BathymetryPrs();
+ aPntCloud->Attributes()->SetPointAspect (new Prs3d_PointAspect (Aspect_TOM_POINT, Quantity_NOC_WHITE, 2.0));
const HYDROData_Bathymetry::AltitudePoints& aBathPoints = aBath->GetAltitudePoints();
int aLower = aBathPoints.Lower();
getContext()->Redisplay( aPntCloud, Standard_False );
}
+void HYDROGUI_ShapeBathymetry::setVisible( const bool theState,
+ const bool theIsUpdateViewer )
+{
+ bool isShown = getContext()->IsDisplayed( getAISObject() );
+ bool isChanged = ( isShown != theState );
+ HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
+ if( isChanged )
+ myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeBathymetry::displayShape( const bool theIsUpdateViewer )
+{
+ bool isShown = getContext()->IsDisplayed( getAISObject() );
+ bool isChanged = ( !isShown );
+ HYDROGUI_Shape::displayShape( theIsUpdateViewer );
+ if( isChanged )
+ myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeBathymetry::display( const bool theIsUpdateViewer )
+{
+ bool isShown = getContext()->IsDisplayed( getAISObject() );
+ bool isChanged = ( !isShown );
+ HYDROGUI_Shape::display( theIsUpdateViewer );
+ if( isChanged )
+ myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeBathymetry::erase( const bool theIsUpdateViewer )
+{
+ bool isShown = getContext()->IsDisplayed( getAISObject() );
+ bool isChanged = ( isShown );
+ HYDROGUI_Shape::erase( theIsUpdateViewer );
+ if( isChanged )
+ myDisplayer->SetToUpdateColorScale();
+}