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

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 =========================================================================*/
00064 #ifndef __vtkCubeAxesActor2D_h
00065 #define __vtkCubeAxesActor2D_h
00066 
00067 #include "vtkActor2D.h"
00068 
00069 #define VTK_FLY_OUTER_EDGES 0
00070 #define VTK_FLY_CLOSEST_TRIAD 1
00071 
00072 class vtkAxisActor2D;
00073 class vtkCamera;
00074 class vtkDataSet;
00075 class vtkTextProperty;
00076 
00077 class VTK_HYBRID_EXPORT vtkCubeAxesActor2D : public vtkActor2D
00078 {
00079 public:
00080   vtkTypeRevisionMacro(vtkCubeAxesActor2D,vtkActor2D);
00081   void PrintSelf(ostream& os, vtkIndent indent);
00082 
00086   static vtkCubeAxesActor2D *New();
00087   
00089 
00090   int RenderOverlay(vtkViewport*);
00091   int RenderOpaqueGeometry(vtkViewport*);
00092   int RenderTranslucentGeometry(vtkViewport *) {return 0;}
00094 
00096 
00099   virtual void SetInput(vtkDataSet*);
00100   vtkGetObjectMacro(Input, vtkDataSet);
00102 
00104 
00106   virtual void SetProp(vtkProp*);
00107   vtkGetObjectMacro(Prop, vtkProp);
00109   
00111 
00115   vtkSetVector6Macro(Bounds,double);
00116   double *GetBounds();
00117   void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax, 
00118                  double& zmin, double& zmax);
00119   void GetBounds(double bounds[6]);
00121 
00123 
00126   vtkSetVector6Macro(Ranges,double);
00127   double *GetRanges();
00128   void GetRanges(double& xmin, double& xmax, double& ymin, double& ymax, 
00129                  double& zmin, double& zmax);
00130   void GetRanges(double ranges[6]);  
00132 
00134 
00136   vtkSetMacro(UseRanges,int);
00137   vtkGetMacro(UseRanges,int);
00138   vtkBooleanMacro(UseRanges,int);
00140 
00142 
00144   virtual void SetCamera(vtkCamera*);
00145   vtkGetObjectMacro(Camera,vtkCamera);
00147 
00149 
00151   vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_CLOSEST_TRIAD);
00152   vtkGetMacro(FlyMode, int);
00153   void SetFlyModeToOuterEdges()
00154     {this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
00155   void SetFlyModeToClosestTriad()
00156     {this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
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, double);
00234 
00236 
00239   vtkSetMacro(CornerOffset, double);
00240   vtkGetMacro(CornerOffset, double);
00242 
00246   void ReleaseGraphicsResources(vtkWindow *);
00247 
00249 
00250   vtkSetMacro(XAxisVisibility,int);
00251   vtkGetMacro(XAxisVisibility,int);
00252   vtkBooleanMacro(XAxisVisibility,int);
00253   vtkSetMacro(YAxisVisibility,int);
00254   vtkGetMacro(YAxisVisibility,int);
00255   vtkBooleanMacro(YAxisVisibility,int);
00256   vtkSetMacro(ZAxisVisibility,int);
00257   vtkGetMacro(ZAxisVisibility,int);
00258   vtkBooleanMacro(ZAxisVisibility,int);
00260 
00262   void ShallowCopy(vtkCubeAxesActor2D *actor);
00263 
00264 protected:
00265   vtkCubeAxesActor2D();
00266   ~vtkCubeAxesActor2D();
00267 
00268   vtkDataSet *Input;    //Define bounds from input data, or
00269   vtkProp    *Prop;     //Define bounds from actor/assembly, or
00270   double      Bounds[6]; //Define bounds explicitly
00271   double      Ranges[6]; //Define ranges explicitly
00272   int        UseRanges; //Flag to use ranges or not
00273 
00274   vtkCamera *Camera;
00275   int FlyMode;
00276   int Scaling;
00277   
00278   vtkAxisActor2D *XAxis;
00279   vtkAxisActor2D *YAxis;
00280   vtkAxisActor2D *ZAxis;
00281   
00282   vtkTextProperty *AxisTitleTextProperty;
00283   vtkTextProperty *AxisLabelTextProperty;
00284 
00285   vtkTimeStamp  BuildTime;
00286 
00287   int   NumberOfLabels;
00288   char *XLabel;
00289   char *YLabel;
00290   char *ZLabel;
00291   char *Labels[3];
00292 
00293   int XAxisVisibility;
00294   int YAxisVisibility;
00295   int ZAxisVisibility;
00296 
00297   char  *LabelFormat;
00298   double FontFactor;
00299   double CornerOffset;
00300   int   Inertia;
00301   int   RenderCount;
00302   int   InertiaAxes[8];
00303   
00304   int RenderSomething;
00305   
00306   // various helper methods
00307   void TransformBounds(vtkViewport *viewport, double bounds[6], 
00308                        double pts[8][3]);
00309   int ClipBounds(vtkViewport *viewport, double pts[8][3], double bounds[6]);
00310   double EvaluatePoint(double planes[24], double x[3]);
00311   double EvaluateBounds(double planes[24], double bounds[6]);
00312   void AdjustAxes(double pts[8][3], double bounds[6], 
00313                   int idx, int xIdx, int yIdx, int zIdx, int zIdx2, 
00314                   int xAxes, int yAxes, int zAxes,
00315                   double xCoords[4], double yCoords[4], double zCoords[4],
00316                   double xRange[2], double yRange[2], double zRange[2]);
00317 
00318 private:
00319   // hide the superclass' ShallowCopy() from the user and the compiler.
00320   void ShallowCopy(vtkProp *prop) { this->vtkProp::ShallowCopy( prop ); };
00321 private:
00322   vtkCubeAxesActor2D(const vtkCubeAxesActor2D&);  // Not implemented.
00323   void operator=(const vtkCubeAxesActor2D&);  // Not implemented.
00324 };
00325 
00326 
00327 #endif