00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00048 #ifndef __vtkCubeAxesActor2D_h
00049 #define __vtkCubeAxesActor2D_h
00050
00051 #include "vtkActor2D.h"
00052
00053 #define VTK_FLY_OUTER_EDGES 0
00054 #define VTK_FLY_CLOSEST_TRIAD 1
00055 #define VTK_FLY_NONE 2
00056
00057 class vtkAxisActor2D;
00058 class vtkCamera;
00059 class vtkDataSet;
00060 class vtkTextProperty;
00061
00062 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00063 {
00064 public:
00065 vtkTypeRevisionMacro(vtkCubeAxesActor2D,vtkActor2D);
00066 void PrintSelf(ostream& os, vtkIndent indent);
00067
00071 static vtkCubeAxesActor2D *New();
00072
00074
00075 int RenderOverlay(vtkViewport*);
00076 int RenderOpaqueGeometry(vtkViewport*);
00077 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *) {return 0;}
00079
00081 virtual int HasTranslucentPolygonalGeometry();
00082
00084
00087 virtual void SetInput(vtkDataSet*);
00088 vtkGetObjectMacro(Input, vtkDataSet);
00090
00092
00094 void SetViewProp(vtkProp* prop);
00095 vtkGetObjectMacro(ViewProp, vtkProp);
00097
00099
00103 vtkSetVector6Macro(Bounds,double);
00104 double *GetBounds();
00105 void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
00106 double& zmin, double& zmax);
00107 void GetBounds(double bounds[6]);
00109
00111
00114 vtkSetVector6Macro(Ranges,double);
00115 double *GetRanges();
00116 void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax,
00117 double& zmin, double& zmax);
00118 void GetRanges(double ranges[6]);
00120
00122
00125 vtkSetMacro( XOrigin, double );
00126 vtkSetMacro( YOrigin, double );
00127 vtkSetMacro( ZOrigin, double );
00129
00131
00133 vtkSetMacro(UseRanges,int);
00134 vtkGetMacro(UseRanges,int);
00135 vtkBooleanMacro(UseRanges,int);
00137
00139
00141 virtual void SetCamera(vtkCamera*);
00142 vtkGetObjectMacro(Camera,vtkCamera);
00144
00146
00149 vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_NONE);
00150 vtkGetMacro(FlyMode, int);
00151 void SetFlyModeToOuterEdges()
00152 {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00153 void SetFlyModeToClosestTriad()
00154 {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00155 void SetFlyModeToNone()
00156 {this->SetFlyMode(VTK_FLY_NONE);};
00158
00160
00164 vtkSetMacro(Scaling,int);
00165 vtkGetMacro(Scaling,int);
00166 vtkBooleanMacro(Scaling,int);
00168
00170
00173 vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00174 vtkGetMacro(NumberOfLabels, int);
00176
00178
00180 vtkSetStringMacro(XLabel);
00181 vtkGetStringMacro(XLabel);
00182 vtkSetStringMacro(YLabel);
00183 vtkGetStringMacro(YLabel);
00184 vtkSetStringMacro(ZLabel);
00185 vtkGetStringMacro(ZLabel);
00187
00189
00191 vtkAxisActor2D *GetXAxisActor2D()
00192 {return this->XAxis;}
00193 vtkAxisActor2D *GetYAxisActor2D()
00194 {return this->YAxis;}
00195 vtkAxisActor2D *GetZAxisActor2D()
00196 {return this->ZAxis;}
00198
00200
00202 virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
00203 vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
00205
00207
00209 virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
00210 vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
00212
00214
00216 vtkSetStringMacro(LabelFormat);
00217 vtkGetStringMacro(LabelFormat);
00219
00221
00223 vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
00224 vtkGetMacro(FontFactor, double);
00226
00228
00231 vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00232 vtkGetMacro(Inertia, int);
00234
00236
00242 vtkSetClampMacro(ShowActualBounds, int, 0, 1);
00243 vtkGetMacro(ShowActualBounds, int);
00245
00247
00250 vtkSetMacro(CornerOffset, double);
00251 vtkGetMacro(CornerOffset, double);
00253
00257 void ReleaseGraphicsResources(vtkWindow *);
00258
00260
00261 vtkSetMacro(XAxisVisibility,int);
00262 vtkGetMacro(XAxisVisibility,int);
00263 vtkBooleanMacro(XAxisVisibility,int);
00264 vtkSetMacro(YAxisVisibility,int);
00265 vtkGetMacro(YAxisVisibility,int);
00266 vtkBooleanMacro(YAxisVisibility,int);
00267 vtkSetMacro(ZAxisVisibility,int);
00268 vtkGetMacro(ZAxisVisibility,int);
00269 vtkBooleanMacro(ZAxisVisibility,int);
00271
00273 void ShallowCopy(vtkCubeAxesActor2D *actor);
00274
00275
00276 #if defined(_COMPILER_VERSION)
00277 # pragma set woff 3303
00278 #endif
00279 #if defined(__INTEL_COMPILER)
00280 # pragma warning (push)
00281 # pragma warning (disable:858)
00282 #endif
00283
00284 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00285 # define SetPropA SetProp
00286 # define SetPropW SetProp
00287 # define GetPropA GetProp
00288 # define GetPropW GetProp
00289 #endif
00290
00293 VTK_LEGACY(virtual void SetProp(vtkProp* prop));
00294
00297 VTK_LEGACY(virtual vtkProp* GetProp());
00298
00299 #ifdef VTK_WORKAROUND_WINDOWS_MANGLE
00300 # undef SetPropW
00301 # undef SetPropA
00302 # undef GetPropW
00303 # undef GetPropA
00304
00305 VTK_LEGACY(virtual void SetPropA(vtkProp* prop));
00306 VTK_LEGACY(virtual void SetPropW(vtkProp* prop));
00307 VTK_LEGACY(virtual vtkProp* GetPropA());
00308 VTK_LEGACY(virtual vtkProp* GetPropW());
00309
00310 #endif
00311
00312
00313 #if defined(__INTEL_COMPILER)
00314 # pragma warning (pop)
00315 #endif
00316 #if defined(_COMPILER_VERSION)
00317 # pragma reset woff 3303
00318 #endif
00319
00320 protected:
00321 vtkCubeAxesActor2D();
00322 ~vtkCubeAxesActor2D();
00323
00324 vtkDataSet *Input;
00325 vtkProp *ViewProp;
00326 double Bounds[6];
00327 double Ranges[6];
00328 int UseRanges;
00329
00330 vtkCamera *Camera;
00331 int FlyMode;
00332 int Scaling;
00333
00334 vtkAxisActor2D *XAxis;
00335 vtkAxisActor2D *YAxis;
00336 vtkAxisActor2D *ZAxis;
00337
00338 vtkTextProperty *AxisTitleTextProperty;
00339 vtkTextProperty *AxisLabelTextProperty;
00340
00341 vtkTimeStamp BuildTime;
00342
00343 int NumberOfLabels;
00344 char *XLabel;
00345 char *YLabel;
00346 char *ZLabel;
00347 char *Labels[3];
00348
00349 int XAxisVisibility;
00350 int YAxisVisibility;
00351 int ZAxisVisibility;
00352
00353 char *LabelFormat;
00354 double FontFactor;
00355 double CornerOffset;
00356 int Inertia;
00357 int RenderCount;
00358 int InertiaAxes[8];
00359
00360 int RenderSomething;
00361
00362
00363 int ShowActualBounds;
00364
00365 double XOrigin;
00366 double YOrigin;
00367 double ZOrigin;
00368
00369
00370 void TransformBounds(vtkViewport *viewport, double bounds[6],
00371 double pts[8][3]);
00372 int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
00373 double EvaluatePoint(double planes[24], double x[3]);
00374 double EvaluateBounds(double planes[24], double bounds[6]);
00375 void AdjustAxes(double pts[8][3], double bounds[6],
00376 int idx, int xIdx, int yIdx, int zIdx, int zIdx2,
00377 int xAxes, int yAxes, int zAxes,
00378 double xCoords[4], double yCoords[4], double zCoords[4],
00379 double xRange[2], double yRange[2], double zRange[2]);
00380
00381 private:
00382
00383 void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00384 private:
00385 vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);
00386 void operator=(const vtkCubeAxesActor2D&);
00387 };
00388
00389
00390 #endif