00001 // -*- C++ -*- 00002 /*************************************************************************** 00003 * 00004 * The IPPL Framework 00005 * 00006 * 00007 * Visit http://people.web.psi.ch/adelmann/ for more details 00008 * 00009 ***************************************************************************/ 00010 00011 /* 00012 * File: UIWindow.h 00013 * Author: Patrick McCormick 00014 * Advanced Computing Laboratory 00015 * Los Alamos National Laboratory 00016 * 00017 * This file contains the description of the UIWindow class which is 00018 * used to remove the creation of the toplevel widget in the main 00019 * function of BX generated code. Our primary purpose for this class 00020 * has been to incorporate BX and VTK together in a working package. 00021 * However, by yanking out the VTK specifics, this class may serve 00022 * other purposes as well. 00023 * 00024 * Please note that the structure of the main program generated by BX 00025 * must be changed to take advantage of this class. We have locally 00026 * created our own version of the BX code generators for this purpose. 00027 * 00028 * VTK NOTES 00029 * 00030 * In terms of VTK, this class assumes that there will be only 00031 * one render master per application. In addition, from the 00032 * perspective of X Windows, we store the application context 00033 * within this class as well (there is only one context per 00034 * application). The remaining functionality of VTK is handled 00035 * by the VTKWindow class (which is incorporated as a class into 00036 * the local BX pallette). 00037 * 00038 */ 00039 #ifndef ACLVIS_UIWINDOW_H 00040 #define ACLVIS_UIWINDOW_H 00041 00042 #ifdef IPPL_USE_STANDARD_HEADERS 00043 #include <iostream> 00044 using namespace std; 00045 #else 00046 #include <iostream.h> 00047 #endif 00048 00049 #include <vtk.h> 00050 #include <vtkXRenderWindow.h> 00051 #include <Xm/Xm.h> 00052 00053 class vtkRenderMaster; /* forward declaration */ 00054 00055 class UIWindow 00056 { 00057 00058 public: 00059 UIWindow(Widget parent, ArgList args, Cardinal num_args, XtAppContext app); 00060 ~UIWindow(); 00061 Widget baseWidget(); 00062 void show(); 00063 void hide(); 00064 00065 static XtAppContext getAppContext(void) 00066 { 00067 return app; 00068 } 00069 00070 static vtkXRenderWindow *createRenderWindow(void) 00071 { 00072 return (vtkXRenderWindow *)(renderMaster->MakeRenderWindow()); 00073 } 00074 00075 private: 00076 static XtAppContext app; 00077 static vtkRenderMaster *renderMaster; 00078 Widget _toplevel; 00079 }; 00080 00081 #endif // ACLVIS_UIWINDOW_H 00082 00083 /*************************************************************************** 00084 * $RCSfile: UIWindow.h,v $ $Author: adelmann $ 00085 * $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:34 $ 00086 * IPPL_VERSION_ID: $Id: UIWindow.h,v 1.1.1.1 2003/01/23 07:40:34 adelmann Exp $ 00087 ***************************************************************************/ 00088