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

Servers/ServerManager/vtkSMRenderModuleProxy.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkSMRenderModuleProxy.h,v $
00005 
00006   Copyright (c) Kitware, Inc.
00007   All rights reserved.
00008   See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
00022 #ifndef __vtkSMRenderModuleProxy_h
00023 #define __vtkSMRenderModuleProxy_h
00024 
00025 #include "vtkSMProxy.h"
00026 
00027 class vtkCamera;
00028 class vtkCollection;
00029 class vtkImageData;
00030 class vtkRenderWindow;
00031 class vtkRenderWindowInteractor;
00032 class vtkRenderer;
00033 class vtkSMDisplay;
00034 class vtkSMDisplayProxy;
00035 
00036 // TODO: have to change the PVCameraManipulators to do ResetCamera on
00037 // the RenderModule rather than renderer.
00038 class VTK_EXPORT vtkSMRenderModuleProxy : public vtkSMProxy
00039 {
00040 public:
00041   vtkTypeRevisionMacro(vtkSMRenderModuleProxy, vtkSMProxy);
00042   void PrintSelf(ostream& os, vtkIndent indent);
00043 
00045 
00049   virtual void AddDisplay(vtkSMDisplayProxy* disp);
00050   virtual void RemoveDisplay(vtkSMDisplayProxy* disp);
00052 
00055   virtual void RemoveAllDisplays();
00056 
00058 
00059   virtual void StillRender();
00060   virtual void InteractiveRender();
00062   
00065   virtual vtkSMDisplayProxy* CreateDisplayProxy();
00066 
00068   virtual void CacheUpdate(int idx, int total);
00069 
00071   virtual void InvalidateAllGeometries();
00072 
00074   void SetUseTriangleStrips(int val);
00075   
00077   void SetUseImmediateMode(int val);
00078    
00080 
00081   vtkGetObjectMacro(Renderer, vtkRenderer);
00082   vtkGetObjectMacro(Renderer2D, vtkRenderer);
00083   vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
00084   vtkGetObjectMacro(Interactor, vtkRenderWindowInteractor);
00086 
00088   void SetBackgroundColorCM(double rgb[3]);
00089 
00091   void ResetCameraClippingRange();
00092 
00094 
00095   vtkSetMacro(RenderInterruptsEnabled,int);
00096   vtkGetMacro(RenderInterruptsEnabled,int);
00097   vtkBooleanMacro(RenderInterruptsEnabled,int);
00099 
00101   void ComputeVisiblePropBounds(double bounds[6]);
00102 
00104 
00105   vtkGetObjectMacro(Displays, vtkCollection);
00107 
00110   virtual double GetZBufferValue(int x, int y);
00111 
00113   void ResetCamera(double bds[6]);
00114 
00117   void ResetCamera();
00118   
00122   virtual void SaveInBatchScript(ofstream* file);
00123 
00126   void SynchronizeCameraProperties();
00127 
00130   void SynchronizeRenderers();
00131 
00133   virtual int WriteImage(const char* filename, const char* writerName);
00134 
00136   void SetUseLight(int enable);
00137 
00140   int GetServerRenderWindowSize(int size[2]);
00141 
00144   virtual void SaveState(const char* name, ostream* file, vtkIndent indent);
00145 
00147   virtual int IsRenderLocal() { return 1; }
00148 
00150   virtual void UpdateAllDisplays();  
00151 
00154   virtual vtkImageData* CaptureWindow(int magnification);
00155 
00156 protected:
00157   vtkSMRenderModuleProxy();
00158   ~vtkSMRenderModuleProxy();
00159 
00163   virtual void CreateVTKObjects(int numObjects);
00164 
00166   void UnRegisterVTKObjects();
00167 
00168   // This collection keeps a reference to all Display Proxies added
00169   // to this module.
00170   vtkCollection* Displays;
00171 
00172   // Collection of props added to the renderer.
00173   vtkCollection* RendererProps; 
00174 
00175   // Collection of props added to the renderer2D.
00176   vtkCollection* Renderer2DProps;
00177  
00178   vtkSMProxy* RendererProxy;
00179   vtkSMProxy* Renderer2DProxy;
00180   vtkSMProxy* ActiveCameraProxy;
00181   vtkSMProxy* RenderWindowProxy;
00182   vtkSMProxy* InteractorProxy;
00183   vtkSMProxy* LightKitProxy;
00184   vtkSMProxy* LightProxy;
00185 
00186   vtkGetObjectMacro(RendererProxy, vtkSMProxy);
00187   vtkGetObjectMacro(Renderer2DProxy, vtkSMProxy);
00188   vtkGetObjectMacro(ActiveCameraProxy, vtkSMProxy);
00189   vtkGetObjectMacro(InteractorProxy, vtkSMProxy);
00190   vtkGetObjectMacro(LightKitProxy, vtkSMProxy);
00191   vtkGetObjectMacro(LightProxy, vtkSMProxy);
00192 
00193   // Pointer to client side objects,
00194   // for convienience.
00195   vtkRenderer* Renderer2D;
00196   vtkRenderer* Renderer;
00197   vtkRenderWindow* RenderWindow;
00198   vtkRenderWindowInteractor* Interactor;
00199   vtkCamera* ActiveCamera;
00200   
00201 
00203 
00206   virtual void AddPropToRenderer(vtkSMProxy* proxy);
00207   virtual void AddPropToRenderer2D(vtkSMProxy* proxy);
00208   virtual void RemovePropFromRenderer(vtkSMProxy* proxy);
00209   virtual void RemovePropFromRenderer2D(vtkSMProxy* proxy);
00211   
00212   //BTX
00213   friend class vtkSMDisplayProxy;
00214   //ETX
00215 
00216   // This is the XMLName of the proxy to get created when CreateDisplayProxy
00217   // is called. It must be a proxy belonging to the group "displays"
00218   // and must be a subclass of vtkSMDisplayProxy.
00219   char* DisplayXMLName;
00220   vtkSetStringMacro(DisplayXMLName);
00221 
00222   int RenderInterruptsEnabled;
00223   int ResetCameraClippingRangeTag;
00224   int AbortCheckTag;
00225   int StartRenderEventTag;
00226 
00228 
00230   virtual void BeginStillRender();
00231   virtual void EndStillRender();
00233 
00234   virtual void BeginInteractiveRender();
00235   virtual void EndInteractiveRender();
00236   
00237   
00238 
00239 private:
00240   vtkSMRenderModuleProxy(const vtkSMRenderModuleProxy&); // Not implemented.
00241   void operator=(const vtkSMRenderModuleProxy&); // Not implemented.
00242 };
00243 
00244 
00245 #endif
00246 

Generated on Tue May 30 12:31:49 2006 for ParaView by doxygen 1.3.5