VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCategoryLegend.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 00030 #ifndef __vtkCategoryLegend_h 00031 #define __vtkCategoryLegend_h 00032 00033 #include "vtkChartsCoreModule.h" // For export macro 00034 #include "vtkChartLegend.h" 00035 #include "vtkNew.h" // For vtkNew ivars 00036 #include "vtkStdString.h" // For vtkStdString ivars 00037 #include "vtkVector.h" // For vtkRectf 00038 00039 class vtkScalarsToColors; 00040 class vtkTextProperty; 00041 class vtkVariantArray; 00042 00043 class VTKCHARTSCORE_EXPORT vtkCategoryLegend: public vtkChartLegend 00044 { 00045 public: 00046 vtkTypeMacro(vtkCategoryLegend, vtkChartLegend); 00047 static vtkCategoryLegend* New(); 00048 00050 00051 enum { 00052 VERTICAL = 0, 00053 HORIZONTAL 00054 }; 00056 00058 virtual bool Paint(vtkContext2D *painter); 00059 00062 virtual vtkRectf GetBoundingRect(vtkContext2D* painter); 00063 00065 00068 virtual void SetScalarsToColors(vtkScalarsToColors* stc); 00069 virtual vtkScalarsToColors * GetScalarsToColors(); 00071 00073 00077 vtkGetMacro(Values, vtkVariantArray*); 00078 vtkSetMacro(Values, vtkVariantArray*); 00080 00082 00083 virtual void SetTitle(const vtkStdString &title); 00084 virtual vtkStdString GetTitle(); 00086 00088 00089 vtkGetMacro(OutlierLabel, vtkStdString); 00090 vtkSetMacro(OutlierLabel, vtkStdString); 00092 00093 protected: 00094 vtkCategoryLegend(); 00095 virtual ~vtkCategoryLegend(); 00096 00097 bool HasOutliers; 00098 float TitleWidthOffset; 00099 vtkScalarsToColors* ScalarsToColors; 00100 vtkStdString OutlierLabel; 00101 vtkStdString Title; 00102 vtkNew<vtkTextProperty> TitleProperties; 00103 vtkVariantArray* Values; 00104 00105 private: 00106 vtkCategoryLegend(const vtkCategoryLegend &); // Not implemented. 00107 void operator=(const vtkCategoryLegend &); // Not implemented. 00108 }; 00109 00110 #endif