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>
26 class HYDROData_Bathymetry;
28 class HYDROGUI_OCCDisplayer;
29 class OCCViewer_ViewWindow;
31 class HYDROGUI_ShapeBathymetry : public HYDROGUI_Shape
34 HYDROGUI_ShapeBathymetry( HYDROGUI_OCCDisplayer* theDisplayer,
35 const Handle(AIS_InteractiveContext)& theContext,
36 const Handle(HYDROData_Bathymetry)& theBathymetry,
37 const int theZLayer = -1 );
38 virtual ~HYDROGUI_ShapeBathymetry();
40 void GetRange( double& theMin, double& theMax ) const;
41 void UpdateWithColorScale( const Handle(AIS_ColorScale)& );
43 // Re-scale by visible points
44 void RescaleByVisible( OCCViewer_ViewWindow* );
45 // Re-scale by selected points
46 void RescaleBySelection();
47 // Custom (user) re-scale
48 void Rescale( double theMin, double theMax );
49 // Default re-scale (by all points)
50 void RescaleDefault();
52 void TextLabels( bool isOn );
54 virtual void display( const bool theIsUpdateViewer = true );
55 virtual void erase( const bool theIsUpdateViewer = true );
57 virtual void update( bool isUpdateViewer,
58 bool isDeactivateSelection );
60 virtual void setVisible( const bool theState,
61 const bool theIsUpdateViewer = true );
66 virtual Handle(AIS_InteractiveObject) createShape() const;
67 virtual void displayShape( const bool theIsUpdateViewer );
69 void setToUpdateColorScale( bool isChanged );
70 void Rescale( const QList<int>& theIndices, bool isForcedAll );
72 QList<int> selected() const;
75 HYDROGUI_OCCDisplayer* myDisplayer;
76 Handle(TColgp_HArray1OfPnt) myCoords;
77 Handle(Quantity_HArray1OfColor) myColors;
81 bool myRangeInitialized;