void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale)& theColorScale )
{
- if (!myCoords)
+ if (!myCoords || getAISObjects().isEmpty())
return;
for( int i=myCoords->Lower(), n=myCoords->Upper(); i<=n; i++ )
void HYDROGUI_ShapeBathymetry::setVisible( const bool theState,
const bool theIsUpdateViewer )
{
+ if( getAISObjects().isEmpty() )
+ return;
+
bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
bool isChanged = ( isShown != theState );
HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
void HYDROGUI_ShapeBathymetry::displayShape( const bool theIsUpdateViewer )
{
+ if( getAISObjects().isEmpty() )
+ return;
+
bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
bool isChanged = ( !isShown );
HYDROGUI_Shape::displayShape( theIsUpdateViewer );
void HYDROGUI_ShapeBathymetry::display( const bool theIsUpdateViewer )
{
+ if( getAISObjects().isEmpty() )
+ return;
+
bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
bool isChanged = ( !isShown );
HYDROGUI_Shape::display( theIsUpdateViewer );
void HYDROGUI_ShapeBathymetry::erase( const bool theIsUpdateViewer )
{
+ if( getAISObjects().isEmpty() )
+ return;
+
bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
bool isChanged = ( isShown );
HYDROGUI_Shape::erase( theIsUpdateViewer );
myMin = qMin( theMin, theMax );
myMax = qMax( theMin, theMax );
setToUpdateColorScale( true );
- getAISObjects()[0]->Redisplay();
+
+ if( !getAISObjects().isEmpty() )
+ getAISObjects()[0]->Redisplay();
}
void HYDROGUI_ShapeBathymetry::RescaleDefault()
void HYDROGUI_ShapeBathymetry::TextLabels( bool isOn )
{
+ if( getAISObjects().isEmpty() )
+ return;
+
Handle(HYDROGUI_BathymetryPrs) prs = Handle(HYDROGUI_BathymetryPrs)::DownCast( getAISObjects()[0] );
if( prs.IsNull() )
return;
getContext()->ClearSelected();
prs->SetTextLabels( selection );
- getAISObjects()[0]->Redisplay();
+ prs->Redisplay();
}