VTK
vtkQtChartZoomHistory.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartZoomHistory.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
20 
23 
24 #ifndef _vtkQtChartZoomHistory_h
25 #define _vtkQtChartZoomHistory_h
26 
27 
28 #include "vtkQtChartExport.h"
29 
30 class vtkQtChartZoomHistoryInternal;
31 
32 
40 class VTKQTCHART_EXPORT vtkQtChartZoomViewport
41 {
42 public:
45 
52  void setPosition(float x, float y);
53 
60  void setZoom(float x, float y);
61 
67  float getXPosition() const {return this->X;}
68 
74  float getYPosition() const {return this->Y;}
75 
81  float getXZoom() const {return this->XFactor;}
82 
88  float getYZoom() const {return this->YFactor;}
89 
90 private:
91  float X;
92  float Y;
93  float XFactor;
94  float YFactor;
95 };
96 
97 
124 class VTKQTCHART_EXPORT vtkQtChartZoomHistory
125 {
126 public:
129 
133  void setLimit(int limit);
134 
139  int getLimit() const {return this->Allowed;}
140 
154  void addHistory(float x, float y, float xZoom, float yZoom);
155 
166  void updatePosition(float x, float y);
167 
172  bool isPreviousAvailable() const;
173 
178  bool isNextAvailable() const;
179 
185  const vtkQtChartZoomViewport *getCurrent() const;
186 
193  const vtkQtChartZoomViewport *getPrevious();
194 
201  const vtkQtChartZoomViewport *getNext();
202 
203 private:
205  vtkQtChartZoomHistoryInternal *Internal;
206 
207  int Current;
208  int Allowed;
209 };
210 
211 #endif
float getYZoom() const
Gets the y-axis zoom factor.
int getLimit() const
Gets the maximum number of items in the history.
The vtkQtChartZoomHistory class stores a list of vtkQtChartZoomViewport objects.
float getXPosition() const
Gets the x coordinate of the viewport.
float getXZoom() const
Gets the x-axis zoom factor.
float getYPosition() const
Gets the y coordinate of the viewport.
The vtkQtChartZoomViewport class stores the position and zoom factors for a viewport.