VTK
vtkQtChartShape.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkQtChartShape.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 _vtkQtChartShape_h
25 #define _vtkQtChartShape_h
26 
27 #include "vtkQtChartExport.h"
28 
29 class QPointF;
30 class QPolygonF;
31 class QRectF;
32 
33 
38 class VTKQTCHART_EXPORT vtkQtChartShape
39 {
40 public:
42  {
43  Left = 0x01000000,
44  Top = 0x00010000,
45  Right = 0x00000100,
46  Bottom = 0x00000001
47  };
48 
49 public:
51 
56  vtkQtChartShape(int series, int index);
57  vtkQtChartShape(const vtkQtChartShape &other);
58  virtual ~vtkQtChartShape() {}
59 
60  vtkQtChartShape &operator=(const vtkQtChartShape &other);
61 
65  virtual void getBounds(QRectF &bounds) const = 0;
66 
72  virtual bool contains(const QPointF &point) const = 0;
73 
79  virtual bool intersects(const QRectF &area) const = 0;
80 
90  virtual void setRectangle(const QRectF &rectangle);
91 
101  virtual void setPolygon(const QPolygonF &polygon);
102 
107  int getSeries() const {return this->Series;}
108 
112  void setSeries(int series) {this->Series = series;}
113 
118  int getIndex() const {return this->Index;}
119 
123  void setIndex(int index) {this->Index = index;}
124 
125 public:
133  static int getBoundingBoxCode(const QPointF &point, const QRectF &bounds);
134 
139  static int getXBoundingBoxCode(float x, const QRectF &bounds);
140 
145  static int getYBoundingBoxCode(float y, const QRectF &bounds);
146 
147 private:
148  int Series;
149  int Index;
150 };
151 
152 #endif
The vtkQtChartShape class is the base class for shapes used in the chart shape locators.
virtual ~vtkQtChartShape()
int getIndex() const
Gets the index in the series.
void setIndex(int index)
Sets the index in the series.
int getSeries() const
Gets the series number.
void setSeries(int series)
Sets the series number.