ssMultibeamRenderView.h

Go to the documentation of this file.
00001 /* $Id: ssMultibeamRenderView.h,v 1.11 2005/12/29 10:16:50 pfb Exp $ */
00002 
00003 /*=========================================================================
00004 Copyright (c) 2000-2001 Kitware Inc. 469 Clifton Corporate Parkway,
00005 Clifton Park, NY, 12065, USA.
00006 All rights reserved.
00007 
00008 Redistribution and use in source and binary forms, with or without
00009 modification, are permitted provided that the following conditions are met:
00010 
00011  * Redistributions of source code must retain the above copyright notice,
00012    this list of conditions and the following disclaimer.
00013 
00014  * Redistributions in binary form must reproduce the above copyright notice,
00015    this list of conditions and the following disclaimer in the documentation
00016    and/or other materials provided with the distribution.
00017 
00018  * Neither the name of Kitware nor the names of any contributors may be used
00019    to endorse or promote products derived from this software without specific 
00020    prior written permission.
00021 
00022  * Modified source versions must be plainly marked as such, and must not be
00023    misrepresented as being the original software.
00024 
00025 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
00026 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00027 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00028 ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR
00029 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00030 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00031 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00032 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00033 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00034 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00035 
00036 =========================================================================*/
00037 /*=========================================================================
00038 This module copied from ParaView's V1.0 vtkPVRenderView and modified as
00039 appropiate.
00040 =========================================================================*/
00041 
00047 #ifndef _ssMultibeamRenderView_h
00048 #define _ssMultibeamRenderView_h
00049 
00054 #include "ssMultibeamView.h"
00055 
00056 class vtkKWLabel;
00057 class vtkKWPushButton;
00058 class vtkKWRadioButton;
00059 class vtkKWScale;
00060 class vtkKWSplitFrame;
00061 class vtkLabeledFrame;
00062 class vtkMultiProcessController;
00063 class ssMultibeamApplication;
00064 class vtkPVCameraIcon;
00065 class vtkPVData;
00066 class vtkPVInteractorStyleControl;
00067 class ssMultibeamRenderViewObserver;
00068 class vtkPVSource;
00069 class vtkPVSourceList;
00070 class vtkPVSourcesNavigationWindow;
00071 class vtkPVTreeComposite;
00072 class ssMultibeamWindow;
00073 class vtkPVRenderModuleUI;
00074 class vtkActor;
00075 class vtkPolyDataMapper;
00076 class vtkPolyData;
00077 
00078 #define VTK_PV_VIEW_MENU_LABEL       " 3D View Properties"
00079 
00083 class VTK_EXPORT ssMultibeamRenderView : public ssMultibeamView
00084   {
00085   //****************************************************************************
00086                              public:
00092   static ssMultibeamRenderView* New();
00093 
00097   vtkTypeMacro(ssMultibeamRenderView, ssMultibeamView);
00098   //vtkTypeRevisionMacro(ssMultibeamRenderView,vtkKWView);
00099 
00105   void PrintSelf(ostream& os, vtkIndent indent);
00106 
00111   void CreateRenderObjects(ssMultibeamApplication *mbApp);
00112   
00116   virtual void CreateViewProperties();
00117   
00123   virtual void Create(vtkKWApplication *app, const char *args);
00124 
00129   vtkPolyData *GetInput() const;
00130 
00134   void ResetCamera();
00135  
00136 // Removed for ParaView 2.2.1
00137 #if 0
00138 
00150 //  void SetCameraState(float p0, float p1, float p2,
00151 //                      float fp0, float fp1, float fp2,
00152 //                      float up0, float up1, float up2);
00153 #endif
00154 
00161   void StandardViewCallback(float x, float y, float z);
00162 
00166   virtual void SaveAsImage() { this->Superclass::SaveAsImage(); }
00167 
00172   virtual void SaveAsImage(const char* filename) ;
00173   
00178   ssMultibeamApplication *GetMBApplication();
00179 
00183   void Render();
00184 
00188   void EventuallyRender();
00189 
00193   void EventuallyRenderCallBack();
00194 
00200   void UpdateTclButAvoidRendering();
00201   
00205   void Exposed();
00206 
00210   void Configured();
00211   
00216   vtkRenderer *GetRenderer();
00217 
00222   vtkRenderWindow *GetRenderWindow();
00223 
00227   void AddBindings();
00228   
00233   void SaveRendererState(ofstream *file);
00234 
00239   void SaveRenderWindowState(ofstream *file);
00240 
00247   void SetBackgroundColor(float r, float g, float b);
00248 
00249 // Removed for ParaView 2.2.1
00250 #if 0
00251 
00257 //  virtual void SetBackgroundColor(float *c) {this->SetBackgroundColor(c[0],
00258 //                                                                      c[1],
00259 //                                                                      c[2]);}
00260 #endif
00261 
00266   virtual void Close();
00267 
00272   void PrepareForDelete();
00273   
00277 //  void ParallelProjectionCallback();
00278   
00283   ssMultibeamWindow *GetMBWindow();
00284 
00289   int* GetRenderWindowSize();
00290 
00307   void ExecuteEvent(vtkObject* wdg, unsigned long event, void* calldata);
00308 
00309 //******************************************************************************
00310                              protected:
00311 
00315   ssMultibeamRenderView();
00316 
00320   virtual ~ssMultibeamRenderView();
00321 
00322   vtkPVRenderModuleUI           *RenderModuleUI;
00323 
00324   int                            EventuallyRenderFlag;
00325   char                          *RenderPending;
00326   vtkSetStringMacro(RenderPending);
00327 
00328   // For the renderer in a separate toplevel window.
00329   vtkKWWidget                   *TopLevelRenderWindow;
00330 
00331   vtkPVInteractorStyleControl   *ManipulatorControl2D;
00332   vtkPVInteractorStyleControl   *ManipulatorControl3D;
00333 
00334   ssMultibeamRenderViewObserver *Observer;
00335 
00340   vtkActor                      *dataActor;
00341 
00345   vtkPolyDataMapper             *dataMapper;
00346 
00347 //******************************************************************************
00348                              private:
00349 
00353   ssMultibeamRenderView(const ssMultibeamRenderView&);
00354   void operator=(const ssMultibeamRenderView&);
00355 
00356   bool alreadyCreated;
00357   };
00358 
00359 /*
00360  * $Log: ssMultibeamRenderView.h,v $
00361  * Revision 1.11  2005/12/29 10:16:50  pfb
00362  * Changes made in upgrade to ParaView 2.2.1, VTK 4.5.0
00363  *
00364  * Revision 1.10  2005/11/02 03:55:45  pfb
00365  * Fixed doxygen tags.
00366  *
00367  * Revision 1.9  2005/05/10 17:08:00  pfb
00368  * Added module info.
00369  *
00370  * Revision 1.8  2004/11/01 06:26:17  pfb
00371  * Temporarily suspended in favor of ssMultibeamLW*.
00372  *
00373  * Revision 1.7  2004/09/05 04:59:18  pfb
00374  * Added documentation.
00375  *
00376  * Revision 1.6  2004/09/02 02:58:13  pfb
00377  * Added GetInput().
00378  *
00379  * Revision 1.5  2004/08/25 05:11:42  pfb
00380  * Added an Actor and Mapper.
00381  *
00382  * Revision 1.4  2004/05/21 04:21:43  pfb
00383  * Now using ssMultibeamView as base class.
00384  *
00385  * Revision 1.3  2004/02/15 16:19:16  pfb
00386  * Moved from MultibeamRenderView to ssMultibeamRenderView.
00387  *
00388  * Revision 1.2  2004/02/08 12:46:23  pfb
00389  * Corrected guard.
00390  *
00391  * Revision 1.1  2004/02/03 09:56:19  pfb
00392  * Initial rev.
00393  *
00394  *
00395  */
00396 
00400 #endif