VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkLegendScaleActor.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 =========================================================================*/ 00039 #ifndef __vtkLegendScaleActor_h 00040 #define __vtkLegendScaleActor_h 00041 00042 #include "vtkRenderingAnnotationModule.h" // For export macro 00043 #include "vtkProp.h" 00044 #include "vtkCoordinate.h" // For vtkViewportCoordinateMacro 00045 00046 class vtkAxisActor2D; 00047 class vtkTextProperty; 00048 class vtkPolyData; 00049 class vtkPolyDataMapper2D; 00050 class vtkActor2D; 00051 class vtkTextMapper; 00052 class vtkPoints; 00053 class vtkCoordinate; 00054 00055 class VTKRENDERINGANNOTATION_EXPORT vtkLegendScaleActor : public vtkProp 00056 { 00057 public: 00059 static vtkLegendScaleActor *New(); 00060 00062 00063 vtkTypeMacro(vtkLegendScaleActor,vtkProp); 00064 void PrintSelf(ostream& os, vtkIndent indent); 00066 00067 //BTX 00068 enum AttributeLocation 00069 { 00070 DISTANCE=0, 00071 XY_COORDINATES=1 00072 }; 00073 //ETX 00074 00076 00080 vtkSetClampMacro(LabelMode,int,DISTANCE,XY_COORDINATES); 00081 vtkGetMacro(LabelMode,int); 00082 void SetLabelModeToDistance() {this->SetLabelMode(DISTANCE);} 00083 void SetLabelModeToXYCoordinates() {this->SetLabelMode(XY_COORDINATES);} 00085 00087 00090 vtkSetMacro(RightAxisVisibility,int); 00091 vtkGetMacro(RightAxisVisibility,int); 00092 vtkBooleanMacro(RightAxisVisibility,int); 00093 vtkSetMacro(TopAxisVisibility,int); 00094 vtkGetMacro(TopAxisVisibility,int); 00095 vtkBooleanMacro(TopAxisVisibility,int); 00096 vtkSetMacro(LeftAxisVisibility,int); 00097 vtkGetMacro(LeftAxisVisibility,int); 00098 vtkBooleanMacro(LeftAxisVisibility,int); 00099 vtkSetMacro(BottomAxisVisibility,int); 00100 vtkGetMacro(BottomAxisVisibility,int); 00101 vtkBooleanMacro(BottomAxisVisibility,int); 00103 00105 00107 vtkSetMacro(LegendVisibility,int); 00108 vtkGetMacro(LegendVisibility,int); 00109 vtkBooleanMacro(LegendVisibility,int); 00111 00113 00114 void AllAxesOn(); 00115 void AllAxesOff(); 00117 00119 00120 void AllAnnotationsOn(); 00121 void AllAnnotationsOff(); 00123 00125 00128 vtkSetClampMacro(RightBorderOffset,int,5,VTK_INT_MAX); 00129 vtkGetMacro(RightBorderOffset,int); 00131 00133 00136 vtkSetClampMacro(TopBorderOffset,int,5,VTK_INT_MAX); 00137 vtkGetMacro(TopBorderOffset,int); 00139 00141 00144 vtkSetClampMacro(LeftBorderOffset,int,5,VTK_INT_MAX); 00145 vtkGetMacro(LeftBorderOffset,int); 00147 00149 00152 vtkSetClampMacro(BottomBorderOffset,int,5,VTK_INT_MAX); 00153 vtkGetMacro(BottomBorderOffset,int); 00155 00157 00159 vtkSetClampMacro(CornerOffsetFactor, double, 1.0, 10.0); 00160 vtkGetMacro(CornerOffsetFactor, double); 00162 00164 00165 vtkGetObjectMacro(LegendTitleProperty,vtkTextProperty); 00166 vtkGetObjectMacro(LegendLabelProperty,vtkTextProperty); 00168 00170 00173 vtkGetObjectMacro(RightAxis,vtkAxisActor2D); 00174 vtkGetObjectMacro(TopAxis,vtkAxisActor2D); 00175 vtkGetObjectMacro(LeftAxis,vtkAxisActor2D); 00176 vtkGetObjectMacro(BottomAxis,vtkAxisActor2D); 00178 00180 00181 virtual void BuildRepresentation(vtkViewport *viewport); 00182 virtual void GetActors2D(vtkPropCollection*); 00183 virtual void ReleaseGraphicsResources(vtkWindow*); 00184 virtual int RenderOverlay(vtkViewport*); 00185 virtual int RenderOpaqueGeometry(vtkViewport*); 00187 00188 protected: 00189 vtkLegendScaleActor(); 00190 ~vtkLegendScaleActor(); 00191 00192 int LabelMode; 00193 int RightBorderOffset; 00194 int TopBorderOffset; 00195 int LeftBorderOffset; 00196 int BottomBorderOffset; 00197 double CornerOffsetFactor; 00198 00199 // The four axes around the borders of the renderer 00200 vtkAxisActor2D *RightAxis; 00201 vtkAxisActor2D *TopAxis; 00202 vtkAxisActor2D *LeftAxis; 00203 vtkAxisActor2D *BottomAxis; 00204 00205 // Control the display of the axes 00206 int RightAxisVisibility; 00207 int TopAxisVisibility; 00208 int LeftAxisVisibility; 00209 int BottomAxisVisibility; 00210 00211 // Support for the legend. 00212 int LegendVisibility; 00213 vtkPolyData *Legend; 00214 vtkPoints *LegendPoints; 00215 vtkPolyDataMapper2D *LegendMapper; 00216 vtkActor2D *LegendActor; 00217 vtkTextMapper *LabelMappers[6]; 00218 vtkActor2D *LabelActors[6]; 00219 vtkTextProperty *LegendTitleProperty; 00220 vtkTextProperty *LegendLabelProperty; 00221 vtkCoordinate *Coordinate; 00222 00223 vtkTimeStamp BuildTime; 00224 00225 private: 00226 vtkLegendScaleActor(const vtkLegendScaleActor&); //Not implemented 00227 void operator=(const vtkLegendScaleActor&); //Not implemented 00228 }; 00229 00230 #endif