1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_SHAPE_BATHYMETRY_H
20 #define HYDROGUI_SHAPE_BATHYMETRY_H
22 #include <HYDROGUI_Shape.h>
23 #include <TColgp_HArray1OfPnt.hxx>
24 #include <Quantity_HArray1OfColor.hxx>
27 class HYDROData_Bathymetry;
29 class HYDROGUI_OCCDisplayer;
30 class OCCViewer_ViewWindow;
32 class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape
35 HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
36 const Handle(AIS_InteractiveContext)& theContext,
37 const Handle(HYDROData_Bathymetry)& theBathymetry,
38 const int theZLayer = -1 );
39 virtual ~HYDROGUI_ShapeBathymetry();
41 void GetRange( double& theMin, double& theMax ) const;
42 void UpdateWithColorScale( const Handle(AIS_ColorScale)& );
44 // Re-scale by visible points
45 void RescaleByVisible( OCCViewer_ViewWindow* );
46 // Re-scale by selected points
47 void RescaleBySelection();
48 // Custom (user) re-scale
49 void Rescale( double theMin, double theMax );
50 // Default re-scale (by all points)
51 void RescaleDefault();
53 void TextLabels( bool isOn, bool isUpdateCurrentViewer=true );
55 virtual void display( const bool theIsUpdateViewer = true );
56 virtual void erase( const bool theIsUpdateViewer = true );
58 virtual void update( bool isUpdateViewer,
59 bool isDeactivateSelection );
61 virtual void setVisible( const bool theState,
62 const bool theIsUpdateViewer = true );
67 virtual QList<Handle(AIS_InteractiveObject)> createShape() const;
68 virtual void displayShape( const bool theIsUpdateViewer );
70 void setToUpdateColorScale( bool isChanged );
71 void Rescale( const QVector<int>& theIndices, bool isForcedAll );
73 QVector<int> selected() const;
76 HYDROGUI_OCCDisplayer* myDisplayer;
77 Handle(TColgp_HArray1OfPnt) myCoords;
78 Handle(Quantity_HArray1OfColor) myColors;
82 bool myRangeInitialized;
83 QVector<int> mySelectedPoints;