Changeset 1228 for trunk/source/visualization
- Timestamp:
- Jan 8, 2010, 11:56:51 AM (14 years ago)
- Location:
- trunk/source/visualization
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/GNUmakefile
r1140 r1228 1 # $Id: GNUmakefile,v 1.2 4 2009/10/12 10:28:38 akimuraExp $1 # $Id: GNUmakefile,v 1.26 2009/11/17 11:31:20 gcosmo Exp $ 2 2 # ----------------------------------------------------------------------- 3 3 # GNUmakefile for visualization and modeling. John Allison, 5/7/95. … … 30 30 # CPPFLAGS += -DG4DEBUG_VIS_MANAGEMENT 31 31 32 # Libraries which can be used without external packages or libraries...33 32 ifdef G4VIS_BUILD 33 # Drivers that can be used without external libraries... 34 34 SUBDIRS += management 35 35 SUBLIBS += G4vis_management … … 48 48 SUBDIRS += gMocren 49 49 SUBLIBS += G4GMocren 50 50 # Drivers needing external libraries... 51 51 ifdef G4VIS_BUILD_OPENGL_DRIVER 52 52 SUBDIRS += externals/gl2ps 53 53 SUBDIRS += OpenGL 54 54 SUBLIBS += G4OpenGL 55 SUBLIBS += G4gl2ps 55 56 endif 56 57 ifdef G4VIS_BUILD_OI_DRIVER … … 58 59 SUBDIRS += OpenInventor 59 60 SUBLIBS += G4OpenInventor 61 SUBLIBS += G4gl2ps 60 62 endif 61 63 endif #G4VIS_BUILD -
trunk/source/visualization/HepRep/History
r1140 r1228 1 .$Id: History,v 1.13 1 2009/10/21 15:13:36 allisonExp $1 .$Id: History,v 1.132 2009/11/23 05:42:28 perl Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/HepRep sub-category 21 21 -------------------------------------------------- 22 23 22nd November 2009 Joseph Perl (vis-HepRep-V09-02-03) 24 - Changed messenger to a singleton. 25 - Added messenger commands to HepRepFile. 26 - Render G4Tubs as polygons if G4Tubs is not at a standard angle. 22 27 23 28 21st October 2009 John Allison (vis-HepRep-V09-02-02 coworks greps-V09-02-02) -
trunk/source/visualization/HepRep/include/G4HepRep.hh
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRep.hh,v 1.1 7 2006/06/29 21:17:04 gunterExp $26 // $Id: G4HepRep.hh,v 1.18 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 36 36 //G4 37 37 #include "G4VGraphicsSystem.hh" 38 39 class G4HepRepMessenger;40 38 41 39 class G4HepRep: public G4VGraphicsSystem { … … 52 50 G4VSceneHandler* sceneHandler; 53 51 G4VViewer* viewer; 54 G4HepRepMessenger* messenger;55 52 }; 56 53 -
trunk/source/visualization/HepRep/include/G4HepRepMessenger.hh
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepMessenger.hh,v 1. 7 2006/06/29 21:17:14 gunterExp $26 // $Id: G4HepRepMessenger.hh,v 1.8 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 40 40 41 41 public: 42 G4HepRepMessenger(); 42 static G4HepRepMessenger* GetInstance(); // Singleton constructor. 43 43 virtual ~G4HepRepMessenger(); 44 44 … … 46 46 virtual void SetNewValue(G4UIcommand * command, G4String newValue); 47 47 48 // Used by HepRepFile 49 virtual G4String getFileDir(); 50 virtual G4String getFileName(); 51 virtual G4bool getOverwrite(); 52 virtual G4bool getCullInvisibles(); 53 54 // Used by HepRepXML 48 55 virtual G4String getEventNumberSuffix(); 49 56 virtual G4bool appendGeometry(); … … 53 60 54 61 private: 62 G4HepRepMessenger(); // Private constructor. 63 static G4HepRepMessenger* fpInstance; 64 55 65 G4UIdirectory* heprepDirectory; 66 67 G4String fileDir; 68 G4UIcmdWithAString* setFileDirCommand; 69 70 G4String fileName; 71 G4UIcmdWithAString* setFileNameCommand; 72 73 G4bool overwrite; 74 G4UIcmdWithABool* setOverwriteCommand; 75 76 G4bool cullInvisibles; 77 G4UIcmdWithABool* setCullInvisiblesCommand; 56 78 57 79 G4String suffix; … … 66 88 G4bool solids; 67 89 G4UIcmdWithABool* useSolidsCommand; 68 90 69 91 G4bool invisibles; 70 92 G4UIcmdWithABool* writeInvisiblesCommand; -
trunk/source/visualization/HepRep/include/G4HepRepSceneHandler.hh
r1140 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepSceneHandler.hh,v 1.4 3 2009/10/21 15:08:35 allisonExp $26 // $Id: G4HepRepSceneHandler.hh,v 1.44 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 63 63 #include "G4PhysicalVolumeModel.hh" 64 64 65 #include "G4HepRepMessenger.hh"66 67 65 class G4HepRepSceneHandler: public G4VSceneHandler { 68 66 69 67 public: 70 G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& messenger,const G4String& name = "");68 G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name = ""); 71 69 virtual ~G4HepRepSceneHandler (); 72 70 … … 187 185 188 186 // initialized Member Variables 189 G4HepRepMessenger& messenger;190 187 G4String geometryLayer, eventLayer, calHitLayer; 191 188 G4String trajectoryLayer, hitLayer; -
trunk/source/visualization/HepRep/include/G4HepRepViewer.hh
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepViewer.hh,v 1.1 8 2006/06/29 21:17:18 gunterExp $26 // $Id: G4HepRepViewer.hh,v 1.19 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 41 41 #include "G4VViewer.hh" 42 42 43 #include "G4HepRepMessenger.hh"44 45 43 class G4HepRepViewer: public G4VViewer { 46 44 public: 47 G4HepRepViewer (G4VSceneHandler& scene, G4HepRepMessenger& messenger,const G4String& name = "");45 G4HepRepViewer (G4VSceneHandler& scene, const G4String& name = ""); 48 46 virtual ~G4HepRepViewer (); 49 47 void SetView (); … … 57 55 private: 58 56 bool geometryIncluded; 59 G4HepRepMessenger& messenger;60 57 }; 61 58 -
trunk/source/visualization/HepRep/src/G4HepRep.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRep.cc,v 1.2 2 2006/06/29 21:17:20 gunterExp $26 // $Id: G4HepRep.cc,v 1.23 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 54 54 sceneHandler(NULL), 55 55 viewer(NULL) { 56 messenger = new G4HepRepMessenger();56 G4HepRepMessenger::GetInstance(); 57 57 } 58 58 59 59 G4HepRep::~G4HepRep () { 60 delete messenger;61 60 } 62 61 … … 66 65 return NULL; 67 66 } 68 sceneHandler = new G4HepRepSceneHandler (*this, *messenger,name);67 sceneHandler = new G4HepRepSceneHandler (*this, name); 69 68 return sceneHandler; 70 69 } … … 75 74 return NULL; 76 75 } 77 viewer = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, *messenger,name);76 viewer = new G4HepRepViewer ((G4HepRepSceneHandler&)scene, name); 78 77 return viewer; 79 78 } -
trunk/source/visualization/HepRep/src/G4HepRepFile.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepFile.cc,v 1.1 1 2007/05/22 17:05:26 allisonExp $26 // $Id: G4HepRepFile.cc,v 1.12 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 38 38 #include "G4HepRepFileSceneHandler.hh" 39 39 #include "G4HepRepFileViewer.hh" 40 #include "G4HepRepMessenger.hh" 40 41 41 42 static G4HepRepFileXMLWriter* hepRepXMLWriter; … … 46 47 "A HepRep (format 1) ascii file driver", 47 48 G4VGraphicsSystem::threeD) { 49 G4HepRepMessenger::GetInstance(); 48 50 hepRepXMLWriter = new G4HepRepFileXMLWriter(); 49 51 } -
trunk/source/visualization/HepRep/src/G4HepRepFileSceneHandler.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepFileSceneHandler.cc,v 1.6 6 2008/01/04 22:11:31 allisonExp $26 // $Id: G4HepRepFileSceneHandler.cc,v 1.68 2009/12/16 17:51:21 gunter Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 34 34 #include "G4HepRepFileSceneHandler.hh" 35 35 #include "G4HepRepFile.hh" 36 #include "G4HepRepMessenger.hh" 37 #include "G4UIcommand.hh" 36 38 37 39 #include "G4Version.hh" … … 71 73 hepRepXMLWriter = ((G4HepRepFile*)(&system))->GetHepRepXMLWriter(); 72 74 fileCounter = 0; 73 int length;74 75 if (getenv("G4HEPREPFILE_DIR") == NULL)76 strcpy(fileDir, "");77 else78 length = sprintf (fileDir, "%s%s", getenv("G4HEPREPFILE_DIR"),"/");79 80 if (getenv("G4HEPREPFILE_NAME") == NULL)81 strcpy(fileName, "G4Data");82 else83 strcpy(fileName, getenv("G4HEPREPFILE_NAME"));84 85 if (getenv("G4HEPREPFILE_OVERWRITE") == NULL)86 fileOverwrite = false;87 else88 fileOverwrite = strcmp(getenv("G4HEPREPFILE_OVERWRITE"),"0");89 90 if (getenv("G4HEPREPFILE_CULL") == NULL)91 cullInvisibleObjects = false;92 else93 cullInvisibleObjects = strcmp(getenv("G4HEPREPFILE_CULL"),"0");94 75 95 76 inPrimitives2D = false; … … 180 161 AddHepRepInstance("Prism", NULL); 181 162 182 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 163 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 164 165 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 183 166 return; 184 167 … … 243 226 AddHepRepInstance("Cylinder", NULL); 244 227 245 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 228 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 229 230 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 246 231 return; 247 232 … … 278 263 #endif 279 264 265 // HepRApp does not correctly represent the end faces of cylinders at 266 // non-standard angles, let the base class convert these solids to polygons. 267 CLHEP::HepRotation r = fpObjectTransformation->getRotation(); 268 G4bool linedUpWithAnAxis = (std::fabs(r.phiX())<=.001 || 269 std::fabs(r.phiY())<=.001 || 270 std::fabs(r.phiZ())<=.001 || 271 std::fabs(r.phiX()-pi)<=.001 || 272 std::fabs(r.phiY()-pi)<=.001 || 273 std::fabs(r.phiZ()-pi)<=.001); 274 //G4cout << "Angle X:" << r.phiX() << ", Angle Y:" << r.phiY() << ", Angle Z:" << r.phiZ() << G4endl; 275 //G4cout << "linedUpWithAnAxis:" << linedUpWithAnAxis << G4endl; 276 280 277 // HepRep does not have a primitive for a cut cylinder, 281 278 // so if this cylinder is cut, let the base class convert this 282 279 // solid to polygons. 283 if (tubs.GetDeltaPhiAngle() < twopi) { 280 if (tubs.GetDeltaPhiAngle() < twopi || !linedUpWithAnAxis) 281 { 284 282 G4VSceneHandler::AddSolid(tubs); // Invoke default action. 285 283 } else { … … 294 292 AddHepRepInstance("Cylinder", NULL); 295 293 296 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 294 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 295 296 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 297 297 return; 298 298 … … 340 340 AddHepRepInstance("Prism", NULL); 341 341 342 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 342 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 343 344 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 343 345 return; 344 346 … … 1004 1006 #endif 1005 1007 1006 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1008 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1009 1010 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1007 1011 return; 1008 1012 … … 1042 1046 #endif 1043 1047 1044 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1048 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1049 1050 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1045 1051 return; 1046 1052 … … 1144 1150 #endif 1145 1151 1146 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1152 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1153 1154 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1147 1155 return; 1148 1156 … … 1188 1196 #endif 1189 1197 1190 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1198 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1199 1200 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1191 1201 return; 1192 1202 … … 1231 1241 #endif 1232 1242 1233 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1243 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1244 1245 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1234 1246 return; 1235 1247 … … 1430 1442 hepRepXMLWriter->addInstance(); 1431 1443 1432 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && cullInvisibleObjects) 1444 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1445 1446 if (fpVisAttribs && (fpVisAttribs->IsVisible()==0) && messenger->getCullInvisibles()) 1433 1447 return; 1434 1448 … … 1512 1526 1513 1527 if (!hepRepXMLWriter->isOpen) { 1514 char* newFileSpec; 1515 newFileSpec = new char [256]; 1516 int length; 1517 1518 if (fileOverwrite) 1519 length = sprintf (newFileSpec, "%s%s%s",fileDir,fileName,".heprep"); 1520 else 1521 length = sprintf (newFileSpec, "%s%s%d%s",fileDir,fileName,fileCounter,".heprep"); 1528 G4String newFileSpec; 1529 1530 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1531 1532 if (messenger->getOverwrite()) { 1533 newFileSpec = messenger->getFileDir()+messenger->getFileName()+".heprep"; 1534 } else { 1535 newFileSpec = messenger->getFileDir()+messenger->getFileName()+G4UIcommand::ConvertToString(fileCounter)+".heprep"; 1536 } 1537 1522 1538 G4cout << "HepRepFile writing to " << newFileSpec << G4endl; 1523 1539 1524 1540 hepRepXMLWriter->open(newFileSpec); 1525 fileCounter++; 1541 1542 if (!messenger->getOverwrite()) 1543 fileCounter++; 1526 1544 1527 1545 hepRepXMLWriter->addAttDef("Generator", "HepRep Data Generator", "Physics",""); -
trunk/source/visualization/HepRep/src/G4HepRepMessenger.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepMessenger.cc,v 1.1 0 2006/06/29 21:17:30 gunterExp $26 // $Id: G4HepRepMessenger.cc,v 1.11 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // 29 29 #include "G4HepRepMessenger.hh" 30 30 31 G4HepRepMessenger* 32 G4HepRepMessenger::fpInstance = 0; 33 34 G4HepRepMessenger* 35 G4HepRepMessenger::GetInstance() 36 { 37 if (!fpInstance) fpInstance = new G4HepRepMessenger; 38 return fpInstance; 39 } 40 31 41 G4HepRepMessenger::G4HepRepMessenger() : 42 fileDir(""), 43 fileName("G4Data"), 44 overwrite(false), 45 cullInvisibles(false), 32 46 suffix (""), 33 47 geometry(true), … … 37 51 heprepDirectory = new G4UIdirectory("/vis/heprep/"); 38 52 heprepDirectory->SetGuidance("HepRep commands."); 39 53 54 setFileDirCommand = new G4UIcmdWithAString("/vis/heprep/setFileDir", this); 55 setFileDirCommand->SetGuidance("Set directory for output."); 56 setFileDirCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML."); 57 setFileDirCommand->SetParameterName("directory",false); 58 if ( getenv( "G4HEPREPFILE_DIR" ) == NULL ) { 59 setFileDirCommand->SetDefaultValue(""); 60 } else { 61 setFileDirCommand->SetDefaultValue(getenv("G4HEPREPFILE_DIR")); 62 fileDir = getenv("G4HEPREPFILE_DIR"); 63 } 64 setFileDirCommand->AvailableForStates(G4State_Idle); 65 66 setFileNameCommand = new G4UIcmdWithAString("/vis/heprep/setFileName", this); 67 setFileNameCommand->SetGuidance("Set file name for output."); 68 setFileNameCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML."); 69 setFileNameCommand->SetParameterName("directory",false); 70 if ( getenv( "G4HEPREPFILE_NAME" ) == NULL ) { 71 setFileNameCommand->SetDefaultValue("G4Data"); 72 } else { 73 setFileNameCommand->SetDefaultValue(getenv("G4HEPREPFILE_NAME")); 74 fileName = getenv("G4HEPREPFILE_NAME"); 75 } 76 setFileNameCommand->AvailableForStates(G4State_Idle); 77 78 setOverwriteCommand = new G4UIcmdWithABool("/vis/heprep/setOverwrite", this); 79 setOverwriteCommand->SetGuidance("Set true to write all output to exact same file name."); 80 setOverwriteCommand->SetGuidance("Set false to increment the file name for each new output."); 81 setOverwriteCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML."); 82 setOverwriteCommand->SetParameterName("flag",false); 83 if ( getenv( "G4HEPREPFILE_OVERWRITE" ) == NULL ) { 84 setOverwriteCommand->SetDefaultValue(false); 85 } else { 86 setOverwriteCommand->SetDefaultValue(getenv("G4HEPREPFILE_OVERWRITE")); 87 overwrite = setOverwriteCommand->ConvertToBool(getenv("G4HEPREPFILE_OVERWRITE")); 88 } 89 setOverwriteCommand->AvailableForStates(G4State_Idle); 90 91 setCullInvisiblesCommand = new G4UIcmdWithABool("/vis/heprep/setCullInvisibles", this); 92 setCullInvisiblesCommand->SetGuidance("Remove invisible objects from output file."); 93 setCullInvisiblesCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML."); 94 setCullInvisiblesCommand->SetParameterName("flag",false); 95 if ( getenv( "G4HEPREPFILE_CULL" ) == NULL ) { 96 setCullInvisiblesCommand->SetDefaultValue(false); 97 } else { 98 setCullInvisiblesCommand->SetDefaultValue(getenv("G4HEPREPFILE_CULL")); 99 cullInvisibles = setCullInvisiblesCommand->ConvertToBool(getenv("G4HEPREPFILE_CULL")); 100 } 101 setCullInvisiblesCommand->AvailableForStates(G4State_Idle); 102 40 103 setEventNumberSuffixCommand = new G4UIcmdWithAString("/vis/heprep/setEventNumberSuffix", this); 41 104 setEventNumberSuffixCommand->SetGuidance("Write separate event files, appended with given suffix."); 42 105 setEventNumberSuffixCommand->SetGuidance("Define the suffix with a pattern such as '-0000'."); 106 setEventNumberSuffixCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile."); 43 107 setEventNumberSuffixCommand->SetParameterName("suffix",false); 44 108 setEventNumberSuffixCommand->SetDefaultValue(""); … … 47 111 appendGeometryCommand = new G4UIcmdWithABool("/vis/heprep/appendGeometry", this); 48 112 appendGeometryCommand->SetGuidance("Appends copy of geometry to every event."); 113 appendGeometryCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile."); 49 114 appendGeometryCommand->SetParameterName("flag",false); 50 115 appendGeometryCommand->SetDefaultValue(true); … … 53 118 addPointAttributesCommand = new G4UIcmdWithABool("/vis/heprep/addPointAttributes", this); 54 119 addPointAttributesCommand->SetGuidance("Adds point attributes to the points of trajectories."); 120 addPointAttributesCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile."); 55 121 addPointAttributesCommand->SetParameterName("flag",false); 56 122 addPointAttributesCommand->SetDefaultValue(false); … … 59 125 useSolidsCommand = new G4UIcmdWithABool("/vis/heprep/useSolids", this); 60 126 useSolidsCommand->SetGuidance("Use HepRep Solids, rather than Geant4 Primitives."); 127 useSolidsCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile."); 61 128 useSolidsCommand->SetParameterName("flag",false); 62 129 useSolidsCommand->SetDefaultValue(true); 63 130 useSolidsCommand->AvailableForStates(G4State_Idle); 64 65 /* Not Enabled Yet66 writeInvisiblesCommand = new G4UIcmdWithABool("/vis/heprep/writeInvisibles", this);67 writeInvisiblesCommand->SetGuidance("Write invisible objects.");68 writeInvisiblesCommand->SetParameterName("flag",false);69 writeInvisiblesCommand->SetDefaultValue(true);70 writeInvisiblesCommand->AvailableForStates(G4State_Idle);71 */72 131 } 73 132 74 133 G4HepRepMessenger::~G4HepRepMessenger() { 134 delete setFileDirCommand; 135 delete setFileNameCommand; 136 delete setOverwriteCommand; 137 delete setCullInvisiblesCommand; 75 138 delete setEventNumberSuffixCommand; 76 139 delete appendGeometryCommand; 77 140 delete addPointAttributesCommand; 78 141 delete useSolidsCommand; 79 // delete writeInvisiblesCommand;80 142 delete heprepDirectory; 81 143 } 82 144 83 145 G4String G4HepRepMessenger::GetCurrentValue(G4UIcommand * command) { 84 if (command==setEventNumberSuffixCommand) { 85 return suffix; 146 if (command==setFileDirCommand) { 147 return fileDir; 148 } else if (command==setFileNameCommand) { 149 return fileName; 150 } else if (command==setOverwriteCommand) { 151 return overwrite; 152 } else if (command==setCullInvisiblesCommand) { 153 return cullInvisibles; 154 } else if (command==setEventNumberSuffixCommand) { 155 return suffix; 86 156 } else if (command==appendGeometryCommand) { 87 157 return appendGeometryCommand->ConvertToString(geometry); … … 90 160 } else if (command==useSolidsCommand) { 91 161 return useSolidsCommand->ConvertToString(solids); 92 // } else if (command==writeInvisiblesCommand) {93 // return writeInvisiblesCommand->ConvertToString(invisibles);94 162 } else { 95 163 return ""; … … 98 166 99 167 void G4HepRepMessenger::SetNewValue(G4UIcommand * command, G4String newValue) { 100 if (command==setEventNumberSuffixCommand) { 168 if (command==setFileDirCommand) { 169 fileDir = newValue; 170 } else if (command==setFileNameCommand) { 171 fileName = newValue; 172 } else if (command==setOverwriteCommand) { 173 overwrite = setOverwriteCommand->GetNewBoolValue(newValue); 174 } else if (command==setCullInvisiblesCommand) { 175 cullInvisibles = setCullInvisiblesCommand->GetNewBoolValue(newValue); 176 } else if (command==setEventNumberSuffixCommand) { 101 177 suffix = newValue; 102 178 } else if (command==appendGeometryCommand) { … … 106 182 } else if (command==useSolidsCommand) { 107 183 solids = useSolidsCommand->GetNewBoolValue(newValue); 108 // } else if (command==writeInvisiblesCommand) {109 // invisibles = writeInvisiblesCommand->GetNewBoolValue(newValue);110 184 } 185 } 186 187 G4String G4HepRepMessenger::getFileDir() { 188 return fileDir; 189 } 190 191 G4String G4HepRepMessenger::getFileName() { 192 return fileName; 193 } 194 195 G4bool G4HepRepMessenger::getOverwrite() { 196 return overwrite; 197 } 198 199 G4bool G4HepRepMessenger::getCullInvisibles() { 200 return cullInvisibles; 111 201 } 112 202 -
trunk/source/visualization/HepRep/src/G4HepRepSceneHandler.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepSceneHandler.cc,v 1.10 1 2007/11/16 20:29:04perl Exp $26 // $Id: G4HepRepSceneHandler.cc,v 1.102 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 45 45 //HepRep 46 46 #include "HEPREP/HepRep.h" 47 #include "G4HepRepMessenger.hh" 47 48 48 49 //G4 … … 90 91 //#define PDEBUG 1 91 92 92 G4HepRepSceneHandler::G4HepRepSceneHandler (G4VGraphicsSystem& system, G4HepRepMessenger& heprepMessenger,const G4String& name)93 G4HepRepSceneHandler::G4HepRepSceneHandler (G4VGraphicsSystem& system, const G4String& name) 93 94 : G4VSceneHandler (system, sceneIdCount++, name), 94 messenger (heprepMessenger),95 95 geometryLayer ("Geometry"), 96 96 eventLayer ("Event"), … … 247 247 writeMultipleFiles = false; 248 248 int startDigit = -1; int endDigit = -1; 249 string suffix = messenger.getEventNumberSuffix(); 249 250 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 251 252 string suffix = messenger->getEventNumberSuffix(); 250 253 if (suffix != "") { 251 254 // look for 0000 pattern in suffix … … 331 334 } 332 335 } else { 336 337 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 333 338 334 339 // add geometry to the heprep if there is an event (separate geometries are written … … 338 343 339 344 // couple geometry 340 if (messenger.appendGeometry()) { 345 346 if ( messenger->appendGeometry()) { 341 347 // couple geometry to event if geometry was written 342 348 if ((_geometryInstanceTree != NULL)) { … … 374 380 375 381 // write out separate geometry 376 if (! messenger.appendGeometry() && (_heprepGeometry != NULL)) {382 if (! messenger->appendGeometry() && (_heprepGeometry != NULL)) { 377 383 if (writeMultipleFiles) { 378 384 char fileName[128]; … … 493 499 494 500 if (dontWrite()) return; 495 496 if (!messenger.useSolids()) { 501 502 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 503 504 if (! messenger->useSolids()) { 497 505 G4VSceneHandler::AddSolid(box); 498 506 return; … … 547 555 548 556 if (dontWrite()) return; 549 550 if (!messenger.useSolids() || (cons.GetDeltaPhiAngle() < twopi)) { 557 558 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 559 560 if (! messenger->useSolids() || (cons.GetDeltaPhiAngle() < twopi)) { 551 561 G4VSceneHandler::AddSolid(cons); 552 562 return; … … 609 619 610 620 if (dontWrite()) return; 611 612 if (!messenger.useSolids() || (tubs.GetDeltaPhiAngle() < twopi)) { 621 622 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 623 624 if (! messenger->useSolids() || (tubs.GetDeltaPhiAngle() < twopi)) { 613 625 G4VSceneHandler::AddSolid(tubs); 614 626 return; … … 666 678 #endif 667 679 if (dontWrite()) return; 668 669 if (!messenger.useSolids()) { 680 681 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 682 683 if (! messenger->useSolids()) { 670 684 G4VSceneHandler::AddSolid(trd); 671 685 return; … … 994 1008 995 1009 996 G4bool G4HepRepSceneHandler::dontWrite() { 997 return !(messenger.writeInvisibles() || (fpVisAttribs ? (bool)fpVisAttribs->IsVisible() : true)); 1010 G4bool G4HepRepSceneHandler::dontWrite() { 1011 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1012 return !( messenger->writeInvisibles() || (fpVisAttribs ? (bool)fpVisAttribs->IsVisible() : true)); 998 1013 } 999 1014 … … 1367 1382 type->addAttDef( "PointUnit", "Length", "Physics", ""); 1368 1383 type->addAttValue("PointUnit", G4String("m")); 1384 1385 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1369 1386 1370 1387 type->addAttDef( "UseSolids", "Use HepRep Solids rather than Geant4 Primitives", "Draw", ""); 1371 type->addAttValue("UseSolids", messenger .useSolids());1388 type->addAttValue("UseSolids", messenger->useSolids()); 1372 1389 1373 1390 type->addAttDef( "WriteInvisibles", "Write Invisible Objects", "Draw", ""); 1374 type->addAttValue("WriteInvisibles", messenger .writeInvisibles());1391 type->addAttValue("WriteInvisibles", messenger->writeInvisibles()); 1375 1392 } 1376 1393 … … 1409 1426 // Create the Geometry InstanceTree. 1410 1427 _geometryInstanceTree = factory->createHepRepInstanceTree("G4GeometryData", "1.0", getGeometryTypeTree()); 1411 if (messenger.appendGeometry()) { 1428 1429 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1430 if ( messenger->appendGeometry()) { 1412 1431 getHepRep()->addInstanceTree(_geometryInstanceTree); 1413 1432 } else { … … 1476 1495 HepRepTreeID* geometryTreeID = factory->createHepRepTreeID("G4GeometryTypes", "1.0"); 1477 1496 _geometryTypeTree = factory->createHepRepTypeTree(geometryTreeID); 1478 if (messenger.appendGeometry()) { 1497 1498 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 1499 if ( messenger->appendGeometry()) { 1479 1500 getHepRep()->addTypeTree(_geometryTypeTree); 1480 1501 } else { -
trunk/source/visualization/HepRep/src/G4HepRepViewer.cc
r944 r1228 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4HepRepViewer.cc,v 1.2 6 2006/06/29 21:17:34 gunterExp $26 // $Id: G4HepRepViewer.cc,v 1.27 2009/11/23 05:42:28 perl Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 40 40 #include "G4Scene.hh" 41 41 #include "G4HepRep.hh" 42 #include "G4HepRepMessenger.hh" 42 43 #include "G4HepRepSceneHandler.hh" 43 44 //This … … 47 48 using namespace std; 48 49 49 G4HepRepViewer::G4HepRepViewer (G4VSceneHandler& sceneHandler, G4HepRepMessenger& heprepMessenger,const G4String& name)50 G4HepRepViewer::G4HepRepViewer (G4VSceneHandler& sceneHandler, const G4String& name) 50 51 : G4VViewer (sceneHandler, sceneHandler.IncrementViewCount(), name), 51 geometryIncluded(false), 52 messenger(heprepMessenger) { 52 geometryIncluded(false) { 53 53 54 54 #ifdef SDEBUG … … 111 111 if (sceneHandler->closeHepRep()) { 112 112 sceneHandler->openHepRep(); 113 if (messenger.appendGeometry()) geometryIncluded = false; 113 114 G4HepRepMessenger* messenger = G4HepRepMessenger::GetInstance(); 115 if (messenger->appendGeometry()) geometryIncluded = false; 114 116 } 115 117 } -
trunk/source/visualization/History
r1196 r1228 1 $Id: History,v 1.4 56 2009/11/17 14:37:06 lgarnierExp $1 $Id: History,v 1.460 2009/11/23 05:56:37 perl Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 25 25 --------------------------------------- 26 26 27 22nd November 2009 Joseph Perl (vis-V09-02-12) 28 - vis-HepRep-V09-02-03 29 o Changed messenger to a singleton. 30 o Added messenger commands to HepRepFile. 31 o Render G4Tubs as polygons if G4Tubs is not at a standard angle. 32 33 22nd November 2009 John Allison 34 - visman-V09-02-08: /vis/scene/add/trajectories rich: 35 o Added G4RichTrajectoryPoint().GetAttDefs() to informational. 36 37 18th November 2009 Gabriele Cosmo 38 - visexternal-V09-02-06: 39 o Added GLOBLIBS dependencies. 40 o Re-instated fix to gl2ps.cc (always #define GL2PS_HAVE_ZLIB). 41 42 17th November 2009 John Allison (vis-V09-02-11) 43 - visman-V09-02-07: 44 o Many small bug fixes. 45 o Enhanced functionality for gMocren driver: 46 . Introduced the concept of end-of-run model. 47 - opengl-V09-02-10: Fixes build problem with gl2ps on Windows. 48 - openinventor-V09-02-03: Fixes build problem with gl2ps on Windows. 49 - Tagged for vis tag. 50 - visexternal-V09-02-05: 51 o gl2ps: Added dependency on zlib if G4LIB_BUILD_ZLIB is set. 52 27 53 17th November 2009 Laurent Garnier 28 - Fix SceneHandler removing viewer if class destructor call 29 before G4VSceneHandler calls it 54 - Allow arbitrary viewer deletion (fixes crash) 55 56 17th November 2009 Gabriele Cosmo 57 - GNUmakefile: Added SUBLIBS += G4gl2ps for OPENGL and OI. 58 59 15th November 2009 John Allison 60 - raytracer-V09-02-02: Formal tag to record fixing of bugzilla Problem 1072. 30 61 31 62 6th November 2009 John Allison 32 63 - vistest-V09-02-01: test19.cc: Use G4UIExecutive. 33 64 34 65 3rd November 2009 John Allison (vis-V09-02-10, greps-V09-02-03, digits_hits-V09-02-02) -
trunk/source/visualization/OpenGL/GNUmakefile
r1227 r1228 1 # $Id: GNUmakefile,v 1.1 0 2009/03/05 11:17:42lgarnier Exp $1 # $Id: GNUmakefile,v 1.12 2010/01/06 15:05:29 lgarnier Exp $ 2 2 3 3 name := G4OpenGL … … 39 39 CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include 40 40 41 #INTYLIBS += -L$(G4LIBDIR)42 43 41 include $(G4INSTALL)/config/moc.gmk 44 42 include $(G4INSTALL)/config/common.gmk -
trunk/source/visualization/OpenGL/History
r1196 r1228 1 $Id: History,v 1.16 0 2009/11/17 11:52:51 gcosmoExp $1 $Id: History,v 1.162 2010/01/06 15:05:29 lgarnier Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 6th January 2010 Laurent Garnier (needs interfaces-V09-02-07 + laurent-QtUI_with_tabs_v1) 21 - GNUMakefile : Add include for interfaces/basic 22 - G4OpenGLQtWiewer : Integration into QtUI Tab 23 24 17th November 2009 John Allison (opengl-V09-02-10) 25 - Tagged for vis tag. 19 26 20 27 17th November 2009 Gabriele Cosmo -
trunk/source/visualization/OpenGL/include/G4OpenGLImmediateQtViewer.hh
r1130 r1228 56 56 void initializeGL (); 57 57 void DrawView (); 58 void FinishView ();58 // void FinishView (); 59 59 void resizeGL(int width,int height); 60 60 void paintGL(); … … 70 70 void contextMenuEvent(QContextMenuEvent *e); 71 71 void keyPressEvent (QKeyEvent * event); 72 void paintEvent(QPaintEvent *event); 72 73 private: 73 74 void ComputeView (); -
trunk/source/visualization/OpenGL/include/G4OpenGLQtViewer.hh
r1160 r1228 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.hh,v 1.2 0 2009/10/21 08:14:44lgarnier Exp $27 // $Id: G4OpenGLQtViewer.hh,v 1.21 2010/01/06 15:05:29 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // -
trunk/source/visualization/OpenGL/src/G4OpenGLImmediateQtViewer.cc
r1227 r1228 107 107 108 108 updateQWidget(); 109 109 110 #ifdef G4DEBUG_VIS_OGL 110 111 printf("G4OpenGLImmediateQtViewer::DrawView ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n"); … … 150 151 #endif 151 152 fHasToRepaint = true; 152 }153 154 void G4OpenGLImmediateQtViewer::FinishView()155 {156 #ifdef G4DEBUG_VIS_OGL157 printf("G4OpenGLImmediateQtViewer::FinishView() BEGIN\n");158 #endif159 glFlush ();160 #ifdef G4DEBUG_VIS_OGL161 printf("G4OpenGLImmediateQtViewer::FinishView() END\n");162 #endif163 164 153 } 165 154 … … 172 161 ,int aHeight) 173 162 { 163 #ifdef G4DEBUG_VIS_OGL 164 printf("\n\nG4OpenGLImmediateQtViewer::resizeGL VVVV\n"); 165 #endif 174 166 ResizeWindow(aWidth,aHeight); 175 167 fHasToRepaint = sizeHasChanged(); 168 #ifdef G4DEBUG_VIS_OGL 169 printf("\n\nG4OpenGLImmediateQtViewer::resizeGL ^^^^^\n"); 170 #endif 176 171 } 177 172 … … 180 175 { 181 176 #ifdef G4DEBUG_VIS_OGL 182 printf("\n\nG4OpenGLImmediateQtViewer::paintGL ?? \n");177 printf("\n\nG4OpenGLImmediateQtViewer::paintGL ?? %d W:%d H:%d \n",fHasToRepaint,getWinWidth(),getWinHeight()); 183 178 #endif 184 179 if (!fReadyToPaint) { … … 186 181 return; 187 182 } 183 if ((getWinWidth() == 0) && (getWinHeight() == 0)) { 184 return; 185 } 186 188 187 // DO NOT RESIZE IF SIZE HAS NOT CHANGE 189 188 if ( !fHasToRepaint) { … … 209 208 } else if ((sw == 0) && (sh == 0)) { // NOT A TOP LEVEL WIDGET 210 209 if (((getWinWidth() == (unsigned int)width())) &&(getWinHeight() == (unsigned int) height())) { 211 //return;210 return; 212 211 } 213 212 } … … 270 269 } 271 270 271 void G4OpenGLImmediateQtViewer::paintEvent(QPaintEvent *event) { 272 // fHasToRepaint= false; 273 #ifdef G4DEBUG_VIS_OGL 274 printf("\n\nG4OpenGLImmediateQtViewer::paintEvent VVVVVVVVV\n"); 275 #endif 276 updateGL(); 277 #ifdef G4DEBUG_VIS_OGL 278 printf("\n\nG4OpenGLImmediateQtViewer::paintEvent ^^^^^^^^^\n"); 279 #endif 280 } 281 282 272 283 void G4OpenGLImmediateQtViewer::updateQWidget() { 273 284 fHasToRepaint= true; 285 #ifdef G4DEBUG_VIS_OGL 286 printf("\n\nG4OpenGLImmediateQtViewer::updateQWidget VVVVVVVVV\n"); 287 #endif 274 288 updateGL(); 289 #ifdef G4DEBUG_VIS_OGL 290 printf("\n\nG4OpenGLImmediateQtViewer::updateQWidget ^^^^^^^^^\n"); 291 #endif 275 292 fHasToRepaint= false; 276 293 } … … 282 299 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 283 300 { 301 #ifdef G4DEBUG_VIS_OGL 302 printf("\n\nG4OpenGLImmediateQtViewer::ShowView VVVV\n"); 303 #endif 284 304 #if QT_VERSION < 0x040000 285 305 setActiveWindow(); … … 287 307 activateWindow(); 288 308 #endif 289 } 290 #endif 309 #ifdef G4DEBUG_VIS_OGL 310 printf("\n\nG4OpenGLImmediateQtViewer::ShowView ^^^^^\n"); 311 #endif 312 } 313 #endif -
trunk/source/visualization/OpenGL/src/G4OpenGLQtViewer.cc
r1225 r1228 25 25 // 26 26 // 27 // $Id: G4OpenGLQtViewer.cc,v 1.4 5 2009/10/21 08:14:44lgarnier Exp $27 // $Id: G4OpenGLQtViewer.cc,v 1.46 2010/01/06 15:05:29 lgarnier Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 104 104 //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!// 105 105 { 106 // G4Qt* interactorManager = G4Qt::getInstance (); 107 108 #ifdef G4DEBUG_VIS_OGL 109 printf("G4OpenGLQtViewer::CreateMainWindow :: BEGIN \n"); 110 #endif 106 111 107 if(fWindow) return; //Done. 112 108 … … 133 129 if (!res) { // we have to do a dialog 134 130 135 #ifdef G4DEBUG_VIS_OGL136 printf("G4OpenGLQtViewer::CreateMainWindow :: NO UI get Parent ? \n");137 #endif138 131 QWidget *myParent = getParentWidget(); 139 132 #ifdef G4DEBUG_VIS_OGL … … 149 142 QHBoxLayout *mainLayout = new QHBoxLayout(fGLWindow); 150 143 151 #ifdef G4DEBUG_VIS_OGL152 printf("G4OpenGLQtViewer::CreateMainWindow :: After create Layout fGLWindow:%d \n",fGLWindow);153 #endif154 144 mainLayout->setMargin(0); 155 145 mainLayout->setSpacing(0); … … 160 150 #else 161 151 fGLWindow->setWindowTitle( name); 162 #ifdef G4DEBUG_VIS_OGL163 printf("G4OpenGLQtViewer::CreateMainWindow :: is QMainWindow \n");164 #endif165 152 #endif 166 153 } 167 154 #if QT_VERSION >= 0x040000 168 #ifdef G4DEBUG_VIS_OGL169 printf("G4OpenGLQtViewer::CreateMainWindow :: set layout to fGLWindow:%d \n",fGLWindow);170 #endif171 155 fGLWindow->setLayout(mainLayout); 172 156 #endif … … 190 174 fGLWindow = fWindow; 191 175 } 192 193 194 176 195 177 if(!fWindow) return; 196 178 197 179 if (!fContextMenu) 198 180 createPopupMenu(); 199 200 #ifdef G4DEBUG_VIS_OGL 201 printf("G4OpenGLQtViewer::CreateMainWindow :: END \n"); 202 #endif 181 203 182 } 204 183 … … 257 236 258 237 #ifdef G4DEBUG_VIS_OGL 259 G4UImanager* UI = G4UImanager::GetUIpointer();260 printf("G4OpenGLQtViewer::getParentWidget :: UImanager %d++++++++++++\n",UI);261 #endif262 263 #ifdef G4DEBUG_VIS_OGL264 238 printf("G4OpenGLQtViewer::G4OpenGLQtViewer END\n"); 265 239 #endif … … 2669 2643 #endif 2670 2644 2671 // if (interactorManager) {2672 // if (interactorManager->GetUIVisWidget()) {2673 // fGLWindow = interactorManager->GetUIVisWidget();2674 // return interactorManager->GetUIVisWidget();2675 // }2676 // }2677 //2678 2679 2680 2645 bool found = false; 2681 2646 -
trunk/source/visualization/OpenInventor/GNUmakefile
r1051 r1228 1 # $Id: GNUmakefile,v 1. 9 2009/02/16 15:31:05 lgarnierExp $1 # $Id: GNUmakefile,v 1.10 2009/11/17 11:33:18 gcosmo Exp $ 2 2 3 3 name := G4OpenInventor … … 7 7 endif 8 8 9 # For debug mode 10 CPPFLAGS += -DG4DEBUG_VIS_OI 11 12 GLOBLIBS = libG4vis_management.lib libG4modeling.lib 13 GLOBLIBS += libG4interfaces.lib libG4run.lib libG4event.lib 9 GLOBLIBS = libG4vis_management.lib libG4modeling.lib libG4gl2ps.lib 10 GLOBLIBS += libG4zlib.lib libG4interfaces.lib libG4run.lib libG4event.lib 14 11 GLOBLIBS += libG4tracking.lib libG4processes.lib libG4digits_hits.lib 15 12 GLOBLIBS += libG4track.lib libG4particles.lib libG4geometry.lib … … 37 34 CPPFLAGS += -I$(G4BASE)/digits_hits/hits/include 38 35 39 INTYLIBS += -L$(G4LIBDIR) -lG4gl2ps40 41 36 include $(G4INSTALL)/config/common.gmk 42 37 -
trunk/source/visualization/OpenInventor/History
r1196 r1228 1 $Id: History,v 1.10 2 2009/09/29 21:23:36allison Exp $1 $Id: History,v 1.104 2009/11/17 17:47:49 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/OpenInventor 21 21 ------------------------------------------- 22 23 17th November 2009 John Allison (openinventor-V09-02-03) 24 - Tagged for vis tag. 25 26 17th November 2009 Gabriele Cosmo 27 - Fixed GNUmakefile. Fixes build problem with gl2ps on Windows. 22 28 23 29 29 September 2009 John Allison (openinventor-V09-02-02) -
trunk/source/visualization/RayTracer/History
r1140 r1228 1 $Id: History,v 1. 59 2009/10/21 15:24:53allison Exp $1 $Id: History,v 1.60 2009/11/15 12:33:54 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 25 25 --------------------------------------- 26 26 27 15th November 2009 John Allison (raytracer-V09-02-02) 28 - Formal tag to record fixing of bugzilla Problem 1072. 29 o There is no change of source code. 30 o This was actullay fixed in raytracer-V09-02-00, which is already accepted. 31 27 32 21st October 2009 John Allison (raytracer-V09-02-01 coworks greps-V09-02-02) 28 33 - Added AddCompound (const G4THitsMap<G4double>&) methods. … … 34 39 19 August 2009 Laurent Garnier 35 40 - G4RayTracerViewer.cc, G4RayTracerXViewer.cc : Fix an bad use of fVP 36 parameters 41 parameters [bugzilla Problem 1072] 37 42 38 43 18 August 2009 Laurent Garnier -
trunk/source/visualization/externals/gl2ps/GNUmakefile
r1169 r1228 1 # $Id: GNUmakefile,v 1. 2 2009/11/02 14:54:31 lgarnierExp $1 # $Id: GNUmakefile,v 1.5 2009/11/18 17:15:11 gcosmo Exp $ 2 2 # ------------------------------------------------------------- 3 3 # GNUmakefile for gl2ps. Laurent Garnier, 6/2/09. … … 12 12 endif 13 13 14 ifdef G4LIB_BUILD_ZLIB 15 CPPFLAGS += -I$(G4BASE)/visualization/externals/zlib/include 16 endif 14 GLOBLIBS = libG4zlib.lib 17 15 18 16 include $(G4INSTALL)/config/architecture.gmk … … 20 18 include $(G4INSTALL)/config/interactivity.gmk 21 19 20 ifdef G4LIB_BUILD_ZLIB 21 CPPFLAGS += -I$(G4BASE)/visualization/externals/zlib/include 22 endif 23 22 24 include $(G4INSTALL)/config/common.gmk -
trunk/source/visualization/externals/gl2ps/History
r1140 r1228 1 $Id: History,v 1.1 0 2009/11/02 14:54:31 lgarnierExp $1 $Id: History,v 1.15 2009/11/18 17:23:36 gcosmo Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 17 17 * Reverse chronological order (last date on top), please * 18 18 ---------------------------------------------------------- 19 20 18 Nov 2009, Gabriele Cosmo (visexternal-V09-02-06) 21 - Added GLOBLIBS dependencies to GNUmakefile to allow for building 22 DLLs on Windows. Removed redundant CPPFLAGS addition. 23 - Re-instated fix to gl2ps.cc. 24 25 17 Nov 2009, John Allison, Gabriele Cosmo (visexternal-V09-02-05) 26 - Added dependency on zlib if G4LIB_BUILD_ZLIB is set and corrected 27 inclusion of zlib.h in gl2ps.cc 19 28 20 29 2 Nov 2009, Laurent Garnier -
trunk/source/visualization/externals/gl2ps/src/G4OpenGL2PSAction.cc
r1196 r1228 125 125 GL2PS_BEST_ROOT | GL2PS_SILENT | GL2PS_DRAW_BACKGROUND; 126 126 int sort = GL2PS_BSP_SORT; 127 sort = GL2PS_SIMPLE_SORT;127 //int sort = GL2PS_SIMPLE_SORT; 128 128 GLint buffsize = 0; 129 129 buffsize += 1024*1024; -
trunk/source/visualization/externals/gl2ps/src/gl2ps.cc
r1174 r1228 92 92 #include "Geant4_gl2ps.h" 93 93 94 #include < math.h>94 #include <cmath> 95 95 #include <string.h> 96 96 #include <sys/types.h> … … 99 99 #include <float.h> 100 100 101 #if defined(G4LIB_USE_ZLIB)102 101 #define GL2PS_HAVE_ZLIB 103 102 #include <zlib.h> 104 #endif105 103 106 104 #if defined(GL2PS_HAVE_LIBPNG) … … 121 119 #define GL2PS_ZOFFSET 5.0e-2F 122 120 #define GL2PS_ZOFFSET_LARGE 20.0F 123 #define GL2PS_ZERO(arg) ( fabs(arg) < 1.e-20)121 #define GL2PS_ZERO(arg) (std::fabs(arg) < 1.e-20) 124 122 125 123 /* Primitive types */ … … 749 747 750 748 for(i = 1; i < n; i++){ 751 if( fabs(rgba[0][0] - rgba[i][0]) > threshold[0] ||752 fabs(rgba[0][1] - rgba[i][1]) > threshold[1] ||753 fabs(rgba[0][2] - rgba[i][2]) > threshold[2])749 if(std::fabs(rgba[0][0] - rgba[i][0]) > threshold[0] || 750 std::fabs(rgba[0][1] - rgba[i][1]) > threshold[1] || 751 std::fabs(rgba[0][2] - rgba[i][2]) > threshold[2]) 754 752 return GL_FALSE; 755 753 } -
trunk/source/visualization/gMocren/History
r1161 r1228 1 $Id: History,v 1. 7 2009/11/05 11:37:12 gcosmoExp $1 $Id: History,v 1.9 2009/12/03 11:44:42 akimura Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/gMocren sub-category 21 21 --------------------------------------------------- 22 23 3 December 2009 Akinori Kimura 24 Line 363 of G4GMocrenFileSceneHandler.cc was deleted. 25 It was a debug code with G4cout. 26 Another file I/O bug was fixed. The following files were committed. 27 G4GMocrenFileViewer.cc 28 G4GMocrenFileSceneHandler.cc 29 G4GMocrenIO.{cc,hh} 22 30 23 31 5 November 2009 Gabriele Cosmo (gMocren-V09-02-03) -
trunk/source/visualization/gMocren/include/G4GMocrenIO.hh
r1142 r1228 43 43 44 44 void clear(); 45 void clearImage(); 45 46 void setSize(int _size[3]); 46 47 void getSize(int _size[3]); … … 292 293 void setModalityImage(short * _image); 293 294 short * getModalityImage(int _z); 295 void clearModalityImage(); 294 296 // set/get the modality image density map 295 297 void setModalityImageDensityMap(std::vector<float> & _map); -
trunk/source/visualization/gMocren/src/G4GMocrenFileCTtoDensityMap.cc
r1142 r1228 1 // 2 // ******************************************************************** 3 // * License and Disclaimer * 4 // * * 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. * 10 // * * 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitation of liability. * 17 // * * 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************************************** 25 // 1 26 #include "G4GMocrenFileCTtoDensityMap.hh" 2 27 -
trunk/source/visualization/gMocren/src/G4GMocrenFileSceneHandler.cc
r1161 r1228 25 25 // 26 26 // 27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.1 0 2009/11/05 11:34:01 gcosmoExp $27 // $Id: G4GMocrenFileSceneHandler.cc,v 1.12 2009/12/03 11:44:42 akimura Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 301 301 302 302 // initializations 303 //kgMocrenIO->clearModalityImage(); 303 304 kgMocrenIO->clearDoseDistAll(); 304 305 kgMocrenIO->clearROIAll(); … … 361 362 modality[ixy] = kgMocrenIO->convertDensityToHU(itr->second); 362 363 } else { 363 G4cout << "ABC : " << x << ", " << y << ", " << z << G4endl;364 364 modality[ixy] = -1024; 365 365 } -
trunk/source/visualization/gMocren/src/G4GMocrenFileViewer.cc
r1142 r1228 25 25 // 26 26 // 27 // $Id: G4GMocrenFileViewer.cc,v 1. 2 2009/10/12 10:04:35akimura Exp $27 // $Id: G4GMocrenFileViewer.cc,v 1.3 2009/12/03 11:44:42 akimura Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 107 107 G4cerr << "***** G4GMocrenFileViewer::ClearView (): No effects " << G4endl; 108 108 109 if(kSceneHandler.kGddDest) {110 kSceneHandler.kGddDest.close();109 //if(kSceneHandler.kGddDest) { 110 //kSceneHandler.kGddDest.close(); 111 111 // Re-open with same filename... 112 kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName);112 //kSceneHandler.kGddDest.open(kSceneHandler.kGddFileName); 113 113 kSceneHandler.kFlagInModeling = false; 114 114 kSceneHandler.GFBeginModeling(); 115 }115 //} 116 116 } 117 117 -
trunk/source/visualization/gMocren/src/G4GMocrenIO.cc
r1161 r1228 25 25 // 26 26 // 27 // $Id: G4GMocrenIO.cc,v 1. 4 2009/11/05 03:14:12 akimura Exp $27 // $Id: G4GMocrenIO.cc,v 1.5 2009/12/03 11:44:42 akimura Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 170 170 kMinmax[1] = (T)-32109; 171 171 172 /* 173 if(!image.empty()) { 174 typename std::vector<T *>::iterator itr; 175 for(itr = image.begin(); itr != image.end(); itr++) { 172 clearImage(); 173 } 174 template <typename T> 175 void GMocrenDataPrimitive<T>::clearImage() { 176 typename std::vector<T *>::iterator itr; 177 for(itr = kImage.begin(); itr != kImage.end(); itr++) { 176 178 delete [] *itr; 177 } 178 } 179 */ 179 } 180 180 kImage.clear(); 181 181 } … … 3368 3368 return kModality.getImage(_z); 3369 3369 } 3370 void G4GMocrenIO::clearModalityImage() { 3371 3372 kModality.clearImage(); 3373 } 3370 3374 // set/get the modality image density map 3371 3375 void G4GMocrenIO::setModalityImageDensityMap(std::vector<float> & _map) { -
trunk/source/visualization/management/History
r1196 r1228 1 $Id: History,v 1.13 4 2009/11/17 14:37:06 lgarnierExp $1 $Id: History,v 1.137 2009/11/22 14:08:09 allison Exp $ 2 2 3 3 ------------------------------------------------------------------- … … 27 27 ------------------------------------------------------ 28 28 29 22nd November 2009 John Allison (visman-V09-02-08) 30 - G4VisCommandsSceneAdd.cc: /vis/scene/add/trajectories rich: 31 o Added G4RichTrajectoryPoint().GetAttDefs() to informational. 32 33 17th November 2009 John Allison (visman-V09-02-07) 34 - Tagged. 35 29 36 17th November 2009 Laurent Garnier 30 - G4VViewer::Fix SceneHandler removing viewer if class destructor call 31 before G4VSceneHandler calls it 37 - Allow arbitrary viewer deletion (fixes crash). 38 o G4VViewer::~G4VViewer: Removes itself from viewer list. 39 o G4VSceneHandler::~G4VSceneHandler: better algorithm for removing viewers 40 to handle viewer self removal. 32 41 33 42 16th November 2009 Laurent Garnier -
trunk/source/visualization/management/include/G4VisExecutive.hh
r944 r1228 25 25 // 26 26 // 27 // $Id: G4VisExecutive.hh,v 1. 8 2009/03/14 11:43:42allison Exp $27 // $Id: G4VisExecutive.hh,v 1.9 2009/11/17 15:34:06 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 69 69 // 70 70 // Notes: 71 72 71 // (a) After instantiation, all references to this object should be as 73 72 // a G4VisManager. The functions RegisterGraphicsSystems and -
trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc
r1170 r1228 25 25 // 26 26 // 27 // $Id: G4VisCommandsSceneAdd.cc,v 1.7 7 2009/11/04 13:15:02allison Exp $27 // $Id: G4VisCommandsSceneAdd.cc,v 1.78 2009/11/22 14:02:30 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // /vis/scene commands - John Allison 9th August 1998 … … 66 66 #include "G4PropagatorInField.hh" 67 67 #include "G4RichTrajectory.hh" 68 #include "G4RichTrajectoryPoint.hh" 68 69 #include "G4AttDef.hh" 69 70 #include "G4ios.hh" … … 1415 1416 "\n\"/vis/modeling/trajectories/create/drawByAttribute\" and" 1416 1417 "\n\"/vis/filtering/trajectories/create/attributeFilter\" commands:\n" 1417 << G4RichTrajectory().GetAttDefs(); 1418 << G4RichTrajectory().GetAttDefs() 1419 << G4RichTrajectoryPoint().GetAttDefs(); 1418 1420 } 1419 1421 } -
trunk/source/visualization/test/History
r1140 r1228 1 $Id: History,v 1.1 19 2009/09/29 21:36:38allison Exp $1 $Id: History,v 1.121 2009/11/06 16:02:33 allison Exp $ 2 2 3 3 History file for visualization/test subdirectory … … 5 5 6 6 $Log: History,v $ 7 Revision 1.121 2009/11/06 16:02:33 allison 8 vistest-V09-02-01 9 10 Revision 1.120 2009/11/06 16:01:57 allison 11 Use G4UIExecutive in a more refined way. 12 7 13 Revision 1.119 2009/09/29 21:36:38 allison 8 14 vistest-V09-02-00 -
trunk/source/visualization/test/test19.cc
r1140 r1228 25 25 // 26 26 // 27 // $Id: test19.cc,v 1.3 1 2009/09/29 21:35:56allison Exp $27 // $Id: test19.cc,v 1.32 2009/11/06 16:01:57 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // … … 32 32 // Usage: test19 [<session>] [<verbosity>] 33 33 // Without verbosity, verbosity=warnings. 34 // Without session, session=new G4UIterminal(), or if G4UI_USE_TCSH is set35 // session=new G4UIterminal(new G4UItcsh),36 34 37 35 #include <stdio.h> … … 82 80 #ifdef G4UI_USE 83 81 // Choose (G)UI. 84 G4UIExecutive* UIexecutive = new G4UIExecutive(argc, argv); 85 G4UImanager::GetUIpointer()->SetSession(UIexecutive->GetSession()); //So that Pause works.. 82 G4UIExecutive* ui = new G4UIExecutive(argc, argv); 86 83 #endif 87 84 … … 119 116 #endif 120 117 121 G4UImanager* UI = G4UImanager::GetUIpointer ();118 G4UImanager* UImanager = G4UImanager::GetUIpointer (); 122 119 #ifdef G4UI_USE_WIN32 123 120 G4cout << "Reading win32.g4m file...." << G4endl; 124 UI -> ApplyCommand ("/control/execute win32.g4m");121 UImanager -> ApplyCommand ("/control/execute win32.g4m"); 125 122 #else 126 123 G4cout << "Reading test19.g4m file...." << G4endl; 127 UI -> ApplyCommand ("/control/execute test19.g4m");124 UImanager -> ApplyCommand ("/control/execute test19.g4m"); 128 125 #endif 129 126 … … 135 132 #ifdef G4UI_USE 136 133 // Start an interactive session. 137 UIexecutive-> SessionStart();134 ui -> SessionStart(); 138 135 #endif 139 136 … … 148 145 G4cout << "vis_test19: Deleting session..." << G4endl; 149 146 #ifdef G4UI_USE 150 delete UIexecutive;147 delete ui; 151 148 G4cout << "vis_test19: Session deleted." << G4endl; 152 149 #endif
Note: See TracChangeset
for help on using the changeset viewer.