VTK
dox/Rendering/Annotation/vtkPolarAxesActor.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCubeAxesActor.h
00005   Language:  C++
00006 
00007 Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen
00008 All rights reserve
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013      PURPOSE.  See the above copyright notice for more information.
00014 =========================================================================*/
00041 #ifndef __vtkPolarAxesActor_h
00042 #define __vtkPolarAxesActor_h
00043 
00044 #define VTK_MAXIMUM_NUMBER_OF_RADIAL_AXES 50
00045 #define VTK_DEFAULT_NUMBER_OF_RADIAL_AXES 5
00046 #define VTK_MAXIMUM_NUMBER_OF_POLAR_AXIS_TICKS 200
00047 #define VTK_POLAR_ARC_RESOLUTION_PER_DEG 0.2
00048 
00049 #include "vtkRenderingAnnotationModule.h" // For export macro
00050 #include "vtkActor.h"
00051 
00052 class vtkAxisActor;
00053 class vtkCamera;
00054 class vtkPolyData;
00055 class vtkPolyDataMapper;
00056 class vtkTextProperty;
00057 
00058 class VTKRENDERINGANNOTATION_EXPORT vtkPolarAxesActor : public vtkActor
00059 {
00060 public:
00061   vtkTypeMacro(vtkPolarAxesActor,vtkActor);
00062   void PrintSelf(ostream& os, vtkIndent indent);
00063 
00066   static vtkPolarAxesActor *New();
00067 
00069 
00070   virtual int RenderOpaqueGeometry(vtkViewport*);
00071   virtual int RenderTranslucentPolygonalGeometry(vtkViewport*) {return 0;};
00073 
00075 
00076   virtual void SetPole( double[3] );
00077   virtual void SetPole( double, double, double );
00078   vtkGetVector3Macro( Pole, double );
00080 
00082 
00083   virtual void SetNumberOfRadialAxes( vtkIdType );
00084   vtkGetMacro( NumberOfRadialAxes, vtkIdType );
00086 
00088 
00090   vtkSetClampMacro( NumberOfPolarAxisTicks, vtkIdType, 0, VTK_MAXIMUM_NUMBER_OF_POLAR_AXIS_TICKS );
00091   vtkGetMacro( NumberOfPolarAxisTicks, vtkIdType );
00093 
00095 
00097   vtkSetMacro( AutoSubdividePolarAxis, bool );
00098   vtkGetMacro( AutoSubdividePolarAxis, bool );
00099   vtkBooleanMacro( AutoSubdividePolarAxis, bool );
00101 
00103 
00104   virtual void SetMaximumRadius( double );
00105   vtkGetMacro( MaximumRadius, double );
00107 
00109 
00111   vtkSetMacro( AutoScaleRadius,bool );
00112   vtkGetMacro( AutoScaleRadius,bool );
00114 
00116 
00117   virtual void SetMinimumAngle( double );
00118   vtkGetMacro( MinimumAngle, double );
00120 
00122 
00123   virtual void SetMaximumAngle( double );
00124   vtkGetMacro( MaximumAngle, double );
00126 
00128 
00130   vtkSetClampMacro( SmallestVisiblePolarAngle, double, 0., 5. );
00131   vtkGetMacro( SmallestVisiblePolarAngle, double );
00133 
00135 
00136   vtkSetMacro( RadialUnits, bool );
00137   vtkGetMacro( RadialUnits, bool );
00139 
00141 
00144   void SetScreenSize( double screenSize );
00145   vtkGetMacro( ScreenSize, double );
00147 
00149 
00151   virtual void SetCamera(vtkCamera*);
00152   vtkGetObjectMacro( Camera,vtkCamera );
00154 
00156 
00157   vtkSetStringMacro( PolarAxisTitle );
00158   vtkGetStringMacro( PolarAxisTitle );
00160 
00162 
00163   vtkSetStringMacro( PolarLabelFormat );
00164   vtkGetStringMacro( PolarLabelFormat );
00166 
00170   void ReleaseGraphicsResources( vtkWindow* );
00171 
00173 
00175   vtkSetMacro( EnableDistanceLOD, int );
00176   vtkGetMacro( EnableDistanceLOD, int );
00178 
00180 
00181   vtkSetClampMacro( DistanceLODThreshold, double, 0.0, 1.0 );
00182   vtkGetMacro( DistanceLODThreshold, double);
00184 
00186 
00188   vtkSetMacro( EnableViewAngleLOD, int );
00189   vtkGetMacro( EnableViewAngleLOD, int );
00191 
00193 
00194   vtkSetClampMacro( ViewAngleLODThreshold, double, 0., 1. );
00195   vtkGetMacro( ViewAngleLODThreshold, double );
00197 
00199 
00200   vtkSetMacro( PolarAxisVisibility, int );
00201   vtkGetMacro( PolarAxisVisibility, int );
00202   vtkBooleanMacro( PolarAxisVisibility, int );
00204 
00206 
00207   vtkSetMacro( PolarTitleVisibility, int );
00208   vtkGetMacro( PolarTitleVisibility, int );
00209   vtkBooleanMacro( PolarTitleVisibility, int );
00211 
00213 
00214   vtkSetMacro( PolarLabelVisibility, int );
00215   vtkGetMacro( PolarLabelVisibility, int );
00216   vtkBooleanMacro( PolarLabelVisibility, int );
00218 
00220 
00221   vtkSetMacro( PolarTickVisibility, int );
00222   vtkGetMacro( PolarTickVisibility, int );
00223   vtkBooleanMacro( PolarTickVisibility, int );
00225 
00227 
00228   vtkSetMacro( RadialAxesVisibility, int );
00229   vtkGetMacro( RadialAxesVisibility, int );
00230   vtkBooleanMacro( RadialAxesVisibility, int );
00232 
00234 
00235   vtkSetMacro( RadialTitleVisibility, int );
00236   vtkGetMacro( RadialTitleVisibility, int );
00237   vtkBooleanMacro( RadialTitleVisibility, int );
00239 
00241 
00242   vtkSetMacro( PolarArcsVisibility, int );
00243   vtkGetMacro( PolarArcsVisibility, int );
00244   vtkBooleanMacro( PolarArcsVisibility, int );
00246 
00248 
00249   virtual void SetPolarAxisTitleTextProperty(vtkTextProperty *p);
00250   vtkGetObjectMacro(PolarAxisTitleTextProperty,vtkTextProperty);
00252 
00254 
00255   virtual void SetPolarAxisLabelTextProperty(vtkTextProperty *p);
00256   vtkGetObjectMacro(PolarAxisLabelTextProperty,vtkTextProperty);
00258 
00260 
00261   virtual void SetPolarAxisProperty(vtkProperty *);
00262   vtkProperty* GetPolarAxisProperty();
00264 
00266 
00267   virtual void SetRadialAxesProperty(vtkProperty *);
00268   vtkProperty* GetRadialAxesProperty();
00270 
00272 
00273   virtual void SetPolarArcsProperty(vtkProperty *);
00274   vtkProperty* GetPolarArcsProperty();
00276 
00278 
00282   vtkSetVector6Macro(Bounds,double);
00283   double *GetBounds();
00284   void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
00285                  double& zmin, double& zmax);
00286   void GetBounds(double bounds[6]);
00288 
00289 protected:
00290   vtkPolarAxesActor();
00291   ~vtkPolarAxesActor();
00292 
00294   void BuildAxes( vtkViewport * );
00295 
00297   void CalculateBounds();
00298 
00300   void SetCommonAxisAttributes( vtkAxisActor* );
00301 
00303   void CreateRadialAxes();
00304 
00306   void BuildRadialAxes();
00307 
00309   void BuildPolarAxisTicks( double );
00310 
00312   void BuildPolarAxisLabelsArcs();
00313 
00315 
00316   double FFix(double );
00317   double FSign(double, double );
00319 
00322   void AutoScale( vtkViewport* viewport );
00323 
00325   double Pole[3];
00326 
00328   int NumberOfRadialAxes;
00329 
00331   int NumberOfPolarAxisTicks;
00332 
00335   bool AutoSubdividePolarAxis;
00336 
00338   double MaximumRadius;
00339 
00342   bool AutoScaleRadius;
00343 
00345   double MinimumAngle;
00346 
00348   double MaximumAngle;
00349 
00351   double SmallestVisiblePolarAngle;
00352 
00354   double Bounds[6];
00355 
00357 
00358   vtkPolyData        *PolarArcs;
00359   vtkPolyDataMapper  *PolarArcsMapper;
00360   vtkActor           *PolarArcsActor;
00362 
00364   vtkCamera *Camera;
00365 
00367   vtkAxisActor* PolarAxis;
00368 
00370   vtkAxisActor** RadialAxes;
00371 
00373 
00375   char *PolarAxisTitle;
00376   char  *PolarLabelFormat;
00378 
00380   bool RadialUnits;
00381 
00384   int EnableDistanceLOD;
00385 
00388   double DistanceLODThreshold;
00389 
00392   int EnableViewAngleLOD;
00393 
00396   double ViewAngleLODThreshold;
00397 
00399 
00400   int PolarAxisVisibility;
00401   int PolarTitleVisibility;
00402   int PolarLabelVisibility;
00403   int PolarTickVisibility;
00405 
00407 
00408   int RadialAxesVisibility;
00409   int RadialTitleVisibility;
00411 
00413   int PolarArcsVisibility;
00414 
00415   int   RenderCount;
00416 
00417   int RenderSomething;
00418 
00420 
00421   vtkTextProperty   *PolarAxisTitleTextProperty;
00422   vtkTextProperty   *PolarAxisLabelTextProperty;
00424 
00426   vtkProperty* PolarAxisProperty;
00427 
00429   vtkProperty* RadialAxesProperty;
00430 
00431   vtkTimeStamp BuildTime;
00432 
00434   double TitleScale;
00435 
00437   double LabelScale;
00438 
00440   double LabelScreenOffset;
00441 
00443   double ScreenSize;
00444 
00445 private:
00446   vtkPolarAxesActor( const vtkPolarAxesActor& ); // Not implemented
00447   void operator=( const vtkPolarAxesActor& ); // Not implemented
00448 };
00449 
00450 
00451 #endif