VTK
dox/Widgets/vtkCameraRepresentation.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkCameraRepresentation.h
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 =========================================================================*/
00035 #ifndef __vtkCameraRepresentation_h
00036 #define __vtkCameraRepresentation_h
00037 
00038 #include "vtkBorderRepresentation.h"
00039 
00040 class vtkRenderer;
00041 class vtkRenderWindowInteractor;
00042 class vtkCamera;
00043 class vtkCameraInterpolator;
00044 class vtkPoints;
00045 class vtkPolyData;
00046 class vtkTransformPolyDataFilter;
00047 class vtkPolyDataMapper2D;
00048 class vtkProperty2D;
00049 class vtkActor2D;
00050 
00051 class VTK_WIDGETS_EXPORT vtkCameraRepresentation : public vtkBorderRepresentation
00052 {
00053 public:
00055   static vtkCameraRepresentation *New();
00056 
00058 
00059   vtkTypeMacro(vtkCameraRepresentation,vtkBorderRepresentation);
00060   void PrintSelf(ostream& os, vtkIndent indent);
00062 
00064 
00066   void SetCamera(vtkCamera *camera);
00067   vtkGetObjectMacro(Camera,vtkCamera);
00069 
00071 
00075   void SetInterpolator(vtkCameraInterpolator *camInt);
00076   vtkGetObjectMacro(Interpolator,vtkCameraInterpolator);
00078   
00080 
00081   vtkSetClampMacro(NumberOfFrames,int,1,VTK_LARGE_INTEGER);
00082   vtkGetMacro(NumberOfFrames,int);
00084 
00086 
00088   vtkGetObjectMacro(Property,vtkProperty2D);
00090 
00092 
00097   void AddCameraToPath();
00098   void AnimatePath(vtkRenderWindowInteractor *rwi);
00099   void InitializePath();
00101 
00103 
00104   virtual void BuildRepresentation();
00105   virtual void GetSize(double size[2])
00106     {size[0]=6.0; size[1]=2.0;}
00108   
00110 
00112   virtual void GetActors2D(vtkPropCollection*);
00113   virtual void ReleaseGraphicsResources(vtkWindow*);
00114   virtual int RenderOverlay(vtkViewport*);
00115   virtual int RenderOpaqueGeometry(vtkViewport*);
00116   virtual int RenderTranslucentPolygonalGeometry(vtkViewport*);
00117   virtual int HasTranslucentPolygonalGeometry();
00119   
00120 protected:
00121   vtkCameraRepresentation();
00122   ~vtkCameraRepresentation();
00123 
00124   // the camera and the interpolator
00125   vtkCamera             *Camera;
00126   vtkCameraInterpolator *Interpolator;
00127   int                   NumberOfFrames;
00128   double                CurrentTime;
00129 
00130   // representation of the camera
00131   vtkPoints                  *Points;
00132   vtkPolyData                *PolyData;
00133   vtkTransformPolyDataFilter *TransformFilter;
00134   vtkPolyDataMapper2D        *Mapper;
00135   vtkProperty2D              *Property;
00136   vtkActor2D                 *Actor;
00137 
00138 private:
00139   vtkCameraRepresentation(const vtkCameraRepresentation&);  //Not implemented
00140   void operator=(const vtkCameraRepresentation&);  //Not implemented
00141 };
00142 
00143 #endif