VTK
vtkQtChartAxisLayer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartAxisLayer.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 _vtkQtChartAxisLayer_h
25 #define _vtkQtChartAxisLayer_h
26 
27 #include "vtkQtChartExport.h"
28 #include "vtkQtChartLayer.h"
29 #include "vtkQtChartAxis.h" // Needed for enum
30 
33 class vtkQtChartAxisLayerItem;
34 class QFont;
35 class QGraphicsRectItem;
36 
37 
41 class VTKQTCHART_EXPORT vtkQtChartAxisLayer : public vtkQtChartLayer
42 {
43  Q_OBJECT
44 
45 public:
47  {
48  ChartSelect = 0,
50  FixedInterval
51  };
52 
53  enum {Type = vtkQtChart_AxisLayerType};
54 
55 public:
57  virtual ~vtkQtChartAxisLayer();
58 
60 
67 
73  vtkQtChartAxis *getHorizontalAxis(vtkQtChartLayer::AxesCorner axes) const;
74 
80  vtkQtChartAxis *getVerticalAxis(vtkQtChartLayer::AxesCorner axes) const;
81 
87  AxisBehavior getAxisBehavior(vtkQtChartAxis::AxisLocation location) const;
88 
93  void setAxisBehavior(vtkQtChartAxis::AxisLocation location,
94  AxisBehavior behavior);
95 
101  const vtkQtChartAxisDomainPriority &getAxisDomainPriority(
103 
108  void setAxisDomainPriority(vtkQtChartAxis::AxisLocation location,
111 
123  virtual void layoutChart(const QRectF &area);
124 
132  virtual void setChartArea(vtkQtChartArea *area);
133 
138  QRectF getLayerBounds() const {return this->LayerBounds;}
139 
140  virtual QRectF boundingRect() const;
141  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
142  QWidget *widget=0);
143 
144 public slots:
146  void handleChartRangeChange();
147 
149  void cancelChartRangeChange();
150 
151 private:
153  void setupAxesCorner();
154 
160  vtkQtChartAxis::AxisDomain getAxisDomain(
162 
170  vtkQtChartAxis::AxisLocation second) const;
171 
179  void findAxisDomain(vtkQtChartAxis::AxisLocation axis,
181  vtkQtChartAxis::AxisDomain neighborDomain,
182  const vtkQtChartLayerDomain &layerDomain,
183  vtkQtChartAxisDomain &axisDomain) const;
184 
185 private:
186  QRectF LayerBounds;
187  QGraphicsRectItem *Border;
188  vtkQtChartAxis *Axis[4];
189  vtkQtChartAxisLayerItem *Option[4];
190  bool RangeChanged;
191 
192 private:
194  vtkQtChartAxisLayer &operator=(const vtkQtChartAxisLayer &);
195 };
196 
197 #endif