Changeset 1097 for trunk/source/visualization/OpenInventor/src
- Timestamp:
- Aug 19, 2009, 3:47:49 PM (15 years ago)
- Location:
- trunk/source/visualization/OpenInventor/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/OpenInventor/src/G4OpenInventorWinViewer.cc
r954 r1097 65 65 }; 66 66 67 #define SIZE 60068 67 // File : 69 68 #define ID_FILE_POSTSCRIPT 1 … … 98 97 G4cout << "Window name: " << fName << G4endl; 99 98 99 } 100 101 102 void G4OpenInventorWinViewer::Initialise() { 103 100 104 G4String wName = fName; 105 106 int width = 600; 107 int height = 600; 101 108 102 109 HWND parent = (HWND)fInteractorManager->GetParentInteractor (); … … 122 129 done = TRUE; 123 130 } 124 131 132 G4String sgeometry = fVP.GetXGeometryString(); 133 if(sgeometry.empty()) { 134 G4cout << "ERROR: Geometry string \"" 135 << sgeometry 136 << "\" is empty. Using \"600x600\"." 137 << G4endl; 138 width = 600; 139 height = 600; 140 sprintf(s,"%dx%d",width,height); 141 sgeometry = s; 142 } else { 143 width = fVP.GetWindowSizeHintX(); 144 height = fVP.GetWindowSizeHintX(); 145 } 146 125 147 HMENU menuBar = CreateMenu(); 126 148 … … 157 179 WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, 158 180 CW_USEDEFAULT, CW_USEDEFAULT, 159 SIZE,SIZE,181 width,height, 160 182 0,menuBar,::GetModuleHandle(0),0); 161 183 // Retreive window and client sizez : … … 167 189 int cw = crect.right-crect.left; 168 190 int ch = crect.bottom-crect.top; 169 // Compell client rect to be SIZE SIZE:170 MoveWindow((HWND)fShell,wrect.left,wrect.top, SIZE+ww-cw,SIZE+wh-ch,TRUE);191 // Compell client rect to be width height : 192 MoveWindow((HWND)fShell,wrect.left,wrect.top,width+ww-cw,height+wh-ch,TRUE); 171 193 ::SetWindowLong((HWND)fShell,GWL_USERDATA,LONG(this)); 172 194 ::SetWindowText((HWND)fShell,shellName.c_str()); … … 184 206 fViewer->setGLRenderAction(fGL2PSAction); 185 207 186 fViewer->setSize(SbVec2s( SIZE,SIZE));208 fViewer->setSize(SbVec2s(width,height)); 187 209 fViewer->setSceneGraph(fSoSelection); 188 210 fViewer->viewAll(); -
trunk/source/visualization/OpenInventor/src/G4OpenInventorXtViewer.cc
r954 r1097 76 76 { 77 77 G4cout << "Window name: " << fName << G4endl; 78 78 } 79 80 81 void G4OpenInventorXtViewer::Initialise() { 82 79 83 G4String wName = fName; 80 81 #define SIZE 600 84 82 85 Widget parent = (Widget)fInteractorManager->GetParentInteractor (); 86 int width = 600; 87 int height = 600; 88 83 89 if(!parent) { 84 90 // Check if user has specified an X-Windows-type geometry string... 85 91 char s[32]; 86 sprintf(s,"%dx%d",SIZE,SIZE); 92 87 93 G4String sgeometry = fVP.GetXGeometryString(); 88 if(sgeometry.empty()) sgeometry = s; 94 if(sgeometry.empty()) { 95 G4cout << "ERROR: Geometry string \"" 96 << sgeometry 97 << "\" is empty. Using \"600x600\"." 98 << G4endl; 99 width = 600; 100 height = 600; 101 sprintf(s,"%dx%d",width,height); 102 sgeometry = s; 103 } else { 104 width = fVP.GetWindowSizeHintX(); 105 height = fVP.GetWindowSizeHintX(); 106 } 89 107 90 108 //Create a shell window : … … 167 185 } 168 186 169 fViewer->setSize(SbVec2s( SIZE,SIZE));187 fViewer->setSize(SbVec2s(width,height)); 170 188 171 189 // Have a GL2PS render action :
Note: See TracChangeset
for help on using the changeset viewer.