- Timestamp:
- Dec 22, 2010, 3:52:27 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc
r1337 r1347 25 25 // 26 26 // 27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.1 7 2010/09/03 16:01:21 gcosmoExp $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 $ 29 29 // 30 30 // … … 43 43 44 44 #include "globals.hh" 45 #include "G4VisManager.hh" 46 45 47 #include "G4GMocrenFile.hh" 46 48 #include "G4GMocrenFileSceneHandler.hh" … … 156 158 G4GMocrenFileSceneHandler::~G4GMocrenFileSceneHandler () 157 159 { 158 if(GFDEBUG) G4cerr << "***** ~G4GMocrenFileSceneHandler" << G4endl; 160 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 161 G4cout << "***** ~G4GMocrenFileSceneHandler" << G4endl; 159 162 160 163 if(kGddDest) { … … 199 202 if( i == MAX_FILE_INDEX ) 200 203 { 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 } 208 213 } 209 214 … … 231 236 } // for 232 237 233 G4c err<< "======================================================================" << G4endl;234 G4c err<< "Output file: " << kGddFileName << G4endl;235 G4c err<< "Destination directory (current dir if NULL): " << kGddDestDir << G4endl;236 G4c err<< "Maximum number of files in the destination directory: " << kMaxFileNum << G4endl;237 G4c err<< "Note:" << G4endl;238 G4c err<< " * The maximum number is customizable as: " << G4endl;239 G4c err<< " % setenv G4GMocrenFile_MAX_FILE_NUM number " << G4endl;240 G4c err<< " * The destination directory is customizable as:" << G4endl;241 G4c err<< " % setenv G4GMocrenFile_DEST_DIR dir_name/ " << G4endl;242 G4c err<< " ** Do not forget \"/\" at the end of the dir_name, e.g. \"./tmp/\"." << G4endl;243 //G4c err<< " dir_name, e.g. \"./tmp/\"." << G4endl;244 G4c err<< G4endl;245 G4c err<< "Maximum number of trajectories is set to " << MAX_NUM_TRAJECTORIES << "."<< G4endl;246 G4c err<< "======================================================================" << 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; 247 252 248 253 } // G4GMocrenFileSceneHandler::SetGddFileName() … … 252 257 void G4GMocrenFileSceneHandler::BeginSavingGdd( void ) 253 258 { 254 if(GFDEBUG) G4cerr << "***** BeginSavingGdd (called)" << G4endl; 259 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 260 G4cout << "***** BeginSavingGdd (called)" << G4endl; 255 261 256 262 if( !IsSavingGdd() ) { 257 263 258 if(GFDEBUG ) {259 G4c err<< "***** (started) " ;260 G4c err<< "(open g4.gdd, ##)" << G4endl;264 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) { 265 G4cout << "***** (started) " ; 266 G4cout << "(open g4.gdd, ##)" << G4endl; 261 267 } 262 268 … … 294 300 295 301 } else { 296 G4c err<< "cann't open the file : " << fname << G4endl;302 G4cout << "cann't open the file : " << fname << G4endl; 297 303 } 298 304 */ … … 322 328 void G4GMocrenFileSceneHandler::EndSavingGdd ( void ) 323 329 { 324 if(GFDEBUG) G4cerr << "***** EndSavingGdd (called)" << G4endl; 330 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 331 G4cout << "***** EndSavingGdd (called)" << G4endl; 325 332 326 333 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; 329 337 330 338 if(kGddDest) kGddDest.close(); … … 483 491 484 492 485 if(GFDEBUG) G4cerr << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl; 493 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 494 G4cout << "***** G4GMocrenFileSceneHandler::GFBeginModeling (called & started)" << G4endl; 486 495 487 496 //----- Send saving command and heading comment … … 511 520 void G4GMocrenFileSceneHandler::AddPrimitive (const G4Polyline& polyline) 512 521 { 513 if(GFDEBUG) G4cerr << "***** AddPrimitive" << G4endl; 522 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 523 G4cout << "***** AddPrimitive" << G4endl; 514 524 515 525 … … 591 601 { 592 602 //----- 593 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4NURBS )" << G4endl; 603 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 604 G4cout << "***** AddPrimitive( G4NURBS )" << G4endl; 594 605 595 606 //----- Initialize if necessary … … 607 618 608 619 //----- 609 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Text )" << G4endl; 620 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 621 G4cout << "***** AddPrimitive( G4Text )" << G4endl; 610 622 611 623 //----- Initialize IF NECESSARY … … 622 634 623 635 //----- 624 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Circle )" << G4endl; 636 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 637 G4cout << "***** AddPrimitive( G4Circle )" << G4endl; 625 638 626 639 //----- Initialize IF NECESSARY … … 638 651 639 652 //----- 640 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Square )" << G4endl; 653 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 654 G4cout << "***** AddPrimitive( G4Square )" << G4endl; 641 655 642 656 //----- Initialize if necessary … … 650 664 { 651 665 //----- 652 if(GFDEBUG) G4cerr << "***** AddPrimitive( G4Polyhedron )" << G4endl; 666 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 667 G4cout << "***** AddPrimitive( G4Polyhedron )" << G4endl; 653 668 654 669 … … 678 693 break; 679 694 default: 680 G4cerr << 681 "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl; 695 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 696 G4cout << 697 "ERROR G4GMocrenFileSceneHandler::AddPrimitive(G4Polyhedron)" << G4endl; 682 698 G4PhysicalVolumeModel* pPVModel = 683 699 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; 690 709 } 691 710 } … … 700 719 701 720 //----- 702 if(GFDEBUG) G4cerr << "***** GFEndModeling (called)" << G4endl; 721 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 722 G4cout << "***** GFEndModeling (called)" << G4endl; 703 723 704 724 if( GFIsInModeling() ) { 705 725 706 if(GFDEBUG ) {707 G4c err<< "***** GFEndModeling (started) " ;708 G4c err<< "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl;726 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) { 727 G4cout << "***** GFEndModeling (started) " ; 728 G4cout << "(/EndModeling, /DrawAll, /CloseDevice)" << G4endl; 709 729 } 710 730 … … 723 743 void G4GMocrenFileSceneHandler::BeginPrimitives (const G4Transform3D& objectTransformation) 724 744 { 725 if(GFDEBUG) G4cerr << "***** BeginPrimitives " << G4endl; 745 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 746 G4cout << "***** BeginPrimitives " << G4endl; 726 747 727 748 GFBeginModeling(); … … 736 757 void G4GMocrenFileSceneHandler::EndPrimitives () 737 758 { 738 if(GFDEBUG) G4cerr << "***** EndPrimitives " << G4endl; 759 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 760 G4cout << "***** EndPrimitives " << G4endl; 739 761 740 762 G4VSceneHandler::EndPrimitives (); … … 747 769 void G4GMocrenFileSceneHandler::AddSolid( const G4Box& box ) 748 770 { 749 if(GFDEBUG) G4cerr << "***** AddSolid ( box )" << G4endl; 771 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 772 G4cout << "***** AddSolid ( box )" << G4endl; 750 773 751 774 if(GFDEBUG_DET > 0) … … 1279 1302 G4GMocrenFileSceneHandler::AddSolid( const G4Tubs& tubes ) 1280 1303 { 1281 if(GFDEBUG) G4cerr << "***** AddSolid ( tubes )" << G4endl; 1304 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1305 G4cout << "***** AddSolid ( tubes )" << G4endl; 1282 1306 1283 1307 //----- skip drawing invisible primitive … … 1321 1345 G4GMocrenFileSceneHandler::AddSolid( const G4Cons& cons ) 1322 1346 { 1323 if(GFDEBUG) G4cerr << "***** AddSolid ( cons )" << G4endl; 1347 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1348 G4cout << "***** AddSolid ( cons )" << G4endl; 1324 1349 1325 1350 //----- skip drawing invisible primitive … … 1338 1363 void G4GMocrenFileSceneHandler::AddSolid ( const G4Trd& trd ) 1339 1364 { 1340 if(GFDEBUG) G4cerr << "***** AddSolid ( trd )" << G4endl; 1365 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1366 G4cout << "***** AddSolid ( trd )" << G4endl; 1341 1367 1342 1368 … … 1356 1382 void G4GMocrenFileSceneHandler::AddSolid ( const G4Sphere& sphere ) 1357 1383 { 1358 if(GFDEBUG) G4cerr << "***** AddSolid ( sphere )" << G4endl; 1384 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1385 G4cout << "***** AddSolid ( sphere )" << G4endl; 1359 1386 1360 1387 //----- skip drawing invisible primitive … … 1373 1400 void G4GMocrenFileSceneHandler::AddSolid (const G4Para& para) 1374 1401 { 1375 if(GFDEBUG) G4cerr << "***** AddSolid ( para )" << G4endl; 1402 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1403 G4cout << "***** AddSolid ( para )" << G4endl; 1376 1404 1377 1405 //----- skip drawing invisible primitive … … 1390 1418 void G4GMocrenFileSceneHandler::AddSolid (const G4Trap& trap) 1391 1419 { 1392 if(GFDEBUG) G4cerr << "***** AddSolid ( trap )" << G4endl; 1420 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1421 G4cout << "***** AddSolid ( trap )" << G4endl; 1393 1422 1394 1423 //----- skip drawing invisible primitive … … 1408 1437 G4GMocrenFileSceneHandler::AddSolid( const G4Torus& torus ) 1409 1438 { 1410 if(GFDEBUG) G4cerr << "***** AddSolid ( torus )" << G4endl; 1439 if(GFDEBUG || G4VisManager::GetVerbosity() >= G4VisManager::errors) 1440 G4cout << "***** AddSolid ( torus )" << G4endl; 1411 1441 1412 1442 //----- skip drawing invisible primitive … … 1452 1482 1453 1483 if(GFDEBUG_TRK) { 1454 std::cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << std::endl;1484 G4cout << " ::AddCompound(const G4VTrajectory&) >>>>>>>>> " << G4endl; 1455 1485 G4TrajectoriesModel * pTrModel = dynamic_cast<G4TrajectoriesModel*>(fpModel); 1456 1486 if (!pTrModel) {
Note: See TracChangeset
for help on using the changeset viewer.