Ignore:
Timestamp:
May 27, 2010, 10:36:45 AM (16 years ago)
Author:
garnier
Message:

update...

Location:
trunk/source/visualization
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/History

    r1228 r1274  
    1 $Id: History,v 1.460 2009/11/23 05:56:37 perl Exp $
     1$Id: History,v 1.464 2010/05/20 07:58:13 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2424History file for visualization category
    2525---------------------------------------
     26
     2720th 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
     3411th 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.
    2645
    274622nd November 2009  Joseph Perl (vis-V09-02-12)
  • trunk/source/visualization/OpenGL/GNUmakefile

    r1254 r1274  
    1111
    1212# For debug mode
    13 # CPPFLAGS += -DG4DEBUG_VIS_OGL
     13CPPFLAGS += -DG4DEBUG_VIS_OGL
    1414
    1515GLOBLIBS  = libG4vis_management.lib libG4modeling.lib libG4gl2ps.lib
  • trunk/source/visualization/OpenGL/History

    r1254 r1274  
    1 $Id: History,v 1.169 2010/05/20 07:09:33 lgarnier Exp $
     1$Id: History,v 1.171 2010/05/26 14:50:56 lgarnier Exp $
    22-------------------------------------------------------------------
    33
     
    1717     * Reverse chronological order (last date on top), please *
    1818     ----------------------------------------------------------
    19 20th May 2010 Laurent Garnier
     19
     2026th May 2010 Laurent Garnier
     21 - G4OpenGLQtViewer : Some improvments with auto rotation mode.
     22
     2320th May 2010 Laurent Garnier  (opengl-V09-03-01)
    2024 Co-working tag : intercoms-V09-03-01, interfaces-V09-03-02
    2125 - GNUMakefile, G4OpenGLQtViewer : Better inclusion of new tabs in UI part
  • trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh

    r1260 r1274  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.hh,v 1.21 2010/01/06 15:05:29 lgarnier Exp $
     27// $Id: G4OpenGLQtViewer.hh,v 1.22 2010/05/26 14:50:56 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/source/visualization/OpenGL/include/G4OpenGLSceneHandler.hh

    r1253 r1274  
    2525//
    2626//
    27 // $Id: G4OpenGLSceneHandler.hh,v 1.28 2010/04/30 13:18:32 lgarnier Exp $
     27// $Id: G4OpenGLSceneHandler.hh,v 1.29 2010/05/11 10:17:32 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    9393  virtual ~G4OpenGLSceneHandler ();
    9494
    95   const G4Polyhedron* CreateSectionPolyhedron ();
    96   const G4Polyhedron* CreateCutawayPolyhedron ();
     95  G4VSolid* CreateSectionSolid ();
     96  G4VSolid* CreateCutawaySolid ();
    9797
    9898  void ClearAndDestroyAtts();  // Destroys att holders and clears pick map.
  • trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc

    r1259 r1274  
    2525//
    2626//
    27 // $Id: G4OpenGLQtViewer.cc,v 1.50 2010/05/20 08:13:37 allison Exp $
     27// $Id: G4OpenGLQtViewer.cc,v 1.51 2010/05/26 14:50:56 lgarnier Exp $
    2828// GEANT4 tag $Name:  $
    2929//
  • trunk/source/visualization/OpenGL/src/G4OpenGLSceneHandler.cc

    r1253 r1274  
    2525//
    2626//
    27 // $Id: G4OpenGLSceneHandler.cc,v 1.57 2010/04/30 13:18:32 lgarnier Exp $
     27// $Id: G4OpenGLSceneHandler.cc,v 1.58 2010/05/11 10:17:32 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    138138}
    139139
    140 const G4Polyhedron* G4OpenGLSceneHandler::CreateSectionPolyhedron ()
     140G4VSolid* G4OpenGLSceneHandler::CreateSectionSolid ()
    141141{
    142142  // Clipping done in G4OpenGLViewer::SetView.
    143   return 0;
     143  // return 0;
    144144
    145145  // But...OpenGL no longer seems to reconstruct clipped edges, so,
    146146  // when the BooleanProcessor is up to it, abandon this and use
    147   // generic clipping in G4VSceneHandler::CreateSectionPolyhedron...
    148   // return G4VSceneHandler::CreateSectionPolyhedron();
    149 }
    150 
    151 const G4Polyhedron* G4OpenGLSceneHandler::CreateCutawayPolyhedron ()
     147  // generic clipping in G4VSceneHandler::CreateSectionSolid...
     148  return G4VSceneHandler::CreateSectionSolid();
     149}
     150
     151G4VSolid* G4OpenGLSceneHandler::CreateCutawaySolid ()
    152152{
    153153  // Cutaway done in G4OpenGLViewer::SetView.
    154   return 0;
     154  // return 0;
    155155
    156156  // But...if not, when the BooleanProcessor is up to it...
    157   // return G4VSceneHandler::CreateCutawayPolyhedron();
     157  return G4VSceneHandler::CreateCutawaySolid();
    158158}
    159159
  • trunk/source/visualization/OpenGL/src/G4OpenGLViewer.cc

    r1245 r1274  
    2525//
    2626//
    27 // $Id: G4OpenGLViewer.cc,v 1.61 2010/04/27 15:59:10 lgarnier Exp $
     27// $Id: G4OpenGLViewer.cc,v 1.62 2010/05/11 10:22:37 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    271271  // force kernel visit on change of clipping plane in
    272272  // 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.
    274275    const G4Plane3D& s = fVP.GetSectionPlane ();
    275276    double sArray[4];
     
    293294  const G4Planes& cutaways = fVP.GetCutawayPlanes();
    294295  size_t nPlanes = cutaways.size();
    295   if (fVP.IsCutaway() &&
     296  //if (fVP.IsCutaway() &&
     297  if (false &&
    296298      fVP.GetCutawayMode() == G4ViewParameters::cutawayIntersection &&
    297299      nPlanes > 0) {
     
    384386  GLint hits = glRenderMode(GL_RENDER);
    385387  if (hits < 0)
    386     G4cout << "Too many hits.  Zoom in to reduce overlaps." << G4cout;
     388    G4cout << "Too many hits.  Zoom in to reduce overlaps." << G4endl;
    387389  else if (hits > 0) {
    388390    //G4cout << hits << " hit(s)" << G4endl;
     
    390392    for (GLint i = 0; i < hits; ++i) {
    391393      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++;
    394396      //G4cout << "Hit " << i << ": " << nnames << " names"
    395397      //     << "\nzmin: " << zmin << ", zmax: " << zmax << G4endl;
     
    478480  // Change the LC_NUMERIC value in order to have "." separtor and not ","
    479481  // 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));
    481484  setlocale(LC_NUMERIC,"C");
    482485
  • trunk/source/visualization/gMocren/History

    r1228 r1274  
    1 $Id: History,v 1.9 2009/12/03 11:44:42 akimura Exp $
     1$Id: History,v 1.11 2010/05/11 10:44:35 allison Exp $
    22-------------------------------------------------------------------
    33
     
    2020History file for visualization/gMocren sub-category
    2121---------------------------------------------------
     22
     2311 May 2010  John Allison  (gMocren-V09-03-01)
     24- G4GMocrenFileSceneHandler.cc: Added G4cout << G4endl; to improve printing.
     25
     2622 January 2010  Gabriele Cosmo (gMocren-V09-03-00)
     27Fix in G4GMocrenFileSceneHandler.cc to allow for porting on C++0x Standard:
     28made explicit with static_cast conversions from double to float. Also use
     29G4 types in consistent way.
    2230
    23313 December 2009  Akinori Kimura
  • trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc

    r1228 r1274  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.12 2009/12/03 11:44:42 akimura Exp $
     27// $Id: G4GMocrenFileSceneHandler.cc,v 1.14 2010/05/11 10:44:11 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    9393
    9494//-- for a debugging
    95 const bool GFDEBUG = false;
    96 const bool GFDEBUG_TRK = false;//true;
    97 const bool GFDEBUG_HIT = false;//true;
     95const G4bool GFDEBUG = false;
     96const G4bool GFDEBUG_TRK = false;//true;
     97const G4bool GFDEBUG_HIT = false;//true;
    9898const G4int GFDEBUG_DET = 0; // 0: false
    9999
     
    170170  kbSetModalityVoxelSize = false;
    171171
    172   for(int i = 0; i < 3; i++) {
     172  for(G4int i = 0; i < 3; i++) {
    173173    kModalitySize[i] = 0;
    174174    kNestedVolumeDimension[i] = 0;
     
    182182{
    183183  // 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 ;
    185185
    186186  // dest directory (null if no environmental variables is set)
     
    191191
    192192  // 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++) {
    195195
    196196    // Message in the final execution
     
    268268    minmax[1] = ctdens.GetMaxCT();
    269269    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++) {
    273273      dens = ctdens.GetDensity(i);
    274274      map.push_back(dens);
     
    283283      ifile >> minmax[0] >> minmax[1];
    284284      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++) {
    288288        ifile >> dens;
    289289        map.push_back(dens);
     
    329329    kFlagSaving_g4_gdd = false;
    330330
    331     std::map<Index3D, float>::iterator itr = kNestedModality.begin();
     331    std::map<Index3D, G4float>::iterator itr = kNestedModality.begin();
    332332    G4int xmax=0, ymax=0, zmax=0;
    333333    for(; itr != kNestedModality.end(); itr++) {
     
    347347
    348348    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++) {
    351351      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--) {
    355355          //G4int ixy = x + (kModalitySize[1]-y-1)*kModalitySize[0];
    356356
     
    377377    std::map<G4String, std::map<Index3D, G4double> >::iterator hitsListItr = kNestedHitsList.begin();
    378378
    379     for(int n = 0; hitsListItr != kNestedHitsList.end(); hitsListItr++, n++) {
     379    for(G4int n = 0; hitsListItr != kNestedHitsList.end(); hitsListItr++, n++) {
    380380
    381381      kgMocrenIO->newDoseDist();
     
    384384
    385385      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++) {
    387387        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++) {
    390390
    391391            G4int ixy = x + y*kModalitySize[0];
     
    421421      rot = kVolumeTrans3D.getRotation().inverse();
    422422      // x
    423       std::vector<float *> tracks;
     423      std::vector<G4float *> tracks;
    424424      unsigned char colors[3];
    425       float * trk = new float[6];
     425      G4float * trk = new G4float[6];
    426426      tracks.push_back(trk);
    427427
     
    435435      za -= trans;
    436436      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];
    439439      colors[0] = 255; colors[1] = 0; colors[2] = 0;
    440440      kgMocrenIO->addTrack(tracks, colors);
    441441      // 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];
    443443      colors[0] = 0; colors[1] = 255; colors[2] = 0;
    444444      kgMocrenIO->addTrack(tracks, colors);
    445445      // 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];
    447447      colors[0] = 0; colors[1] = 0; colors[2] = 255;
    448448      kgMocrenIO->addTrack(tracks, colors);
     
    454454
    455455    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++) {
    458458      // need to check!!
    459459      transformObjects.push_back((kVolumeSize[i]/2. - kVoxelDimension[i]/2.));
     
    533533
    534534    if(GFDEBUG_TRK) G4cout << "   trajectory points : " << G4endl;
    535     std::vector<float *> trajectory;
     535    std::vector<G4float *> trajectory;
    536536    if(polyline.size() < 2) return;
    537537    G4Polyline::const_iterator preitr = polyline.begin();
     
    544544      postPts -= trans;
    545545      postPts.transform(rot);
    546       float * stepPts = new float[6];
     546      G4float * stepPts = new G4float[6];
    547547      stepPts[0] = prePts.x();
    548548      stepPts[1] = prePts.y();
     
    657657
    658658  //---------- (3) Facet block
    659   for (int f = polyhedron.GetNoFacets(); f; f--){
     659  for (G4int f = polyhedron.GetNoFacets(); f; f--){
    660660    G4int notLastEdge;
    661661    G4int index = -1; // initialization
     
    764764    G4Polyhedron * poly = box.CreatePolyhedron();
    765765    poly->Transform(*fpObjectTransformation);
    766     //int nv = poly->GetNoVertices();
     766    //G4int nv = poly->GetNoVertices();
    767767    G4Point3D v1, v2;
    768768    G4int next;
    769769    //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.
    771771      poly->GetNextEdge(v1, v2, next);
    772772      if(next == 0) break;
     
    927927      }
    928928     
    929       for(int i = 0; i < 3; i++) {
     929      for(G4int i = 0; i < 3; i++) {
    930930        kNestedVolumeDimension[i] = nDaughters[i];
    931931        //kNestedVolumeDimension[i] = nDaughters[dirAxis[i]];
     
    940940      if(nestPara) {
    941941        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++) {
    945945                 
    946946              G4GMocrenTouchable * touch = new G4GMocrenTouchable(n1, n0);
     
    961961              xyz[2] = tbox.GetZHalfLength()/mm;
    962962              if(n0 != 0 || n1 != 0 || n2 != 0) {
    963                 for(int i = 0; i < 3; i++) {
     963                for(G4int i = 0; i < 3; i++) {
    964964                  if(xyz[i] != prexyz[i]) G4Exception("Error[gMocrenFileSceneHandler]: Unsupported parameterisation.");
    965965                }
     
    980980                       << "  density: " << dens << G4endl;
    981981
    982               for(int i = 0; i < 3; i++) prexyz[i] = xyz[i];
     982              for(G4int i = 0; i < 3; i++) prexyz[i] = xyz[i];
    983983            }
    984984          }
     
    990990        // mesh size
    991991        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])};
    993995          kgMocrenIO->setVoxelSpacing(spacing);
    994996          kVoxelDimension.set(spacing[0], spacing[1], spacing[2]);
     
    10141016          G4cout << "     physical volume node id : "
    10151017                 << "size: " << npvp << ", PV name: ";
    1016           for(int i = 0; i < npvp; i++) {
     1018          for(G4int i = 0; i < npvp; i++) {
    10171019            G4cout << pPVModel->GetDrawnPVPath()[i].GetPhysicalVolume()->GetName()
    10181020                   << " [param:"
     
    10931095      G4int nXY = kNestedVolumeDimension[0]*kNestedVolumeDimension[1];
    10941096
    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++) {
    10981100
    10991101            G4int repNo = n0 + n1*nX + n2*nXY;
     
    11231125      // mesh size
    11241126      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())};
    11281130        kgMocrenIO->setVoxelSpacing(spacing);
    11291131        kVoxelDimension.set(spacing[0], spacing[1], spacing[2]);
     
    11581160
    11591161    // 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++) {
    11631165
    11641166          G4double dens = 0.*(g/cm3);
     
    11921194    // mesh size
    11931195    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])};
    11971199
    11981200      kgMocrenIO->setVoxelSpacing(spacing);
     
    12921294    G4cout << "    " << tubes.GetName() << G4endl;
    12931295    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++) {
    12961298      G4cout << "    (" << poly->GetVertex(i).x() << ", "
    12971299             << poly->GetVertex(i).y() << ", "
     
    14491451  if(GFDEBUG_TRK) {
    14501452    std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl;
    1451 
    14521453    G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
    14531454    if (!pTrModel) {
     
    14641465      G4cout << "    momentum: " << trj->GetInitialMomentum() << G4endl;
    14651466     
    1466       int nPnt = trj->GetPointEntries();
     1467      G4int nPnt = trj->GetPointEntries();
    14671468      G4cout << "    point:    ";
    1468       for(int i = 0; i < nPnt; i++) {
     1469      for(G4int i = 0; i < nPnt; i++) {
    14691470        G4cout << trj->GetPoint(i)->GetPosition() << ", ";
    14701471      }
    14711472      G4cout << G4endl;
    1472 
    1473 
    1474     }
     1473    }
     1474    G4cout << G4endl;
    14751475  }
    14761476
     
    15441544      // Get attributes
    15451545      for(itr = attval->begin(); itr != attval->end(); itr++) {
    1546         for(int i = 0; i < nhitname; i++) {
     1546        for(G4int i = 0; i < nhitname; i++) {
    15471547          if(itr->GetName() == hitNames[i]) {
    15481548
     
    16011601 
    16021602
    1603   //for(int i = 0; i < nhitname; i++) {       // this selection trusts
     1603  //for(G4int i = 0; i < nhitname; i++) {       // this selection trusts
    16041604    //if(scorername == hitScorerNames[i]) {   // thea command /vis/scene/add/psHits hit_name.
    16051605
     
    16301630    G4cout << "       >>>>> " << meshname << " : " << scorername  << G4endl;
    16311631
    1632     for(int i = 0; i < nhitname; i++)
     1632    for(G4int i = 0; i < nhitname; i++)
    16331633      if(scorername == hitScorerNames[i])
    16341634        G4cout << "       !!!! Hit scorer !!!! " << scorername << G4endl;
     
    17021702
    17031703  // edge points of the detector
    1704   std::vector<float *> dedges;
     1704  std::vector<G4float *> dedges;
    17051705  G4Polyhedron * poly = solid.CreatePolyhedron();
    17061706  detector.polyhedron = poly;
     
    17171717    //uccolor[0] = uccolor[1] = uccolor[2] = 30; // dark grey
    17181718  }
    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];
    17201720  //
    17211721  kDetectors.push_back(detector);
    17221722
    17231723  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] << ")"
    17261726           << G4endl;
    17271727  }
     
    17421742
    17431743    // edge points of the detector
    1744     std::vector<float *> dedges;
     1744    std::vector<G4float *> dedges;
    17451745    G4Polyhedron * poly = itr->polyhedron;
    17461746    poly->Transform(itr->transform3D);
     
    17551755    while(bnext) {
    17561756      if(!(poly->GetNextEdge(v1, v2, next))) bnext =false;
    1757       float * edge = new float[6];
     1757      G4float * edge = new G4float[6];
    17581758      edge[0] = v1.x()/mm;
    17591759      edge[1] = v1.y()/mm;
     
    17721772    //
    17731773    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.
    17751775      delete [] dedges[i];
    17761776    }
     
    17781778
    17791779    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] << ")"
    17821782             << G4endl;
    17831783    }
     
    17891789     kNestedVolumeDimension[1] == 0 ||
    17901790     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;
    17921792    return;
    17931793  }
  • trunk/source/visualization/management/History

    r1258 r1274  
    1 $Id: History,v 1.142 2010/05/11 12:17:40 allison Exp $
     1$Id: History,v 1.143 2010/05/20 07:56:21 allison Exp $
    22
    33-------------------------------------------------------------------
     
    2626History file for visualization management sub-category
    2727------------------------------------------------------
     28
     2920th 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.
    2833
    293411th May 2010  John Allison  (visman-V09-03-00)
  • trunk/source/visualization/management/include/G4VGraphicsSystem.hh

    r954 r1274  
    2525//
    2626//
    27 // $Id: G4VGraphicsSystem.hh,v 1.11 2006/06/29 21:28:04 gunter Exp $
     27// $Id: G4VGraphicsSystem.hh,v 1.12 2010/05/20 07:55:47 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    8080  const G4String& GetDescription   () const;
    8181  Functionality   GetFunctionality () const;
     82  void SetName          (const G4String&);
     83  void SetNickName      (const G4String&);
     84  void SetDescription   (const G4String&);
     85  void SetFunctionality (Functionality);
    8286
    8387protected:
    84   const G4String fName;
    85   const G4String fNickname;
    86   const G4String fDescription;
     88  G4String fName;
     89  G4String fNickname;
     90  G4String fDescription;
    8791  Functionality  fFunctionality;
    8892};
  • trunk/source/visualization/management/include/G4VGraphicsSystem.icc

    r954 r1274  
    2525//
    2626//
    27 // $Id: G4VGraphicsSystem.icc,v 1.7 2006/06/29 21:28:06 gunter Exp $
     27// $Id: G4VGraphicsSystem.icc,v 1.8 2010/05/20 07:55:47 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    4848  return fFunctionality;
    4949}
     50
     51inline void G4VGraphicsSystem::SetName (const G4String& name) {
     52  fName = name;
     53}
     54
     55inline void G4VGraphicsSystem::SetNickName (const G4String& nickname) {
     56  fNickname = nickname;
     57}
     58
     59inline void G4VGraphicsSystem::SetDescription (const G4String& description) {
     60  fDescription = description;
     61}
     62
     63inline void G4VGraphicsSystem::SetFunctionality (Functionality f) {
     64  fFunctionality = f;
     65}
  • trunk/source/visualization/management/include/G4VisManager.hh

    r933 r1274  
    2525//
    2626//
    27 // $Id: G4VisManager.hh,v 1.70 2009/02/25 18:28:00 lgarnier Exp $
     27// $Id: G4VisManager.hh,v 1.71 2010/05/20 07:54:31 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929//
     
    366366                      const G4VisExtent& = G4VisExtent::NullExtent);
    367367  void SetUserActionExtent (const G4VisExtent&);
    368   void              SetCurrentGraphicsSystem    (G4VGraphicsSystem* pSystem);
     368  void              SetCurrentGraphicsSystem    (G4VGraphicsSystem*);
    369369  void              SetCurrentScene             (G4Scene*);
    370   void              SetCurrentSceneHandler      (G4VSceneHandler* pScene);
    371   void              SetCurrentViewer            (G4VViewer* pView);
     370  void              SetCurrentSceneHandler      (G4VSceneHandler*);
     371  void              SetCurrentViewer            (G4VViewer*);
    372372  G4SceneHandlerList& SetAvailableSceneHandlers ();  // Returns lvalue.
    373373  G4SceneList&      SetSceneList                ();  // Returns lvalue.
  • trunk/source/visualization/management/src/G4VisCommandsCompound.cc

    r954 r1274  
    2525//
    2626//
    27 // $Id: G4VisCommandsCompound.cc,v 1.39 2007/11/16 20:29:04 perl Exp $
     27// $Id: G4VisCommandsCompound.cc,v 1.40 2010/05/20 07:54:01 allison Exp $
    2828// GEANT4 tag $Name:  $
    2929
     
    6666  is >> pvname >> system;
    6767
     68  G4VGraphicsSystem* keepSystem = fpVisManager->GetCurrentGraphicsSystem();
     69  G4Scene* keepScene = fpVisManager->GetCurrentScene();
     70  G4VSceneHandler* keepSceneHandler = fpVisManager->GetCurrentSceneHandler();
     71  G4VViewer* keepViewer = fpVisManager->GetCurrentViewer();
     72
    6873  G4UImanager* UImanager = G4UImanager::GetUIpointer();
    6974  G4int keepVerbose = UImanager->GetVerboseLevel();
     
    7782  UImanager->ApplyCommand("/vis/viewer/flush");
    7883  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  }
    7994}
    8095
  • trunk/source/visualization/test/History

    r1228 r1274  
    1 $Id: History,v 1.121 2009/11/06 16:02:33 allison Exp $
     1$Id: History,v 1.123 2010/05/11 12:06:08 allison Exp $
    22
    33History file for visualization/test subdirectory
     
    55
    66$Log: History,v $
     7Revision 1.123  2010/05/11 12:06:08  allison
     8vistest-V09-03-00
     9
     10Revision 1.122  2010/05/11 12:04:39  allison
     11Added printEPS to test19.g4m, as suggested by Laurent.
     12
    713Revision 1.121  2009/11/06 16:02:33  allison
    814vistest-V09-02-01
  • trunk/source/visualization/test/test19.g4m

    r1138 r1274  
    4141#/vis/sceneHandler/create OGLSXm
    4242#/vis/sceneHandler/create OGLIX
    43 #/vis/sceneHandler/create OGLSX
    44 /vis/sceneHandler/create OGLSXm
     43/vis/sceneHandler/create OGLSX
     44#/vis/sceneHandler/create OGLSXm
    4545#/vis/sceneHandler/create VRML1
    4646#/vis/sceneHandler/create VRML1FILE
     
    7171# (all that happens is an extra refresh).
    7272/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
    7377#
    7478# Create another viewer.
     
    8084#
    8185/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
    8290#
    8391# Now hidden line removal.
     
    9098#
    9199/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
    92104#
    93105# Now hidden line *and* hidden surface removal.
     
    100112#
    101113/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
    102118#
    103119# Start a run to initialise/optimise geometry and draw user-drawn transients.
     
    112128/vis/scene/notifyHandlers
    113129/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
    114134#
    115135# Logical volume of Boolean solids...
     
    122142/vis/scene/notifyHandlers
    123143/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
    124148#
    125149/vis/scene/create
     
    129153/vis/viewer/set/viewpointThetaPhi 35 35
    130154/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
    131159#
    132160/vis/scene/create
     
    136164/vis/viewer/set/viewpointThetaPhi 35 35
    137165/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
    138170#
    139171# Send geantino through...
     
    153185/tracking/verbose 0
    154186/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
    155191#
    156192# Rotated tracker tube
     
    172208/run/beamOn
    173209/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
    174214#
    175215# G4Trap1
     
    215255/run/beamOn
    216256/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
    217261#
    218262# G4Trap2
     
    241285/run/beamOn
    242286/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
    243291#
    244292# Displaced solid.
     
    252300/run/beamOn
    253301/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
    254306#
    255307# Boolean solid.
     
    313365/run/beamOn
    314366/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
    315371#
    316372# To view replicas...
     
    355411/run/beamOn
    356412/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
    357417#...end
    358418#
     
    360420/vis/viewer/set/projection perspective 30
    361421/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
    362426#
    363427#/vis/sceneHandler/create OIX
     
    367431/vis/viewer/set/viewpointThetaPhi 30 30
    368432/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
    369437#
    370438# You can use /vis/rayTracer/... commands
     
    378446/vis/viewer/set/viewpointThetaPhi 45 45
    379447/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
    380452#
    381453# Odd!!?  JPEG image seems upside down for default view direction...
    382454/vis/viewer/create ! ! 200
    383455/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
     460exit
Note: See TracChangeset for help on using the changeset viewer.