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
The vtkQtChartLayerDomain class is used to merge chart layer domains.
The vtkQtChartAxisDomainPriority class stores the domain priority order.
The vtkQtChartAxisDomain class is used to merge similar domains for an axis.
virtual void layoutChart(const QRectF &area)=0
Used to layout the chart layer.
QRectF getLayerBounds() const
Gets the area inside the chart axes.
The vtkQtChartAxisLayer class is used to display the chart axes.
The vtkQtChartLayer class is the base class for all chart drawing layers.
The vtkQtChartArea class manages the chart axes and layers.
The vtkQtChartAxis class is used to display a cartesian axis.
virtual void setChartArea(vtkQtChartArea *area)
Sets the chart area that contains this layer.
The axis labels are determined by space.