VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkChartLegend.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 00025 #ifndef __vtkChartLegend_h 00026 #define __vtkChartLegend_h 00027 00028 #include "vtkContextItem.h" 00029 00030 class vtkVector2f; 00031 class vtkChart; 00032 00033 class VTK_CHARTS_EXPORT vtkChartLegend : public vtkContextItem 00034 { 00035 public: 00036 vtkTypeMacro(vtkChartLegend, vtkContextItem); 00037 virtual void PrintSelf(ostream &os, vtkIndent indent); 00038 00040 static vtkChartLegend *New(); 00041 00043 00044 vtkSetVector2Macro(Point, float); 00046 00048 00049 vtkGetVector2Macro(Point, float); 00051 00052 //BTX 00053 enum { 00054 LEFT = 0, 00055 CENTER, 00056 RIGHT, 00057 TOP, 00058 BOTTOM 00059 }; 00060 00062 void SetPoint(const vtkVector2f &point); 00063 00065 const vtkVector2f& GetPointVector(); 00066 //ETX 00067 00069 00070 vtkSetMacro(HorizontalAlignment, int); 00072 00074 00075 vtkGetMacro(HorizontalAlignment, int); 00077 00079 00080 vtkSetMacro(VerticalAlignment, int); 00082 00084 00085 vtkGetMacro(VerticalAlignment, int); 00087 00089 00090 vtkSetMacro(LabelSize, int); 00092 00094 00095 vtkGetMacro(LabelSize, int); 00097 00100 void SetChart(vtkChart* chart); 00101 00104 vtkChart* GetChart(); 00105 00108 virtual void Update(); 00109 00111 virtual bool Paint(vtkContext2D *painter); 00112 00113 //BTX 00114 protected: 00115 vtkChartLegend(); 00116 ~vtkChartLegend(); 00117 00118 float* Point; // The point the legend is anchored to. 00119 int HorizontalAlignment; // Alignment of the legend to the point it is anchored to. 00120 int VerticalAlignment; // Alignment of the legend to the point it is anchored to. 00121 int LabelSize; // The point size of the labels 00122 00123 // Private storage class 00124 class Private; 00125 Private* Storage; 00126 00127 private: 00128 vtkChartLegend(const vtkChartLegend &); // Not implemented. 00129 void operator=(const vtkChartLegend &); // Not implemented. 00130 //ETX 00131 }; 00132 00133 #endif //__vtkChartLegend_h