00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00036 #ifndef __vtkPieChartActor_h
00037 #define __vtkPieChartActor_h
00038
00039 #include "vtkActor2D.h"
00040
00041 class vtkAxisActor2D;
00042 class vtkDataObject;
00043 class vtkPolyData;
00044 class vtkPolyDataMapper2D;
00045 class vtkTextMapper;
00046 class vtkTextProperty;
00047 class vtkLegendBoxActor;
00048 class vtkGlyphSource2D;
00049 class vtkPieceLabelArray;
00050
00051 class VTK_HYBRID_EXPORT vtkPieChartActor : public vtkActor2D
00052 {
00053 public:
00055
00056 vtkTypeRevisionMacro(vtkPieChartActor,vtkActor2D);
00057 void PrintSelf(ostream& os, vtkIndent indent);
00059
00061 static vtkPieChartActor *New();
00062
00064 virtual void SetInput(vtkDataObject*);
00065
00067
00068 vtkGetObjectMacro(Input,vtkDataObject);
00070
00072
00073 vtkSetMacro(TitleVisibility, int);
00074 vtkGetMacro(TitleVisibility, int);
00075 vtkBooleanMacro(TitleVisibility, int);
00077
00079
00080 vtkSetStringMacro(Title);
00081 vtkGetStringMacro(Title);
00083
00085
00087 virtual void SetTitleTextProperty(vtkTextProperty *p);
00088 vtkGetObjectMacro(TitleTextProperty,vtkTextProperty);
00090
00092
00093 vtkSetMacro(LabelVisibility, int);
00094 vtkGetMacro(LabelVisibility, int);
00095 vtkBooleanMacro(LabelVisibility, int);
00097
00099
00101 virtual void SetLabelTextProperty(vtkTextProperty *p);
00102 vtkGetObjectMacro(LabelTextProperty,vtkTextProperty);
00104
00106
00108 void SetPieceColor(int i, double r, double g, double b);
00109 void SetPieceColor(int i, const double color[3])
00110 { this->SetPieceColor(i, color[0], color[1], color[2]); }
00111 double *GetPieceColor(int i);
00113
00115
00117 void SetPieceLabel(const int i, const char *);
00118 const char* GetPieceLabel(int i);
00120
00122
00125 vtkSetMacro(LegendVisibility, int);
00126 vtkGetMacro(LegendVisibility, int);
00127 vtkBooleanMacro(LegendVisibility, int);
00129
00131
00133 vtkGetObjectMacro(LegendActor,vtkLegendBoxActor);
00135
00137
00138 int RenderOverlay(vtkViewport*);
00139 int RenderOpaqueGeometry(vtkViewport*);
00140 virtual int RenderTranslucentPolygonalGeometry(vtkViewport* ) {return 0;}
00142
00144 virtual int HasTranslucentPolygonalGeometry();
00145
00149 void ReleaseGraphicsResources(vtkWindow *);
00150
00151 protected:
00152 vtkPieChartActor();
00153 ~vtkPieChartActor();
00154
00155 private:
00156 vtkDataObject *Input;
00157 vtkIdType ArrayNumber;
00158 vtkIdType ComponentNumber;
00159 int TitleVisibility;
00160 char *Title;
00161 vtkTextProperty *TitleTextProperty;
00162 int LabelVisibility;
00163 vtkTextProperty *LabelTextProperty;
00164 vtkPieceLabelArray *Labels;
00165 int LegendVisibility;
00166 vtkLegendBoxActor *LegendActor;
00167 vtkGlyphSource2D *GlyphSource;
00168
00169
00170 vtkIdType N;
00171 double Total;
00172 double *Fractions;
00173
00174 vtkTextMapper **PieceMappers;
00175 vtkActor2D **PieceActors;
00176
00177 vtkTextMapper *TitleMapper;
00178 vtkActor2D *TitleActor;
00179
00180 vtkPolyData *WebData;
00181 vtkPolyDataMapper2D *WebMapper;
00182 vtkActor2D *WebActor;
00183
00184 vtkPolyData *PlotData;
00185 vtkPolyDataMapper2D *PlotMapper;
00186 vtkActor2D *PlotActor;
00187
00188 vtkTimeStamp BuildTime;
00189
00190 double Center[3];
00191 double Radius;
00192
00193 int LastPosition[2];
00194 int LastPosition2[2];
00195 double P1[3];
00196 double P2[3];
00197
00198 void Initialize();
00199 int PlaceAxes(vtkViewport *viewport, int *size);
00200 int BuildPlot(vtkViewport*);
00201
00202 private:
00203 vtkPieChartActor(const vtkPieChartActor&);
00204 void operator=(const vtkPieChartActor&);
00205 };
00206
00207
00208 #endif
00209