Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // 27 // 27 // 28 /* 28 /* 29 * jck : 05 Feb 1997 : Initial Implementation 29 * jck : 05 Feb 1997 : Initial Implementation 30 * jck : 21 Apr 1997 : Mods for SoXtHepViewer 30 * jck : 21 Apr 1997 : Mods for SoXtHepViewer 31 * gb : on Win32 use an SoXtExaminerViewer. 31 * gb : on Win32 use an SoXtExaminerViewer. 32 * gb : 05 April 2004 : creation. 32 * gb : 05 April 2004 : creation. 33 * gb : 09 November 2004 : Pulldown menu with 33 * gb : 09 November 2004 : Pulldown menu with the escape menu item. 34 * gb 14 November 2004 : inherit G4OpenInvento 34 * gb 14 November 2004 : inherit G4OpenInventorViewer. 35 */ 35 */ 36 36 >> 37 #ifdef G4VIS_BUILD_OIWIN32_DRIVER >> 38 37 // this : 39 // this : 38 #include "G4OpenInventorWinViewer.hh" 40 #include "G4OpenInventorWinViewer.hh" 39 41 40 #include <Inventor/nodes/SoSelection.h> 42 #include <Inventor/nodes/SoSelection.h> 41 43 42 #include <Inventor/Win/SoWin.h> 44 #include <Inventor/Win/SoWin.h> 43 #include <Inventor/Win/viewers/SoWinExaminerVi 45 #include <Inventor/Win/viewers/SoWinExaminerViewer.h> 44 46 45 #include "HEPVis/actions/SoGL2PSAction.h" 47 #include "HEPVis/actions/SoGL2PSAction.h" 46 48 47 #include "G4OpenInventor.hh" 49 #include "G4OpenInventor.hh" 48 #include "G4OpenInventorSceneHandler.hh" 50 #include "G4OpenInventorSceneHandler.hh" 49 #include "G4VInteractorManager.hh" 51 #include "G4VInteractorManager.hh" 50 #include "G4VisManager.hh" 52 #include "G4VisManager.hh" 51 53 52 #include <windowsx.h> 54 #include <windowsx.h> 53 55 54 // To have sizeChanged public : 56 // To have sizeChanged public : 55 class Geant4_SoWinExaminerViewer : public SoWi 57 class Geant4_SoWinExaminerViewer : public SoWinExaminerViewer { 56 public: 58 public: 57 Geant4_SoWinExaminerViewer(HWND parent,const 59 Geant4_SoWinExaminerViewer(HWND parent,const char* name,SbBool embed) 58 :SoWinExaminerViewer(parent,name,embed){} 60 :SoWinExaminerViewer(parent,name,embed){} 59 virtual void sizeChanged(const SbVec2s & siz 61 virtual void sizeChanged(const SbVec2s & size){ 60 SoWinExaminerViewer::sizeChanged(size); 62 SoWinExaminerViewer::sizeChanged(size); 61 } 63 } 62 }; 64 }; 63 65 64 // File : 66 // File : 65 #define ID_FILE_POSTSCRIPT 1 67 #define ID_FILE_POSTSCRIPT 1 66 #define ID_FILE_PIXMAP_POSTSCRIPT 2 68 #define ID_FILE_PIXMAP_POSTSCRIPT 2 67 #define ID_FILE_INVENTOR 3 69 #define ID_FILE_INVENTOR 3 68 #define ID_FILE_ESCAPE 4 70 #define ID_FILE_ESCAPE 4 69 // Etc : 71 // Etc : 70 #define ID_ETC_ERASE_DETECTOR 101 72 #define ID_ETC_ERASE_DETECTOR 101 71 #define ID_ETC_ERASE_EVENT 102 73 #define ID_ETC_ERASE_EVENT 102 72 #define ID_ETC_SET_SOLID 103 74 #define ID_ETC_SET_SOLID 103 73 #define ID_ETC_SET_WIRE_FRAME 104 75 #define ID_ETC_SET_WIRE_FRAME 104 74 #define ID_ETC_SET_REDUCED_WIRE_FRAME 105 76 #define ID_ETC_SET_REDUCED_WIRE_FRAME 105 75 #define ID_ETC_SET_FULL_WIRE_FRAME 106 77 #define ID_ETC_SET_FULL_WIRE_FRAME 106 76 #define ID_ETC_SET_PREVIEW 107 78 #define ID_ETC_SET_PREVIEW 107 77 #define ID_ETC_SET_PREVIEW_AND_FULL 108 79 #define ID_ETC_SET_PREVIEW_AND_FULL 108 78 #define ID_ETC_UPDATE_SCENE 109 80 #define ID_ETC_UPDATE_SCENE 109 79 #define ID_ETC_STATS 110 81 #define ID_ETC_STATS 110 80 // Help : 82 // Help : 81 #define ID_HELP_CONTROLS 201 83 #define ID_HELP_CONTROLS 201 82 84 83 //static void SecondaryLoopPostAction (); 85 //static void SecondaryLoopPostAction (); 84 86 85 static const char className[] = "G4OpenInvento 87 static const char className[] = "G4OpenInventorShellWindow"; 86 88 87 G4OpenInventorWinViewer::G4OpenInventorWinView 89 G4OpenInventorWinViewer::G4OpenInventorWinViewer( 88 G4OpenInventorSceneHandler& sceneHandler 90 G4OpenInventorSceneHandler& sceneHandler 89 ,const G4String& name) 91 ,const G4String& name) 90 :G4OpenInventorViewer (sceneHandler, name) 92 :G4OpenInventorViewer (sceneHandler, name) 91 ,fShell(0) 93 ,fShell(0) 92 ,fViewer(0) 94 ,fViewer(0) 93 { 95 { 94 if (G4VisManager::GetVerbosity() >= G4VisMan 96 if (G4VisManager::GetVerbosity() >= G4VisManager::confirmations) 95 G4cout << "Window name: " << fName << G4en 97 G4cout << "Window name: " << fName << G4endl; 96 } 98 } 97 99 98 100 99 void G4OpenInventorWinViewer::Initialise() { 101 void G4OpenInventorWinViewer::Initialise() { 100 102 101 G4String wName = fName; 103 G4String wName = fName; 102 104 103 int width = fVP.GetWindowSizeHintX(); << 105 int width = 600; 104 int height = fVP.GetWindowSizeHintY();; << 106 int height = 600; 105 107 106 HWND parent = (HWND)fInteractorManager->GetP 108 HWND parent = (HWND)fInteractorManager->GetParentInteractor (); 107 if(!parent) { 109 if(!parent) { 108 //Create a shell window : 110 //Create a shell window : 109 G4String shellName = wName; 111 G4String shellName = wName; 110 shellName += "_shell"; 112 shellName += "_shell"; 111 static SbBool done = FALSE; 113 static SbBool done = FALSE; 112 if(done==FALSE) { 114 if(done==FALSE) { 113 HBRUSH brush = (HBRUSH) GetSysColorBrush 115 HBRUSH brush = (HBRUSH) GetSysColorBrush(COLOR_BTNFACE); 114 WNDCLASS wc; 116 WNDCLASS wc; 115 wc.style = CS_HREDRAW | CS_VREDRAW; 117 wc.style = CS_HREDRAW | CS_VREDRAW; 116 wc.lpfnWndProc = (WNDPROC)WindowProc; 118 wc.lpfnWndProc = (WNDPROC)WindowProc; 117 wc.cbClsExtra = 0; 119 wc.cbClsExtra = 0; 118 wc.cbWndExtra = 0; 120 wc.cbWndExtra = 0; 119 wc.hInstance = ::GetModuleHandle(0); 121 wc.hInstance = ::GetModuleHandle(0); 120 wc.hIcon = ::LoadIcon(0, IDI_APPLICATION 122 wc.hIcon = ::LoadIcon(0, IDI_APPLICATION); 121 wc.hCursor = ::LoadCursor(0, IDC_ARROW); 123 wc.hCursor = ::LoadCursor(0, IDC_ARROW); 122 wc.hbrBackground = brush; 124 wc.hbrBackground = brush; 123 wc.lpszMenuName = className; 125 wc.lpszMenuName = className; 124 wc.lpszClassName = className; 126 wc.lpszClassName = className; 125 ::RegisterClass(&wc); 127 ::RegisterClass(&wc); 126 done = TRUE; 128 done = TRUE; 127 } 129 } 128 130 129 width = fVP.GetWindowSizeHintX(); 131 width = fVP.GetWindowSizeHintX(); 130 height = fVP.GetWindowSizeHintX(); 132 height = fVP.GetWindowSizeHintX(); 131 133 132 HMENU menuBar = CreateMenu(); 134 HMENU menuBar = CreateMenu(); 133 135 134 {HMENU casc = CreatePopupMenu(); 136 {HMENU casc = CreatePopupMenu(); 135 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc," 137 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc,"File"); 136 ::AppendMenu(casc,MF_STRING,ID_FILE_POSTSC 138 ::AppendMenu(casc,MF_STRING,ID_FILE_POSTSCRIPT,"PS (gl2ps)"); 137 ::AppendMenu(casc,MF_STRING,ID_FILE_PIXMAP 139 ::AppendMenu(casc,MF_STRING,ID_FILE_PIXMAP_POSTSCRIPT,"PS (pixmap)"); 138 ::AppendMenu(casc,MF_STRING,ID_FILE_INVENT 140 ::AppendMenu(casc,MF_STRING,ID_FILE_INVENTOR,"IV"); 139 ::AppendMenu(casc,MF_STRING,ID_FILE_ESCAPE 141 ::AppendMenu(casc,MF_STRING,ID_FILE_ESCAPE,"Escape");} 140 142 141 {HMENU casc = CreatePopupMenu(); 143 {HMENU casc = CreatePopupMenu(); 142 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc," 144 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc,"Etc"); 143 ::AppendMenu(casc,MF_STRING,ID_ETC_ERASE_D 145 ::AppendMenu(casc,MF_STRING,ID_ETC_ERASE_DETECTOR,"Erase detector"); 144 ::AppendMenu(casc,MF_STRING,ID_ETC_ERASE_E 146 ::AppendMenu(casc,MF_STRING,ID_ETC_ERASE_EVENT,"Erase event"); 145 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_SOL 147 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_SOLID,"Set solid"); 146 //::AppendMenu(casc,MF_STRING,ID_ETC_SET_W 148 //::AppendMenu(casc,MF_STRING,ID_ETC_SET_WIRE_FRAME,"Set (G4) wire frame"); 147 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_RED 149 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_REDUCED_WIRE_FRAME, 148 "Set (G4) reduced wire f 150 "Set (G4) reduced wire frame"); 149 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_FUL 151 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_FULL_WIRE_FRAME, 150 "Set (G4) full wire fram 152 "Set (G4) full wire frame"); 151 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_PRE 153 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_PREVIEW, 152 "Visible mothers + invis 154 "Visible mothers + invisible daughters"); 153 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_PRE 155 ::AppendMenu(casc,MF_STRING,ID_ETC_SET_PREVIEW_AND_FULL, 154 "Visible mothers + visib 156 "Visible mothers + visible daughters"); 155 ::AppendMenu(casc,MF_STRING,ID_ETC_UPDATE_ 157 ::AppendMenu(casc,MF_STRING,ID_ETC_UPDATE_SCENE,"Update scene"); 156 ::AppendMenu(casc,MF_STRING,ID_ETC_STATS," 158 ::AppendMenu(casc,MF_STRING,ID_ETC_STATS,"Scene graph stats");} 157 159 158 {HMENU casc = CreatePopupMenu(); 160 {HMENU casc = CreatePopupMenu(); 159 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc," 161 ::AppendMenu(menuBar,MF_POPUP,(UINT)casc,"Help"); 160 ::AppendMenu(casc,MF_STRING,ID_HELP_CONTRO 162 ::AppendMenu(casc,MF_STRING,ID_HELP_CONTROLS,"Controls");} 161 163 162 fShell = ::CreateWindow(className, shellNa 164 fShell = ::CreateWindow(className, shellName.c_str(), 163 WS_OVERLAPPEDWINDO 165 WS_OVERLAPPEDWINDOW | 164 WS_VISIBLE | WS_CL 166 WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 165 CW_USEDEFAULT, CW_ 167 CW_USEDEFAULT, CW_USEDEFAULT, 166 width,height, 168 width,height, 167 0,menuBar,::GetMod 169 0,menuBar,::GetModuleHandle(0),0); 168 // Retreive window and client sizez : 170 // Retreive window and client sizez : 169 RECT wrect,crect; 171 RECT wrect,crect; 170 GetWindowRect((HWND)fShell,&wrect); 172 GetWindowRect((HWND)fShell,&wrect); 171 GetClientRect((HWND)fShell,&crect); 173 GetClientRect((HWND)fShell,&crect); 172 int ww = wrect.right-wrect.left; 174 int ww = wrect.right-wrect.left; 173 int wh = wrect.bottom-wrect.top; 175 int wh = wrect.bottom-wrect.top; 174 int cw = crect.right-crect.left; 176 int cw = crect.right-crect.left; 175 int ch = crect.bottom-crect.top; 177 int ch = crect.bottom-crect.top; 176 // Compell client rect to be width height 178 // Compell client rect to be width height : 177 MoveWindow((HWND)fShell,wrect.left,wrect.t 179 MoveWindow((HWND)fShell,wrect.left,wrect.top,width+ww-cw,height+wh-ch,TRUE); 178 ::SetWindowLongPtr((HWND)fShell,GWLP_USERD 180 ::SetWindowLongPtr((HWND)fShell,GWLP_USERDATA,LONG(this)); 179 ::SetWindowText((HWND)fShell,shellName.c_s 181 ::SetWindowText((HWND)fShell,shellName.c_str()); 180 parent = fShell; 182 parent = fShell; 181 fInteractorManager->AddShell(fShell); 183 fInteractorManager->AddShell(fShell); 182 } else { 184 } else { 183 char* str = fInteractorManager->GetCreatio 185 char* str = fInteractorManager->GetCreationString(); 184 if(str!=0) wName = str; 186 if(str!=0) wName = str; 185 } 187 } 186 fViewer = new Geant4_SoWinExaminerViewer(par 188 fViewer = new Geant4_SoWinExaminerViewer(parent,wName.c_str(),TRUE); 187 189 188 // Have a GL2PS render action : 190 // Have a GL2PS render action : 189 const SbViewportRegion& vpRegion = fViewer-> 191 const SbViewportRegion& vpRegion = fViewer->getViewportRegion(); 190 fGL2PSAction = new SoGL2PSAction(vpRegion); 192 fGL2PSAction = new SoGL2PSAction(vpRegion); 191 fViewer->setGLRenderAction(fGL2PSAction); 193 fViewer->setGLRenderAction(fGL2PSAction); 192 194 193 fViewer->setSize(SbVec2s(width,height)); 195 fViewer->setSize(SbVec2s(width,height)); 194 fViewer->setSceneGraph(fSoSelection); 196 fViewer->setSceneGraph(fSoSelection); 195 fViewer->viewAll(); 197 fViewer->viewAll(); 196 fViewer->saveHomePosition(); 198 fViewer->saveHomePosition(); 197 fViewer->setTitle(fName); 199 fViewer->setTitle(fName); 198 fViewer->show(); 200 fViewer->show(); 199 if(fShell) { 201 if(fShell) { 200 SoWin::show(fShell); 202 SoWin::show(fShell); 201 fInteractorManager->FlushAndWaitExecution 203 fInteractorManager->FlushAndWaitExecution (); 202 } 204 } 203 fInteractorManager->SetCreatedInteractor (fV 205 fInteractorManager->SetCreatedInteractor (fViewer -> getWidget()); 204 fViewer->setTransparencyType(SoGLRenderActio 206 fViewer->setTransparencyType(SoGLRenderAction::SORTED_OBJECT_ADD); 205 } 207 } 206 208 207 G4OpenInventorWinViewer::~G4OpenInventorWinVie 209 G4OpenInventorWinViewer::~G4OpenInventorWinViewer () { 208 if(fShell) fInteractorManager->RemoveShell(f 210 if(fShell) fInteractorManager->RemoveShell(fShell); 209 if(fViewer) { 211 if(fViewer) { 210 fViewer->setSceneGraph(0); 212 fViewer->setSceneGraph(0); 211 delete fViewer; 213 delete fViewer; 212 } 214 } 213 if(fShell) { 215 if(fShell) { 214 ::SetWindowLongPtr((HWND)fShell,GWLP_USERD 216 ::SetWindowLongPtr((HWND)fShell,GWLP_USERDATA,LONG(0)); 215 ::DestroyWindow((HWND)fShell); 217 ::DestroyWindow((HWND)fShell); 216 } 218 } 217 } 219 } 218 220 219 void G4OpenInventorWinViewer::FinishView () { 221 void G4OpenInventorWinViewer::FinishView () { 220 if(!fViewer) return; 222 if(!fViewer) return; 221 fViewer->viewAll(); 223 fViewer->viewAll(); 222 fViewer->saveHomePosition(); 224 fViewer->saveHomePosition(); 223 } 225 } 224 226 225 void G4OpenInventorWinViewer::SetView () { 227 void G4OpenInventorWinViewer::SetView () { 226 G4OpenInventorViewer::SetView (); 228 G4OpenInventorViewer::SetView (); 227 if(!fViewer) return; 229 if(!fViewer) return; 228 // Background. 230 // Background. 229 G4Colour b = fVP.GetBackgroundColour (); 231 G4Colour b = fVP.GetBackgroundColour (); 230 fViewer->setBackgroundColor 232 fViewer->setBackgroundColor 231 (SbColor((float)b.GetRed(),(float)b.GetGre 233 (SbColor((float)b.GetRed(),(float)b.GetGreen(),(float)b.GetBlue())); 232 } 234 } 233 void G4OpenInventorWinViewer::ViewerRender () 235 void G4OpenInventorWinViewer::ViewerRender () { 234 if(!fViewer) return; 236 if(!fViewer) return; 235 fViewer->render(); 237 fViewer->render(); 236 } 238 } 237 239 238 SoCamera* G4OpenInventorWinViewer::GetCamera ( 240 SoCamera* G4OpenInventorWinViewer::GetCamera () { 239 if(!fViewer) return 0; 241 if(!fViewer) return 0; 240 return fViewer->getCamera(); 242 return fViewer->getCamera(); 241 } 243 } 242 244 243 245 244 ////////////////////////////////////////////// 246 ////////////////////////////////////////////////////////////////////////////// 245 LRESULT CALLBACK G4OpenInventorWinViewer::Wind 247 LRESULT CALLBACK G4OpenInventorWinViewer::WindowProc ( 246 HWND aWindow 248 HWND aWindow 247 ,UINT aMessage 249 ,UINT aMessage 248 ,WPARAM aWParam 250 ,WPARAM aWParam 249 ,LPARAM aLParam 251 ,LPARAM aLParam 250 ) 252 ) 251 ////////////////////////////////////////////// 253 ////////////////////////////////////////////////////////////////////////////// 252 // Below treatment of WM_SIZE, WM_SETFOCUS no 254 // Below treatment of WM_SIZE, WM_SETFOCUS not necessary 253 // with TGS, but needed with SoFree. WM_DESTRO 255 // with TGS, but needed with SoFree. WM_DESTROY needed for 254 // 'main top level window' so that 'Close wind 256 // 'main top level window' so that 'Close window' induces 255 // the end of the task. 257 // the end of the task. 256 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 258 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 257 { 259 { 258 switch (aMessage) { 260 switch (aMessage) { 259 case WM_SIZE:{ // Assume one child window ! 261 case WM_SIZE:{ // Assume one child window ! 260 int width = LOWORD(aLParam); 262 int width = LOWORD(aLParam); 261 int height = HIWORD(aLParam); 263 int height = HIWORD(aLParam); 262 //printf("debug : G4SoWindow : WMS_SIZE : 264 //printf("debug : G4SoWindow : WMS_SIZE : %d %d\n",width,height); 263 G4OpenInventorWinViewer* This = 265 G4OpenInventorWinViewer* This = 264 (G4OpenInventorWinViewer*)::GetWindowLon 266 (G4OpenInventorWinViewer*)::GetWindowLongPtr(aWindow,GWLP_USERDATA); 265 if(This && This->fViewer) { 267 if(This && This->fViewer) { 266 This->fViewer->sizeChanged(SbVec2s(width 268 This->fViewer->sizeChanged(SbVec2s(width,height)); 267 } 269 } 268 }return 0; 270 }return 0; 269 case WM_SETFOCUS:{ // Assume one child windo 271 case WM_SETFOCUS:{ // Assume one child window ! 270 HWND hwnd = ::GetFirstChild(aWindow); 272 HWND hwnd = ::GetFirstChild(aWindow); 271 if(hwnd!=0) ::SetFocus(hwnd); 273 if(hwnd!=0) ::SetFocus(hwnd); 272 }return 0; 274 }return 0; 273 case WM_DESTROY:{ 275 case WM_DESTROY:{ 274 //G4OpenInventorWinViewer* This = 276 //G4OpenInventorWinViewer* This = 275 // (G4OpenInventorWinViewer*)::GetWindowL 277 // (G4OpenInventorWinViewer*)::GetWindowLongPtr(aWindow,GWLP_USERDATA); 276 //::PostQuitMessage(0); 278 //::PostQuitMessage(0); 277 }return 0; 279 }return 0; 278 case WM_COMMAND:{ 280 case WM_COMMAND:{ 279 G4OpenInventorWinViewer* This = 281 G4OpenInventorWinViewer* This = 280 (G4OpenInventorWinViewer*)::GetWindowLon 282 (G4OpenInventorWinViewer*)::GetWindowLongPtr(aWindow,GWLP_USERDATA); 281 if(This) { 283 if(This) { 282 if(aLParam==0) { //From menu. 284 if(aLParam==0) { //From menu. 283 // File : 285 // File : 284 if(aWParam==ID_FILE_POSTSCRIPT) { 286 if(aWParam==ID_FILE_POSTSCRIPT) { 285 This->WritePostScript(); 287 This->WritePostScript(); 286 } else if(aWParam==ID_FILE_PIXMAP_POST 288 } else if(aWParam==ID_FILE_PIXMAP_POSTSCRIPT) { 287 This->WritePixmapPostScript(); 289 This->WritePixmapPostScript(); 288 } else if(aWParam==ID_FILE_INVENTOR) { 290 } else if(aWParam==ID_FILE_INVENTOR) { 289 This->WriteInventor(); 291 This->WriteInventor(); 290 } else if(aWParam==ID_FILE_ESCAPE) { 292 } else if(aWParam==ID_FILE_ESCAPE) { 291 This->Escape(); 293 This->Escape(); 292 // Etc : 294 // Etc : 293 } else if(aWParam==ID_ETC_ERASE_DETECT 295 } else if(aWParam==ID_ETC_ERASE_DETECTOR) { 294 This->EraseDetector(); 296 This->EraseDetector(); 295 } else if(aWParam==ID_ETC_ERASE_EVENT) 297 } else if(aWParam==ID_ETC_ERASE_EVENT) { 296 This->EraseEvent(); 298 This->EraseEvent(); 297 } else if(aWParam==ID_ETC_SET_SOLID) { 299 } else if(aWParam==ID_ETC_SET_SOLID) { 298 This->SetSolid(); 300 This->SetSolid(); 299 } else if(aWParam==ID_ETC_SET_WIRE_FRA 301 } else if(aWParam==ID_ETC_SET_WIRE_FRAME) { 300 This->SetWireFrame(); 302 This->SetWireFrame(); 301 } else if(aWParam==ID_ETC_SET_REDUCED_ 303 } else if(aWParam==ID_ETC_SET_REDUCED_WIRE_FRAME) { 302 This->SetReducedWireFrame(true); 304 This->SetReducedWireFrame(true); 303 } else if(aWParam==ID_ETC_SET_FULL_WIR 305 } else if(aWParam==ID_ETC_SET_FULL_WIRE_FRAME) { 304 This->SetReducedWireFrame(false); 306 This->SetReducedWireFrame(false); 305 } else if(aWParam==ID_ETC_SET_PREVIEW) 307 } else if(aWParam==ID_ETC_SET_PREVIEW) { 306 This->SetPreview(); 308 This->SetPreview(); 307 } else if(aWParam==ID_ETC_SET_PREVIEW_ 309 } else if(aWParam==ID_ETC_SET_PREVIEW_AND_FULL) { 308 This->SetPreviewAndFull(); 310 This->SetPreviewAndFull(); 309 } else if(aWParam==ID_ETC_UPDATE_SCENE 311 } else if(aWParam==ID_ETC_UPDATE_SCENE) { 310 This->UpdateScene(); 312 This->UpdateScene(); 311 } else if(aWParam==ID_ETC_STATS) { 313 } else if(aWParam==ID_ETC_STATS) { 312 This->SceneGraphStatistics(); 314 This->SceneGraphStatistics(); 313 // Help : 315 // Help : 314 } else if(aWParam==ID_HELP_CONTROLS) { 316 } else if(aWParam==ID_HELP_CONTROLS) { 315 G4cout << This->Help() << G4endl; 317 G4cout << This->Help() << G4endl; 316 } 318 } 317 } 319 } 318 } 320 } 319 }return 0; 321 }return 0; 320 default: 322 default: 321 return (::DefWindowProc(aWindow,aMessage,a 323 return (::DefWindowProc(aWindow,aMessage,aWParam,aLParam)); 322 } 324 } 323 } 325 } >> 326 >> 327 #endif 324 328