Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

Hybrid/vtkCubeAxesActor2D.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkCubeAxesActor2D.h,v $
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 =========================================================================*/
00051 #ifndef __vtkCubeAxesActor2D_h
00052 #define __vtkCubeAxesActor2D_h
00053 
00054 #include "vtkActor2D.h"
00055 
00056 #define VTK_FLY_OUTER_EDGES 0
00057 #define VTK_FLY_CLOSEST_TRIAD 1
00058 
00059 class vtkAxisActor2D;
00060 class vtkCamera;
00061 class vtkDataSet;
00062 class vtkTextProperty;
00063 
00064 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00065 {
00066 public:
00067   vtkTypeRevisionMacro(vtkCubeAxesActor2D,vtkActor2D);
00068   void PrintSelf(ostream& os, vtkIndent indent);
00069 
00073   static vtkCubeAxesActor2D *New();
00074   
00076 
00077   int RenderOverlay(vtkViewport*);
00078   int RenderOpaqueGeometry(vtkViewport*);
00079   int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00081 
00083 
00086   virtual void SetInput(vtkDataSet*);
00087   vtkGetObjectMacro(Input, vtkDataSet);
00089 
00091 
00093   virtual void SetProp(vtkProp*);
00094   vtkGetObjectMacro(Prop, vtkProp);
00096   
00098 
00102   vtkSetVector6Macro(Bounds,double);
00103   double *GetBounds();
00104   void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax, 
00105                  double& zmin, double& zmax);
00106   void GetBounds(double bounds[6]);
00108 
00110 
00113   vtkSetVector6Macro(Ranges,double);
00114   double *GetRanges();
00115   void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax, 
00116                  double& zmin, double& zmax);
00117   void GetRanges(double ranges[6]);  
00119 
00121 
00123   vtkSetMacro(UseRanges,int);
00124   vtkGetMacro(UseRanges,int);
00125   vtkBooleanMacro(UseRanges,int);
00127 
00129 
00131   virtual void SetCamera(vtkCamera*);
00132   vtkGetObjectMacro(Camera,vtkCamera);
00134 
00136 
00138   vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00139   vtkGetMacro(FlyMode, int);
00140   void SetFlyModeToOuterEdges()
00141     {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00142   void SetFlyModeToClosestTriad()
00143     {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
00145 
00147 
00151   vtkSetMacro(Scaling,int);
00152   vtkGetMacro(Scaling,int);
00153   vtkBooleanMacro(Scaling,int);
00155 
00157 
00160   vtkSetClampMacro(NumberOfLabels, int, 0, 50);
00161   vtkGetMacro(NumberOfLabels, int);
00163   
00165 
00167   vtkSetStringMacro(XLabel);
00168   vtkGetStringMacro(XLabel);
00169   vtkSetStringMacro(YLabel);
00170   vtkGetStringMacro(YLabel);
00171   vtkSetStringMacro(ZLabel);
00172   vtkGetStringMacro(ZLabel);
00174 
00176 
00178   vtkAxisActor2D *GetXAxisActor2D()
00179     {return this->XAxis;}
00180   vtkAxisActor2D *GetYAxisActor2D()
00181     {return this->YAxis;}
00182   vtkAxisActor2D *GetZAxisActor2D()
00183     {return this->ZAxis;}
00185 
00187 
00189   virtual void SetAxisTitleTextProperty(vtkTextProperty *p);
00190   vtkGetObjectMacro(AxisTitleTextProperty,vtkTextProperty);
00192   
00194 
00196   virtual void SetAxisLabelTextProperty(vtkTextProperty *p);
00197   vtkGetObjectMacro(AxisLabelTextProperty,vtkTextProperty);
00199       
00201 
00203   vtkSetStringMacro(LabelFormat);
00204   vtkGetStringMacro(LabelFormat);
00206   
00208 
00210   vtkSetClampMacro(FontFactor, double, 0.1, 2.0);
00211   vtkGetMacro(FontFactor, double);
00213 
00215 
00218   vtkSetClampMacro(Inertia, int, 1, VTK_LARGE_INTEGER);
00219   vtkGetMacro(Inertia, double);
00221 
00223 
00226   vtkSetMacro(CornerOffset, double);
00227   vtkGetMacro(CornerOffset, double);
00229 
00233   void ReleaseGraphicsResources(vtkWindow *);
00234 
00236 
00237   vtkSetMacro(XAxisVisibility,int);
00238   vtkGetMacro(XAxisVisibility,int);
00239   vtkBooleanMacro(XAxisVisibility,int);
00240   vtkSetMacro(YAxisVisibility,int);
00241   vtkGetMacro(YAxisVisibility,int);
00242   vtkBooleanMacro(YAxisVisibility,int);
00243   vtkSetMacro(ZAxisVisibility,int);
00244   vtkGetMacro(ZAxisVisibility,int);
00245   vtkBooleanMacro(ZAxisVisibility,int);
00247 
00249   void ShallowCopy(vtkCubeAxesActor2D *actor);
00250 
00251 protected:
00252   vtkCubeAxesActor2D();
00253   ~vtkCubeAxesActor2D();
00254 
00255   vtkDataSet *Input;    //Define bounds from input data, or
00256   vtkProp    *Prop;     //Define bounds from actor/assembly, or
00257   double      Bounds[6]; //Define bounds explicitly
00258   double      Ranges[6]; //Define ranges explicitly
00259   int        UseRanges; //Flag to use ranges or not
00260 
00261   vtkCamera *Camera;
00262   int FlyMode;
00263   int Scaling;
00264   
00265   vtkAxisActor2D *XAxis;
00266   vtkAxisActor2D *YAxis;
00267   vtkAxisActor2D *ZAxis;
00268   
00269   vtkTextProperty *AxisTitleTextProperty;
00270   vtkTextProperty *AxisLabelTextProperty;
00271 
00272   vtkTimeStamp  BuildTime;
00273 
00274   int   NumberOfLabels;
00275   char *XLabel;
00276   char *YLabel;
00277   char *ZLabel;
00278   char *Labels[3];
00279 
00280   int XAxisVisibility;
00281   int YAxisVisibility;
00282   int ZAxisVisibility;
00283 
00284   char  *LabelFormat;
00285   double FontFactor;
00286   double CornerOffset;
00287   int   Inertia;
00288   int   RenderCount;
00289   int   InertiaAxes[8];
00290   
00291   int RenderSomething;
00292   
00293   // various helper methods
00294   void TransformBounds(vtkViewport *viewport, double bounds[6], 
00295                        double pts[8][3]);
00296   int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
00297   double EvaluatePoint(double planes[24], double x[3]);
00298   double EvaluateBounds(double planes[24], double bounds[6]);
00299   void AdjustAxes(double pts[8][3], double bounds[6], 
00300                   int idx, int xIdx, int yIdx, int zIdx, int zIdx2, 
00301                   int xAxes, int yAxes, int zAxes,
00302                   double xCoords[4], double yCoords[4], double zCoords[4],
00303                   double xRange[2], double yRange[2], double zRange[2]);
00304 
00305 private:
00306   // hide the superclass' ShallowCopy() from the user and the compiler.
00307   void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00308 private:
00309   vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);  // Not implemented.
00310   void operator=(const vtkCubeAxesActor2D&);  // Not implemented.
00311 };
00312 
00313 
00314 #endif