Salome HOME
size of image is limited by 7000 pixels
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ShapeBathymetry.h
index 840026ed1786b890c20121baaeacc57dc2fc7a48..814337242d44f8d159d87d5620e827d87e10fcbf 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  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
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // 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 <TColgp_HArray1OfPnt.hxx>
 #include <Quantity_HArray1OfColor.hxx>
 
-class Handle_HYDROData_Bathymetry;
-class Handle_Aspect_ColorScale;
+class HYDROData_Bathymetry;
+class AIS_ColorScale;
+class HYDROGUI_OCCDisplayer;
+class OCCViewer_ViewWindow;
 
 class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape
 {
 public:
-  HYDROGUI_ShapeBathymetry( const Handle(AIS_InteractiveContext)& theContext,
-                            const Handle_HYDROData_Bathymetry&    theBathymetry,
+  HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
+                            const Handle(AIS_InteractiveContext)& theContext,
+                            const Handle(HYDROData_Bathymetry)&    theBathymetry,
                             const int                             theZLayer = -1 );
   virtual ~HYDROGUI_ShapeBathymetry();
 
   void GetRange( double& theMin, double& theMax ) const;
-  void UpdateWithColorScale( const Handle_Aspect_ColorScale& );
+  void UpdateWithColorScale( const Handle(AIS_ColorScale)& );
+
+  // Re-scale by visible points
+  void RescaleByVisible( OCCViewer_ViewWindow* );
+  // Re-scale by selected points
+  void RescaleBySelection();
+  // Custom (user) re-scale 
+  void Rescale( double theMin, double theMax );
+  // Default re-scale (by all points)
+  void RescaleDefault();
+
+  void TextLabels( bool isOn );
+
+  virtual void display( const bool theIsUpdateViewer = true );
+  virtual void erase( const bool theIsUpdateViewer = true );
 
   virtual void               update( bool isUpdateViewer,
                                      bool isDeactivateSelection );
 
+  virtual void               setVisible( const bool theState,
+                                         const bool theIsUpdateViewer = true );
+
+  void Build();
+
 protected:
-  virtual Handle_AIS_InteractiveObject createShape() const;
+  virtual QList<Handle(AIS_InteractiveObject)> createShape() const;
+  virtual void displayShape( const bool theIsUpdateViewer );
+
+  void setToUpdateColorScale( bool isChanged );
+  void Rescale( const QList<int>& theIndices, bool isForcedAll );
+
+  QList<int> selected() const;
 
 private:
-  Handle_TColgp_HArray1OfPnt     myCoords;
-  Handle_Quantity_HArray1OfColor myColors;
+  HYDROGUI_OCCDisplayer* myDisplayer;
+  Handle(TColgp_HArray1OfPnt)     myCoords;
+  Handle(Quantity_HArray1OfColor) myColors;
+
+  double myMin;
+  double myMax;
+  bool myRangeInitialized;
 };
 
 #endif