VTK
|
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 "vtkInteractionWidgetsModule.h" // For export macro 00039 #include "vtkBorderRepresentation.h" 00040 00041 class vtkRenderer; 00042 class vtkRenderWindowInteractor; 00043 class vtkCamera; 00044 class vtkCameraInterpolator; 00045 class vtkPoints; 00046 class vtkPolyData; 00047 class vtkTransformPolyDataFilter; 00048 class vtkPolyDataMapper2D; 00049 class vtkProperty2D; 00050 class vtkActor2D; 00051 00052 class VTKINTERACTIONWIDGETS_EXPORT vtkCameraRepresentation : public vtkBorderRepresentation 00053 { 00054 public: 00056 static vtkCameraRepresentation *New(); 00057 00059 00060 vtkTypeMacro(vtkCameraRepresentation,vtkBorderRepresentation); 00061 void PrintSelf(ostream& os, vtkIndent indent); 00063 00065 00067 void SetCamera(vtkCamera *camera); 00068 vtkGetObjectMacro(Camera,vtkCamera); 00070 00072 00076 void SetInterpolator(vtkCameraInterpolator *camInt); 00077 vtkGetObjectMacro(Interpolator,vtkCameraInterpolator); 00079 00081 00082 vtkSetClampMacro(NumberOfFrames,int,1,VTK_INT_MAX); 00083 vtkGetMacro(NumberOfFrames,int); 00085 00087 00089 vtkGetObjectMacro(Property,vtkProperty2D); 00091 00093 00098 void AddCameraToPath(); 00099 void AnimatePath(vtkRenderWindowInteractor *rwi); 00100 void InitializePath(); 00102 00104 00105 virtual void BuildRepresentation(); 00106 virtual void GetSize(double size[2]) 00107 {size[0]=6.0; size[1]=2.0;} 00109 00111 00113 virtual void GetActors2D(vtkPropCollection*); 00114 virtual void ReleaseGraphicsResources(vtkWindow*); 00115 virtual int RenderOverlay(vtkViewport*); 00116 virtual int RenderOpaqueGeometry(vtkViewport*); 00117 virtual int RenderTranslucentPolygonalGeometry(vtkViewport*); 00118 virtual int HasTranslucentPolygonalGeometry(); 00120 00121 protected: 00122 vtkCameraRepresentation(); 00123 ~vtkCameraRepresentation(); 00124 00125 // the camera and the interpolator 00126 vtkCamera *Camera; 00127 vtkCameraInterpolator *Interpolator; 00128 int NumberOfFrames; 00129 double CurrentTime; 00130 00131 // representation of the camera 00132 vtkPoints *Points; 00133 vtkPolyData *PolyData; 00134 vtkTransformPolyDataFilter *TransformFilter; 00135 vtkPolyDataMapper2D *Mapper; 00136 vtkProperty2D *Property; 00137 vtkActor2D *Actor; 00138 00139 private: 00140 vtkCameraRepresentation(const vtkCameraRepresentation&); //Not implemented 00141 void operator=(const vtkCameraRepresentation&); //Not implemented 00142 }; 00143 00144 #endif