HYDROGUI_ShapeBathymetry::~HYDROGUI_ShapeBathymetry()
{
- myDisplayer->SetToUpdateColorScale();
+ setToUpdateColorScale( true );
}
void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivateSelection )
Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() );
- if ( !aBath.IsNull() )
+ if ( !aBath.IsNull() && !aBath->GetAltitudePoints().empty())
{
buildShape();
updateShape( false, false );
void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(Aspect_ColorScale)& theColorScale )
{
+ if (!myCoords)
+ return;
for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ )
{
double z = myCoords->Value( i ).Z();
bool isShown = getContext()->IsDisplayed( getAISObject() );
bool isChanged = ( isShown != theState );
HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
- if( isChanged )
- myDisplayer->SetToUpdateColorScale();
+ setToUpdateColorScale( isChanged );
}
void HYDROGUI_ShapeBathymetry::displayShape( const bool theIsUpdateViewer )
bool isShown = getContext()->IsDisplayed( getAISObject() );
bool isChanged = ( !isShown );
HYDROGUI_Shape::displayShape( theIsUpdateViewer );
- if( isChanged )
- myDisplayer->SetToUpdateColorScale();
+ setToUpdateColorScale( isChanged );
}
void HYDROGUI_ShapeBathymetry::display( const bool theIsUpdateViewer )
bool isShown = getContext()->IsDisplayed( getAISObject() );
bool isChanged = ( !isShown );
HYDROGUI_Shape::display( theIsUpdateViewer );
- if( isChanged )
- myDisplayer->SetToUpdateColorScale();
+ setToUpdateColorScale( isChanged );
}
void HYDROGUI_ShapeBathymetry::erase( const bool theIsUpdateViewer )
bool isShown = getContext()->IsDisplayed( getAISObject() );
bool isChanged = ( isShown );
HYDROGUI_Shape::erase( theIsUpdateViewer );
- if( isChanged )
+ setToUpdateColorScale( isChanged );
+}
+
+void HYDROGUI_ShapeBathymetry::setToUpdateColorScale( bool isChanged )
+{
+#ifndef LIGHT_MODE
+ if( isChanged && myDisplayer )
myDisplayer->SetToUpdateColorScale();
+#endif
}