00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00077 #ifndef __vtkCubeAxesActor2D_h
00078 #define __vtkCubeAxesActor2D_h
00079
00080 #include "vtkAxisActor2D.h"
00081 #include "vtkCamera.h"
00082
00083 #define VTK_FLY_OUTER_EDGES 0
00084 #define VTK_FLY_CLOSEST_TRIAD 1
00085
00086 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00087 {
00088 public:
00089 vtkTypeMacro(vtkCubeAxesActor2D,vtkActor2D);
00090 void PrintSelf(ostream& os, vtkIndent indent);
00091
00095 static vtkCubeAxesActor2D *New();
00096
00098
00099 int RenderOverlay(vtkViewport*);
00100 int RenderOpaqueGeometry(vtkViewport*);
00101 int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00103
00105
00108 vtkSetObjectMacro(Input, vtkDataSet);
00109 vtkGetObjectMacro(Input, vtkDataSet);
00111
00113
00115 vtkSetObjectMacro(Prop, vtkProp);
00116 vtkGetObjectMacro(Prop, vtkProp);
00118
00120
00124 vtkSetVector6Macro(Bounds,float);
00125 float *GetBounds();
00126 void GetBounds(float& xmin, float& xmax, float& ymin, float& ymax,
00127 float& zmin, float& zmax);
00128 void GetBounds(float bounds[6]);
00130
00132
00135 vtkSetVector6Macro(Ranges,float);
00136 float *GetRanges();
00137 void GetRanges(float& xmin, float& xmax, float& ymin, float& ymax,
00138 float& zmin, float& zmax);
00139 void GetRanges(float ranges[6]);
00141
00143
00145 vtkSetMacro(UseRanges,int);
00146 vtkGetMacro(UseRanges,int);
00147 vtkBooleanMacro(UseRanges,int);
00149
00151
00153 vtkSetObjectMacro(Camera,vtkCamera);
00154 vtkGetObjectMacro(Camera,vtkCamera);
00156
00158
00160 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00161 vtkGetMacro(FlyMode, int);
00162 void SetFlyModeToOuterEdges()
00163 {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00164 void SetFlyModeToClosestTriad()
00165 {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00167
00169
00173 vtkSetMacro(Scaling,int);
00174 vtkGetMacro(Scaling,int);
00175 vtkBooleanMacro(Scaling,int);
00177
00179
00182 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00183 vtkGetMacro(NumberOfLabels, int);
00185
00187
00189 vtkSetStringMacro(XLabel);
00190 vtkGetStringMacro(XLabel);
00191 vtkSetStringMacro(YLabel);
00192 vtkGetStringMacro(YLabel);
00193 vtkSetStringMacro(ZLabel);
00194 vtkGetStringMacro(ZLabel);
00196
00198
00199 vtkSetMacro(Bold, int);
00200 vtkGetMacro(Bold, int);
00201 vtkBooleanMacro(Bold, int);
00203
00205
00206 vtkSetMacro(Italic, int);
00207 vtkGetMacro(Italic, int);
00208 vtkBooleanMacro(Italic, int);
00210
00212
00214 vtkSetMacro(Shadow, int);
00215 vtkGetMacro(Shadow, int);
00216 vtkBooleanMacro(Shadow, int);
00218
00220
00223 vtkSetMacro(FontFamily, int);
00224 vtkGetMacro(FontFamily, int);
00225 void SetFontFamilyToArial() {this->SetFontFamily(VTK_ARIAL);};
00226 void SetFontFamilyToCourier() {this->SetFontFamily(VTK_COURIER);};
00227 void SetFontFamilyToTimes() {this->SetFontFamily(VTK_TIMES);};
00229
00231
00233 vtkSetStringMacro(LabelFormat);
00234 vtkGetStringMacro(LabelFormat);
00236
00238
00240 vtkSetClampMacro(FontFactor, float, 0.1, 2.0);
00241 vtkGetMacro(FontFactor, float);
00243
00245
00248 vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00249 vtkGetMacro(Inertia, float);
00251
00253
00256 vtkSetMacro(CornerOffset, float);
00257 vtkGetMacro(CornerOffset, float);
00259
00263 void ReleaseGraphicsResources(vtkWindow *);
00264
00266
00267 vtkSetMacro(XAxisVisibility,int);
00268 vtkGetMacro(XAxisVisibility,int);
00269 vtkBooleanMacro(XAxisVisibility,int);
00270 vtkSetMacro(YAxisVisibility,int);
00271 vtkGetMacro(YAxisVisibility,int);
00272 vtkBooleanMacro(YAxisVisibility,int);
00273 vtkSetMacro(ZAxisVisibility,int);
00274 vtkGetMacro(ZAxisVisibility,int);
00275 vtkBooleanMacro(ZAxisVisibility,int);
00277
00279 void ShallowCopy(vtkCubeAxesActor2D *actor);
00280
00281 protected:
00282 vtkCubeAxesActor2D();
00283 ~vtkCubeAxesActor2D();
00284
00285 vtkDataSet *Input;
00286 vtkProp *Prop;
00287 float Bounds[6];
00288 float Ranges[6];
00289 int UseRanges;
00290
00291 vtkCamera *Camera;
00292 int FlyMode;
00293 int Scaling;
00294
00295 vtkAxisActor2D *XAxis;
00296 vtkAxisActor2D *YAxis;
00297 vtkAxisActor2D *ZAxis;
00298
00299 int NumberOfLabels;
00300 char *XLabel;
00301 char *YLabel;
00302 char *ZLabel;
00303 char *Labels[3];
00304
00305 int XAxisVisibility;
00306 int YAxisVisibility;
00307 int ZAxisVisibility;
00308
00309 int Bold;
00310 int Italic;
00311 int Shadow;
00312 int FontFamily;
00313 char *LabelFormat;
00314 float FontFactor;
00315 float CornerOffset;
00316 int Inertia;
00317 int RenderCount;
00318 int InertiaAxes[8];
00319
00320 int RenderSomething;
00321
00322
00323 void TransformBounds(vtkViewport *viewport, float bounds[6],
00324 float pts[8][3]);
00325 int ClipBounds(vtkViewport *viewport, float pts[8][3], float bounds[6]);
00326 float EvaluatePoint(float planes[24], float x[3]);
00327 float EvaluateBounds(float planes[24], float bounds[6]);
00328 void AdjustAxes(float pts[8][3], float bounds[6],
00329 int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
00330 int xAxes, int yAxes, int zAxes,
00331 float xCoords[4], float yCoords[4], float zCoords[4],
00332 float xRange[2], float yRange[2], float zRange[2]);
00333
00334 private:
00335
00336 void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00337 private:
00338 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);
00339 void operator=(const vtkCubeAxesActor2D&);
00340 };
00341
00342
00343 #endif