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 vtkTypeRevisionMacro(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
00105 vtkSetMacro(LegendVisibility,int);
00106 vtkGetMacro(LegendVisibility,int);
00107 vtkBooleanMacro(LegendVisibility,int);
00109
00111
00112 void AllAxesOn();
00113 void AllAxesOff();
00115
00117
00118 void AllAnnotationsOn();
00119 void AllAnnotationsOff();
00121
00123
00126 vtkSetClampMacro(RightBorderOffset,int,5,VTK_LARGE_INTEGER);
00127 vtkGetMacro(RightBorderOffset,int);
00128 vtkSetClampMacro(TopBorderOffset,int,5,VTK_LARGE_INTEGER);
00129 vtkGetMacro(TopBorderOffset,int);
00130 vtkSetClampMacro(LeftBorderOffset,int,5,VTK_LARGE_INTEGER);
00131 vtkGetMacro(LeftBorderOffset,int);
00132 vtkSetClampMacro(BottomBorderOffset,int,5,VTK_LARGE_INTEGER);
00133 vtkGetMacro(BottomBorderOffset,int);
00135
00137
00138 vtkGetObjectMacro(LegendTitleProperty,vtkTextProperty);
00139 vtkGetObjectMacro(LegendLabelProperty,vtkTextProperty);
00141
00143
00146 vtkGetObjectMacro(RightAxis,vtkAxisActor2D);
00147 vtkGetObjectMacro(TopAxis,vtkAxisActor2D);
00148 vtkGetObjectMacro(LeftAxis,vtkAxisActor2D);
00149 vtkGetObjectMacro(BottomAxis,vtkAxisActor2D);
00151
00153
00154 virtual void BuildRepresentation(vtkViewport *viewport);
00155 virtual void GetActors2D(vtkPropCollection*);
00156 virtual void ReleaseGraphicsResources(vtkWindow*);
00157 virtual int RenderOverlay(vtkViewport*);
00158 virtual int RenderOpaqueGeometry(vtkViewport*);
00160
00161 protected:
00162 vtkLegendScaleActor();
00163 ~vtkLegendScaleActor();
00164
00165 int LabelMode;
00166 int RightBorderOffset;
00167 int TopBorderOffset;
00168 int LeftBorderOffset;
00169 int BottomBorderOffset;
00170
00171
00172 vtkAxisActor2D *RightAxis;
00173 vtkAxisActor2D *TopAxis;
00174 vtkAxisActor2D *LeftAxis;
00175 vtkAxisActor2D *BottomAxis;
00176
00177
00178 int RightAxisVisibility;
00179 int TopAxisVisibility;
00180 int LeftAxisVisibility;
00181 int BottomAxisVisibility;
00182
00183
00184 int LegendVisibility;
00185 vtkPolyData *Legend;
00186 vtkPoints *LegendPoints;
00187 vtkPolyDataMapper2D *LegendMapper;
00188 vtkActor2D *LegendActor;
00189 vtkTextMapper *LabelMappers[6];
00190 vtkActor2D *LabelActors[6];
00191 vtkTextProperty *LegendTitleProperty;
00192 vtkTextProperty *LegendLabelProperty;
00193 vtkCoordinate *Coordinate;
00194
00195 vtkTimeStamp BuildTime;
00196
00197 private:
00198 vtkLegendScaleActor(const vtkLegendScaleActor&);
00199 void operator=(const vtkLegendScaleActor&);
00200 };
00201
00202 #endif