Changeset 1348 for trunk/source/visualization/modeling
- Timestamp:
- Jan 5, 2011, 12:19:12 PM (14 years ago)
- Location:
- trunk/source/visualization/modeling
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/modeling/CVS/Entries
r1346 r1348 1 1 D/include//// 2 2 D/src//// 3 /CMakeLists.txt/1.1/Wed Sep 29 19:15:11 2010// Tgeant4-09-04-ref-004 /GNUmakefile/1.12/dummy timestamp from new-entry// Tgeant4-09-04-ref-005 /History/1.12 3/Fri Nov 26 15:30:48 2010//Tgeant4-09-04-ref-006 /README/1.1/Thu Jan 7 16:15:34 1999// Tgeant4-09-04-ref-007 /sources.cmake/1.1/Wed Sep 29 19:15:19 2010// Tgeant4-09-04-ref-003 /CMakeLists.txt/1.1/Wed Sep 29 19:15:11 2010// 4 /GNUmakefile/1.12/dummy timestamp from new-entry// 5 /History/1.126/Mon Jan 3 14:39:14 2011// 6 /README/1.1/Thu Jan 7 16:15:34 1999// 7 /sources.cmake/1.1/Wed Sep 29 19:15:19 2010// -
trunk/source/visualization/modeling/History
r1346 r1348 1 $Id: History,v 1.12 3 2010/11/14 22:14:11allison Exp $1 $Id: History,v 1.126 2010/12/27 12:29:28 allison Exp $ 2 2 ------------------------------------------------------------------- 3 3 … … 20 20 History file for visualization/modeling 21 21 --------------------------------------- 22 23 27th December 2010 John Allison (modeling-V09-04-00) 24 - Tagged. 25 26 11th December 2010 John Allison 27 - G4AttributeFilterT.hh, G4TrajectoryDrawByAttribute.cc: 28 o Changed some exceptions from FatalError to JustWarnings. 29 - G4TrajectoryDrawerUtils.cc: 30 o Rework TimesValidity. 22 31 23 32 14th November 2010 John Allison (modeling-V09-03-05) -
trunk/source/visualization/modeling/include/CVS/Entries
r1346 r1348 1 /G4AttFilterUtils.hh/1.2/Wed Dec 13 15:49:58 2006// Tgeant4-09-04-ref-002 /G4AttValueFilterT.hh/1.3/Wed Dec 13 15:50:00 2006// Tgeant4-09-04-ref-003 /G4AttributeFilterT.hh/1. 6/Wed Dec 13 15:50:02 2006//Tgeant4-09-04-ref-004 /G4AxesModel.hh/1.6/Wed Nov 1 10:28:42 2006// Tgeant4-09-04-ref-005 /G4BoundingSphereScene.hh/1.20/Sun May 30 11:23:25 2010// Tgeant4-09-04-ref-006 /G4CallbackModel.hh/1.5/Thu Jun 29 21:30:10 2006// Tgeant4-09-04-ref-007 /G4DigiFilterFactories.hh/1.1/Sun May 30 11:24:30 2010// Tgeant4-09-04-ref-008 /G4DigiModel.hh/1.1/Sun May 30 11:24:30 2010// Tgeant4-09-04-ref-009 /G4FlavoredParallelWorldModel.hh/1.8/Thu Jun 29 21:30:12 2006// Tgeant4-09-04-ref-0010 /G4HitFilterFactories.hh/1.1/Tue Sep 12 18:53:03 2006// Tgeant4-09-04-ref-0011 /G4HitsModel.hh/1.10/Thu Nov 2 11:57:31 2006// Tgeant4-09-04-ref-0012 /G4LogicalVolumeModel.hh/1.9/Wed Nov 1 10:28:42 2006// Tgeant4-09-04-ref-0013 /G4ModelApplyCommandsT.hh/1.6/Wed Nov 10 10:16:47 2010// Tgeant4-09-04-ref-0014 /G4ModelColourMap.hh/1.2/Thu Jun 29 21:30:22 2006// Tgeant4-09-04-ref-0015 /G4ModelCommandUtils.hh/1.3/Tue Feb 24 12:00:56 2009// Tgeant4-09-04-ref-0016 /G4ModelCommandsT.hh/1.13/Tue Feb 24 12:00:56 2009// Tgeant4-09-04-ref-0017 /G4ModelCompoundCommandsT.hh/1.1/Mon Sep 11 21:52:18 2006// Tgeant4-09-04-ref-0018 /G4ModelingParameters.hh/1.18/Tue May 11 11:13:35 2010// Tgeant4-09-04-ref-0019 /G4ModelingParameters.icc/1.12/Tue May 11 11:13:35 2010// Tgeant4-09-04-ref-0020 /G4NullModel.hh/1.7/Thu Jun 29 21:30:30 2006// Tgeant4-09-04-ref-0021 /G4PSHitsModel.hh/1.4/Wed Nov 4 12:44:39 2009// Tgeant4-09-04-ref-0022 /G4PhysicalVolumeMassScene.hh/1.11/Sun May 30 11:23:25 2010// Tgeant4-09-04-ref-0023 /G4PhysicalVolumeModel.hh/1.36/Tue May 11 11:16:51 2010// Tgeant4-09-04-ref-0024 /G4PhysicalVolumeSearchScene.hh/1.20/Sun May 30 11:23:25 2010// Tgeant4-09-04-ref-0025 /G4PhysicalVolumeSearchScene.icc/1.6/Thu Jun 29 21:30:38 2006// Tgeant4-09-04-ref-0026 /G4ScaleModel.hh/1.4/Wed Nov 1 10:28:42 2006// Tgeant4-09-04-ref-0027 /G4TextModel.hh/1.7/Wed Nov 1 10:28:42 2006// Tgeant4-09-04-ref-0028 /G4TrajectoriesModel.hh/1.11/Tue May 11 11:21:52 2010// Tgeant4-09-04-ref-0029 /G4TrajectoryChargeFilter.hh/1.3/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0030 /G4TrajectoryDrawByAttribute.hh/1.2/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0031 /G4TrajectoryDrawByCharge.hh/1.8/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0032 /G4TrajectoryDrawByOriginVolume.hh/1.5/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0033 /G4TrajectoryDrawByParticleID.hh/1.8/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0034 /G4TrajectoryDrawerUtils.hh/1.9/Tue May 11 11:58:18 2010// Tgeant4-09-04-ref-0035 /G4TrajectoryFilterFactories.hh/1.4/Tue Sep 12 18:53:03 2006// Tgeant4-09-04-ref-0036 /G4TrajectoryGenericDrawer.hh/1.3/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0037 /G4TrajectoryModelFactories.hh/1.6/Tue Sep 12 18:53:03 2006// Tgeant4-09-04-ref-0038 /G4TrajectoryOriginVolumeFilter.hh/1.3/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0039 /G4TrajectoryParticleFilter.hh/1.3/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0040 /G4VAttValueFilter.hh/1.2/Wed Dec 13 15:50:04 2006// Tgeant4-09-04-ref-0041 /G4VModel.hh/1.19/Mon Jul 10 16:09:30 2006// Tgeant4-09-04-ref-0042 /G4VModel.icc/1.12/Mon Jul 10 16:09:30 2006// Tgeant4-09-04-ref-0043 /G4VModelCommand.hh/1.4/Mon Sep 11 21:22:02 2006// Tgeant4-09-04-ref-0044 /G4VModelFactory.hh/1.6/Thu Jun 29 21:32:30 2006// Tgeant4-09-04-ref-0045 /G4VTrajectoryModel.hh/1.8/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0046 /G4VisTrajContext.hh/1.4/Tue Feb 24 12:00:56 2009// Tgeant4-09-04-ref-0047 /G4VisTrajContext.icc/1.4/Tue Feb 24 12:00:56 2009// Tgeant4-09-04-ref-001 /G4AttFilterUtils.hh/1.2/Wed Dec 13 15:49:58 2006// 2 /G4AttValueFilterT.hh/1.3/Wed Dec 13 15:50:00 2006// 3 /G4AttributeFilterT.hh/1.7/Mon Jan 3 14:39:14 2011// 4 /G4AxesModel.hh/1.6/Wed Nov 1 10:28:42 2006// 5 /G4BoundingSphereScene.hh/1.20/Sun May 30 11:23:25 2010// 6 /G4CallbackModel.hh/1.5/Thu Jun 29 21:30:10 2006// 7 /G4DigiFilterFactories.hh/1.1/Sun May 30 11:24:30 2010// 8 /G4DigiModel.hh/1.1/Sun May 30 11:24:30 2010// 9 /G4FlavoredParallelWorldModel.hh/1.8/Thu Jun 29 21:30:12 2006// 10 /G4HitFilterFactories.hh/1.1/Tue Sep 12 18:53:03 2006// 11 /G4HitsModel.hh/1.10/Thu Nov 2 11:57:31 2006// 12 /G4LogicalVolumeModel.hh/1.9/Wed Nov 1 10:28:42 2006// 13 /G4ModelApplyCommandsT.hh/1.6/Wed Nov 10 10:16:47 2010// 14 /G4ModelColourMap.hh/1.2/Thu Jun 29 21:30:22 2006// 15 /G4ModelCommandUtils.hh/1.3/Tue Feb 24 12:00:56 2009// 16 /G4ModelCommandsT.hh/1.13/Tue Feb 24 12:00:56 2009// 17 /G4ModelCompoundCommandsT.hh/1.1/Mon Sep 11 21:52:18 2006// 18 /G4ModelingParameters.hh/1.18/Tue May 11 11:13:35 2010// 19 /G4ModelingParameters.icc/1.12/Tue May 11 11:13:35 2010// 20 /G4NullModel.hh/1.7/Thu Jun 29 21:30:30 2006// 21 /G4PSHitsModel.hh/1.4/Wed Nov 4 12:44:39 2009// 22 /G4PhysicalVolumeMassScene.hh/1.11/Sun May 30 11:23:25 2010// 23 /G4PhysicalVolumeModel.hh/1.36/Tue May 11 11:16:51 2010// 24 /G4PhysicalVolumeSearchScene.hh/1.20/Sun May 30 11:23:25 2010// 25 /G4PhysicalVolumeSearchScene.icc/1.6/Thu Jun 29 21:30:38 2006// 26 /G4ScaleModel.hh/1.4/Wed Nov 1 10:28:42 2006// 27 /G4TextModel.hh/1.7/Wed Nov 1 10:28:42 2006// 28 /G4TrajectoriesModel.hh/1.11/Tue May 11 11:21:52 2010// 29 /G4TrajectoryChargeFilter.hh/1.3/Fri Aug 25 19:44:14 2006// 30 /G4TrajectoryDrawByAttribute.hh/1.2/Tue May 11 11:31:31 2010// 31 /G4TrajectoryDrawByCharge.hh/1.8/Tue May 11 11:31:31 2010// 32 /G4TrajectoryDrawByOriginVolume.hh/1.5/Tue May 11 11:31:31 2010// 33 /G4TrajectoryDrawByParticleID.hh/1.8/Tue May 11 11:31:31 2010// 34 /G4TrajectoryDrawerUtils.hh/1.9/Tue May 11 11:58:18 2010// 35 /G4TrajectoryFilterFactories.hh/1.4/Tue Sep 12 18:53:03 2006// 36 /G4TrajectoryGenericDrawer.hh/1.3/Tue May 11 11:31:31 2010// 37 /G4TrajectoryModelFactories.hh/1.6/Tue Sep 12 18:53:03 2006// 38 /G4TrajectoryOriginVolumeFilter.hh/1.3/Fri Aug 25 19:44:14 2006// 39 /G4TrajectoryParticleFilter.hh/1.3/Fri Aug 25 19:44:14 2006// 40 /G4VAttValueFilter.hh/1.2/Wed Dec 13 15:50:04 2006// 41 /G4VModel.hh/1.19/Mon Jul 10 16:09:30 2006// 42 /G4VModel.icc/1.12/Mon Jul 10 16:09:30 2006// 43 /G4VModelCommand.hh/1.4/Mon Sep 11 21:22:02 2006// 44 /G4VModelFactory.hh/1.6/Thu Jun 29 21:32:30 2006// 45 /G4VTrajectoryModel.hh/1.8/Tue May 11 11:31:31 2010// 46 /G4VisTrajContext.hh/1.4/Tue Feb 24 12:00:56 2009// 47 /G4VisTrajContext.icc/1.4/Tue Feb 24 12:00:56 2009// 48 48 D -
trunk/source/visualization/modeling/include/G4AttributeFilterT.hh
r1346 r1348 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4AttributeFilterT.hh,v 1. 6 2006/12/13 15:50:02 gunterExp $26 // $Id: G4AttributeFilterT.hh,v 1.7 2010/12/11 16:41:11 allison Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 128 128 // Expect definition to exist 129 129 if (!G4AttUtils::ExtractAttDef(object, fAttName, attDef)) { 130 std::ostringstream o; 131 o <<"Unable to extract attribute definition named "<<fAttName; 132 G4Exception 133 ("G4AttributeFilterT::Evaluate", "InvalidAttributeDefinition", FatalErrorInArgument, o.str().c_str()); 130 static G4bool warnedUnableToExtract = false; 131 if (!warnedUnableToExtract) { 132 std::ostringstream o; 133 o <<"Unable to extract attribute definition named "<<fAttName; 134 G4Exception 135 ("G4AttributeFilterT::Evaluate", "InvalidAttributeDefinition", JustWarning, o.str().c_str()); 136 G4cout << "Available attributes:\n" 137 << object.GetAttDefs(); 138 warnedUnableToExtract = true; 139 } 140 return false; 134 141 } 135 142 … … 152 159 // Expect value to exist 153 160 if (!G4AttUtils::ExtractAttValue(object, fAttName, attVal)) { 154 std::ostringstream o; 155 o <<"Unable to extract attribute value named "<<fAttName; 156 G4Exception 157 ("G4AttributeFilterT::Evaluate", "InvalidAttributeValue", FatalErrorInArgument, o.str().c_str()); 161 static G4bool warnedUnableToExtract = false; 162 if (!warnedUnableToExtract) { 163 std::ostringstream o; 164 o <<"Unable to extract attribute value named "<<fAttName; 165 G4Exception 166 ("G4AttributeFilterT::Evaluate", "InvalidAttributeValue", JustWarning, o.str().c_str()); 167 } 168 G4cout << "Available attributes:\n" 169 << object.GetAttDefs(); 170 warnedUnableToExtract = true; 171 return false; 158 172 } 159 173 -
trunk/source/visualization/modeling/src/CVS/Entries
r1346 r1348 1 /G4AttFilterUtils.cc/1.4/Wed Dec 13 15:50:06 2006// Tgeant4-09-04-ref-002 /G4AxesModel.cc/1.6/Thu Jun 29 21:32:38 2006// Tgeant4-09-04-ref-003 /G4BoundingSphereScene.cc/1.11/Thu Jun 29 21:32:40 2006// Tgeant4-09-04-ref-004 /G4DigiFilterFactories.cc/1.1/Sun May 30 11:24:30 2010// Tgeant4-09-04-ref-005 /G4DigiModel.cc/1.1/Sun May 30 11:24:30 2010// Tgeant4-09-04-ref-006 /G4FlavoredParallelWorldModel.cc/1.7/Thu Jun 29 21:32:42 2006// Tgeant4-09-04-ref-007 /G4HitFilterFactories.cc/1.2/Sun May 30 11:24:03 2010// Tgeant4-09-04-ref-008 /G4HitsModel.cc/1.18/Tue Nov 14 14:42:08 2006// Tgeant4-09-04-ref-009 /G4LogicalVolumeModel.cc/1.14/Wed Nov 1 10:28:42 2006// Tgeant4-09-04-ref-0010 /G4ModelingParameters.cc/1.16/Tue May 11 11:13:35 2010// Tgeant4-09-04-ref-0011 /G4NullModel.cc/1.9/Thu Jun 29 21:32:50 2006// Tgeant4-09-04-ref-0012 /G4PSHitsModel.cc/1.4/Wed Nov 4 12:44:39 2009// Tgeant4-09-04-ref-0013 /G4PhysicalVolumeMassScene.cc/1.7/Mon Nov 6 09:24:13 2006// Tgeant4-09-04-ref-0014 /G4PhysicalVolumeModel.cc/1.68/Fri Nov 5 15:19:29 2010// Tgeant4-09-04-ref-0015 /G4PhysicalVolumeSearchScene.cc/1.14/Sun Jul 27 10:49:24 2008// Tgeant4-09-04-ref-0016 /G4ScaleModel.cc/1.4/Thu Jun 29 21:32:58 2006// Tgeant4-09-04-ref-0017 /G4TextModel.cc/1.7/Thu Jun 29 21:33:00 2006// Tgeant4-09-04-ref-0018 /G4TrajectoriesModel.cc/1.25/Tue May 11 11:21:52 2010// Tgeant4-09-04-ref-0019 /G4TrajectoryChargeFilter.cc/1.4/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0020 /G4TrajectoryDrawByAttribute.cc/1. 5/Fri May 28 02:00:59 2010//Tgeant4-09-04-ref-0021 /G4TrajectoryDrawByCharge.cc/1.10/Fri May 28 02:00:59 2010// Tgeant4-09-04-ref-0022 /G4TrajectoryDrawByOriginVolume.cc/1.6/Fri May 28 02:00:59 2010// Tgeant4-09-04-ref-0023 /G4TrajectoryDrawByParticleID.cc/1.11/Tue Jun 1 21:17:41 2010// Tgeant4-09-04-ref-0024 /G4TrajectoryDrawerUtils.cc/1.1 5/dummy timestamp from new-entry//Tgeant4-09-04-ref-0025 /G4TrajectoryFilterFactories.cc/1.5/Tue Sep 12 18:53:03 2006// Tgeant4-09-04-ref-0026 /G4TrajectoryGenericDrawer.cc/1.3/Tue May 11 11:31:31 2010// Tgeant4-09-04-ref-0027 /G4TrajectoryModelFactories.cc/1.7/Tue Sep 12 18:53:03 2006// Tgeant4-09-04-ref-0028 /G4TrajectoryOriginVolumeFilter.cc/1.3/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0029 /G4TrajectoryParticleFilter.cc/1.3/Fri Aug 25 19:44:14 2006// Tgeant4-09-04-ref-0030 /G4VModel.cc/1.14/Wed Nov 1 10:33:00 2006// Tgeant4-09-04-ref-0031 /G4VTrajectoryModel.cc/1.3/Thu Jun 29 21:33:26 2006// Tgeant4-09-04-ref-0032 /G4VisTrajContext.cc/1.6/Tue Feb 24 12:00:56 2009// Tgeant4-09-04-ref-001 /G4AttFilterUtils.cc/1.4/Wed Dec 13 15:50:06 2006// 2 /G4AxesModel.cc/1.6/Thu Jun 29 21:32:38 2006// 3 /G4BoundingSphereScene.cc/1.11/Thu Jun 29 21:32:40 2006// 4 /G4DigiFilterFactories.cc/1.1/Sun May 30 11:24:30 2010// 5 /G4DigiModel.cc/1.1/Sun May 30 11:24:30 2010// 6 /G4FlavoredParallelWorldModel.cc/1.7/Thu Jun 29 21:32:42 2006// 7 /G4HitFilterFactories.cc/1.2/Sun May 30 11:24:03 2010// 8 /G4HitsModel.cc/1.18/Tue Nov 14 14:42:08 2006// 9 /G4LogicalVolumeModel.cc/1.14/Wed Nov 1 10:28:42 2006// 10 /G4ModelingParameters.cc/1.16/Tue May 11 11:13:35 2010// 11 /G4NullModel.cc/1.9/Thu Jun 29 21:32:50 2006// 12 /G4PSHitsModel.cc/1.4/Wed Nov 4 12:44:39 2009// 13 /G4PhysicalVolumeMassScene.cc/1.7/Mon Nov 6 09:24:13 2006// 14 /G4PhysicalVolumeModel.cc/1.68/Fri Nov 5 15:19:29 2010// 15 /G4PhysicalVolumeSearchScene.cc/1.14/Sun Jul 27 10:49:24 2008// 16 /G4ScaleModel.cc/1.4/Thu Jun 29 21:32:58 2006// 17 /G4TextModel.cc/1.7/Thu Jun 29 21:33:00 2006// 18 /G4TrajectoriesModel.cc/1.25/Tue May 11 11:21:52 2010// 19 /G4TrajectoryChargeFilter.cc/1.4/Fri Aug 25 19:44:14 2006// 20 /G4TrajectoryDrawByAttribute.cc/1.6/Mon Jan 3 14:39:15 2011// 21 /G4TrajectoryDrawByCharge.cc/1.10/Fri May 28 02:00:59 2010// 22 /G4TrajectoryDrawByOriginVolume.cc/1.6/Fri May 28 02:00:59 2010// 23 /G4TrajectoryDrawByParticleID.cc/1.11/Tue Jun 1 21:17:41 2010// 24 /G4TrajectoryDrawerUtils.cc/1.16/Result of merge// 25 /G4TrajectoryFilterFactories.cc/1.5/Tue Sep 12 18:53:03 2006// 26 /G4TrajectoryGenericDrawer.cc/1.3/Tue May 11 11:31:31 2010// 27 /G4TrajectoryModelFactories.cc/1.7/Tue Sep 12 18:53:03 2006// 28 /G4TrajectoryOriginVolumeFilter.cc/1.3/Fri Aug 25 19:44:14 2006// 29 /G4TrajectoryParticleFilter.cc/1.3/Fri Aug 25 19:44:14 2006// 30 /G4VModel.cc/1.14/Wed Nov 1 10:33:00 2006// 31 /G4VTrajectoryModel.cc/1.3/Thu Jun 29 21:33:26 2006// 32 /G4VisTrajContext.cc/1.6/Tue Feb 24 12:00:56 2009// 33 33 D -
trunk/source/visualization/modeling/src/G4TrajectoryDrawByAttribute.cc
r1346 r1348 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4TrajectoryDrawByAttribute.cc,v 1. 5 2010/05/28 02:00:59allison Exp $26 // $Id: G4TrajectoryDrawByAttribute.cc,v 1.6 2010/12/11 16:41:11 allison Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 97 97 // Expect definition to exist 98 98 if (!G4AttUtils::ExtractAttDef(object, fAttName, attDef)) { 99 std::ostringstream o; 100 o <<"Unable to extract attribute definition named "<<fAttName; 101 G4Exception 102 ("G4TrajectoryDrawByAttribute::Draw", "InvalidAttributeDefinition", FatalErrorInArgument, o.str().c_str()); 99 static G4bool warnedUnableToExtract = false; 100 if (!warnedUnableToExtract) { 101 std::ostringstream o; 102 o <<"Unable to extract attribute definition named "<<fAttName; 103 G4Exception 104 ("G4TrajectoryDrawByAttribute::Draw", "InvalidAttributeDefinition", JustWarning, o.str().c_str()); 105 G4cout << "Available attributes:\n" 106 << object.GetAttDefs(); 107 warnedUnableToExtract = true; 108 } 109 return; 103 110 } 104 111 … … 127 134 // Expect value to exist 128 135 if (!G4AttUtils::ExtractAttValue(object, fAttName, attVal)) { 136 static G4bool warnedUnableToExtract = false; 137 if (!warnedUnableToExtract) { 129 138 std::ostringstream o; 130 139 o <<"Unable to extract attribute value named "<<fAttName; 131 140 G4Exception 132 ("G4TrajectoryDrawByAttribute::Draw", "InvalidAttributeValue", FatalErrorInArgument, o.str().c_str()); 141 ("G4TrajectoryDrawByAttribute::Draw", "InvalidAttributeValue", JustWarning, o.str().c_str()); 142 G4cout << "Available attributes:\n" 143 << object.GetAttDefs(); 144 warnedUnableToExtract = true; 145 } 146 return; 133 147 } 134 148 -
trunk/source/visualization/modeling/src/G4TrajectoryDrawerUtils.cc
r1346 r1348 24 24 // ******************************************************************** 25 25 // 26 // $Id: G4TrajectoryDrawerUtils.cc,v 1.1 5 2010/11/14 22:13:55allison Exp $26 // $Id: G4TrajectoryDrawerUtils.cc,v 1.16 2010/12/11 16:40:16 allison Exp $ 27 27 // GEANT4 tag $Name: $ 28 28 // … … 44 44 namespace G4TrajectoryDrawerUtils { 45 45 46 47 void GetPoints(const G4VTrajectory& traj, 48 G4Polyline& trajectoryLine, 49 G4Polymarker& auxiliaryPoints, 50 G4Polymarker& stepPoints) 51 { 46 enum TimesValidity {InvalidTimes, ValidTimes}; 47 48 TimesValidity GetPointsAndTimes 49 (const G4VTrajectory& traj, 50 const G4VisTrajContext& context, 51 G4Polyline& trajectoryLine, 52 G4Polymarker& auxiliaryPoints, 53 G4Polymarker& stepPoints, 54 std::vector<G4double>& trajectoryLineTimes, 55 std::vector<G4double>& auxiliaryPointTimes, 56 std::vector<G4double>& stepPointTimes) 57 { 58 TimesValidity validity = InvalidTimes; 59 if (context.GetTimeSliceInterval()) validity = ValidTimes; 60 61 // Memory for last trajectory point position for auxiliary point 62 // time interpolation algorithm. There are no auxiliary points 63 // for the first trajectory point, so its initial value is 64 // immaterial. 65 G4ThreeVector lastTrajectoryPointPosition; 66 52 67 // Keep positions. Don't store unless first or different. 53 68 std::vector<G4ThreeVector> positions; … … 62 77 if (positions.size() == 0 || 63 78 trajectoryPointPosition != positions[positions.size()-1]) { 79 80 // Pre- and Post-Point times from the trajectory point... 81 G4double trajectoryPointPreTime = -std::numeric_limits<double>::max(); 82 G4double trajectoryPointPostTime = std::numeric_limits<double>::max(); 83 84 if (context.GetTimeSliceInterval() && validity == ValidTimes) { 85 86 std::vector<G4AttValue>* trajectoryPointAttValues = 87 aTrajectoryPoint->CreateAttValues(); 88 if (!trajectoryPointAttValues) { 89 static G4bool warnedNoAttValues = false; 90 if (!warnedNoAttValues) { 91 G4cout << 92 "*************************************************************************" 93 "\n* WARNING: G4TrajectoryDrawerUtils::GetPointsAndTimes: no att values." 94 "\n*************************************************************************" 95 << G4endl; 96 warnedNoAttValues = true; 97 } 98 validity = InvalidTimes; 99 } else { 100 G4bool foundPreTime = false, foundPostTime = false; 101 for (std::vector<G4AttValue>::iterator i = 102 trajectoryPointAttValues->begin(); 103 i != trajectoryPointAttValues->end(); ++i) { 104 if (i->GetName() == "PreT") { 105 trajectoryPointPreTime = 106 G4UIcommand::ConvertToDimensionedDouble(i->GetValue()); 107 foundPreTime = true; 108 } 109 if (i->GetName() == "PostT") { 110 trajectoryPointPostTime = 111 G4UIcommand::ConvertToDimensionedDouble(i->GetValue()); 112 foundPostTime = true; 113 } 114 } 115 if (!foundPreTime || !foundPostTime) { 116 static G4bool warnedTimesNotFound = false; 117 if (!warnedTimesNotFound) { 118 G4cout << 119 "*************************************************************************" 120 "\n* WARNING: G4TrajectoryDrawerUtils::GetPointsAndTimes: times not found." 121 "\n*************************************************************************" 122 << G4endl; 123 warnedTimesNotFound = true; 124 } 125 validity = InvalidTimes; 126 } 127 } 128 } 64 129 65 130 const std::vector<G4ThreeVector>* auxiliaries … … 74 139 trajectoryLine.push_back(auxPointPosition); 75 140 auxiliaryPoints.push_back(auxPointPosition); 141 if (validity == ValidTimes) { 142 // Interpolate time for auxiliary points... 143 const G4ThreeVector& auxPointPosition = (*auxiliaries)[iAux]; 144 G4double s1 = 145 (auxPointPosition - lastTrajectoryPointPosition).mag(); 146 G4double s2 = 147 (trajectoryPointPosition - auxPointPosition).mag(); 148 G4double t = trajectoryPointPreTime + 149 (trajectoryPointPostTime - trajectoryPointPreTime) * 150 (s1 / (s1 + s2)); 151 trajectoryLineTimes.push_back(t); 152 auxiliaryPointTimes.push_back(t); 153 } 76 154 } 77 155 } … … 81 159 trajectoryLine.push_back(trajectoryPointPosition); 82 160 stepPoints.push_back(trajectoryPointPosition); 83 } 84 } 161 if (validity == ValidTimes) { 162 trajectoryLineTimes.push_back(trajectoryPointPostTime); 163 stepPointTimes.push_back(trajectoryPointPostTime); 164 } 165 lastTrajectoryPointPosition = trajectoryPointPosition; 166 } 167 } 168 return validity; 85 169 } 86 170 … … 476 560 if (!context.GetDrawLine() && !context.GetDrawAuxPts() && !context.GetDrawStepPts()) return; 477 561 478 // Get points to draw 562 // Get points and times (times are returned only if time-slicing 563 // is requested). 479 564 G4Polyline trajectoryLine; 480 565 G4Polymarker stepPoints; 481 566 G4Polymarker auxiliaryPoints; 482 483 GetPoints(traj, trajectoryLine, auxiliaryPoints, stepPoints); 484 485 if (context.GetTimeSliceInterval()) { 486 487 // Get corresponding track time information, if any 488 std::vector<G4double> trajectoryLineTimes; 489 std::vector<G4double> stepPointTimes; 490 std::vector<G4double> auxiliaryPointTimes; 491 492 GetTimes(traj, trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes); 493 494 // Check validity 495 if (trajectoryLineTimes.size() != trajectoryLine.size() || 496 stepPointTimes.size() != stepPoints.size() || 497 auxiliaryPointTimes.size() != auxiliaryPoints.size()) { 498 499 // Revert to drawing without time information... 500 DrawWithoutTime(context, trajectoryLine, auxiliaryPoints, stepPoints); 501 } else { 502 503 SliceLine(context.GetTimeSliceInterval(), 504 trajectoryLine, trajectoryLineTimes); 505 506 DrawWithTime(context, 507 trajectoryLine, auxiliaryPoints, stepPoints, 508 trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes); 509 } 567 std::vector<G4double> trajectoryLineTimes; 568 std::vector<G4double> stepPointTimes; 569 std::vector<G4double> auxiliaryPointTimes; 570 571 TimesValidity validity = GetPointsAndTimes 572 (traj, context, 573 trajectoryLine, auxiliaryPoints, stepPoints, 574 trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes); 575 576 if (validity == ValidTimes) { 577 578 SliceLine(context.GetTimeSliceInterval(), 579 trajectoryLine, trajectoryLineTimes); 580 581 DrawWithTime(context, 582 trajectoryLine, auxiliaryPoints, stepPoints, 583 trajectoryLineTimes, auxiliaryPointTimes, stepPointTimes); 510 584 511 585 } else {
Note: See TracChangeset
for help on using the changeset viewer.