Salome HOME
refs #1330: draft preferences implementation for polyline arrow
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeBathymetry.cxx
index a88b5069923989e42e06f4bcf2ef403b7ef4b692..3a72a138893dc1707e32925cd620335dedcaa9c8 100644 (file)
@@ -58,8 +58,10 @@ void HYDROGUI_ShapeBathymetry::update( bool theIsUpdateViewer, bool isDeactivate
 }
 
 
-Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const
+QList<Handle(AIS_InteractiveObject)> HYDROGUI_ShapeBathymetry::createShape() const
 {
+  QList<Handle(AIS_InteractiveObject)> shapes;
+
   Handle(AIS_InteractiveObject) aPntCloud;
 
   Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( getObject() );
@@ -78,9 +80,11 @@ Handle(AIS_InteractiveObject) HYDROGUI_ShapeBathymetry::createShape() const
     aThat->myColors = new Quantity_HArray1OfColor( aLower, anUpper );
     for( int i=aLower; i<=anUpper; i++ )
       aThat->myCoords->SetValue( i, gp_Pnt( aBathPoints[i].X, aBathPoints[i].Y, aBathPoints[i].Z ) );
+
+    shapes.append( aPntCloud );
   }
 
-  return aPntCloud;
+  return shapes;
 }
 
 void HYDROGUI_ShapeBathymetry::GetRange( double& theMin, double& theMax ) const
@@ -113,7 +117,7 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale
     theColorScale->FindColor( z, aColor );
     myColors->SetValue( i, aColor );
   }
-  Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObject() );
+  Handle(AIS_PointCloud) aPntCloud = Handle(AIS_PointCloud)::DownCast( getAISObjects()[0] );
   aPntCloud->SetPoints( myCoords, myColors );
   getContext()->Redisplay( aPntCloud, Standard_False );
 }
@@ -121,7 +125,7 @@ void HYDROGUI_ShapeBathymetry::UpdateWithColorScale( const Handle(AIS_ColorScale
 void HYDROGUI_ShapeBathymetry::setVisible( const bool theState,
                                            const bool theIsUpdateViewer )
 {
-  bool isShown = getContext()->IsDisplayed( getAISObject() );
+  bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
   bool isChanged = ( isShown != theState );
   HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
   setToUpdateColorScale( isChanged );
@@ -129,7 +133,7 @@ void HYDROGUI_ShapeBathymetry::setVisible( const bool theState,
 
 void HYDROGUI_ShapeBathymetry::displayShape( const bool theIsUpdateViewer )
 {
-  bool isShown = getContext()->IsDisplayed( getAISObject() );
+  bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
   bool isChanged = ( !isShown  );
   HYDROGUI_Shape::displayShape( theIsUpdateViewer );
   setToUpdateColorScale( isChanged );
@@ -137,7 +141,7 @@ void HYDROGUI_ShapeBathymetry::displayShape( const bool theIsUpdateViewer )
 
 void HYDROGUI_ShapeBathymetry::display( const bool theIsUpdateViewer )
 {
-  bool isShown = getContext()->IsDisplayed( getAISObject() );
+  bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
   bool isChanged = ( !isShown  );
   HYDROGUI_Shape::display( theIsUpdateViewer );
   setToUpdateColorScale( isChanged );
@@ -145,7 +149,7 @@ void HYDROGUI_ShapeBathymetry::display( const bool theIsUpdateViewer )
 
 void HYDROGUI_ShapeBathymetry::erase( const bool theIsUpdateViewer )
 {
-  bool isShown = getContext()->IsDisplayed( getAISObject() );
+  bool isShown = getContext()->IsDisplayed( getAISObjects()[0] );
   bool isChanged = ( isShown  );
   HYDROGUI_Shape::erase( theIsUpdateViewer );
   setToUpdateColorScale( isChanged );