00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00067 #ifndef __vtkCubeAxesActor2D_h
00068 #define __vtkCubeAxesActor2D_h
00069
00070 #include "vtkActor2D.h"
00071
00072 #define VTK_FLY_OUTER_EDGES 0
00073 #define VTK_FLY_CLOSEST_TRIAD 1
00074
00075 class vtkAxisActor2D;
00076 class vtkCamera;
00077 class vtkDataSet;
00078 class vtkTextProperty;
00079
00080 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00081 {
00082 public:
00083 vtkTypeRevisionMacro(vtkCubeAxesActor2D,vtkActor2D);
00084 void PrintSelf(ostream& os, vtkIndent indent);
00085
00089 static vtkCubeAxesActor2D *New();
00090
00092
00093 int RenderOverlay(vtkViewport*);
00094 int RenderOpaqueGeometry(vtkViewport*);
00095 int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00097
00099
00102 virtual void SetInput(vtkDataSet*);
00103 vtkGetObjectMacro(Input, vtkDataSet);
00105
00107
00109 virtual void SetProp(vtkProp*);
00110 vtkGetObjectMacro(Prop, vtkProp);
00112
00114
00118 vtkSetVector6Macro(Bounds,float);
00119 float *GetBounds();
00120 void GetBounds(float& xmin, float& xmax, float& ymin, float& ymax,
00121 float& zmin, float& zmax);
00122 void GetBounds(float bounds[6]);
00124
00126
00129 vtkSetVector6Macro(Ranges,float);
00130 float *GetRanges();
00131 void GetRanges(float& xmin, float& xmax, float& ymin, float& ymax,
00132 float& zmin, float& zmax);
00133 void GetRanges(float ranges[6]);
00135
00137
00139 vtkSetMacro(UseRanges,int);
00140 vtkGetMacro(UseRanges,int);
00141 vtkBooleanMacro(UseRanges,int);
00143
00145
00147 virtual void SetCamera(vtkCamera*);
00148 vtkGetObjectMacro(Camera,vtkCamera);
00150
00152
00154 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00155 vtkGetMacro(FlyMode, int);
00156 void SetFlyModeToOuterEdges()
00157 {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00158 void SetFlyModeToClosestTriad()
00159 {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00161
00163
00167 vtkSetMacro(Scaling,int);
00168 vtkGetMacro(Scaling,int);
00169 vtkBooleanMacro(Scaling,int);
00171
00173
00176 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00177 vtkGetMacro(NumberOfLabels, int);
00179
00181
00183 vtkSetStringMacro(XLabel);
00184 vtkGetStringMacro(XLabel);
00185 vtkSetStringMacro(YLabel);
00186 vtkGetStringMacro(YLabel);
00187 vtkSetStringMacro(ZLabel);
00188 vtkGetStringMacro(ZLabel);
00190
00192
00194 vtkAxisActor2D *GetXAxisActor2D()
00195 {return this->XAxis;}
00196 vtkAxisActor2D *GetYAxisActor2D()
00197 {return this->YAxis;}
00198 vtkAxisActor2D *GetZAxisActor2D()
00199 {return this->ZAxis;}
00201
00203
00205 virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
00206 vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
00208
00210
00212 virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
00213 vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
00215
00216 #ifndef VTK_REMOVE_LEGACY_CODE
00217
00218
00223 virtual void SetFontFamily(int val);
00224 virtual int GetFontFamily();
00225 void SetFontFamilyToArial() { this->SetFontFamily(VTK_ARIAL); };
00226 void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00227 void SetFontFamilyToTimes() { this->SetFontFamily(VTK_TIMES); };
00229 #endif
00230
00231 #ifndef VTK_REMOVE_LEGACY_CODE
00232
00233
00236 virtual void SetBold(int val);
00237 virtual int GetBold();
00238 vtkBooleanMacro(Bold, int);
00240 #endif
00241
00242 #ifndef VTK_REMOVE_LEGACY_CODE
00243
00244
00247 virtual void SetItalic(int val);
00248 virtual int GetItalic();
00249 vtkBooleanMacro(Italic, int);
00251 #endif
00252
00253 #ifndef VTK_REMOVE_LEGACY_CODE
00254
00255
00258 virtual void SetShadow(int val);
00259 virtual int GetShadow();
00260 vtkBooleanMacro(Shadow, int);
00262 #endif
00263
00265
00267 vtkSetStringMacro(LabelFormat);
00268 vtkGetStringMacro(LabelFormat);
00270
00272
00274 vtkSetClampMacro(FontFactor, float, 0.1, 2.0);
00275 vtkGetMacro(FontFactor, float);
00277
00279
00282 vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00283 vtkGetMacro(Inertia, float);
00285
00287
00290 vtkSetMacro(CornerOffset, float);
00291 vtkGetMacro(CornerOffset, float);
00293
00297 void ReleaseGraphicsResources(vtkWindow *);
00298
00300
00301 vtkSetMacro(XAxisVisibility,int);
00302 vtkGetMacro(XAxisVisibility,int);
00303 vtkBooleanMacro(XAxisVisibility,int);
00304 vtkSetMacro(YAxisVisibility,int);
00305 vtkGetMacro(YAxisVisibility,int);
00306 vtkBooleanMacro(YAxisVisibility,int);
00307 vtkSetMacro(ZAxisVisibility,int);
00308 vtkGetMacro(ZAxisVisibility,int);
00309 vtkBooleanMacro(ZAxisVisibility,int);
00311
00313 void ShallowCopy(vtkCubeAxesActor2D *actor);
00314
00315 protected:
00316 vtkCubeAxesActor2D();
00317 ~vtkCubeAxesActor2D();
00318
00319 vtkDataSet *Input;
00320 vtkProp *Prop;
00321 float Bounds[6];
00322 float Ranges[6];
00323 int UseRanges;
00324
00325 vtkCamera *Camera;
00326 int FlyMode;
00327 int Scaling;
00328
00329 vtkAxisActor2D *XAxis;
00330 vtkAxisActor2D *YAxis;
00331 vtkAxisActor2D *ZAxis;
00332
00333 vtkTextProperty *AxisTitleTextProperty;
00334 vtkTextProperty *AxisLabelTextProperty;
00335
00336 vtkTimeStamp BuildTime;
00337
00338 int NumberOfLabels;
00339 char *XLabel;
00340 char *YLabel;
00341 char *ZLabel;
00342 char *Labels[3];
00343
00344 int XAxisVisibility;
00345 int YAxisVisibility;
00346 int ZAxisVisibility;
00347
00348 char *LabelFormat;
00349 float FontFactor;
00350 float CornerOffset;
00351 int Inertia;
00352 int RenderCount;
00353 int InertiaAxes[8];
00354
00355 int RenderSomething;
00356
00357
00358 void TransformBounds(vtkViewport *viewport, float bounds[6],
00359 float pts[8][3]);
00360 int ClipBounds(vtkViewport *viewport, float pts[8][3], float bounds[6]);
00361 float EvaluatePoint(float planes[24], float x[3]);
00362 float EvaluateBounds(float planes[24], float bounds[6]);
00363 void AdjustAxes(float pts[8][3], float bounds[6],
00364 int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
00365 int xAxes, int yAxes, int zAxes,
00366 float xCoords[4], float yCoords[4], float zCoords[4],
00367 float xRange[2], float yRange[2], float zRange[2]);
00368
00369 private:
00370
00371 void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00372 private:
00373 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);
00374 void operator=(const vtkCubeAxesActor2D&);
00375 };
00376
00377
00378 #endif