00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00039 #ifndef __vtkLegendScaleActor_h
00040 #define __vtkLegendScaleActor_h
00041
00042 #include "vtkProp.h"
00043 #include "vtkCoordinate.h"
00044
00045 class vtkAxisActor2D;
00046 class vtkTextProperty;
00047 class vtkPolyData;
00048 class vtkPolyDataMapper2D;
00049 class vtkActor2D;
00050 class vtkTextMapper;
00051 class vtkPoints;
00052 class vtkCoordinate;
00053
00054 class VTK_HYBRID_EXPORT vtkLegendScaleActor : public vtkProp
00055 {
00056 public:
00058 static vtkLegendScaleActor *New();
00059
00061
00062 vtkTypeMacro(vtkLegendScaleActor,vtkProp);
00063 void PrintSelf(ostream& os, vtkIndent indent);
00065
00066
00067 enum AttributeLocation
00068 {
00069 DISTANCE=0,
00070 XY_COORDINATES=1
00071 };
00072
00073
00075
00079 vtkSetClampMacro(LabelMode,int,DISTANCE,XY_COORDINATES);
00080 vtkGetMacro(LabelMode,int);
00081 void SetLabelModeToDistance() {this->SetLabelMode(DISTANCE);}
00082 void SetLabelModeToXYCoordinates() {this->SetLabelMode(XY_COORDINATES);}
00084
00086
00089 vtkSetMacro(RightAxisVisibility,int);
00090 vtkGetMacro(RightAxisVisibility,int);
00091 vtkBooleanMacro(RightAxisVisibility,int);
00092 vtkSetMacro(TopAxisVisibility,int);
00093 vtkGetMacro(TopAxisVisibility,int);
00094 vtkBooleanMacro(TopAxisVisibility,int);
00095 vtkSetMacro(LeftAxisVisibility,int);
00096 vtkGetMacro(LeftAxisVisibility,int);
00097 vtkBooleanMacro(LeftAxisVisibility,int);
00098 vtkSetMacro(BottomAxisVisibility,int);
00099 vtkGetMacro(BottomAxisVisibility,int);
00100 vtkBooleanMacro(BottomAxisVisibility,int);
00102
00104
00106 vtkSetMacro(LegendVisibility,int);
00107 vtkGetMacro(LegendVisibility,int);
00108 vtkBooleanMacro(LegendVisibility,int);
00110
00112
00113 void AllAxesOn();
00114 void AllAxesOff();
00116
00118
00119 void AllAnnotationsOn();
00120 void AllAnnotationsOff();
00122
00124
00127 vtkSetClampMacro(RightBorderOffset,int,5,VTK_LARGE_INTEGER);
00128 vtkGetMacro(RightBorderOffset,int);
00130
00132
00135 vtkSetClampMacro(TopBorderOffset,int,5,VTK_LARGE_INTEGER);
00136 vtkGetMacro(TopBorderOffset,int);
00138
00140
00143 vtkSetClampMacro(LeftBorderOffset,int,5,VTK_LARGE_INTEGER);
00144 vtkGetMacro(LeftBorderOffset,int);
00146
00148
00151 vtkSetClampMacro(BottomBorderOffset,int,5,VTK_LARGE_INTEGER);
00152 vtkGetMacro(BottomBorderOffset,int);
00154
00156
00158 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0);
00159 vtkGetMacro(CornerOffsetFactor, double);
00161
00163
00164 vtkGetObjectMacro(LegendTitleProperty,vtkTextProperty);
00165 vtkGetObjectMacro(LegendLabelProperty,vtkTextProperty);
00167
00169
00172 vtkGetObjectMacro(RightAxis,vtkAxisActor2D);
00173 vtkGetObjectMacro(TopAxis,vtkAxisActor2D);
00174 vtkGetObjectMacro(LeftAxis,vtkAxisActor2D);
00175 vtkGetObjectMacro(BottomAxis,vtkAxisActor2D);
00177
00179
00180 virtual void BuildRepresentation(vtkViewport *viewport);
00181 virtual void GetActors2D(vtkPropCollection*);
00182 virtual void ReleaseGraphicsResources(vtkWindow*);
00183 virtual int RenderOverlay(vtkViewport*);
00184 virtual int RenderOpaqueGeometry(vtkViewport*);
00186
00187 protected:
00188 vtkLegendScaleActor();
00189 ~vtkLegendScaleActor();
00190
00191 int LabelMode;
00192 int RightBorderOffset;
00193 int TopBorderOffset;
00194 int LeftBorderOffset;
00195 int BottomBorderOffset;
00196 double CornerOffsetFactor;
00197
00198
00199 vtkAxisActor2D *RightAxis;
00200 vtkAxisActor2D *TopAxis;
00201 vtkAxisActor2D *LeftAxis;
00202 vtkAxisActor2D *BottomAxis;
00203
00204
00205 int RightAxisVisibility;
00206 int TopAxisVisibility;
00207 int LeftAxisVisibility;
00208 int BottomAxisVisibility;
00209
00210
00211 int LegendVisibility;
00212 vtkPolyData *Legend;
00213 vtkPoints *LegendPoints;
00214 vtkPolyDataMapper2D *LegendMapper;
00215 vtkActor2D *LegendActor;
00216 vtkTextMapper *LabelMappers[6];
00217 vtkActor2D *LabelActors[6];
00218 vtkTextProperty *LegendTitleProperty;
00219 vtkTextProperty *LegendLabelProperty;
00220 vtkCoordinate *Coordinate;
00221
00222 vtkTimeStamp BuildTime;
00223
00224 private:
00225 vtkLegendScaleActor(const vtkLegendScaleActor&);
00226 void operator=(const vtkLegendScaleActor&);
00227 };
00228
00229 #endif