00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00068 #ifndef __vtkCubeAxesActor2D_h
00069 #define __vtkCubeAxesActor2D_h
00070
00071 #include "vtkActor2D.h"
00072
00073 #define VTK_FLY_OUTER_EDGES 0
00074 #define VTK_FLY_CLOSEST_TRIAD 1
00075
00076 class vtkAxisActor2D;
00077 class vtkCamera;
00078 class vtkDataSet;
00079 class vtkTextProperty;
00080
00081 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00082 {
00083 public:
00084 vtkTypeRevisionMacro(vtkCubeAxesActor2D,vtkActor2D);
00085 void PrintSelf(ostream& os, vtkIndent indent);
00086
00090 static vtkCubeAxesActor2D *New();
00091
00093
00094 int RenderOverlay(vtkViewport*);
00095 int RenderOpaqueGeometry(vtkViewport*);
00096 int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00098
00100
00103 virtual void SetInput(vtkDataSet*);
00104 vtkGetObjectMacro(Input, vtkDataSet);
00106
00108
00110 virtual void SetProp(vtkProp*);
00111 vtkGetObjectMacro(Prop, vtkProp);
00113
00115
00119 vtkSetVector6Macro(Bounds,float);
00120 float *GetBounds();
00121 void GetBounds(float& xmin, float& xmax, float& ymin, float& ymax,
00122 float& zmin, float& zmax);
00123 void GetBounds(float bounds[6]);
00125
00127
00130 vtkSetVector6Macro(Ranges,float);
00131 float *GetRanges();
00132 void GetRanges(float& xmin, float& xmax, float& ymin, float& ymax,
00133 float& zmin, float& zmax);
00134 void GetRanges(float ranges[6]);
00136
00138
00140 vtkSetMacro(UseRanges,int);
00141 vtkGetMacro(UseRanges,int);
00142 vtkBooleanMacro(UseRanges,int);
00144
00146
00148 virtual void SetCamera(vtkCamera*);
00149 vtkGetObjectMacro(Camera,vtkCamera);
00151
00153
00155 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00156 vtkGetMacro(FlyMode, int);
00157 void SetFlyModeToOuterEdges()
00158 {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00159 void SetFlyModeToClosestTriad()
00160 {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00162
00164
00168 vtkSetMacro(Scaling,int);
00169 vtkGetMacro(Scaling,int);
00170 vtkBooleanMacro(Scaling,int);
00172
00174
00177 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00178 vtkGetMacro(NumberOfLabels, int);
00180
00182
00184 vtkSetStringMacro(XLabel);
00185 vtkGetStringMacro(XLabel);
00186 vtkSetStringMacro(YLabel);
00187 vtkGetStringMacro(YLabel);
00188 vtkSetStringMacro(ZLabel);
00189 vtkGetStringMacro(ZLabel);
00191
00193
00195 vtkAxisActor2D *GetXAxisActor2D()
00196 {return this->XAxis;}
00197 vtkAxisActor2D *GetYAxisActor2D()
00198 {return this->YAxis;}
00199 vtkAxisActor2D *GetZAxisActor2D()
00200 {return this->ZAxis;}
00202
00204
00206 virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
00207 vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
00209
00211
00213 virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
00214 vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
00216
00217 #ifndef VTK_REMOVE_LEGACY_CODE
00218
00219
00224 virtual void SetFontFamily(int val);
00225 virtual int GetFontFamily();
00226 void SetFontFamilyToArial() { this->SetFontFamily(VTK_ARIAL); };
00227 void SetFontFamilyToCourier() { this->SetFontFamily(VTK_COURIER);};
00228 void SetFontFamilyToTimes() { this->SetFontFamily(VTK_TIMES); };
00230 #endif
00231
00232 #ifndef VTK_REMOVE_LEGACY_CODE
00233
00234
00237 virtual void SetBold(int val);
00238 virtual int GetBold();
00239 vtkBooleanMacro(Bold, int);
00241 #endif
00242
00243 #ifndef VTK_REMOVE_LEGACY_CODE
00244
00245
00248 virtual void SetItalic(int val);
00249 virtual int GetItalic();
00250 vtkBooleanMacro(Italic, int);
00252 #endif
00253
00254 #ifndef VTK_REMOVE_LEGACY_CODE
00255
00256
00259 virtual void SetShadow(int val);
00260 virtual int GetShadow();
00261 vtkBooleanMacro(Shadow, int);
00263 #endif
00264
00266
00268 vtkSetStringMacro(LabelFormat);
00269 vtkGetStringMacro(LabelFormat);
00271
00273
00275 vtkSetClampMacro(FontFactor, float, 0.1, 2.0);
00276 vtkGetMacro(FontFactor, float);
00278
00280
00283 vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00284 vtkGetMacro(Inertia, float);
00286
00288
00291 vtkSetMacro(CornerOffset, float);
00292 vtkGetMacro(CornerOffset, float);
00294
00298 void ReleaseGraphicsResources(vtkWindow *);
00299
00301
00302 vtkSetMacro(XAxisVisibility,int);
00303 vtkGetMacro(XAxisVisibility,int);
00304 vtkBooleanMacro(XAxisVisibility,int);
00305 vtkSetMacro(YAxisVisibility,int);
00306 vtkGetMacro(YAxisVisibility,int);
00307 vtkBooleanMacro(YAxisVisibility,int);
00308 vtkSetMacro(ZAxisVisibility,int);
00309 vtkGetMacro(ZAxisVisibility,int);
00310 vtkBooleanMacro(ZAxisVisibility,int);
00312
00314 void ShallowCopy(vtkCubeAxesActor2D *actor);
00315
00316 protected:
00317 vtkCubeAxesActor2D();
00318 ~vtkCubeAxesActor2D();
00319
00320 vtkDataSet *Input;
00321 vtkProp *Prop;
00322 float Bounds[6];
00323 float Ranges[6];
00324 int UseRanges;
00325
00326 vtkCamera *Camera;
00327 int FlyMode;
00328 int Scaling;
00329
00330 vtkAxisActor2D *XAxis;
00331 vtkAxisActor2D *YAxis;
00332 vtkAxisActor2D *ZAxis;
00333
00334 vtkTextProperty *AxisTitleTextProperty;
00335 vtkTextProperty *AxisLabelTextProperty;
00336
00337 vtkTimeStamp BuildTime;
00338
00339 int NumberOfLabels;
00340 char *XLabel;
00341 char *YLabel;
00342 char *ZLabel;
00343 char *Labels[3];
00344
00345 int XAxisVisibility;
00346 int YAxisVisibility;
00347 int ZAxisVisibility;
00348
00349 char *LabelFormat;
00350 float FontFactor;
00351 float CornerOffset;
00352 int Inertia;
00353 int RenderCount;
00354 int InertiaAxes[8];
00355
00356 int RenderSomething;
00357
00358
00359 void TransformBounds(vtkViewport *viewport, float bounds[6],
00360 float pts[8][3]);
00361 int ClipBounds(vtkViewport *viewport, float pts[8][3], float bounds[6]);
00362 float EvaluatePoint(float planes[24], float x[3]);
00363 float EvaluateBounds(float planes[24], float bounds[6]);
00364 void AdjustAxes(float pts[8][3], float bounds[6],
00365 int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
00366 int xAxes, int yAxes, int zAxes,
00367 float xCoords[4], float yCoords[4], float zCoords[4],
00368 float xRange[2], float yRange[2], float zRange[2]);
00369
00370 private:
00371
00372 void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00373 private:
00374 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);
00375 void operator=(const vtkCubeAxesActor2D&);
00376 };
00377
00378
00379 #endif