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

GUI/Client/vtkPVRenderView.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   ParaView
00004   Module:    $RCSfile: vtkPVRenderView.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 =========================================================================*/
00029 #ifndef __vtkPVRenderView_h
00030 #define __vtkPVRenderView_h
00031 
00032 #include "vtkKWView.h"
00033 
00034 class vtkInteractorObserver;
00035 class vtkKWChangeColorButton;
00036 class vtkKWLabel;
00037 class vtkKWPushButton;
00038 class vtkKWRadioButton;
00039 class vtkKWScaleWithEntry;
00040 class vtkKWTopLevel;
00041 class vtkPVSourceNotebook;
00042 class vtkKWSplitFrame;
00043 class vtkMultiProcessController;
00044 class vtkPVApplication;
00045 class vtkPVAxesWidget;
00046 class vtkPVCameraIcon;
00047 class vtkPVCameraControl;
00048 class vtkPVCornerAnnotationEditor;
00049 class vtkPVData;
00050 class vtkPVInteractorStyleControl;
00051 class vtkPVSource;
00052 class vtkPVSourceList;
00053 class vtkPVSourcesNavigationWindow;
00054 class vtkPVTreeComposite;
00055 class vtkPVWindow;
00056 class vtkPVRenderModuleUI;
00057 class vtkPVRenderViewObserver;
00058 class vtkSMRenderModuleProxy;
00059 class vtkTimerLog;
00060 class vtkSMProxy;
00061 
00062 #define VTK_PV_VIEW_MENU_LABEL       " 3D View Properties"
00063 
00064 class VTK_EXPORT vtkPVRenderView : public vtkKWView
00065 {
00066 public:
00067   static vtkPVRenderView* New();
00068   vtkTypeRevisionMacro(vtkPVRenderView,vtkKWView);
00069   void PrintSelf(ostream& os, vtkIndent indent);
00070 
00072 
00074   void AddAnnotationProp(vtkPVCornerAnnotationEditor *c);
00075   void RemoveAnnotationProp(vtkPVCornerAnnotationEditor *c);
00077 
00079   void CreateRenderObjects(vtkPVApplication *pvApp);
00080   
00082   virtual void CreateViewProperties();
00083   
00085   virtual void Create(vtkKWApplication *app);
00086   
00088   void ResetCamera();
00089   
00091 
00092   void SetCameraState(float p0, float p1, float p2,
00093                       float fp0, float fp1, float fp2,
00094                       float up0, float up1, float up2);
00096   
00098   void SetCameraParallelScale(float scale);
00099 
00101   void StandardViewCallback(float x, float y, float z);
00102 
00104 
00105   virtual void SaveAsImage() { this->Superclass::SaveAsImage(); }
00106   virtual void SaveAsImage(const char* filename) ;
00108 
00110 
00112   vtkGetObjectMacro(RenderModuleProxy, vtkSMRenderModuleProxy);
00114   
00116   vtkPVApplication *GetPVApplication();
00117 
00119 
00120   void Render();
00121   void ForceRender();
00122   void EventuallyRender();
00123   void EventuallyRenderCallBack();
00124   void DisableRendering();
00126 
00130   void UpdateTclButAvoidRendering();
00131   
00133 
00134   void Exposed();
00135   void Configured();
00137   
00139   void UpdateNavigationWindow(vtkPVSource *currentSource, int nobind);
00140 
00142 
00143   vtkGetObjectMacro(NavigationFrame, vtkKWFrameWithLabel);
00145 
00147 
00150   void ShowNavigationWindowCallback(int registry);
00151   void ShowSelectionWindowCallback(int registry);
00153   
00155 
00156   void SaveInBatchScript(ofstream *file);
00157   void SaveState(ofstream *file);
00159 
00161   void SetRendererBackgroundColor(double r, double g, double b);
00162 
00165   virtual void Close();
00166 
00169   void PrepareForDelete();
00170   
00172 
00173   vtkGetObjectMacro(ParallelProjectionCheck, vtkKWCheckButton);
00175 
00177 
00178   void ParallelProjectionCallback();
00179   void ParallelProjectionOn();
00180   void ParallelProjectionOff();
00182   
00184 
00185   void TriangleStripsCallback();
00186   void SetUseTriangleStrips(int state);
00188   
00190 
00191   void ImmediateModeCallback();
00192   void SetUseImmediateMode(int state);
00194   
00196 
00197   vtkGetObjectMacro(TriangleStripsCheck, vtkKWCheckButton);
00199   
00201 
00202   vtkGetObjectMacro(ImmediateModeCheck, vtkKWCheckButton);
00204 
00206   vtkPVWindow *GetPVWindow();
00207 
00209 
00210   vtkGetObjectMacro(ManipulatorControl3D, vtkPVInteractorStyleControl);
00211   vtkGetObjectMacro(ManipulatorControl2D, vtkPVInteractorStyleControl);
00213 
00215 
00216   vtkGetObjectMacro(CameraControl, vtkPVCameraControl);
00218   
00220   int* GetRenderWindowSize();
00221 
00224   void SetupCameraManipulators();
00225 
00227   void UpdateCameraManipulators();
00228 
00230 
00231   virtual vtkKWWidget *GetSourceParent();
00232   vtkKWSplitFrame *GetSplitFrame() {return this->SplitFrame;}
00234 
00236 
00240   vtkGetObjectMacro(SourceNotebook,vtkPVSourceNotebook);
00242 
00245   void ExecuteEvent(vtkObject* wdg, unsigned long event, void* calldata);
00246 
00249   void StoreCurrentCamera(int position);
00250   
00252   void RestoreCurrentCamera(int position);  
00253 
00255 
00256   void Display3DWidgetsCallback();
00257   void SetDisplay3DWidgets(int s);
00259 
00261   void SetSourcesBrowserAlwaysShowName(int s);
00262 
00264   void SwitchBackAndForthToViewProperties();
00265 
00266   //BTX
00268 
00269   vtkRenderWindow *GetRenderWindow();
00270   vtkRenderer *GetRenderer();
00271   //ETX
00273   
00276   void SetRenderWindowSize(int x, int y);
00277 
00279   void Enable3DWidget(vtkInteractorObserver *o);
00280 
00282 
00283   void SetOrientationAxesVisibility(int val);
00284   int  GetOrientationAxesVisibility();
00285   void OrientationAxesCheckCallback();
00286   void SetOrientationAxesInteractivity(int val);
00287   void OrientationAxesInteractiveCallback();
00288   void SetOrientationAxesOutlineColor(double r, double g, double b);
00289   void SetOrientationAxesTextColor(double r, double g, double b);
00291 
00293 
00294   vtkGetObjectMacro(RenderModuleUI, vtkPVRenderModuleUI);
00296 
00298   virtual void EditCopy();
00299 
00301   virtual void PrintView();
00302 
00309   virtual void UpdateEnableState();
00310 
00312 
00314   void StartBlockingRender();
00315   void EndBlockingRender();
00317  
00319 
00320   vtkGetObjectMacro(StandardViewsFrame, vtkKWFrameWithLabel);
00321   vtkGetObjectMacro(CameraIconsFrame, vtkKWFrameWithLabel);
00322   vtkGetObjectMacro(CameraControlFrame, vtkKWFrameWithLabel);
00323   vtkGetObjectMacro(OrientationAxesFrame, vtkKWFrameWithLabel);
00324   //BTX
00325   vtkGetObjectMacro(OrientationAxes, vtkPVAxesWidget);
00326   //ETX
00328 
00329 
00331 
00332   void DefaultLightIntensityCallback();
00333   void DefaultLightIntensityEndCallback();
00334   void SetDefaultLightIntensity(double intensity);
00335   void SetDefaultLightIntensityNoTrace(double intensity);
00336   void SetDefaultLightAmbientColor(double r, double g, double b);
00337   void SetDefaultLightDiffuseColor(double r, double g, double b);
00338   void SetDefaultLightSpecularColor(double r, double g, double b);
00339   void DefaultLightSwitchCallback();
00340   void SetDefaultLightSwitch(int val);
00342 
00344   void              LightCallback(int type, int subtype);
00345 
00347   void              LightEndCallback(int type, int subtype);
00348 
00350 
00351   void              MaintainLuminanceCallback();
00352   void              SetMaintainLuminance(int s);
00354 
00356 
00358   void              UseLightCallback();
00359   void              SetUseLight(int s);
00361   
00363 
00364   double            GetLight(int type, int subtype);
00365   void              SetLightNoTrace(int type, int subtype, double value);
00366   void              SetLight(int type, int subtype, double value);
00368 
00369 
00370 protected:
00371   vtkPVRenderView();
00372   ~vtkPVRenderView();
00373 
00374   // Access to the overlay renderer.
00375   vtkRenderer *GetRenderer2D();
00376 
00377   vtkPVSourceNotebook* SourceNotebook;
00378 
00379   void CalculateBBox(char* name, int bbox[4]);
00380  
00381   vtkKWFrameWithLabel *StandardViewsFrame;
00382   vtkKWPushButton   *XMaxViewButton; 
00383   vtkKWPushButton   *XMinViewButton; 
00384   vtkKWPushButton   *YMaxViewButton; 
00385   vtkKWPushButton   *YMinViewButton; 
00386   vtkKWPushButton   *ZMaxViewButton; 
00387   vtkKWPushButton   *ZMinViewButton; 
00388 
00389   vtkKWFrameWithLabel *RenderParametersFrame;
00390   vtkKWCheckButton *TriangleStripsCheck;
00391   vtkKWCheckButton *ParallelProjectionCheck;
00392   vtkKWCheckButton *ImmediateModeCheck;
00393 
00394   vtkPVRenderModuleUI* RenderModuleUI;
00395 
00396   vtkKWFrameWithLabel *InterfaceSettingsFrame;
00397   vtkKWCheckButton *Display3DWidgets;
00398 
00399   // Default light
00400   vtkKWFrameWithLabel    *DefaultLightFrame;
00401   vtkKWChangeColorButton *DefaultLightAmbientColor;
00402   vtkKWChangeColorButton *DefaultLightSpecularColor;
00403   vtkKWChangeColorButton *DefaultLightDiffuseColor;
00404   vtkKWScaleWithEntry    *DefaultLightIntensity;
00405   vtkKWCheckButton       *DefaultLightSwitch;
00406 
00407   // Lighting stuff:
00408   vtkKWFrameWithLabel *LightParameterFrame;
00409   vtkKWCheckButton  *UseLightButton;
00410   vtkKWLabel        *KeyLightLabel;
00411   vtkKWLabel        *FillLightLabel;
00412   vtkKWLabel        *BackLightLabel;
00413   vtkKWLabel        *HeadLightLabel;
00414   vtkKWScaleWithEntry        *KeyLightScale[4];
00415   vtkKWScaleWithEntry        *FillLightScale[4];
00416   vtkKWScaleWithEntry        *BackLightScale[4];
00417   vtkKWScaleWithEntry        *HeadLightScale[4];
00418   vtkKWCheckButton  *MaintainLuminanceButton;
00419   // Main proxy to access the vtkLightKit
00420 
00421   vtkKWFrameWithLabel *OrientationAxesFrame;
00422   vtkKWCheckButton *OrientationAxesCheck;
00423   vtkKWCheckButton *OrientationAxesInteractiveCheck;
00424   vtkKWChangeColorButton *OrientationAxesOutlineColor;
00425   vtkKWChangeColorButton *OrientationAxesTextColor;
00426   vtkPVAxesWidget *OrientationAxes;
00427 
00428   vtkKWSplitFrame *SplitFrame;
00429 
00430   vtkKWFrameWithLabel* NavigationFrame;
00431   vtkPVSourcesNavigationWindow* NavigationWindow;
00432   vtkPVSourcesNavigationWindow* SelectionWindow;
00433   vtkKWRadioButton *NavigationWindowButton;
00434   vtkKWRadioButton *SelectionWindowButton;
00435   
00436   int BlockRender;
00437 
00438   int ShowSelectionWindow;
00439   int ShowNavigationWindow;
00440 
00441   // For the renderer in a separate toplevel window.
00442   vtkKWTopLevel *TopLevelRenderWindow;
00443 
00444   vtkPVInteractorStyleControl *ManipulatorControl2D;
00445   vtkPVInteractorStyleControl *ManipulatorControl3D;
00446 
00447   // Camera icons
00448   vtkKWFrameWithLabel* CameraIconsFrame;
00449   vtkPVCameraIcon* CameraIcons[6];
00450   
00451   // Camera controls (elevation, azimuth, roll)
00452   vtkKWFrameWithLabel *CameraControlFrame;
00453   vtkPVCameraControl *CameraControl;
00454 
00455   vtkKWPushButton *PropertiesButton;
00456 
00457   char *MenuLabelSwitchBackAndForthToViewProperties;
00458   vtkSetStringMacro(MenuLabelSwitchBackAndForthToViewProperties);
00459   
00460   vtkPVRenderViewObserver* Observer;
00461   vtkSMRenderModuleProxy* RenderModuleProxy;
00462 
00463   vtkTimerLog *RenderTimer;
00464   Tcl_TimerToken TimerToken;
00465   
00466 private:
00467   vtkPVRenderView(const vtkPVRenderView&); // Not implemented
00468   void operator=(const vtkPVRenderView&); // Not implemented
00469 };
00470 
00471 
00472 #endif

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