Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc

    r1337 r1347  
    2525//
    2626//
    27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.17 2010/09/03 16:01:21 gcosmo Exp $
    28 // GEANT4 tag $Name: $
     27// $Id: G4GMocrenFileSceneHandler.cc,v 1.18 2010/11/10 23:53:23 akimura Exp $
     28// GEANT4 tag $Name: geant4-09-04-ref-00 $
    2929//
    3030//
     
    4343
    4444#include "globals.hh"
     45#include "G4VisManager.hh"
     46
    4547#include "G4GMocrenFile.hh"
    4648#include "G4GMocrenFileSceneHandler.hh"
     
    156158G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler ()
    157159{
    158   if(GFDEBUG) G4cerr << "***** ~G4GMocrenFileSceneHandler" << G4endl;
     160  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     161      G4cout << "***** ~G4GMocrenFileSceneHandler" << G4endl;
    159162
    160163  if(kGddDest) {
     
    199202    if( i == MAX_FILE_INDEX )
    200203      {
    201         G4cerr << "==========================================="   << G4endl;
    202         G4cerr << "WARNING MESSAGE from GMocrenFile driver:   "   << G4endl;
    203         G4cerr << "  This file name is the final one in the   "   << G4endl;
    204         G4cerr << "  automatic updation of the output file name." << G4endl;
    205         G4cerr << "  You may overwrite existing files, i.e.   "   << G4endl;
    206         G4cerr << "  g4_XX.gdd."   << G4endl;
    207         G4cerr << "==========================================="   << G4endl;
     204        if (G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     205          G4cout << "==========================================="   << G4endl;
     206          G4cout << "WARNING MESSAGE from GMocrenFile driver:   "   << G4endl;
     207          G4cout << "  This file name is the final one in the   "   << G4endl;
     208          G4cout << "  automatic updation of the output file name." << G4endl;
     209          G4cout << "  You may overwrite existing files, i.e.   "   << G4endl;
     210          G4cout << "  g4_XX.gdd."   << G4endl;
     211          G4cout << "==========================================="   << G4endl;
     212        }
    208213      }
    209214
     
    231236  } // for
    232237
    233   G4cerr << "======================================================================" << G4endl;
    234   G4cerr << "Output file: " << kGddFileName                          << G4endl;
    235   G4cerr << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;
    236   G4cerr << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;
    237   G4cerr << "Note:" << G4endl;
    238   G4cerr << "  * The maximum number is customizable as:           " << G4endl;
    239   G4cerr << "      % setenv  G4GMocrenFile_MAX_FILE_NUM  number " << G4endl;       
    240   G4cerr << "  * The destination directory is customizable as:" << G4endl;
    241   G4cerr << "      % setenv  G4GMocrenFile_DEST_DIR  dir_name/  " << G4endl;       
    242   G4cerr << "     ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;             
    243   //G4cerr << "        dir_name, e.g. \"./tmp/\"."                 << G4endl;             
    244   G4cerr << G4endl;
    245   G4cerr << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;
    246   G4cerr << "======================================================================" << G4endl;
     238  G4cout << "======================================================================" << G4endl;
     239  G4cout << "Output file: " << kGddFileName                          << G4endl;
     240  G4cout << "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;
     241  G4cout << "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;
     242  G4cout << "Note:" << G4endl;
     243  G4cout << "  * The maximum number is customizable as:           " << G4endl;
     244  G4cout << "      % setenv  G4GMocrenFile_MAX_FILE_NUM  number " << G4endl;       
     245  G4cout << "  * The destination directory is customizable as:" << G4endl;
     246  G4cout << "      % setenv  G4GMocrenFile_DEST_DIR  dir_name/  " << G4endl;       
     247  G4cout << "     ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;             
     248  //G4cout << "        dir_name, e.g. \"./tmp/\"."                 << G4endl;             
     249  G4cout << G4endl;
     250  G4cout << "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;
     251  G4cout << "======================================================================" << G4endl;
    247252
    248253} // G4GMocrenFileSceneHandler::SetGddFileName()
     
    252257void    G4GMocrenFileSceneHandler::BeginSavingGdd( void )
    253258{
    254   if(GFDEBUG) G4cerr << "***** BeginSavingGdd (called)" << G4endl;
     259  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     260      G4cout << "***** BeginSavingGdd (called)" << G4endl;
    255261
    256262  if( !IsSavingGdd() ) {
    257263
    258     if(GFDEBUG) {
    259       G4cerr << "*****                   (started) " ;
    260       G4cerr << "(open g4.gdd, ##)"  << G4endl;
     264    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     265      G4cout << "*****                   (started) " ;
     266      G4cout << "(open g4.gdd, ##)"  << G4endl;
    261267    }
    262268
     
    294300     
    295301    } else {
    296       G4cerr << "cann't open the file : " << fname << G4endl;
     302      G4cout << "cann't open the file : " << fname << G4endl;
    297303    }
    298304    */
     
    322328void    G4GMocrenFileSceneHandler::EndSavingGdd  ( void )
    323329{
    324   if(GFDEBUG) G4cerr << "***** EndSavingGdd (called)" << G4endl;
     330  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     331    G4cout << "***** EndSavingGdd (called)" << G4endl;
    325332
    326333  if(IsSavingGdd()) {
    327     if(GFDEBUG) G4cerr << "*****                 (started) (close "
    328                        << kGddFileName << ")" << G4endl;
     334    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     335      G4cout << "*****                 (started) (close "
     336             << kGddFileName << ")" << G4endl;
    329337
    330338    if(kGddDest) kGddDest.close();
     
    483491
    484492
    485       if(GFDEBUG) G4cerr << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl;
     493    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     494      G4cout << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl;
    486495
    487496      //----- Send saving command and heading comment
     
    511520void G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline& polyline)
    512521{
    513   if(GFDEBUG) G4cerr << "***** AddPrimitive" << G4endl;
     522  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     523    G4cout << "***** AddPrimitive" << G4endl;
    514524
    515525
     
    591601{
    592602  //-----
    593   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4NURBS )" << G4endl;
     603  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     604    G4cout << "***** AddPrimitive( G4NURBS )" << G4endl;
    594605
    595606  //----- Initialize if necessary
     
    607618
    608619  //-----
    609   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Text )" << G4endl;
     620  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     621    G4cout << "***** AddPrimitive( G4Text )" << G4endl;
    610622
    611623  //----- Initialize IF NECESSARY
     
    622634
    623635  //-----
    624   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Circle )" << G4endl;
     636  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     637    G4cout << "***** AddPrimitive( G4Circle )" << G4endl;
    625638
    626639  //----- Initialize IF NECESSARY
     
    638651
    639652  //-----
    640   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Square )" << G4endl;
     653  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     654    G4cout << "***** AddPrimitive( G4Square )" << G4endl;
    641655
    642656  //----- Initialize if necessary
     
    650664{
    651665  //-----
    652   if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Polyhedron )" << G4endl;
     666  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     667    G4cout << "***** AddPrimitive( G4Polyhedron )" << G4endl;
    653668
    654669
     
    678693      break;
    679694    default:
    680       G4cerr <<
    681         "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl;
     695      if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     696        G4cout <<
     697          "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl;
    682698      G4PhysicalVolumeModel* pPVModel =
    683699        dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
    684       if (pPVModel) G4cerr <<
    685                       "Volume " << pPVModel->GetCurrentPV()->GetName() <<
    686                       ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() <<
    687                       " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType();
    688       G4cerr <<
    689         "\nG4Polyhedron facet with " << i << " edges" << G4endl;       
     700      if (pPVModel)   
     701        if(G4VisManager::GetVerbosity() >= G4VisManager::errors)
     702          G4cout << "Volume " << pPVModel->GetCurrentPV()->GetName() <<
     703            ", Solid " << pPVModel->GetCurrentLV()->GetSolid()->GetName() <<
     704            " (" << pPVModel->GetCurrentLV()->GetSolid()->GetEntityType();
     705
     706      if(G4VisManager::GetVerbosity() >= G4VisManager::errors)
     707        G4cout <<
     708          "\nG4Polyhedron facet with " << i << " edges" << G4endl;     
    690709    }
    691710  }
     
    700719
    701720  //-----               
    702   if(GFDEBUG) G4cerr << "***** GFEndModeling (called)" << G4endl;
     721  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     722    G4cout << "***** GFEndModeling (called)" << G4endl;
    703723
    704724  if( GFIsInModeling() ) {
    705725
    706     if(GFDEBUG) {
    707       G4cerr << "***** GFEndModeling (started) " ;
    708       G4cerr << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;
     726    if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) {
     727      G4cout << "***** GFEndModeling (started) " ;
     728      G4cout << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;
    709729    }
    710730
     
    723743void G4GMocrenFileSceneHandler::BeginPrimitives (const G4Transform3D& objectTransformation)
    724744{
    725   if(GFDEBUG) G4cerr << "***** BeginPrimitives " << G4endl;
     745  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     746    G4cout << "***** BeginPrimitives " << G4endl;
    726747
    727748  GFBeginModeling();
     
    736757void G4GMocrenFileSceneHandler::EndPrimitives ()
    737758{
    738   if(GFDEBUG) G4cerr << "***** EndPrimitives " << G4endl;
     759  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     760    G4cout << "***** EndPrimitives " << G4endl;
    739761
    740762  G4VSceneHandler::EndPrimitives ();
     
    747769void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box )
    748770{
    749   if(GFDEBUG) G4cerr << "***** AddSolid ( box )" << G4endl;
     771  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     772    G4cout << "***** AddSolid ( box )" << G4endl;
    750773
    751774  if(GFDEBUG_DET > 0)
     
    12791302G4GMocrenFileSceneHandler::AddSolid( const G4Tubs& tubes )
    12801303{
    1281   if(GFDEBUG) G4cerr << "***** AddSolid ( tubes )" << G4endl;
     1304  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1305    G4cout << "***** AddSolid ( tubes )" << G4endl;
    12821306
    12831307  //----- skip drawing invisible primitive
     
    13211345G4GMocrenFileSceneHandler::AddSolid( const G4Cons& cons )
    13221346{
    1323   if(GFDEBUG) G4cerr << "***** AddSolid ( cons )" << G4endl;
     1347  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1348    G4cout << "***** AddSolid ( cons )" << G4endl;
    13241349
    13251350  //----- skip drawing invisible primitive
     
    13381363void G4GMocrenFileSceneHandler::AddSolid ( const G4Trd& trd )
    13391364{
    1340   if(GFDEBUG) G4cerr << "***** AddSolid ( trd )" << G4endl;
     1365  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1366    G4cout << "***** AddSolid ( trd )" << G4endl;
    13411367
    13421368
     
    13561382void G4GMocrenFileSceneHandler::AddSolid ( const G4Sphere& sphere )
    13571383{
    1358   if(GFDEBUG) G4cerr << "***** AddSolid ( sphere )" << G4endl;
     1384  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1385    G4cout << "***** AddSolid ( sphere )" << G4endl;
    13591386
    13601387  //----- skip drawing invisible primitive
     
    13731400void G4GMocrenFileSceneHandler::AddSolid (const G4Para& para)
    13741401{
    1375   if(GFDEBUG) G4cerr << "***** AddSolid ( para )" << G4endl;
     1402  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1403    G4cout << "***** AddSolid ( para )" << G4endl;
    13761404
    13771405  //----- skip drawing invisible primitive
     
    13901418void G4GMocrenFileSceneHandler::AddSolid (const G4Trap& trap)
    13911419{
    1392   if(GFDEBUG) G4cerr << "***** AddSolid ( trap )" << G4endl;
     1420  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1421    G4cout << "***** AddSolid ( trap )" << G4endl;
    13931422
    13941423  //----- skip drawing invisible primitive
     
    14081437G4GMocrenFileSceneHandler::AddSolid( const G4Torus& torus )
    14091438{
    1410   if(GFDEBUG) G4cerr << "***** AddSolid ( torus )" << G4endl;
     1439  if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors)
     1440    G4cout << "***** AddSolid ( torus )" << G4endl;
    14111441
    14121442  //----- skip drawing invisible primitive
     
    14521482
    14531483  if(GFDEBUG_TRK) {
    1454     std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl;
     1484    G4cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << G4endl;
    14551485    G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
    14561486    if (!pTrModel) {
Note: See TracChangeset for help on using the changeset viewer.