Changeset 1274 for trunk/source/visualization
- Timestamp:
- May 27, 2010, 10:36:45 AM (16 years ago)
- Location:
- trunk/source/visualization
- Files:
-
- 17 edited
-
History (modified) (2 diffs)
-
OpenGL/GNUmakefile (modified) (1 diff)
-
OpenGL/History (modified) (2 diffs)
-
OpenGL/include/G4OpenGLQtViewer.hh (modified) (1 diff)
-
OpenGL/include/G4OpenGLSceneHandler.hh (modified) (2 diffs)
-
OpenGL/src/G4OpenGLQtViewer.cc (modified) (1 diff)
-
OpenGL/src/G4OpenGLSceneHandler.cc (modified) (2 diffs)
-
OpenGL/src/G4OpenGLViewer.cc (modified) (6 diffs)
-
gMocren/History (modified) (2 diffs)
-
gMocren/src/G4GMocrenFileSceneHandler.cc (modified) (41 diffs)
-
management/History (modified) (2 diffs)
-
management/include/G4VGraphicsSystem.hh (modified) (2 diffs)
-
management/include/G4VGraphicsSystem.icc (modified) (2 diffs)
-
management/include/G4VisManager.hh (modified) (2 diffs)
-
management/src/G4VisCommandsCompound.cc (modified) (3 diffs)
-
test/History (modified) (2 diffs)
-
test/test19.g4m (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/History
r1228 r1274 1 $Id: History,v 1.46 0 2009/11/23 05:56:37 perlExp $1 $Id: History,v 1.464 2010/05/20 07:58:13 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 24 24 History file for visualization category 25 25 --------------------------------------- 26 27 20th May 2010 John Allison (vis-V09-03-01) 28 - Co-working tags: intercoms-V09-03-01, interfaces-V09-03-02 29 - opengl-V09-03-01: 30 o GNUMakefile, G4OpenGLQtViewer : Better inclusion of new tabs in UI part 31 - visman-V09-03-01: 32 o Restore previous viewer after /vis/drawTree. 33 34 11th May 2010 John Allison (vis-V09-03-00) 35 - visman-09-03-00: Print i_mode warnings. 36 - modeling-V09-03-00: 37 o Replace polyhedra with solids for sections and cutaways. 38 o Trap use of i_mode and print warning. 39 - opengl-V09-03-00: 40 o Many improvements to OpenGL Qt. 41 o Speed improvements for polymarkers (e.g., trajectories). 42 o Use generic section and cutaway algorithm. 43 - gMocren-V09-03-01: printing improvement. 44 - vistest-V09-03-00: Added printEPS to test19.g4m, as suggested by Laurent. 26 45 27 46 22nd November 2009 Joseph Perl (vis-V09-02-12) -
trunk/source/visualization/OpenGL/GNUmakefile
r1254 r1274 11 11 12 12 # For debug mode 13 #CPPFLAGS += -DG4DEBUG_VIS_OGL13 CPPFLAGS += -DG4DEBUG_VIS_OGL 14 14 15 15 GLOBLIBS = libG4vis_management.lib libG4modeling.lib libG4gl2ps.lib -
trunk/source/visualization/OpenGL/History
r1254 r1274 1 $Id: History,v 1.1 69 2010/05/20 07:09:33lgarnier Exp $1 $Id: History,v 1.171 2010/05/26 14:50:56 lgarnier Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20th May 2010 Laurent Garnier 19 20 26th May 2010 Laurent Garnier 21 - G4OpenGLQtViewer : Some improvments with auto rotation mode. 22 23 20th May 2010 Laurent Garnier (opengl-V09-03-01) 20 24 Co-working tag : intercoms-V09-03-01, interfaces-V09-03-02 21 25 - GNUMakefile, G4OpenGLQtViewer : Better inclusion of new tabs in UI part -
trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r1260 r1274 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.hh,v 1.2 1 2010/01/06 15:05:29lgarnier Exp $27 // $Id: G4OpenGLQtViewer.hh,v 1.22 2010/05/26 14:50:56 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/source/visualization/OpenGL/include/G4OpenGLSceneHandler.hh
r1253 r1274 25 25 // 26 26 // 27 // $Id: G4OpenGLSceneHandler.hh,v 1.2 8 2010/04/30 13:18:32 lgarnierExp $27 // $Id: G4OpenGLSceneHandler.hh,v 1.29 2010/05/11 10:17:32 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 93 93 virtual ~G4OpenGLSceneHandler (); 94 94 95 const G4Polyhedron* CreateSectionPolyhedron();96 const G4Polyhedron* CreateCutawayPolyhedron();95 G4VSolid* CreateSectionSolid (); 96 G4VSolid* CreateCutawaySolid (); 97 97 98 98 void ClearAndDestroyAtts(); // Destroys att holders and clears pick map. -
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r1259 r1274 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.cc,v 1.5 0 2010/05/20 08:13:37 allisonExp $27 // $Id: G4OpenGLQtViewer.cc,v 1.51 2010/05/26 14:50:56 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/source/visualization/OpenGL/src/G4OpenGLSceneHandler.cc
r1253 r1274 25 25 // 26 26 // 27 // $Id: G4OpenGLSceneHandler.cc,v 1.5 7 2010/04/30 13:18:32 lgarnierExp $27 // $Id: G4OpenGLSceneHandler.cc,v 1.58 2010/05/11 10:17:32 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 138 138 } 139 139 140 const G4Polyhedron* G4OpenGLSceneHandler::CreateSectionPolyhedron()140 G4VSolid* G4OpenGLSceneHandler::CreateSectionSolid () 141 141 { 142 142 // Clipping done in G4OpenGLViewer::SetView. 143 return 0;143 // return 0; 144 144 145 145 // But...OpenGL no longer seems to reconstruct clipped edges, so, 146 146 // when the BooleanProcessor is up to it, abandon this and use 147 // generic clipping in G4VSceneHandler::CreateSection Polyhedron...148 // return G4VSceneHandler::CreateSectionPolyhedron();149 } 150 151 const G4Polyhedron* G4OpenGLSceneHandler::CreateCutawayPolyhedron()147 // generic clipping in G4VSceneHandler::CreateSectionSolid... 148 return G4VSceneHandler::CreateSectionSolid(); 149 } 150 151 G4VSolid* G4OpenGLSceneHandler::CreateCutawaySolid () 152 152 { 153 153 // Cutaway done in G4OpenGLViewer::SetView. 154 return 0;154 // return 0; 155 155 156 156 // But...if not, when the BooleanProcessor is up to it... 157 // return G4VSceneHandler::CreateCutawayPolyhedron();157 return G4VSceneHandler::CreateCutawaySolid(); 158 158 } 159 159 -
trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc
r1245 r1274 25 25 // 26 26 // 27 // $Id: G4OpenGLViewer.cc,v 1.6 1 2010/04/27 15:59:10 lgarnierExp $27 // $Id: G4OpenGLViewer.cc,v 1.62 2010/05/11 10:22:37 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 271 271 // force kernel visit on change of clipping plane in 272 272 // G4OpenGLStoredViewer::CompareForKernelVisit. 273 if (fVP.IsSection () ) { // pair of back to back clip planes. 273 //if (fVP.IsSection () ) { // pair of back to back clip planes. 274 if (false) { // pair of back to back clip planes. 274 275 const G4Plane3D& s = fVP.GetSectionPlane (); 275 276 double sArray[4]; … … 293 294 const G4Planes& cutaways = fVP.GetCutawayPlanes(); 294 295 size_t nPlanes = cutaways.size(); 295 if (fVP.IsCutaway() && 296 //if (fVP.IsCutaway() && 297 if (false && 296 298 fVP.GetCutawayMode() == G4ViewParameters::cutawayIntersection && 297 299 nPlanes > 0) { … … 384 386 GLint hits = glRenderMode(GL_RENDER); 385 387 if (hits < 0) 386 G4cout << "Too many hits. Zoom in to reduce overlaps." << G4 cout;388 G4cout << "Too many hits. Zoom in to reduce overlaps." << G4endl; 387 389 else if (hits > 0) { 388 390 //G4cout << hits << " hit(s)" << G4endl; … … 390 392 for (GLint i = 0; i < hits; ++i) { 391 393 GLuint nnames = *p++; 392 *p++; //OR GLuint zmin = *p++;393 *p++; //OR GLuint zmax = *p++;394 p++; //OR GLuint zmin = *p++; 395 p++; //OR GLuint zmax = *p++; 394 396 //G4cout << "Hit " << i << ": " << nnames << " names" 395 397 // << "\nzmin: " << zmin << ", zmax: " << zmax << G4endl; … … 478 480 // Change the LC_NUMERIC value in order to have "." separtor and not "," 479 481 // This case is only useful for French, Canadien... 480 char *oldLocale = strdup(setlocale(LC_NUMERIC,NULL)); 482 char* oldLocale = (char*)(malloc(strlen(setlocale(LC_NUMERIC,NULL))+1)); 483 if(oldLocale!=NULL) strcpy(oldLocale,setlocale(LC_NUMERIC,NULL)); 481 484 setlocale(LC_NUMERIC,"C"); 482 485 -
trunk/source/visualization/gMocren/History
r1228 r1274 1 $Id: History,v 1. 9 2009/12/03 11:44:42 akimuraExp $1 $Id: History,v 1.11 2010/05/11 10:44:35 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/gMocren sub-category 21 21 --------------------------------------------------- 22 23 11 May 2010 John Allison (gMocren-V09-03-01) 24 - G4GMocrenFileSceneHandler.cc: Added G4cout << G4endl; to improve printing. 25 26 22 January 2010 Gabriele Cosmo (gMocren-V09-03-00) 27 Fix in G4GMocrenFileSceneHandler.cc to allow for porting on C++0x Standard: 28 made explicit with static_cast conversions from double to float. Also use 29 G4 types in consistent way. 22 30 23 31 3 December 2009 Akinori Kimura -
trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc
r1228 r1274 25 25 // 26 26 // 27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.1 2 2009/12/03 11:44:42 akimuraExp $27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.14 2010/05/11 10:44:11 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 93 93 94 94 //-- for a debugging 95 const bool GFDEBUG = false;96 const bool GFDEBUG_TRK = false;//true;97 const bool GFDEBUG_HIT = false;//true;95 const G4bool GFDEBUG = false; 96 const G4bool GFDEBUG_TRK = false;//true; 97 const G4bool GFDEBUG_HIT = false;//true; 98 98 const G4int GFDEBUG_DET = 0; // 0: false 99 99 … … 170 170 kbSetModalityVoxelSize = false; 171 171 172 for( int i = 0; i < 3; i++) {172 for(G4int i = 0; i < 3; i++) { 173 173 kModalitySize[i] = 0; 174 174 kNestedVolumeDimension[i] = 0; … … 182 182 { 183 183 // g4_00.gdd, g4_01.gdd, ..., g4_MAX_FILE_INDEX.gdd 184 const int MAX_FILE_INDEX = kMaxFileNum - 1 ;184 const G4int MAX_FILE_INDEX = kMaxFileNum - 1 ; 185 185 186 186 // dest directory (null if no environmental variables is set) … … 191 191 192 192 // Automatic updation of file names 193 static int currentNumber = 0;194 for( int i = currentNumber ; i < kMaxFileNum ; i++) {193 static G4int currentNumber = 0; 194 for( G4int i = currentNumber ; i < kMaxFileNum ; i++) { 195 195 196 196 // Message in the final execution … … 268 268 minmax[1] = ctdens.GetMaxCT(); 269 269 kgMocrenIO->setModalityImageMinMax(minmax); 270 std::vector< float> map;271 float dens;272 for( int i = minmax[0]; i <= minmax[1]; i++) {270 std::vector<G4float> map; 271 G4float dens; 272 for(G4int i = minmax[0]; i <= minmax[1]; i++) { 273 273 dens = ctdens.GetDensity(i); 274 274 map.push_back(dens); … … 283 283 ifile >> minmax[0] >> minmax[1]; 284 284 kgMocrenIO->setModalityImageMinMax(minmax); 285 std::vector< float> map;286 float dens;287 for( int i = minmax[0]; i <= minmax[1]; i++) {285 std::vector<G4float> map; 286 G4float dens; 287 for(G4int i = minmax[0]; i <= minmax[1]; i++) { 288 288 ifile >> dens; 289 289 map.push_back(dens); … … 329 329 kFlagSaving_g4_gdd = false; 330 330 331 std::map<Index3D, float>::iterator itr = kNestedModality.begin();331 std::map<Index3D, G4float>::iterator itr = kNestedModality.begin(); 332 332 G4int xmax=0, ymax=0, zmax=0; 333 333 for(; itr != kNestedModality.end(); itr++) { … … 347 347 348 348 G4int nxy = kModalitySize[0]*kModalitySize[1]; 349 //std::map<G4int, float>::iterator itr;350 for( int z = 0; z < kModalitySize[2]; z++) {349 //std::map<G4int, G4float>::iterator itr; 350 for(G4int z = 0; z < kModalitySize[2]; z++) { 351 351 short * modality = new short[nxy]; 352 for( int y = 0; y < kModalitySize[1]; y++) {353 for( int x = 0; x < kModalitySize[0]; x++) {354 //for( int x = kModalitySize[0]-1; x >= 0 ; x--) {352 for(G4int y = 0; y < kModalitySize[1]; y++) { 353 for(G4int x = 0; x < kModalitySize[0]; x++) { 354 //for(G4int x = kModalitySize[0]-1; x >= 0 ; x--) { 355 355 //G4int ixy = x + (kModalitySize[1]-y-1)*kModalitySize[0]; 356 356 … … 377 377 std::map<G4String, std::map<Index3D, G4double> >::iterator hitsListItr = kNestedHitsList.begin(); 378 378 379 for( int n = 0; hitsListItr != kNestedHitsList.end(); hitsListItr++, n++) {379 for(G4int n = 0; hitsListItr != kNestedHitsList.end(); hitsListItr++, n++) { 380 380 381 381 kgMocrenIO->newDoseDist(); … … 384 384 385 385 G4double minmax[2] = {DBL_MAX, -DBL_MAX}; 386 for( int z = 0 ; z < kModalitySize[2]; z++) {386 for(G4int z = 0 ; z < kModalitySize[2]; z++) { 387 387 G4double * values = new G4double[nxy]; 388 for( int y = 0; y < kModalitySize[1]; y++) {389 for( int x = 0; x < kModalitySize[0]; x++) {388 for(G4int y = 0; y < kModalitySize[1]; y++) { 389 for(G4int x = 0; x < kModalitySize[0]; x++) { 390 390 391 391 G4int ixy = x + y*kModalitySize[0]; … … 421 421 rot = kVolumeTrans3D.getRotation().inverse(); 422 422 // x 423 std::vector< float *> tracks;423 std::vector<G4float *> tracks; 424 424 unsigned char colors[3]; 425 float * trk = newfloat[6];425 G4float * trk = new G4float[6]; 426 426 tracks.push_back(trk); 427 427 … … 435 435 za -= trans; 436 436 za.transform(rot); 437 for( int i = 0; i < 3; i++) trk[i] = orig[i];438 for( int i = 0; i < 3; i++) trk[i+3] = xa[i];437 for(G4int i = 0; i < 3; i++) trk[i] = orig[i]; 438 for(G4int i = 0; i < 3; i++) trk[i+3] = xa[i]; 439 439 colors[0] = 255; colors[1] = 0; colors[2] = 0; 440 440 kgMocrenIO->addTrack(tracks, colors); 441 441 // y 442 for( int i = 0; i < 3; i++) trk[i+3] = ya[i];442 for(G4int i = 0; i < 3; i++) trk[i+3] = ya[i]; 443 443 colors[0] = 0; colors[1] = 255; colors[2] = 0; 444 444 kgMocrenIO->addTrack(tracks, colors); 445 445 // z 446 for( int i = 0; i < 3; i++) trk[i+3] = za[i];446 for(G4int i = 0; i < 3; i++) trk[i+3] = za[i]; 447 447 colors[0] = 0; colors[1] = 0; colors[2] = 255; 448 448 kgMocrenIO->addTrack(tracks, colors); … … 454 454 455 455 if(GFDEBUG_DET) G4cout << ">>>>>>>>>>>>>>>>>>>>>> ("; 456 std::vector< float> transformObjects;457 for( int i = 0; i < 3; i++) {456 std::vector<G4float> transformObjects; 457 for(G4int i = 0; i < 3; i++) { 458 458 // need to check!! 459 459 transformObjects.push_back((kVolumeSize[i]/2. - kVoxelDimension[i]/2.)); … … 533 533 534 534 if(GFDEBUG_TRK) G4cout << " trajectory points : " << G4endl; 535 std::vector< float *> trajectory;535 std::vector<G4float *> trajectory; 536 536 if(polyline.size() < 2) return; 537 537 G4Polyline::const_iterator preitr = polyline.begin(); … … 544 544 postPts -= trans; 545 545 postPts.transform(rot); 546 float * stepPts = newfloat[6];546 G4float * stepPts = new G4float[6]; 547 547 stepPts[0] = prePts.x(); 548 548 stepPts[1] = prePts.y(); … … 657 657 658 658 //---------- (3) Facet block 659 for ( int f = polyhedron.GetNoFacets(); f; f--){659 for (G4int f = polyhedron.GetNoFacets(); f; f--){ 660 660 G4int notLastEdge; 661 661 G4int index = -1; // initialization … … 764 764 G4Polyhedron * poly = box.CreatePolyhedron(); 765 765 poly->Transform(*fpObjectTransformation); 766 // int nv = poly->GetNoVertices();766 //G4int nv = poly->GetNoVertices(); 767 767 G4Point3D v1, v2; 768 768 G4int next; 769 769 //while(1) { // next flag isn't functional. 770 for( int i = 0; i < 12; i++) { // # of edges is 12.770 for(G4int i = 0; i < 12; i++) { // # of edges is 12. 771 771 poly->GetNextEdge(v1, v2, next); 772 772 if(next == 0) break; … … 927 927 } 928 928 929 for( int i = 0; i < 3; i++) {929 for(G4int i = 0; i < 3; i++) { 930 930 kNestedVolumeDimension[i] = nDaughters[i]; 931 931 //kNestedVolumeDimension[i] = nDaughters[dirAxis[i]]; … … 940 940 if(nestPara) { 941 941 G4double prexyz[3] = {0.,0.,0.}, xyz[3] = {0.,0.,0.}; 942 for( int n0 = 0; n0 < nDaughters[0]; n0++) {943 for( int n1 = 0; n1 < nDaughters[1]; n1++) {944 for( int n2 = 0; n2 < nDaughters[2]; n2++) {942 for(G4int n0 = 0; n0 < nDaughters[0]; n0++) { 943 for(G4int n1 = 0; n1 < nDaughters[1]; n1++) { 944 for(G4int n2 = 0; n2 < nDaughters[2]; n2++) { 945 945 946 946 G4GMocrenTouchable * touch = new G4GMocrenTouchable(n1, n0); … … 961 961 xyz[2] = tbox.GetZHalfLength()/mm; 962 962 if(n0 != 0 || n1 != 0 || n2 != 0) { 963 for( int i = 0; i < 3; i++) {963 for(G4int i = 0; i < 3; i++) { 964 964 if(xyz[i] != prexyz[i]) G4Exception("Error[gMocrenFileSceneHandler]: Unsupported parameterisation."); 965 965 } … … 980 980 << " density: " << dens << G4endl; 981 981 982 for( int i = 0; i < 3; i++) prexyz[i] = xyz[i];982 for(G4int i = 0; i < 3; i++) prexyz[i] = xyz[i]; 983 983 } 984 984 } … … 990 990 // mesh size 991 991 if(!kbSetModalityVoxelSize) { 992 float spacing[3] = {2*xyz[0], 2*xyz[1], 2*xyz[2]}; 992 G4float spacing[3] = {static_cast<G4float>(2*xyz[0]), 993 static_cast<G4float>(2*xyz[1]), 994 static_cast<G4float>(2*xyz[2])}; 993 995 kgMocrenIO->setVoxelSpacing(spacing); 994 996 kVoxelDimension.set(spacing[0], spacing[1], spacing[2]); … … 1014 1016 G4cout << " physical volume node id : " 1015 1017 << "size: " << npvp << ", PV name: "; 1016 for( int i = 0; i < npvp; i++) {1018 for(G4int i = 0; i < npvp; i++) { 1017 1019 G4cout << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetName() 1018 1020 << " [param:" … … 1093 1095 G4int nXY = kNestedVolumeDimension[0]*kNestedVolumeDimension[1]; 1094 1096 1095 for( int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) {1096 for( int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) {1097 for( int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) {1097 for(G4int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) { 1098 for(G4int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) { 1099 for(G4int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) { 1098 1100 1099 1101 G4int repNo = n0 + n1*nX + n2*nXY; … … 1123 1125 // mesh size 1124 1126 if(!kbSetModalityVoxelSize) { 1125 float spacing[3] = {2*phantomPara->GetVoxelHalfX(),1126 2*phantomPara->GetVoxelHalfY(),1127 2*phantomPara->GetVoxelHalfZ()};1127 G4float spacing[3] = {static_cast<G4float>(2*phantomPara->GetVoxelHalfX()), 1128 static_cast<G4float>(2*phantomPara->GetVoxelHalfY()), 1129 static_cast<G4float>(2*phantomPara->GetVoxelHalfZ())}; 1128 1130 kgMocrenIO->setVoxelSpacing(spacing); 1129 1131 kVoxelDimension.set(spacing[0], spacing[1], spacing[2]); … … 1158 1160 1159 1161 // get densities of the parameterized patient geometry 1160 for( int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) {1161 for( int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) {1162 for( int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) {1162 for(G4int n0 = 0; n0 < kNestedVolumeDimension[0]; n0++) { 1163 for(G4int n1 = 0; n1 < kNestedVolumeDimension[1]; n1++) { 1164 for(G4int n2 = 0; n2 < kNestedVolumeDimension[2]; n2++) { 1163 1165 1164 1166 G4double dens = 0.*(g/cm3); … … 1192 1194 // mesh size 1193 1195 if(!kbSetModalityVoxelSize) { 1194 float spacing[3] = {boxSize.x()*2/nVoxels[0],1195 boxSize.y()*2/nVoxels[1],1196 boxSize.z()*2/nVoxels[2]};1196 G4float spacing[3] = {static_cast<G4float>(boxSize.x()*2/nVoxels[0]), 1197 static_cast<G4float>(boxSize.y()*2/nVoxels[1]), 1198 static_cast<G4float>(boxSize.z()*2/nVoxels[2])}; 1197 1199 1198 1200 kgMocrenIO->setVoxelSpacing(spacing); … … 1292 1294 G4cout << " " << tubes.GetName() << G4endl; 1293 1295 G4Polyhedron * poly = tubes.CreatePolyhedron(); 1294 int nv = poly->GetNoVertices();1295 for( int i = 0; i < nv; i++) {1296 G4int nv = poly->GetNoVertices(); 1297 for(G4int i = 0; i < nv; i++) { 1296 1298 G4cout << " (" << poly->GetVertex(i).x() << ", " 1297 1299 << poly->GetVertex(i).y() << ", " … … 1449 1451 if(GFDEBUG_TRK) { 1450 1452 std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl; 1451 1452 1453 G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel); 1453 1454 if (!pTrModel) { … … 1464 1465 G4cout << " momentum: " << trj->GetInitialMomentum() << G4endl; 1465 1466 1466 int nPnt = trj->GetPointEntries();1467 G4int nPnt = trj->GetPointEntries(); 1467 1468 G4cout << " point: "; 1468 for( int i = 0; i < nPnt; i++) {1469 for(G4int i = 0; i < nPnt; i++) { 1469 1470 G4cout << trj->GetPoint(i)->GetPosition() << ", "; 1470 1471 } 1471 1472 G4cout << G4endl; 1472 1473 1474 } 1473 } 1474 G4cout << G4endl; 1475 1475 } 1476 1476 … … 1544 1544 // Get attributes 1545 1545 for(itr = attval->begin(); itr != attval->end(); itr++) { 1546 for( int i = 0; i < nhitname; i++) {1546 for(G4int i = 0; i < nhitname; i++) { 1547 1547 if(itr->GetName() == hitNames[i]) { 1548 1548 … … 1601 1601 1602 1602 1603 //for( int i = 0; i < nhitname; i++) { // this selection trusts1603 //for(G4int i = 0; i < nhitname; i++) { // this selection trusts 1604 1604 //if(scorername == hitScorerNames[i]) { // thea command /vis/scene/add/psHits hit_name. 1605 1605 … … 1630 1630 G4cout << " >>>>> " << meshname << " : " << scorername << G4endl; 1631 1631 1632 for( int i = 0; i < nhitname; i++)1632 for(G4int i = 0; i < nhitname; i++) 1633 1633 if(scorername == hitScorerNames[i]) 1634 1634 G4cout << " !!!! Hit scorer !!!! " << scorername << G4endl; … … 1702 1702 1703 1703 // edge points of the detector 1704 std::vector< float *> dedges;1704 std::vector<G4float *> dedges; 1705 1705 G4Polyhedron * poly = solid.CreatePolyhedron(); 1706 1706 detector.polyhedron = poly; … … 1717 1717 //uccolor[0] = uccolor[1] = uccolor[2] = 30; // dark grey 1718 1718 } 1719 for( int i = 0; i < 3; i++) detector.color[i] = uccolor[i];1719 for(G4int i = 0; i < 3; i++) detector.color[i] = uccolor[i]; 1720 1720 // 1721 1721 kDetectors.push_back(detector); 1722 1722 1723 1723 if(GFDEBUG_DET > 1) { 1724 G4cout << "0 color: (" << ( int)uccolor[0] << ", "1725 << ( int)uccolor[1] << ", " << (int)uccolor[2] << ")"1724 G4cout << "0 color: (" << (G4int)uccolor[0] << ", " 1725 << (G4int)uccolor[1] << ", " << (G4int)uccolor[2] << ")" 1726 1726 << G4endl; 1727 1727 } … … 1742 1742 1743 1743 // edge points of the detector 1744 std::vector< float *> dedges;1744 std::vector<G4float *> dedges; 1745 1745 G4Polyhedron * poly = itr->polyhedron; 1746 1746 poly->Transform(itr->transform3D); … … 1755 1755 while(bnext) { 1756 1756 if(!(poly->GetNextEdge(v1, v2, next))) bnext =false; 1757 float * edge = newfloat[6];1757 G4float * edge = new G4float[6]; 1758 1758 edge[0] = v1.x()/mm; 1759 1759 edge[1] = v1.y()/mm; … … 1772 1772 // 1773 1773 kgMocrenIO->addDetector(detname, dedges, uccolor); 1774 for( int i = 0; i < nedges; i++) { // # of edges is 12.1774 for(G4int i = 0; i < nedges; i++) { // # of edges is 12. 1775 1775 delete [] dedges[i]; 1776 1776 } … … 1778 1778 1779 1779 if(GFDEBUG_DET > 1) { 1780 G4cout << " color: (" << ( int)uccolor[0] << ", "1781 << ( int)uccolor[1] << ", " << (int)uccolor[2] << ")"1780 G4cout << " color: (" << (G4int)uccolor[0] << ", " 1781 << (G4int)uccolor[1] << ", " << (G4int)uccolor[2] << ")" 1782 1782 << G4endl; 1783 1783 } … … 1789 1789 kNestedVolumeDimension[1] == 0 || 1790 1790 kNestedVolumeDimension[2] == 0) { 1791 for( int i = 0; i < 3; i++) _idx3d[i] = 0;1791 for(G4int i = 0; i < 3; i++) _idx3d[i] = 0; 1792 1792 return; 1793 1793 } -
trunk/source/visualization/management/History
r1258 r1274 1 $Id: History,v 1.14 2 2010/05/11 12:17:40allison Exp $1 $Id: History,v 1.143 2010/05/20 07:56:21 allison Exp $ 2 2 3 3 ------------------------------------------------------------------- … … 26 26 History file for visualization management sub-category 27 27 ------------------------------------------------------ 28 29 20th May 2010 John Allison (visman-V09-03-01) 30 - G4VisCommandsCompound.cc: Restore previous viewer after /vis/drawTree. 31 - G4VisManager.hh: Cosmetic. 32 - G4VGraphicsSystem: Add Set methods. 28 33 29 34 11th May 2010 John Allison (visman-V09-03-00) -
trunk/source/visualization/management/include/G4VGraphicsSystem.hh
r954 r1274 25 25 // 26 26 // 27 // $Id: G4VGraphicsSystem.hh,v 1.1 1 2006/06/29 21:28:04 gunterExp $27 // $Id: G4VGraphicsSystem.hh,v 1.12 2010/05/20 07:55:47 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 80 80 const G4String& GetDescription () const; 81 81 Functionality GetFunctionality () const; 82 void SetName (const G4String&); 83 void SetNickName (const G4String&); 84 void SetDescription (const G4String&); 85 void SetFunctionality (Functionality); 82 86 83 87 protected: 84 constG4String fName;85 constG4String fNickname;86 constG4String fDescription;88 G4String fName; 89 G4String fNickname; 90 G4String fDescription; 87 91 Functionality fFunctionality; 88 92 }; -
trunk/source/visualization/management/include/G4VGraphicsSystem.icc
r954 r1274 25 25 // 26 26 // 27 // $Id: G4VGraphicsSystem.icc,v 1. 7 2006/06/29 21:28:06 gunterExp $27 // $Id: G4VGraphicsSystem.icc,v 1.8 2010/05/20 07:55:47 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 48 48 return fFunctionality; 49 49 } 50 51 inline void G4VGraphicsSystem::SetName (const G4String& name) { 52 fName = name; 53 } 54 55 inline void G4VGraphicsSystem::SetNickName (const G4String& nickname) { 56 fNickname = nickname; 57 } 58 59 inline void G4VGraphicsSystem::SetDescription (const G4String& description) { 60 fDescription = description; 61 } 62 63 inline void G4VGraphicsSystem::SetFunctionality (Functionality f) { 64 fFunctionality = f; 65 } -
trunk/source/visualization/management/include/G4VisManager.hh
r933 r1274 25 25 // 26 26 // 27 // $Id: G4VisManager.hh,v 1.7 0 2009/02/25 18:28:00 lgarnierExp $27 // $Id: G4VisManager.hh,v 1.71 2010/05/20 07:54:31 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 366 366 const G4VisExtent& = G4VisExtent::NullExtent); 367 367 void SetUserActionExtent (const G4VisExtent&); 368 void SetCurrentGraphicsSystem (G4VGraphicsSystem* pSystem);368 void SetCurrentGraphicsSystem (G4VGraphicsSystem*); 369 369 void SetCurrentScene (G4Scene*); 370 void SetCurrentSceneHandler (G4VSceneHandler* pScene);371 void SetCurrentViewer (G4VViewer* pView);370 void SetCurrentSceneHandler (G4VSceneHandler*); 371 void SetCurrentViewer (G4VViewer*); 372 372 G4SceneHandlerList& SetAvailableSceneHandlers (); // Returns lvalue. 373 373 G4SceneList& SetSceneList (); // Returns lvalue. -
trunk/source/visualization/management/src/G4VisCommandsCompound.cc
r954 r1274 25 25 // 26 26 // 27 // $Id: G4VisCommandsCompound.cc,v 1. 39 2007/11/16 20:29:04 perlExp $27 // $Id: G4VisCommandsCompound.cc,v 1.40 2010/05/20 07:54:01 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 … … 66 66 is >> pvname >> system; 67 67 68 G4VGraphicsSystem* keepSystem = fpVisManager->GetCurrentGraphicsSystem(); 69 G4Scene* keepScene = fpVisManager->GetCurrentScene(); 70 G4VSceneHandler* keepSceneHandler = fpVisManager->GetCurrentSceneHandler(); 71 G4VViewer* keepViewer = fpVisManager->GetCurrentViewer(); 72 68 73 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 69 74 G4int keepVerbose = UImanager->GetVerboseLevel(); … … 77 82 UImanager->ApplyCommand("/vis/viewer/flush"); 78 83 UImanager->SetVerboseLevel(keepVerbose); 84 85 if (keepViewer) { 86 if (fpVisManager->GetVerbosity() >= G4VisManager::warnings) { 87 G4cout << "Reverting to " << keepViewer->GetName() << G4endl; 88 } 89 fpVisManager->SetCurrentGraphicsSystem(keepSystem); 90 fpVisManager->SetCurrentScene(keepScene); 91 fpVisManager->SetCurrentSceneHandler(keepSceneHandler); 92 fpVisManager->SetCurrentViewer(keepViewer); 93 } 79 94 } 80 95 -
trunk/source/visualization/test/History
r1228 r1274 1 $Id: History,v 1.12 1 2009/11/06 16:02:33allison Exp $1 $Id: History,v 1.123 2010/05/11 12:06:08 allison Exp $ 2 2 3 3 History file for visualization/test subdirectory … … 5 5 6 6 $Log: History,v $ 7 Revision 1.123 2010/05/11 12:06:08 allison 8 vistest-V09-03-00 9 10 Revision 1.122 2010/05/11 12:04:39 allison 11 Added printEPS to test19.g4m, as suggested by Laurent. 12 7 13 Revision 1.121 2009/11/06 16:02:33 allison 8 14 vistest-V09-02-01 -
trunk/source/visualization/test/test19.g4m
r1138 r1274 41 41 #/vis/sceneHandler/create OGLSXm 42 42 #/vis/sceneHandler/create OGLIX 43 #/vis/sceneHandler/create OGLSX44 /vis/sceneHandler/create OGLSXm43 /vis/sceneHandler/create OGLSX 44 #/vis/sceneHandler/create OGLSXm 45 45 #/vis/sceneHandler/create VRML1 46 46 #/vis/sceneHandler/create VRML1FILE … … 71 71 # (all that happens is an extra refresh). 72 72 /vis/viewer/flush 73 /vis/ogl/set/printMode vectored 74 /vis/ogl/set/printSize 800 600 75 /vis/ogl/set/printFilename output-test19-1 76 /vis/ogl/printEPS 73 77 # 74 78 # Create another viewer. … … 80 84 # 81 85 /vis/viewer/flush 86 /vis/ogl/set/printMode vectored 87 /vis/ogl/set/printSize 800 600 88 /vis/ogl/set/printFilename output-test19-2 89 /vis/ogl/printEPS 82 90 # 83 91 # Now hidden line removal. … … 90 98 # 91 99 /vis/viewer/flush 100 /vis/ogl/set/printMode vectored 101 /vis/ogl/set/printSize 800 600 102 /vis/ogl/set/printFilename output-test19-3 103 /vis/ogl/printEPS 92 104 # 93 105 # Now hidden line *and* hidden surface removal. … … 100 112 # 101 113 /vis/viewer/flush 114 /vis/ogl/set/printMode vectored 115 /vis/ogl/set/printSize 800 600 116 /vis/ogl/set/printFilename output-test19-4 117 /vis/ogl/printEPS 102 118 # 103 119 # Start a run to initialise/optimise geometry and draw user-drawn transients. … … 112 128 /vis/scene/notifyHandlers 113 129 /vis/viewer/flush 130 /vis/ogl/set/printMode vectored 131 /vis/ogl/set/printSize 800 600 132 /vis/ogl/set/printFilename output-test19-5 133 /vis/ogl/printEPS 114 134 # 115 135 # Logical volume of Boolean solids... … … 122 142 /vis/scene/notifyHandlers 123 143 /vis/viewer/flush 144 /vis/ogl/set/printMode vectored 145 /vis/ogl/set/printSize 800 600 146 /vis/ogl/set/printFilename output-test19-6 147 /vis/ogl/printEPS 124 148 # 125 149 /vis/scene/create … … 129 153 /vis/viewer/set/viewpointThetaPhi 35 35 130 154 /vis/viewer/flush 155 /vis/ogl/set/printMode vectored 156 /vis/ogl/set/printSize 800 600 157 /vis/ogl/set/printFilename output-test19-7 158 /vis/ogl/printEPS 131 159 # 132 160 /vis/scene/create … … 136 164 /vis/viewer/set/viewpointThetaPhi 35 35 137 165 /vis/viewer/flush 166 /vis/ogl/set/printMode vectored 167 /vis/ogl/set/printSize 800 600 168 /vis/ogl/set/printFilename output-test19-8 169 /vis/ogl/printEPS 138 170 # 139 171 # Send geantino through... … … 153 185 /tracking/verbose 0 154 186 /vis/viewer/flush 187 /vis/ogl/set/printMode vectored 188 /vis/ogl/set/printSize 800 600 189 /vis/ogl/set/printFilename output-test19-9 190 /vis/ogl/printEPS 155 191 # 156 192 # Rotated tracker tube … … 172 208 /run/beamOn 173 209 /vis/viewer/flush 210 /vis/ogl/set/printMode vectored 211 /vis/ogl/set/printSize 800 600 212 /vis/ogl/set/printFilename output-test19-10 213 /vis/ogl/printEPS 174 214 # 175 215 # G4Trap1 … … 215 255 /run/beamOn 216 256 /vis/viewer/flush 257 /vis/ogl/set/printMode vectored 258 /vis/ogl/set/printSize 800 600 259 /vis/ogl/set/printFilename output-test19-11 260 /vis/ogl/printEPS 217 261 # 218 262 # G4Trap2 … … 241 285 /run/beamOn 242 286 /vis/viewer/flush 287 /vis/ogl/set/printMode vectored 288 /vis/ogl/set/printSize 800 600 289 /vis/ogl/set/printFilename output-test19-12 290 /vis/ogl/printEPS 243 291 # 244 292 # Displaced solid. … … 252 300 /run/beamOn 253 301 /vis/viewer/flush 302 /vis/ogl/set/printMode vectored 303 /vis/ogl/set/printSize 800 600 304 /vis/ogl/set/printFilename output-test19-13 305 /vis/ogl/printEPS 254 306 # 255 307 # Boolean solid. … … 313 365 /run/beamOn 314 366 /vis/viewer/flush 367 /vis/ogl/set/printMode vectored 368 /vis/ogl/set/printSize 800 600 369 /vis/ogl/set/printFilename output-test19-14 370 /vis/ogl/printEPS 315 371 # 316 372 # To view replicas... … … 355 411 /run/beamOn 356 412 /vis/viewer/flush 413 /vis/ogl/set/printMode vectored 414 /vis/ogl/set/printSize 800 600 415 /vis/ogl/set/printFilename output-test19-15 416 /vis/ogl/printEPS 357 417 #...end 358 418 # … … 360 420 /vis/viewer/set/projection perspective 30 361 421 /vis/viewer/flush 422 /vis/ogl/set/printMode vectored 423 /vis/ogl/set/printSize 800 600 424 /vis/ogl/set/printFilename output-test19-16 425 /vis/ogl/printEPS 362 426 # 363 427 #/vis/sceneHandler/create OIX … … 367 431 /vis/viewer/set/viewpointThetaPhi 30 30 368 432 /vis/viewer/flush 433 /vis/ogl/set/printMode vectored 434 /vis/ogl/set/printSize 800 600 435 /vis/ogl/set/printFilename output-test19-17 436 /vis/ogl/printEPS 369 437 # 370 438 # You can use /vis/rayTracer/... commands … … 378 446 /vis/viewer/set/viewpointThetaPhi 45 45 379 447 /vis/viewer/flush 448 /vis/ogl/set/printMode vectored 449 /vis/ogl/set/printSize 800 600 450 /vis/ogl/set/printFilename output-test19-18 451 /vis/ogl/printEPS 380 452 # 381 453 # Odd!!? JPEG image seems upside down for default view direction... 382 454 /vis/viewer/create ! ! 200 383 455 /vis/viewer/flush 456 /vis/ogl/set/printMode vectored 457 /vis/ogl/set/printSize 800 600 458 /vis/ogl/set/printFilename output-test19-19 459 /vis/ogl/printEPS 460 exit
Note:
See TracChangeset
for help on using the changeset viewer.
