graxml-commit Mailing List for GraXML (Page 21)
Brought to you by:
hrivnac
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(1) |
Apr
(5) |
May
(6) |
Jun
(2) |
Jul
|
Aug
(12) |
Sep
(32) |
Oct
(41) |
Nov
(16) |
Dec
(21) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(10) |
Feb
(10) |
Mar
(3) |
Apr
(3) |
May
(10) |
Jun
(12) |
Jul
|
Aug
|
Sep
(11) |
Oct
|
Nov
|
Dec
|
2007 |
Jan
(169) |
Feb
(17) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(5) |
Oct
(100) |
Nov
(14) |
Dec
(10) |
2008 |
Jan
(37) |
Feb
(4) |
Mar
(10) |
Apr
(73) |
May
(22) |
Jun
(8) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Julius H. <hr...@us...> - 2006-05-31 14:26:20
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions/Interactivity In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv20186/net/hep/graphics/GraXML/Java3DExtensions/Interactivity Modified Files: Interacter.java Log Message: optimisation = 8,9 creates pure wireframe scenegraph Index: Interacter.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions/Interactivity/Interacter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Interacter.java 30 Mar 2005 20:36:03 -0000 1.2 --- Interacter.java 31 May 2006 14:26:13 -0000 1.3 *************** *** 27,30 **** --- 27,33 ---- * <pre> * $Log$ + * Revision 1.3 2006/05/31 14:26:13 hrivnac + * optimisation = 8,9 creates pure wireframe scenegraph + * * Revision 1.2 2005/03/30 20:36:03 hrivnac * custom exporters enabled *************** *** 101,112 **** _name = name; // Don't create interactivity if non-interactive SceneGraph is being created // or non-interactive Interacter is requested if (! _interactive) { ! addChild(node); ! // Add outline if requested ! if (node instanceof Shape3D && _outlined && outlineColor != null) { ! addChild(OutlinedShape3DFactory.create((Shape3D)node, outlineColor)); } return; } --- 104,125 ---- _name = name; + boolean wireframe = (node instanceof Shape3D && _outlined && outlineColor != null); + // Don't create interactivity if non-interactive SceneGraph is being created // or non-interactive Interacter is requested if (! _interactive) { ! if (_solid && !wireframe) { ! addChild(node); } + if (!_solid && wireframe) { + OutlinedShape3DFactory.outline((Shape3D)node, outlineColor); + addChild(node); + } + if (_solid && wireframe) { + Node clone = ((Shape3D)node).cloneNode(false); + OutlinedShape3DFactory.outline((Shape3D)clone, outlineColor); + addChild(node); + addChild(clone); + } return; } *************** *** 143,150 **** // Add Node (and its outline if requested) ! transform.addChild(node); ! if (node instanceof Shape3D && _outlined && outlineColor != null) { ! transform.addChild(OutlinedShape3DFactory.create((Shape3D)node, outlineColor)); } addChild(transform); --- 156,172 ---- // Add Node (and its outline if requested) ! if (_solid && !wireframe) { ! transform.addChild(node); } + if (!_solid && wireframe) { + OutlinedShape3DFactory.outline((Shape3D)node, outlineColor); + transform.addChild(node); + } + if (_solid && wireframe) { + Node clone = ((Shape3D)node).cloneNode(false); + OutlinedShape3DFactory.outline((Shape3D)clone, outlineColor); + transform.addChild(node); + transform.addChild(clone); + } addChild(transform); *************** *** 202,206 **** /** Give outlining status. ! * @return Wheather outlining is anabled. */ public static final boolean outlined() { return _outlined; --- 224,228 ---- /** Give outlining status. ! * @return Wheather outlining is enabled. */ public static final boolean outlined() { return _outlined; *************** *** 209,212 **** --- 231,249 ---- private static boolean _outlined = true; + /** Enable/Disable solid. + * @param outlined If solid should be enabled, + * the default is <code>true</code>. */ + public static final void setSolid(boolean solid) { + _solid = solid; + } + + /** Give solid status. + * @return Wheather solid is enabled. */ + public static final boolean solid() { + return _solid; + } + + private static boolean _solid = true; + /** Set minimal <code>Interacter</code> (i.e. just {@link BranchGroup}). * @param minimal If minimal <code>Interacter</code> should be created, |
From: Julius H. <hr...@us...> - 2006-05-31 14:26:20
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv20186/net/hep/graphics/GraXML/doc-files Modified Files: Guide.html Log Message: optimisation = 8,9 creates pure wireframe scenegraph Index: Guide.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files/Guide.html,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Guide.html 17 Jan 2006 17:39:34 -0000 1.10 --- Guide.html 31 May 2006 14:26:13 -0000 1.11 *************** *** 292,296 **** <li><tt><font color="#990000">SelectedColor.setPalette(int palette); // default = RANDOM, also possible: ATLANTIS, SOLIDATLANTIS</font></tt></li> <li><tt><font color="#990000">SelectedColor.setPaletteOffset(int offset); // default = 0</font></tt></li> ! <li><tt><font color="#990000">org.freehep.j3d.OutlinedShape.setOutlineColor(Color3f oc); // default = OutlinedShape.DARK, others = WHITE, BLACK, BRIGHT, null</font></tt></li> <li><tt><font color="#990000">Envelope.setAxis(boolean axis); // default = true</font></tt></li> <li><tt><font color="#990000">Envelope.setCylinder(boolean cylinder); // default = false</font></tt></li> --- 292,296 ---- <li><tt><font color="#990000">SelectedColor.setPalette(int palette); // default = RANDOM, also possible: ATLANTIS, SOLIDATLANTIS</font></tt></li> <li><tt><font color="#990000">SelectedColor.setPaletteOffset(int offset); // default = 0</font></tt></li> ! <li><tt><font color="#990000">org.freehep.j3d.OutlinedShape3DFactory.setOutlineColor(Color3f oc); // default = OutlinedShape3DFactory.DARK, others = WHITE, BLACK, BRIGHT, null</font></tt></li> <li><tt><font color="#990000">Envelope.setAxis(boolean axis); // default = true</font></tt></li> <li><tt><font color="#990000">Envelope.setCylinder(boolean cylinder); // default = false</font></tt></li> *************** *** 396,399 **** --- 396,400 ---- Other Builders can be added by putting costomised <code>builders.properties</code> into current directory. + <hr> <h2><a name="Help"></a>Help</h2> *************** *** 568,571 **** --- 569,576 ---- <li><b><a href="http://home.cern.ch/hrivnac/Activities/2004/September/GraXML">GraXML</a></b> (J.Hrivnac) during CHEP in Sep'04, Interlaken</li> </ul> + <li>2006:</li> + <ul> + <li><b><a href="http://home.cern.ch/hrivnac/Activities/2006/February/GraXML">Using XML for Detector Geometry Description in the Virtual Monte Carlo Framework</a></b> (V.Fine, J.Lauret, M.Potekhin, J.Hrivnac) during CHEP in Feb'06, Mumbai</li> + </ul> </ul> </ul> *************** *** 652,655 **** --- 657,661 ---- <u>Found Bugs</u> <ul> + <li>org.freehep.j3d.OutlinedShape3DFactory.setOutlineColor(null) doesn't work.</li> <li>Picking picks often several objects, which are close.</li> <li>Only one XML file can be read simultaniously.</li> *************** *** 897,900 **** --- 903,908 ---- <li>Color can be explicitely set from a specific builder.</li> <li>GraXML can be started using WebStart.</li> + <li>Java3D 1.5.0 used.</li> + <li>optimisation = 8,9 creates only wireframe.</li> </ul> <li>Bug fixes:</li> |
From: Julius H. <hr...@us...> - 2006-05-31 14:26:20
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv20186/net/hep/graphics/GraXML/FrontEnd Modified Files: GraXML.java Log Message: optimisation = 8,9 creates pure wireframe scenegraph Index: GraXML.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd/GraXML.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraXML.java 30 Mar 2005 12:44:30 -0000 1.1 --- GraXML.java 31 May 2006 14:26:13 -0000 1.2 *************** *** 1,4 **** --- 1,7 ---- package net.hep.graphics.GraXML.FrontEnd; + import java.net.URL; + import java.net.URLClassLoader; + // GraXML import net.hep.graphics.GraXML.GlobalOptions; *************** *** 14,17 **** --- 17,23 ---- * <pre> * $Log$ + * Revision 1.2 2006/05/31 14:26:13 hrivnac + * optimisation = 8,9 creates pure wireframe scenegraph + * * Revision 1.1 2005/03/30 12:44:30 hrivnac * GraXML introduced *************** *** 99,102 **** --- 105,119 ---- private static Logger log = Logger.getLogger(GraXML.class); + public void T() { + ClassLoader cl = getClass().getClassLoader().getSystemClassLoader(); + if (cl instanceof URLClassLoader) { + URLClassLoader urlcl = (URLClassLoader)cl; + URL[] urls = urlcl.getURLs(); + for (URL url : urls) { + log.info(url); + } + } + } + } |
From: Julius H. <hr...@us...> - 2006-05-31 14:26:17
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv20186/net/hep/graphics/GraXML Modified Files: Config.java Log Message: optimisation = 8,9 creates pure wireframe scenegraph Index: Config.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Config.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Config.java 30 Mar 2005 12:44:29 -0000 1.1 --- Config.java 31 May 2006 14:26:13 -0000 1.2 *************** *** 17,20 **** --- 17,23 ---- * <pre> * $Log$ + * Revision 1.2 2006/05/31 14:26:13 hrivnac + * optimisation = 8,9 creates pure wireframe scenegraph + * * Revision 1.1 2005/03/30 12:44:29 hrivnac * GraXML introduced *************** *** 112,127 **** OptimisationDB.setGroupOptimisation(GlobalOptions.optimisation() > 6); } ! private static final void setExtensions() { // - Interacter Interacter.setInteractivity(GlobalOptions.optimisation() < 6); - Interacter.setOutlined(GlobalOptions.optimisation() < 6); Interacter.setMinimal(!GlobalOptions.graphical()); // - SelectedColor SelectedColor.setLineAntiAliasing(GlobalOptions.quality() > 5); - // - OutlinedShape3DFactory - OutlinedShape3DFactory.setOutlineColor(GlobalOptions.quality() > 4 ? DARK : null); } ! private static final void setDisconnecter() { DetachableConnection.setDisconnected(GlobalOptions.graphical() && DetachableConnection.disconnected()); --- 115,133 ---- OptimisationDB.setGroupOptimisation(GlobalOptions.optimisation() > 6); } ! private static final void setExtensions() { // - Interacter + // optimisation = <0,5> - outlined solid + // <6,7> - solid + // <8,9> - wireframe + Interacter.setSolid( GlobalOptions.optimisation() < 8); + Interacter.setOutlined(GlobalOptions.optimisation() < 6 || + GlobalOptions.optimisation() > 7); Interacter.setInteractivity(GlobalOptions.optimisation() < 6); Interacter.setMinimal(!GlobalOptions.graphical()); // - SelectedColor SelectedColor.setLineAntiAliasing(GlobalOptions.quality() > 5); } ! private static final void setDisconnecter() { DetachableConnection.setDisconnected(GlobalOptions.graphical() && DetachableConnection.disconnected()); |
From: Julius H. <hr...@us...> - 2006-04-18 21:37:49
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Schema In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24692/net/hep/AGDD/Schema Modified Files: AGDD.xsd Log Message: compositions in BuildingBlocks Index: AGDD.xsd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Schema/AGDD.xsd,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AGDD.xsd 23 Dec 2005 12:48:42 -0000 1.7 --- AGDD.xsd 18 Apr 2006 21:37:39 -0000 1.8 *************** *** 2,5 **** --- 2,8 ---- <!-- $Log$ + Revision 1.8 2006/04/18 21:37:39 hrivnac + compositions in BuildingBlocks + Revision 1.7 2005/12/23 12:48:42 hrivnac schema should be in the current directory *************** *** 154,158 **** of detector. A section is primarily made of "volume" elements but also may receive a set of named and typed parameter blocks (used to specify ! constants). Solids can be encapsulated in a buildingBlock. <br></br> Attributes of section are: --- 157,161 ---- of detector. A section is primarily made of "volume" elements but also may receive a set of named and typed parameter blocks (used to specify ! constants). Solids and variables can be encapsulated in a buildingBlock. <br></br> Attributes of section are: *************** *** 1123,1127 **** <xs:annotation> <xs:documentation> ! BuildingBlock can encapsulate a set of Solids </xs:documentation> </xs:annotation> --- 1126,1130 ---- <xs:annotation> <xs:documentation> ! BuildingBlock can encapsulate a set of other elements. </xs:documentation> </xs:annotation> *************** *** 1132,1135 **** --- 1135,1139 ---- <xs:element ref="abstractBooleanVolume"/> <xs:element ref="abstractData"/> + <xs:element ref="composition"/> </xs:choice> <xs:attribute ref="xml:base" xmlns:xml="http://www.w3.org/XML/1998/namespace"/> |
From: Julius H. <hr...@us...> - 2006-04-18 21:37:49
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24692/net/hep/AGDD/Test/data Modified Files: IncludedBuildingBlockSolids.agdd IncludedBuildingBlockVariables.agdd IncludedComposition.agdd Including.agdd Log Message: compositions in BuildingBlocks Index: IncludedComposition.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/IncludedComposition.agdd,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** IncludedComposition.agdd 1 Feb 2006 11:27:43 -0000 1.2 --- IncludedComposition.agdd 18 Apr 2006 21:37:39 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/04/18 21:37:39 hrivnac + compositions in BuildingBlocks + Revision 1.2 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used *************** *** 20,23 **** <composition name="TEST"> ! <posXYZ X_Y_Z=" 2*var1; 2000; 0"> <volume name="box"/> </posXYZ> </composition> --- 23,28 ---- <composition name="TEST"> ! <var name="var1" value="1000"/> ! <posXYZ X_Y_Z=" 0; 0; 2*z"> <volume name="comp1"/> </posXYZ> ! <posXYZ X_Y_Z=" 0; 0; 3*z"> <volume name="comp2"/> </posXYZ> </composition> Index: IncludedBuildingBlockSolids.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/IncludedBuildingBlockSolids.agdd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IncludedBuildingBlockSolids.agdd 1 Feb 2006 11:27:43 -0000 1.1 --- IncludedBuildingBlockSolids.agdd 18 Apr 2006 21:37:39 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.2 2006/04/18 21:37:39 hrivnac + compositions in BuildingBlocks + Revision 1.1 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used *************** *** 11,14 **** <buildingBlock> ! <box name="box" medium="active" X_Y_Z="var1; 2000; 8000"/> </buildingBlock> --- 14,18 ---- <buildingBlock> ! <var name="xyz" value="1000"/> ! <box name="box" medium="active" X_Y_Z="1000; 1000; 1000"/> </buildingBlock> Index: IncludedBuildingBlockVariables.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/IncludedBuildingBlockVariables.agdd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IncludedBuildingBlockVariables.agdd 1 Feb 2006 11:27:43 -0000 1.1 --- IncludedBuildingBlockVariables.agdd 18 Apr 2006 21:37:39 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.2 2006/04/18 21:37:39 hrivnac + compositions in BuildingBlocks + Revision 1.1 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used *************** *** 11,14 **** <buildingBlock> ! <var name="var1" value="1000"/> </buildingBlock> --- 14,17 ---- <buildingBlock> ! <var name="z" value="3000"/> </buildingBlock> Index: Including.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/Including.agdd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Including.agdd 1 Feb 2006 11:27:43 -0000 1.5 --- Including.agdd 18 Apr 2006 21:37:39 -0000 1.6 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.6 2006/04/18 21:37:39 hrivnac + compositions in BuildingBlocks + Revision 1.5 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used *************** *** 42,45 **** --- 45,49 ---- <xi:include href="IncludedBuildingBlockSolids.agdd"/> <xi:include href="IncludedComposition.agdd"/> + <xi:include href="IncludedBuildingBlockCompositions.agdd"/> </section> |
From: Julius H. <hr...@us...> - 2006-04-18 21:37:48
|
Update of /cvsroot/graxml/DetDescr/AGDD/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24692 Modified Files: index.html Log Message: compositions in BuildingBlocks Index: index.html =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/index.html,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** index.html 1 Feb 2006 11:27:43 -0000 1.17 --- index.html 18 Apr 2006 21:37:39 -0000 1.18 *************** *** 38,42 **** <a href="Examples/IncludedBuildingBlockVariables.agdd">IncludedBuildingBlockVariables.agdd</a>, <a href="Examples/IncludedBuildingBlockSolids.agdd">IncludedBuildingBlockSolids.agdd</a>, ! <a href="Examples/IncludedComposition.agdd">IncludedComposition.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Including.wrl.gz">Including.wrl</a></li> <li><a href="Examples/MultiplePositioners.agdd">MultiplePositioners.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/MultiplePositioners.wrl.gz">MultiplePositioners.wrl</a></li> <li><a href="Examples/ParametrisedColors.agdd">ParametrisedColors.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/ParametrisedColors.wrl.gz">ParametrisedColors.wrl</a></li> --- 38,43 ---- <a href="Examples/IncludedBuildingBlockVariables.agdd">IncludedBuildingBlockVariables.agdd</a>, <a href="Examples/IncludedBuildingBlockSolids.agdd">IncludedBuildingBlockSolids.agdd</a>, ! <a href="Examples/IncludedComposition.agdd">IncludedComposition.agdd</a>, ! <a href="Examples/IncludedBuildingBlockCompositions.agdd">IncludedBuildingBlockCompositions.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Including.wrl.gz">Including.wrl</a></li> <li><a href="Examples/MultiplePositioners.agdd">MultiplePositioners.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/MultiplePositioners.wrl.gz">MultiplePositioners.wrl</a></li> <li><a href="Examples/ParametrisedColors.agdd">ParametrisedColors.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/ParametrisedColors.wrl.gz">ParametrisedColors.wrl</a></li> *************** *** 129,132 **** --- 130,134 ---- <li>Flexible Color specification included.</li> <li>BuildingBlock included.</li> + <li>Multiple compositions can be xincluded inside buildingBlock.</li> </ul> </li> |
Update of /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8953/net/hep/geant4/GDML/Test/data Modified Files: Booleans.gdml BooleansWithTransformation.gdml Parametrisations.gdml Replications.gdml Rotations.gdml Solids.gdml Log Message: dimensions interpreted as in Geant4 Index: Parametrisations.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/Parametrisations.gdml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Parametrisations.gdml 23 Dec 2005 11:09:41 -0000 1.2 --- Parametrisations.gdml 1 Mar 2006 11:06:49 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.2 2005/12/23 11:09:41 hrivnac schema should be in the current directory *************** *** 49,55 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="300" y="300" z="300"/> ! <box name="box" x="500" y="700" z="900"/> ! <tube name="tube" rmin="0" rmax="700" z="1000" startphi="0" deltaphi="TWOPI"/> </solids> --- 52,58 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="600" y="600" z="600"/> ! <box name="box" x="1000" y="1400" z="1800"/> ! <tube name="tube" rmin="0" rmax="700" z="2000" startphi="0" deltaphi="TWOPI"/> </solids> Index: Booleans.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/Booleans.gdml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Booleans.gdml 23 Dec 2005 11:09:41 -0000 1.2 --- Booleans.gdml 1 Mar 2006 11:06:49 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.2 2005/12/23 11:09:41 hrivnac schema should be in the current directory *************** *** 63,67 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <cone name="cone_full" rmin1="500" rmax1="1000" rmin2="1000" rmax2="1400" z="4000" startphi="0" deltaphi="PI"/> <sphere name="sphere_full" rmin="800" rmax="1500" startphi="HALFPI" deltaphi="PI" starttheta="0" deltatheta="PI"/> <union name="union"> --- 66,70 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <cone name="cone_full" rmin1="500" rmax1="1000" rmin2="1000" rmax2="1400" z="8000" startphi="0" deltaphi="PI"/> <sphere name="sphere_full" rmin="800" rmax="1500" startphi="HALFPI" deltaphi="PI" starttheta="0" deltatheta="PI"/> <union name="union"> Index: Replications.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/Replications.gdml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Replications.gdml 23 Dec 2005 11:09:41 -0000 1.2 --- Replications.gdml 1 Mar 2006 11:06:49 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.2 2005/12/23 11:09:41 hrivnac schema should be in the current directory *************** *** 51,56 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="300" y="300" z="300"/> ! <box name="box" x="400" y="600" z="800"/> </solids> --- 54,59 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="600" y="600" z="600"/> ! <box name="box" x="800" y="1200" z="1600"/> </solids> Index: BooleansWithTransformation.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/BooleansWithTransformation.gdml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BooleansWithTransformation.gdml 30 Mar 2005 13:51:16 -0000 1.1 --- BooleansWithTransformation.gdml 1 Mar 2006 11:06:49 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.2 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.1 2005/03/30 13:51:16 hrivnac GDML added *************** *** 44,49 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box" x="1000" y="1000" z="2000"/> ! <cone name="cone" rmin1="0" rmax1="300" rmin2="0" rmax2="700" z="3000" startphi="0" deltaphi="TWOPI"/> <subtraction name="no"> <first ref="box"/> --- 47,52 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box" x="2000" y="2000" z="4000"/> ! <cone name="cone" rmin1="0" rmax1="300" rmin2="0" rmax2="700" z="6000" startphi="0" deltaphi="TWOPI"/> <subtraction name="no"> <first ref="box"/> Index: Rotations.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/Rotations.gdml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Rotations.gdml 23 Dec 2005 11:09:41 -0000 1.2 --- Rotations.gdml 1 Mar 2006 11:06:49 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.2 2005/12/23 11:09:41 hrivnac schema should be in the current directory *************** *** 60,65 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="300" y="300" z="300"/> ! <box name="box" x="200" y="400" z="800"/> </solids> --- 63,68 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box0" x="600" y="600" z="600"/> ! <box name="box" x="400" y="800" z="1600"/> </solids> Index: Solids.gdml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/Test/data/Solids.gdml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Solids.gdml 23 Dec 2005 11:09:41 -0000 1.2 --- Solids.gdml 1 Mar 2006 11:06:49 -0000 1.3 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.3 2006/03/01 11:06:49 hrivnac + dimensions interpreted as in Geant4 + Revision 1.2 2005/12/23 11:09:41 hrivnac schema should be in the current directory *************** *** 97,161 **** <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box" x="500" y="1000" z="4000"/> ! <trd name="trd" x1="200" x2="500" y1="600" y2="1000" z="4000"/> ! <trap name="trap" x1="300" x2="200" x3="600" x4="400" y1="500" y2="1000" z="4000" alpha1="0.3" alpha2="0.4" phi="0.4" theta="0.2"/> ! <para name="para" x="500" y="1000" z="4000" alpha="0.3" phi="0.4" theta="0.2"/> ! <cone name="cone_full" rmin1=" 0" rmax1="1000" rmin2=" 0" rmax2="1400" z="4000" startphi="0" deltaphi="TWOPI"/> ! <cone name="cone_hole" rmin1="500" rmax1="1000" rmin2="900" rmax2="1400" z="4000" startphi="0" deltaphi="TWOPI"/> ! <cone name="cone_angle" rmin1="500" rmax1="1000" rmin2="900" rmax2="1400" z="4000" startphi="0" deltaphi="HALFPI"/> ! <tube name="tube_full" rmin=" 0" rmax="1000" z="4000" startphi="0" deltaphi="TWOPI"/> ! <tube name="tube_hole" rmin="500" rmax="1000" z="4000" startphi="0" deltaphi="TWOPI"/> ! <tube name="tube_angle" rmin="500" rmax="1000" z="4000" startphi="0" deltaphi="HALFPI"/> <sphere name="sphere_full" rmin=" 0" rmax="1400" startphi="0.0" deltaphi="TWOPI" starttheta="0.0" deltatheta="PI"/> <sphere name="sphere_hole" rmin="1000" rmax="1400" startphi="0.5" deltaphi="5.0" starttheta="0.5" deltatheta="1.5"/> <sphere name="sphere_angle" rmin=" 0" rmax="1400" startphi="0.5" deltaphi="5.0" starttheta="0.5" deltatheta="1.5"/> <orb name="orb" r="1400"/> ! <eltube name="eltube" dx="500" dy="1000" dz="4000"/> ! <hype name="hype_full" rmin=" 0" rmax="500" z="4000" inst="0.0" outst="0.5"/> ! <hype name="hype_hole" rmin="400" rmax="500" z="4000" inst="0.3" outst="0.5"/> <torus name="torus_full" rmin=" 0" rmax="500" rtor="800" startphi="0.0" deltaphi="TWOPI"/> <torus name="torus_hole" rmin=" 0" rmax="500" rtor="800" startphi="0.5" deltaphi="5.0"/> <torus name="torus_angle" rmin=" 200" rmax="500" rtor="800" startphi="0.5" deltaphi="5.0"/> <polycone name="polycone_full" startphi="0.0" deltaphi="TWOPI"> ! <zplane z="-2000" rmin=" 0" rmax=" 500"/> ! <zplane z="-1000" rmin=" 0" rmax=" 900"/> <zplane z=" 0" rmin=" 0" rmax="1000"/> ! <zplane z=" 1000" rmin=" 0" rmax=" 800"/> ! <zplane z=" 2000" rmin=" 0" rmax="1400"/> </polycone> <polycone name="polycone_hole" startphi="0.0" deltaphi="TWOPI"> ! <zplane z="-2000" rmin=" 100" rmax=" 500"/> ! <zplane z="-1000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 1000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 2000" rmin="1300" rmax="1400"/> </polycone> <polycone name="polycone_angle" startphi="0.5" deltaphi="5.0"> ! <zplane z="-2000" rmin=" 100" rmax=" 500"/> ! <zplane z="-1000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 1000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 2000" rmin="1300" rmax="1400"/> </polycone> <polyhedra name="polyhedra_full" startphi="0.0" totalphi="TWOPI" numsides="5"> ! <zplane z="-2000" rmin=" 0" rmax=" 500"/> ! <zplane z="-1000" rmin=" 0" rmax=" 900"/> <zplane z=" 0" rmin=" 0" rmax="1000"/> ! <zplane z=" 1000" rmin=" 0" rmax=" 800"/> ! <zplane z=" 2000" rmin=" 0" rmax="1400"/> </polyhedra> <polyhedra name="polyhedra_hole" startphi="0.0" totalphi="TWOPI" numsides="5"> ! <zplane z="-2000" rmin=" 100" rmax=" 500"/> ! <zplane z="-1000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 1000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 2000" rmin="1300" rmax="1400"/> </polyhedra> <polyhedra name="polyhedra_angle" startphi="0.5" totalphi="5.0" numsides="5"> ! <zplane z="-2000" rmin=" 100" rmax=" 500"/> ! <zplane z="-1000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 1000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 2000" rmin="1300" rmax="1400"/> </polyhedra> </solids> --- 100,164 ---- <solids> <box name="WorldBox" x="100000" y="100000" z="100000"/> ! <box name="box" x="1000" y="2000" z="8000"/> ! <trd name="trd" x1="400" x2="1000" y1="1200" y2="2000" z="8000"/> ! <trap name="trap" x1="600" x2="400" x3="1200" x4="800" y1="1000" y2="2000" z="8000" alpha1="0.3" alpha2="0.4" phi="0.4" theta="0.2"/> ! <para name="para" x="1000" y="2000" z="8000" alpha="0.3" phi="0.4" theta="0.2"/> ! <cone name="cone_full" rmin1=" 0" rmax1="1000" rmin2=" 0" rmax2="1400" z="8000" startphi="0" deltaphi="TWOPI"/> ! <cone name="cone_hole" rmin1="500" rmax1="1000" rmin2="900" rmax2="1400" z="8000" startphi="0" deltaphi="TWOPI"/> ! <cone name="cone_angle" rmin1="500" rmax1="1000" rmin2="900" rmax2="1400" z="8000" startphi="0" deltaphi="HALFPI"/> ! <tube name="tube_full" rmin=" 0" rmax="1000" z="8000" startphi="0" deltaphi="TWOPI"/> ! <tube name="tube_hole" rmin="500" rmax="1000" z="8000" startphi="0" deltaphi="TWOPI"/> ! <tube name="tube_angle" rmin="500" rmax="1000" z="8000" startphi="0" deltaphi="HALFPI"/> <sphere name="sphere_full" rmin=" 0" rmax="1400" startphi="0.0" deltaphi="TWOPI" starttheta="0.0" deltatheta="PI"/> <sphere name="sphere_hole" rmin="1000" rmax="1400" startphi="0.5" deltaphi="5.0" starttheta="0.5" deltatheta="1.5"/> <sphere name="sphere_angle" rmin=" 0" rmax="1400" startphi="0.5" deltaphi="5.0" starttheta="0.5" deltatheta="1.5"/> <orb name="orb" r="1400"/> ! <eltube name="eltube" dx="500" dy="1000" dz="8000"/> ! <hype name="hype_full" rmin=" 0" rmax="200" z="8000" inst="0.0" outst="0.3"/> ! <hype name="hype_hole" rmin="400" rmax="800" z="8000" inst="0.1" outst="0.3"/> <torus name="torus_full" rmin=" 0" rmax="500" rtor="800" startphi="0.0" deltaphi="TWOPI"/> <torus name="torus_hole" rmin=" 0" rmax="500" rtor="800" startphi="0.5" deltaphi="5.0"/> <torus name="torus_angle" rmin=" 200" rmax="500" rtor="800" startphi="0.5" deltaphi="5.0"/> <polycone name="polycone_full" startphi="0.0" deltaphi="TWOPI"> ! <zplane z="-4000" rmin=" 0" rmax=" 500"/> ! <zplane z="-2000" rmin=" 0" rmax=" 900"/> <zplane z=" 0" rmin=" 0" rmax="1000"/> ! <zplane z=" 2000" rmin=" 0" rmax=" 800"/> ! <zplane z=" 4000" rmin=" 0" rmax="1400"/> </polycone> <polycone name="polycone_hole" startphi="0.0" deltaphi="TWOPI"> ! <zplane z="-4000" rmin=" 100" rmax=" 500"/> ! <zplane z="-2000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 2000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 4000" rmin="1300" rmax="1400"/> </polycone> <polycone name="polycone_angle" startphi="0.5" deltaphi="5.0"> ! <zplane z="-4000" rmin=" 100" rmax=" 500"/> ! <zplane z="-2000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 2000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 4000" rmin="1300" rmax="1400"/> </polycone> <polyhedra name="polyhedra_full" startphi="0.0" totalphi="TWOPI" numsides="5"> ! <zplane z="-4000" rmin=" 0" rmax=" 500"/> ! <zplane z="-2000" rmin=" 0" rmax=" 900"/> <zplane z=" 0" rmin=" 0" rmax="1000"/> ! <zplane z=" 2000" rmin=" 0" rmax=" 800"/> ! <zplane z=" 4000" rmin=" 0" rmax="1400"/> </polyhedra> <polyhedra name="polyhedra_hole" startphi="0.0" totalphi="TWOPI" numsides="5"> ! <zplane z="-4000" rmin=" 100" rmax=" 500"/> ! <zplane z="-2000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 2000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 4000" rmin="1300" rmax="1400"/> </polyhedra> <polyhedra name="polyhedra_angle" startphi="0.5" totalphi="5.0" numsides="5"> ! <zplane z="-4000" rmin=" 100" rmax=" 500"/> ! <zplane z="-2000" rmin=" 700" rmax=" 900"/> <zplane z=" 0" rmin=" 200" rmax="1000"/> ! <zplane z=" 2000" rmin=" 300" rmax=" 800"/> ! <zplane z=" 4000" rmin="1300" rmax="1400"/> </polyhedra> </solids> |
From: Julius H. <hr...@us...> - 2006-03-01 11:06:56
|
Update of /cvsroot/graxml/DetDescr/GDML/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8953 Modified Files: index.html Log Message: dimensions interpreted as in Geant4 Index: index.html =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/index.html,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.html 12 Aug 2005 09:26:44 -0000 1.5 --- index.html 1 Mar 2006 11:06:48 -0000 1.6 *************** *** 128,132 **** <li>Bug fixes: <ul> ! <li>...</li> </ul> </li> --- 128,132 ---- <li>Bug fixes: <ul> ! <li>Lengths made conform to Geant4 conventions (thanks to John Watts).</li> </ul> </li> |
From: Julius H. <hr...@us...> - 2006-03-01 11:06:56
|
Update of /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8953/net/hep/geant4/GDML/GeometricModel/Reps Modified Files: Box.java Cone.java Para.java Trap.java Trd.java Tube.java Log Message: dimensions interpreted as in Geant4 Index: Trd.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Trd.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Trd.java 30 Mar 2005 13:51:16 -0000 1.1 --- Trd.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 28,31 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 109,117 **** // Create Trapezod and use it ! use(new Trapezoid(2*x2, ! 2*x1, ! 2*y1, ! 2*y2, ! 2*z, builder.appearance(name0, builder().material())), name, --- 112,120 ---- // Create Trapezod and use it ! use(new Trapezoid(x2, ! x1, ! y1, ! y2, ! z, builder.appearance(name0, builder().material())), name, Index: Tube.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Tube.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Tube.java 30 Mar 2005 13:51:16 -0000 1.1 --- Tube.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 29,32 **** --- 29,35 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 103,107 **** use(new ConeSegment(rmin, rmax, ! 2*z, phi0, phi0 + delphi, --- 106,110 ---- use(new ConeSegment(rmin, rmax, ! z, phi0, phi0 + delphi, Index: Box.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Box.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Box.java 30 Mar 2005 13:51:16 -0000 1.1 --- Box.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 28,31 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 125,131 **** // Create Trapezod and use it ! use(new Trapezoid(2*x, ! 2*y, ! 2*z, builder.appearance(name0, builder().material())), name, --- 128,134 ---- // Create Trapezod and use it ! use(new Trapezoid(x, ! y, ! z, builder.appearance(name0, builder().material())), name, Index: Para.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Para.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Para.java 30 Mar 2005 13:51:16 -0000 1.1 --- Para.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 116,126 **** // Create Trapezod and use it ! use(new Trapezoid(2*x, ! 2*x, ! 2*x, ! 2*x, ! 2*y, ! 2*y, ! 2*z, atan(tan(theta) * cos(phi)), atan(tan(theta) * sin(phi)), --- 119,129 ---- // Create Trapezod and use it ! use(new Trapezoid(x, ! x, ! x, ! x, ! y, ! y, ! z, atan(tan(theta) * cos(phi)), atan(tan(theta) * sin(phi)), Index: Trap.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Trap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Trap.java 30 Mar 2005 13:51:16 -0000 1.1 --- Trap.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 34,37 **** --- 34,40 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 124,134 **** // Create Trapezod and use it ! use(new Trapezoid(2*x2, ! 2*x1, ! 2*x4, ! 2*x3, ! 2*y1, ! 2*y2, ! 2*z, atan(tan(theta) * cos(phi)), atan(tan(theta) * sin(phi)), --- 127,137 ---- // Create Trapezod and use it ! use(new Trapezoid(x2, ! x1, ! x4, ! x3, ! y1, ! y2, ! z, atan(tan(theta) * cos(phi)), atan(tan(theta) * sin(phi)), Index: Cone.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/src/net/hep/geant4/GDML/GeometricModel/Reps/Cone.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Cone.java 30 Mar 2005 13:51:16 -0000 1.1 --- Cone.java 1 Mar 2006 11:06:48 -0000 1.2 *************** *** 29,32 **** --- 29,35 ---- * <pre> * $Log$ + * Revision 1.2 2006/03/01 11:06:48 hrivnac + * dimensions interpreted as in Geant4 + * * Revision 1.1 2005/03/30 13:51:16 hrivnac * GDML added *************** *** 113,117 **** rmax1, rmax2, ! 2*z, phi0, phi0 + delphi, --- 116,120 ---- rmax1, rmax2, ! z, phi0, phi0 + delphi, |
From: starXML <st...@us...> - 2006-02-09 20:09:55
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22658/AGDD/src/net/hep/AGDD/TGeoModel/Reps Modified Files: Box.java Para.java Trap.java Trd.java Log Message: Updated the code for better structure. Para and Trap still not functional. Index: Trap.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps/Trap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Trap.java 9 Feb 2006 19:25:54 -0000 1.1 --- Trap.java 9 Feb 2006 20:09:47 -0000 1.2 *************** *** 31,36 **** * <pre> * $Log$ ! * Revision 1.1 2006/02/09 19:25:54 starxml ! * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac --- 31,36 ---- * <pre> * $Log$ ! * Revision 1.2 2006/02/09 20:09:47 starxml ! * Updated the code for better structure. Para and Trap still not functional. * * Revision 1.3 2005/03/24 14:24:30 hrivnac *************** *** 74,102 **** String name0 = trap.getName(); String name = builder().name(name0); // Verify reuse ! if (isLink(name0, name, parent, tg)) { ! return; ! } ! ! // Create Trapezod and use it ! // builder().setMaterial(trap.getMaterial().toString()); ! use(new Trapezoid(xmumdpupdympz[0], ! xmumdpupdympz[1], ! xmumdpupdympz[2], ! xmumdpupdympz[3], ! xmumdpupdympz[4], ! xmumdpupdympz[5], ! xmumdpupdympz[6], ! inclination[0], ! inclination[1], ! declination[0], ! declination[1], ! builder.appearance(name0, builder().material())), ! name, ! parent, ! tg); ! } /** Logging . */ --- 74,98 ---- String name0 = trap.getName(); String name = builder().name(name0); + setColor(trap); // Verify reuse ! if (!isLink(name0, name, parent, tg)) { ! use(new Trapezoid(xmumdpupdympz[0], ! xmumdpupdympz[1], ! xmumdpupdympz[2], ! xmumdpupdympz[3], ! xmumdpupdympz[4], ! xmumdpupdympz[5], ! xmumdpupdympz[6], ! inclination[0], ! inclination[1], ! declination[0], ! declination[1], ! builder().appearance(name0, rgb(), transparency())), ! name, ! parent, ! tg); } + } /** Logging . */ Index: Box.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps/Box.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Box.java 8 Feb 2006 21:20:14 -0000 1.1 --- Box.java 9 Feb 2006 20:09:47 -0000 1.2 *************** *** 36,41 **** * <pre> * $Log$ ! * Revision 1.1 2006/02/08 21:20:14 starxml ! * This is a first check-in of the working Box rep in the AGDD/TGeo system * * </pre> --- 36,41 ---- * <pre> * $Log$ ! * Revision 1.2 2006/02/09 20:09:47 starxml ! * Updated the code for better structure. Para and Trap still not functional. * * </pre> *************** *** 67,73 **** setColor(box); - String x = evaluator.formatted(xyz[0]/2.0f); - String y = evaluator.formatted(xyz[1]/2.0f); - String z = evaluator.formatted(xyz[2]/2.0f); if (!isLink(name0, name, parent, tg)) { // Verify reuse --- 67,70 ---- *************** *** 77,82 **** --- 74,84 ---- //------------------------------------- TGEO ProcessMediumAndMaterial(element); + + String x = evaluator.formatted(xyz[0]/2.0f); + String y = evaluator.formatted(xyz[1]/2.0f); + String z = evaluator.formatted(xyz[2]/2.0f); String key = _nameCore+";"+x+";"+y+";"+z; String agddName=""; + if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); Index: Trd.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps/Trd.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Trd.java 9 Feb 2006 19:25:54 -0000 1.1 --- Trd.java 9 Feb 2006 20:09:47 -0000 1.2 *************** *** 29,34 **** * <pre> * $Log$ ! * Revision 1.1 2006/02/09 19:25:54 starxml ! * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac --- 29,34 ---- * <pre> * $Log$ ! * Revision 1.2 2006/02/09 20:09:47 starxml ! * Updated the code for better structure. Para and Trap still not functional. * * Revision 1.3 2005/03/24 14:24:30 hrivnac *************** *** 49,106 **** public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { ! // Verify and set builder type ! setBuilder(builder); - // Verify element type if (! (element instanceof TrdType)) { ! log.error(element + " can't be traversed using " + getClass().getName() + " representation"); ! return; ! } // Get element properties Evaluator evaluator = builder().evaluator(); TrdType trd = (TrdType)element; // not used: trd.isSensitive(); String lUnit = trd.getUnitLength(); String aUnit = trd.getUnitAngle(); float[] xmpympz = evaluator.valueOf(trd.getXmpYmpZ(), lUnit); float[] inclination = evaluator.valueOf(trd.getInclination(), lUnit); String name0 = trd.getName(); String name = builder().name(name0); ! // Verify reuse ! if (isLink(name0, name, parent, tg)) { ! return; ! } ! ! // Create Trapezod and use it ! // builder().setMaterial(trd.getMaterial().toString()); ! use(new Trapezoid(xmpympz[0], ! xmpympz[1], ! xmpympz[2], ! xmpympz[3], ! xmpympz[4], ! inclination[0], ! inclination[1], ! builder.appearance(name0, builder().material())), ! name, ! parent, ! tg); ! ! String x1 = evaluator.formatted(xmpympz[0]/2.0f); ! String x2 = evaluator.formatted(xmpympz[1]/2.0f); ! String y1 = evaluator.formatted(xmpympz[2]/2.0f); ! String y2 = evaluator.formatted(xmpympz[3]/2.0f); ! String dz = evaluator.formatted(xmpympz[4]/2.0f); ! String key = _nameCore+";"+x1+";"+x2+";"+y1+";"+y2+";"+dz; ! System.out.println("trd "+_nameCore+" key: "+key); String agddName=""; ! //----------------------- TGEO if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); ! System.out.println("Creating trd "+ agddName); ! builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeTrd2(\""+agddName+"\",medSTANDARD,"+x1+","+x2+","+y1+","+y2+","+dz+");"); } else { --- 49,102 ---- public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { ! setBuilder(builder); // Verify and set builder type if (! (element instanceof TrdType)) { ! log.error(element + " can't be traversed using " + getClass().getName() + " representation"); ! return; ! } // Get element properties Evaluator evaluator = builder().evaluator(); TrdType trd = (TrdType)element; + // not used: trd.isSensitive(); String lUnit = trd.getUnitLength(); String aUnit = trd.getUnitAngle(); + float[] xmpympz = evaluator.valueOf(trd.getXmpYmpZ(), lUnit); float[] inclination = evaluator.valueOf(trd.getInclination(), lUnit); String name0 = trd.getName(); String name = builder().name(name0); + setColor(trd); ! if (!isLink(name0, name, parent, tg)) { // Verify reuse ! use(new Trapezoid(xmpympz[0], ! xmpympz[1], ! xmpympz[2], ! xmpympz[3], ! xmpympz[4], ! inclination[0], ! inclination[1], ! builder().appearance(name0, rgb(), transparency())), ! name, ! parent, ! tg); ! } + //------------------------------------- TGEO + ProcessMediumAndMaterial(element); ! String x1 = evaluator.formatted(xmpympz[0]/2.0f); ! String x2 = evaluator.formatted(xmpympz[1]/2.0f); ! String y1 = evaluator.formatted(xmpympz[2]/2.0f); ! String y2 = evaluator.formatted(xmpympz[3]/2.0f); ! String dz = evaluator.formatted(xmpympz[4]/2.0f); ! String key = _nameCore+";"+x1+";"+x2+";"+y1+";"+y2+";"+dz; // System.out.println("trd "+_nameCore+" key: "+key); String agddName=""; ! if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); ! System.out.println("Creating trd "+ agddName + " made of "+_medName); ! builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeTrd2(\""+agddName+"\","+_medName+","+x1+","+x2+","+y1+","+y2+","+dz+");"); } else { Index: Para.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps/Para.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Para.java 9 Feb 2006 19:25:54 -0000 1.1 --- Para.java 9 Feb 2006 20:09:47 -0000 1.2 *************** *** 35,40 **** * <pre> * $Log$ ! * Revision 1.1 2006/02/09 19:25:54 starxml ! * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac --- 35,40 ---- * <pre> * $Log$ ! * Revision 1.2 2006/02/09 20:09:47 starxml ! * Updated the code for better structure. Para and Trap still not functional. * * Revision 1.3 2005/03/24 14:24:30 hrivnac *************** *** 55,66 **** public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { ! // Verify and set builder type ! setBuilder(builder); - // Verify element type if (! (element instanceof ParaType)) { ! log.error(element + " can't be traversed using " + getClass().getName() + " representation"); ! return; ! } // Get element properties --- 55,64 ---- public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { ! setBuilder(builder); // Verify and set builder type if (! (element instanceof ParaType)) { ! log.error(element + " can't be traversed using " + getClass().getName() + " representation"); ! return; ! } // Get element properties *************** *** 70,73 **** --- 68,72 ---- String lUnit = para.getUnitLength(); String aUnit = para.getUnitAngle(); + float[] xyz = evaluator.valueOf(para.getXYZ(), lUnit); float[] alpha = evaluator.valueOf(para.getAlpha(), aUnit); *************** *** 76,104 **** String name0 = para.getName(); String name = builder().name(name0); // Verify reuse ! if (isLink(name0, name, parent, tg)) { ! return; ! } ! ! // Create Trapezod and use it ! // builder().setMaterial(para.getMaterial().toString()); ! use(new Trapezoid(xyz[0], ! xyz[0], ! xyz[0], ! xyz[0], ! xyz[1], ! xyz[1], ! xyz[2], ! atan(tan(theta[0]) * cos(phi[0])), ! atan(tan(theta[0]) * sin(phi[0])), ! alpha[0], ! alpha[0], ! builder.appearance(name0, builder().material())), ! name, ! parent, ! tg); ! } /** Logging . */ --- 75,100 ---- String name0 = para.getName(); String name = builder().name(name0); + setColor(para); // Verify reuse ! if (!isLink(name0, name, parent, tg)) { ! use(new Trapezoid(xyz[0], ! xyz[0], ! xyz[0], ! xyz[0], ! xyz[1], ! xyz[1], ! xyz[2], ! atan(tan(theta[0]) * cos(phi[0])), ! atan(tan(theta[0]) * sin(phi[0])), ! alpha[0], ! alpha[0], ! builder.appearance(name0, builder().material())), ! name, ! parent, ! tg); } + + } /** Logging . */ |
From: starXML <st...@us...> - 2006-02-09 19:26:06
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4290/AGDD/src/net/hep/AGDD/TGeoModel/Reps Added Files: MposR.java MposWedge.java Para.java Trap.java Trd.java Log Message: --- NEW FILE: Trap.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.TrapType; import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.Trapezoid; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>trap</code> AGDD element * connected via JAXB {@link TrapType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Trap.java,v $ * Revision 1.1 2006/02/09 19:25:54 starxml * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Trap.java,v 1.1 2006/02/09 19:25:54 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Trap extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof TrapType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); TrapType trap = (TrapType)element; Medium med = (Medium) trap.getMedium(); Material mat = (Material) med.getMaterial(); // not used: trap.isSensitive(); String lUnit = trap.getUnitLength(); String aUnit = trap.getUnitAngle(); float[] xmumdpupdympz = evaluator.valueOf(trap.getXmumdpupdYmpZ(), lUnit); float[] inclination = evaluator.valueOf(trap.getInclination(), lUnit); float[] declination = evaluator.valueOf(trap.getDeclination(), lUnit); String name0 = trap.getName(); String name = builder().name(name0); // Verify reuse if (isLink(name0, name, parent, tg)) { return; } // Create Trapezod and use it // builder().setMaterial(trap.getMaterial().toString()); use(new Trapezoid(xmumdpupdympz[0], xmumdpupdympz[1], xmumdpupdympz[2], xmumdpupdympz[3], xmumdpupdympz[4], xmumdpupdympz[5], xmumdpupdympz[6], inclination[0], inclination[1], declination[0], declination[1], builder.appearance(name0, builder().material())), name, parent, tg); } /** Logging . */ private static Logger log = Logger.getLogger(Trap.class); } --- NEW FILE: MposR.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.*; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import static java.lang.Math.sin; import static java.lang.Math.cos; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposR</code> AGDD element * connected via JAXB {@link MposRType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposR.java,v $ * Revision 1.1 2006/02/09 19:25:54 starxml * *** empty log message *** * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposR.java,v 1.1 2006/02/09 19:25:54 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposR extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposRType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposRType pos = (MposRType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); String[] units = new String[2]; units[0] = lUnit; units[1] = aUnit; float[] r0 = evaluator.valueOf(pos.getR0(), lUnit); float[] dr = evaluator.valueOf(pos.getDR(), lUnit); float[] zphi = evaluator.valueOf(pos.getZPhi(), units); float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[2] = zphi[0]; for (int i = 0; i < (int)ncopy[0]; i++) { xyz[0] = (r0[0] + dr[0] * i) * (float)cos(zphi[1]); xyz[1] = (r0[0] + dr[0] * i) * (float)sin(zphi[1]); use(new Position(xyz, rot, s[0], 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot); } } } /** Logging . */ private static Logger log = Logger.getLogger(MposR.class); } --- NEW FILE: Trd.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.TrdType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.Trapezoid; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>trd</code> AGDD element * connected via JAXB {@link TrdType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Trd.java,v $ * Revision 1.1 2006/02/09 19:25:54 starxml * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Trd.java,v 1.1 2006/02/09 19:25:54 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Trd extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof TrdType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); TrdType trd = (TrdType)element; // not used: trd.isSensitive(); String lUnit = trd.getUnitLength(); String aUnit = trd.getUnitAngle(); float[] xmpympz = evaluator.valueOf(trd.getXmpYmpZ(), lUnit); float[] inclination = evaluator.valueOf(trd.getInclination(), lUnit); String name0 = trd.getName(); String name = builder().name(name0); // Verify reuse if (isLink(name0, name, parent, tg)) { return; } // Create Trapezod and use it // builder().setMaterial(trd.getMaterial().toString()); use(new Trapezoid(xmpympz[0], xmpympz[1], xmpympz[2], xmpympz[3], xmpympz[4], inclination[0], inclination[1], builder.appearance(name0, builder().material())), name, parent, tg); String x1 = evaluator.formatted(xmpympz[0]/2.0f); String x2 = evaluator.formatted(xmpympz[1]/2.0f); String y1 = evaluator.formatted(xmpympz[2]/2.0f); String y2 = evaluator.formatted(xmpympz[3]/2.0f); String dz = evaluator.formatted(xmpympz[4]/2.0f); String key = _nameCore+";"+x1+";"+x2+";"+y1+";"+y2+";"+dz; System.out.println("trd "+_nameCore+" key: "+key); String agddName=""; //----------------------- TGEO if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); System.out.println("Creating trd "+ agddName); builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeTrd2(\""+agddName+"\",medSTANDARD,"+x1+","+x2+","+y1+","+y2+","+dz+");"); } else { FromKeyHash(key); } } /** Logging . */ private static Logger log = Logger.getLogger(Trd.class); } --- NEW FILE: MposWedge.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.MposWedgeType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposWedge</code> AGDD element * connected via JAXB {@link MposWedgeType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposWedge.java,v $ * Revision 1.1 2006/02/09 19:25:54 starxml * *** empty log message *** * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposWedge.java,v 1.1 2006/02/09 19:25:54 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposWedge extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposWedgeType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposWedgeType pos = (MposWedgeType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] phi0 = evaluator.valueOf(pos.getPhi0(), aUnit); float[] rz = evaluator.valueOf(pos.getRZ(), lUnit); float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] sectors = evaluator.valueOf(pos.getSectors(), "1"); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[2] = rz[1]; float phi; // Main loop -- here the multiple instances are positioned: for (int i = 0; i < (int)ncopy[0]; i++) { if (sectors[i] != 0) { phi = phi0[0] + (2f*(float)PI/ ncopy[0])*i; // System.out.println(" from Pos: "+String.valueOf(phi)); xyz[0] = rz[0] * (float)cos(phi); xyz[1] = rz[0] * (float)sin(phi); //System.out.println("Phi:"+phi+" X:"+String.valueOf(xyz[0])+" Y:"+String.valueOf(xyz[1])+" "+String.valueOf(pos.isImpliedRot())); use(new Position(xyz, rot, s[0], pos.isImpliedRot() ? phi:0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData(); for ( Object o : vols) { positionCore(o,xyz,rot,pos.isImpliedRot() ? phi:0.0f); } } } } /** Logging . */ private static Logger log = Logger.getLogger(MposWedge.class); } --- NEW FILE: Para.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.ParaType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.Trapezoid; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Java import static java.lang.Math.atan; import static java.lang.Math.tan; import static java.lang.Math.sin; import static java.lang.Math.cos; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>para</code> AGDD element * connected via JAXB {@link ParaType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Para.java,v $ * Revision 1.1 2006/02/09 19:25:54 starxml * *** empty log message *** * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Para.java,v 1.1 2006/02/09 19:25:54 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Para extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof ParaType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); ParaType para = (ParaType)element; // not used: para.isSensitive(); String lUnit = para.getUnitLength(); String aUnit = para.getUnitAngle(); float[] xyz = evaluator.valueOf(para.getXYZ(), lUnit); float[] alpha = evaluator.valueOf(para.getAlpha(), aUnit); float[] theta = evaluator.valueOf(para.getTheta(), aUnit); float[] phi = evaluator.valueOf(para.getPhi(), aUnit); String name0 = para.getName(); String name = builder().name(name0); // Verify reuse if (isLink(name0, name, parent, tg)) { return; } // Create Trapezod and use it // builder().setMaterial(para.getMaterial().toString()); use(new Trapezoid(xyz[0], xyz[0], xyz[0], xyz[0], xyz[1], xyz[1], xyz[2], atan(tan(theta[0]) * cos(phi[0])), atan(tan(theta[0]) * sin(phi[0])), alpha[0], alpha[0], builder.appearance(name0, builder().material())), name, parent, tg); } /** Logging . */ private static Logger log = Logger.getLogger(Para.class); } |
From: starXML <st...@us...> - 2006-02-08 23:20:27
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12636/GraXML/src/net/hep/graphics/GraXML Modified Files: MasterBuilder.java Log Message: Small additions to place a couple of hooks we need for automatic code generation. Index: MasterBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/MasterBuilder.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** MasterBuilder.java 23 Dec 2005 00:18:24 -0000 1.5 --- MasterBuilder.java 8 Feb 2006 23:20:18 -0000 1.6 *************** *** 60,65 **** * <pre> * $Log$ ! * Revision 1.5 2005/12/23 00:18:24 hrivnac ! * schema should be in the current directory * * Revision 1.4 2005/12/05 15:19:03 hrivnac --- 60,65 ---- * <pre> * $Log$ ! * Revision 1.6 2006/02/08 23:20:18 starxml ! * Small additions to place a couple of hooks we need for automatic code generation. * * Revision 1.4 2005/12/05 15:19:03 hrivnac *************** *** 200,203 **** --- 200,223 ---- // Main entry ---------------------------------------------------------------- + // Aux stubs for AGDD + public void auxiliaryOutput(String filename) {} + private static String _sourceFile = ""; + + public static void setSource(String s) { + // Get the filename and drop the base: + String filename = s; + int i = s.lastIndexOf('/'); + + if (i>-1) { + filename = s.substring(i); + } + + _sourceFile=filename; + } + + public static String getSource() { + return _sourceFile; + } + /** Build Geometric Model {@link BranchGroup} from JAXB * Generic Model. *************** *** 212,215 **** --- 232,241 ---- Document document, BranchGroup group) throws GraXMLException { + + + auxiliaryOutput(file); + + setSource(file); + _group = group; // If RootWindow exists, run in graphical mode *************** *** 283,286 **** --- 309,313 ---- log.info((Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory()) / 1024 / 1024 + " MB of memory used"); log.info(time / 1000.0 + " s of CPU spent\n"); + finish(); } *************** *** 289,292 **** --- 316,321 ---- /** Perform specific configuration in {@link MasterBuilder} subclass.. */ public abstract void configure(); + public void finish() {}; + // Dispatcher ---------------------------------------------------------------- *************** *** 581,584 **** --- 610,614 ---- } + private static String _buildersFile = "builders.properties"; |
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20631/AGDD/src/net/hep/AGDD/TGeoModel/Reps Added Files: AGDD.java AGDDaddelement.java AGDDelement.java AGDDmaterial.java AGDDmedium.java Array.java Composition.java Cons.java Foreach.java MposPhi.java MposX.java MposY.java MposZ.java Pcon.java PosRPhiZ.java PosXYZ.java Section.java Table.java Tubs.java Var.java Log Message: First cut --- NEW FILE: PosRPhiZ.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.PosRPhiZType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import static java.lang.Math.sin; import static java.lang.Math.cos; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>posRPhiZ</code> AGDD element * connected via JAXB {@link PosRPhiZType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: PosRPhiZ.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.1 2005/01/20 13:39:13 hrivnac * posRPhiZ added * * </pre> * </font></p> * @version $Id: PosRPhiZ.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class PosRPhiZ extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof PosRPhiZType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); PosRPhiZType pos = (PosRPhiZType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); String[] units = new String[3]; units[0] = lUnit; units[1] = aUnit; units[2] = lUnit; float[] rphiz = evaluator.valueOf(pos.getRPhiZ(), units); float phi = rphiz[1]; // System.out.println("PHI: "+phi); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[0] = rphiz[0] * (float)cos(phi); xyz[1] = rphiz[0] * (float)sin(phi); xyz[2] = rphiz[2]; use(new Position(xyz, rot, s[0], pos.isImpliedRot() ? phi : 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot,pos.isImpliedRot() ? phi:0.0f); } } /** Logging . */ private static Logger log = Logger.getLogger(PosRPhiZ.class); } --- NEW FILE: MposPhi.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.*; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposPhi</code> AGDD element * connected via JAXB {@link MposPhiType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposPhi.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposPhi.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposPhi extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposPhiType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposPhiType pos = (MposPhiType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] phi0 = evaluator.valueOf(pos.getPhi0(), aUnit); String dphiS = pos.getDPhi(); float[] dphi; if (dphiS == null) { dphi = new float[1]; dphi[0] = 2f*(float)PI/ncopy[0];} else { dphi = evaluator.valueOf(dphiS, aUnit); } float[] rz = evaluator.valueOf(pos.getRZ(), lUnit); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[2] = rz[1]; float phi; // Main loop -- here the multiple instances are positioned: for (int i = 0; i<(int)ncopy[0]; i++) { phi = phi0[0] + dphi[0]*i; xyz[0] = rz[0]*(float)cos(phi); xyz[1] = rz[0]*(float)sin(phi); use(new Position(xyz, rot, s[0], pos.isImpliedRot() ? phi:0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot,pos.isImpliedRot() ? phi:0.0f); } } } /** Logging . */ private static Logger log = Logger.getLogger(MposPhi.class); } --- NEW FILE: AGDDelement.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; // Utility import java.util.HashMap; /** AGDD representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>box</code> AGDD element * connected via JAXB {@link BoxType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: AGDDelement.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * * </pre> * </font></p> * @version $Id: AGDDelement.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:pot...@bn...">M.Potekhin</a> */ public final class AGDDelement implements net.hep.AGDD.JAXB.Element { public AGDDelement() { } public AGDDelement(Element e) { // net.hep.AGDD.JAXB.Solid jaxbSolid = (net.hep.AGDD.JAXB.Solid)e; // Medium medium = (net.hep.AGDD.JAXB.Medium) jaxbSolid.getMedium(); // setName (medium.getName()); // setColor (medium.getColor()); // setMaterial(medium.getMaterial()); } public java.lang.String getSymbol() { String foo="foo"; return foo; } public void setSymbol(java.lang.String value) {} public java.util.List getAddisotopeOrAtom() { java.util.List foo = null; return foo; } // --------------------------------------------------- /** Logging . */ private static Logger log = Logger.getLogger(AGDDmedium.class); } --- NEW FILE: Foreach.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; // Generic Model import net.hep.AGDD.JAXB.ForeachType; import net.hep.AGDD.JAXB.Data; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import java.util.ArrayList; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>foreach</code> AGDD element * connected via JAXB {@link ForeachType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Foreach.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.2 2005/02/13 12:10:06 hrivnac * new tests results included * * Revision 1.1 2005/02/13 02:13:09 hrivnac * foraech added * * </pre> * </font></p> * @version $Id: Foreach.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Foreach implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder0, Element element, Group tg, String parent) { // Verify builder type if (! (builder0 instanceof TGeoAGDDBuilder)) { log.error(element + " can't be traversed using " + builder0 + " builder"); return; } TGeoAGDDBuilder builder = (TGeoAGDDBuilder)builder0; // Verify element type if (! (element instanceof ForeachType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder.evaluator(); ForeachType foreach = (ForeachType)element; String index = foreach.getIndex(); double begin = new Double(evaluator.valueOf(foreach.getBegin())); double loops = new Double(evaluator.valueOf(foreach.getLoops())); double step = new Double(evaluator.valueOf(foreach.getStep())); String whenS = foreach.getWhen(); boolean when; log.debug("for each (index, begin, loops, step, when) = (" + index + ", " + begin + ", " + loops + ", " + step + ", " + whenS + ")"); // Traverse all children and add their representations into branch List<String> variables = new ArrayList<String>(); List volumes = foreach.getForeachOrAbstractDataOrAbstractPosition(); BranchGroup branch; String name; for (double i = begin; i < begin + step * loops; i += step) { branch = new BranchGroup(); evaluator.setValue(index, String.valueOf(i)); if (evaluator.valueOf(whenS).equals("1")) { // name = builder.peekComp(); name = builder.name(index + "=" + i); for (Object o : volumes) { if (o instanceof Data && o instanceof Element) { builder.traverse((Element)o, branch, name); variables.add(evaluator.lastVariable()); } else if (o instanceof Element) { // builder.cxx("2"); builder.traverse((Element)o, branch, name); } } // Register BranchGroup into Connections database builder.conDB().addConnection(new DetachableConnection(name, parent, tg, branch, null)); // Roll back variables for (String variable : variables) {evaluator.rollbackVariable(variable);} variables.clear(); } } } /** Logging . */ private static Logger log = Logger.getLogger(Composition.class); } --- NEW FILE: AGDDmaterial.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // import net.hep.AGDD.JAXB.Element; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; // misc import java.util.List; // Utility import java.util.HashMap; /** AGDD representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>box</code> AGDD element * connected via JAXB {@link BoxType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: AGDDmaterial.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * * </pre> * </font></p> * @version $Id: AGDDmaterial.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class AGDDmaterial implements net.hep.AGDD.JAXB.Material { public AGDDmaterial(AGDDmedium medium) { _material = (net.hep.AGDD.JAXB.Material) medium.getMaterial(); _name = _material.getName(); _aweight = _material.getAweight(); _zeff = _material.getZeff(); _density = _material.getDensity(); _lambda = _material.getLambda(); _x0 = _material.getX0(); _ctorString = ""; _symbol = ""; System.out.println("Material:"+ _name + " A:"+_aweight+" Z:"+_zeff+" rho:"+_density); } public AGDDmaterial() { } public void Process(Integer n_) { _n = n_; List addElements = _material.getAddelement(); // System.out.println("Material "+ _name + " made of elements: "+addElements.size()); if(addElements.size() > 0) { // see what kind of constructor we need to use String symbol=null; for(Object o: addElements) { AGDDaddelement ae = new AGDDaddelement(o); _ctorString += ae.ctor(); // added code for elements _symbol = ae.symbol(); } constructor1(); } else { constructor2(); } } public String ctor() { return _ctorString; } public void constructor1() { System.out.println("ctor1"); // TGeoMaterial(const char* name, TGeoElement* elem, Double_t rho) _ctorString+="TGeoMaterial *"+_name+" = new TGeoMaterial(\""+_name+"\","+_symbol+","+_density+");\n"; _ctorString+=_name+"->SetUniqueID("+_n.toString()+");"; } public void constructor2() { System.out.println("ctor2"); // TGeoMaterial(const char* name, Double_t a, Double_t z, Double_t rho, Double_t radlen = 0, Double_t intlen = 0) System.out.println("***Material:"+ _name + " A:"+_aweight+" Z:"+_zeff+" rho:"+_density); _ctorString+="TGeoMaterial *"+_name+" = new TGeoMaterial(\""+_name+"\","+_aweight+","+_zeff+","+_density+","+_x0+","+_lambda+");\n"; _ctorString+=_name+"->SetUniqueID("+_n.toString()+");"; } public List getAddelement() { //dummy java.util.List l = null; return l; } public double getDensity() { return 0.0; } public void setDensity(double value) {} public java.lang.String getState() { String state = "foo"; return state; } public void setState(java.lang.String value) {} public double getAweight() { return _aweight; } public void setAweight(double value) { _aweight = value; } public double getLambda() { return _lambda; } public void setLambda(double value) {} public java.lang.String getName() { return _name; } public void setName(java.lang.String value) { _name = value; } public double getZeff() { return _zeff; } public void setZeff(double value) { _zeff = value; } public double getX0() { return _x0; } public void setX0(double value) {} protected Integer _n; protected String _name; protected String _symbol; protected double _aweight; protected double _zeff; protected double _density; protected double _lambda; protected double _x0; protected net.hep.AGDD.JAXB.Material _material; protected String _ctorString; // ---------------------------------------------------------------- protected static HashMap _matHash = new HashMap(1000); protected static int _nMat = 0; public static Integer InHash(String key) { return (Integer) ((_matHash.containsKey(key))?_matHash.get(key):0); } public static Integer ToHash(String key) { Integer count = ++_nMat; _matHash.put(key, count); return count; } // ---------------------------------------------------------------- /** Logging . */ private static Logger log = Logger.getLogger(AGDDmaterial.class); // protected net.hep.AGDD.JAXB.MaterialType _material; } --- NEW FILE: Var.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; // Generic Model import net.hep.AGDD.JAXB.VarType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.GraXMLJAXBRep; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>var</code> AGDD element * connected via JAXB {@link VarType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Var.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.1 2005/02/12 21:32:30 hrivnac * mathematics works * * </pre> * </font></p> * @version $Id: Var.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Var implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder0, Element element, Group tg, String parent) { // Verify builder type if (! (builder0 instanceof TGeoAGDDBuilder)) { log.error(element + " can't be traversed using " + builder0 + " builder"); return; } TGeoAGDDBuilder builder = (TGeoAGDDBuilder)builder0; // Verify element type if (! (element instanceof VarType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder.evaluator(); VarType var = (VarType)element; evaluator.setValue(var.getName(), var.getValue()); } /** Logging . */ private static Logger log = Logger.getLogger(Var.class); } --- NEW FILE: PosXYZ.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.JAXB.impl.*; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.*; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>posXYZ</code> AGDD element * connected via JAXB {@link PosXYZType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: PosXYZ.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/01/20 15:08:28 hrivnac * all mpos added * * Revision 1.2 2005/01/20 13:39:13 hrivnac * posRPhiZ added * * Revision 1.1 2005/01/20 13:06:40 hrivnac * Box + PosXYZ implemented * * </pre> * </font></p> * @version $Id: PosXYZ.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class PosXYZ extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof PosXYZType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // builder().cxx("// parent="+parent); // Get element properties Evaluator evaluator = (builder()).evaluator(); PosXYZType pos = (PosXYZType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] xyz = evaluator.valueOf(pos.getXYZ(), lUnit); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes use(new Position(xyz, rot, s[0], 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData(); // System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot); } } /** Logging . */ private static Logger log = Logger.getLogger(PosXYZ.class); } // if (o instanceof VolumeType) { // String key=keyToPosition((VolumeType)o); // if(builder().compStackNotEmpty()) { // System.out.println("Peeking comp: "+ builder().peekComp()); // } // String realParent = builder().peekComp(); // String[] poz = evaluator.formatted(xyz); // String[] rot1 = evaluator.formattedRad2Deg(rot); // System.out.println("Rotation"+" "+rot1[0]+" "+rot1[1]+" "+rot1[2]); // int Ncopy = Solid.Ncopy(key); // String genName = Solid.FromKeyHash(key); // System.out.println("STAR: positioning: "+genName+" in "+realParent+" with Ncopy="+Ncopy); // if(rot[0]==0.0 && rot[1]==0.0 && rot[2]==0.0) { // unity rotation // AddNode(realParent, genName, Ncopy, poz); // } // else { // AddNodeRotation(realParent, genName, Ncopy, poz, rot1); // } // } --- NEW FILE: Pcon.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.PconType; import net.hep.AGDD.JAXB.PolyplaneType; import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.PolyConeSegment; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>pcon</code> AGDD element * connected via JAXB {@link PconType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Pcon.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Pcon.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Pcon extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof PconType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); PconType pcon = (PconType)element; // not used: pcon.isSensitive(); String lUnit = pcon.getUnitLength(); String aUnit = pcon.getUnitAngle(); float[] profile = evaluator.valueOf(pcon.getProfile(), aUnit); String name0 = pcon.getName(); String name = builder().name(name0); setColor(pcon); List planes = pcon.getPolyplane(); System.out.println("pcon "+name+" "+name0); float[] rioz; double[] ri = new double[planes.size()]; double[] ro = new double[planes.size()]; double[] z = new double[planes.size()]; double[] zs = new double[planes.size()]; int i = 0; for (Object o : planes) { if (o instanceof PolyplaneType) { rioz = evaluator.valueOf(((PolyplaneType)o).getRioZ(), lUnit); ri[i] = rioz[0]; ro[i] = rioz[1]; z[i] = rioz[2]; zs[i] = rioz[2]; i++; } } // double delz = (z[z.length - 1] - z[0]) / 2.0; // for (int j = 0; j < i; j++) { // z[j] -= delz; // } if (!isLink(name0, name, parent, tg)) { // Verify reuse use(new PolyConeSegment(ri, ro, z, profile[0], profile[0]+profile[1], BuildOptions.granularity(), builder().appearance(name0,rgb(), transparency())), name, parent, tg); } //------------------------------------- TGEO ProcessMediumAndMaterial(element); String nz = String.valueOf(i); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); String key = _nameCore; String agddName=""; String[] Rin = new String[i]; String[] Rout = new String[i]; String[] Z = new String[i]; double zOff = (zs[0]+zs[i-1])/2.0; for(int nSec=0;nSec<i;nSec++) { zs[nSec]-=zOff; } for(int nSec=0;nSec<i;nSec++) { Z[nSec] = evaluator.formatted(zs[nSec]); Rin[nSec] = evaluator.formatted(ri[nSec]); Rout[nSec] = evaluator.formatted(ro[nSec]); key+=";"+Rin[nSec]+";"+Rout[nSec]+";"+Z[nSec]; } key+=";"+phi1+";"+phi2+";"+nz; System.out.println("pcon "+_nameCore+" key: "+key); if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); System.out.println("Creating pcon "+ agddName); builder().cxx("TGeoVolume* "+agddName+" = gGeoManager->MakePcon(\""+agddName+"\","+_medName+","+phi1+","+phi2+","+nz+");"); builder().cxx("TGeoPcon* "+agddName+"_shape = (TGeoPcon*) "+agddName+"->GetShape();"); AssignColor(agddName); for(int sec=0;sec<i;sec++) { builder().cxx(agddName+"_shape->DefineSection("+String.valueOf(sec)+","+Z[sec]+","+Rin[sec]+","+Rout[sec]+");"); } } else { FromKeyHash(key); } } /** Logging . */ private static Logger log = Logger.getLogger(Pcon.class); } --- NEW FILE: AGDDaddelement.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; import net.hep.AGDD.JAXB.Addelement; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; // Utility import java.util.HashMap; import java.util.List; /** AGDD representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>box</code> AGDD element * connected via JAXB {@link BoxType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: AGDDaddelement.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * * </pre> * </font></p> * @version $Id: AGDDaddelement.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class AGDDaddelement implements net.hep.AGDD.JAXB.Addelement { public AGDDaddelement() { } public AGDDaddelement(Object o) { _ctorString = ""; net.hep.AGDD.JAXB.Addelement ae = (net.hep.AGDD.JAXB.Addelement) o; net.hep.AGDD.JAXB.Element e = (net.hep.AGDD.JAXB.Element) ae.getName(); String symbol = e.getSymbol(); if (AGDDaddelement.InHash(symbol)==0) { // only construct if not already have done so Integer symNumber = AGDDaddelement.ToHash(symbol); List atomList = e.getAddisotopeOrAtom(); System.out.println("Creating element No."+symNumber.toString()+":"+symbol+" of "+atomList.size()+" atoms"); processAtoms(symbol,atomList); } else { // already have created this element and will just use it. _symbol=symbol; } } public void processAtoms(String symbol, List atoms) { for(Object o: atoms) { net.hep.AGDD.JAXB.Atom a = (net.hep.AGDD.JAXB.Atom) o; double aweight = a.getAweight(); double zeff = a.getZeff(); int Z = (int) zeff; _ctorString+="TGeoElement *"+symbol+" = new TGeoElement(\""+symbol+"\",\""+symbol+"\","+Z+","+a.getAweight()+");\n"; _symbol=symbol; } } public String ctor() { return _ctorString; } public String symbol() { return _symbol; } public java.lang.Object getName() { return getName(); } public void setName(java.lang.Object value) {} public double getNatoms() { return 2.0f; } /** * */ public void setNatoms(double value) {} protected String _ctorString; protected String _symbol; protected static HashMap _elHash = new HashMap(64); protected static int _nEl = 0; public static Integer InHash(String key) { return (Integer) ((_elHash.containsKey(key))?_elHash.get(key):0); } public static Integer ToHash(String key) { Integer count = ++_nEl; _elHash.put(key, count); return count; } // --------------------------------------------------- /** Logging . */ private static Logger log = Logger.getLogger(AGDDmedium.class); } --- NEW FILE: Section.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; // Generic Model import net.hep.AGDD.JAXB.SectionType; import net.hep.AGDD.JAXB.BuildingBlockType; import net.hep.AGDD.JAXB.Data; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>section</code> AGDD element * connected via JAXB {@link SectionType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Section.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/02/12 21:32:30 hrivnac * mathematics works * * Revision 1.2 2005/01/20 13:06:40 hrivnac * Box + PosXYZ implemented * * Revision 1.1 2005/01/19 16:06:20 hrivnac * top-level GeometricModel classes added * * </pre> * </font></p> * @version $Id: Section.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Section implements GraXMLJAXBRep { protected void setBuilder(MasterBuilder builder) { if (! (builder instanceof TGeoAGDDBuilder)) { log.error("Can't be traversed using " + builder + " builder"); return; } _builder = (TGeoAGDDBuilder)builder; } protected TGeoAGDDBuilder builder() { return _builder; } private TGeoAGDDBuilder _builder; public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { setBuilder(builder); // Verify element type if (! (element instanceof SectionType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties SectionType section = (SectionType)element; String version = section.getVersion(); // not used: String dtd = section.getDTDVersion(); // not used: String author = section.getAuthor(); // not used: String date = section.getDate(); String name = section.getName(); String info = name + " (" + version + ")"; System.out.println("SECTION: "+name); // Traverse all children and add their representations into branch BranchGroup branch = new BranchGroup(); // - Volume List volumes = section.getAbstractSolidOrAbstractStackOrAbstractBooleanVolume(); for (Object o : volumes) { // -- via BuildingBlock if (o instanceof BuildingBlockType) { List volumes0 = ((BuildingBlockType)o).getAbstractSolidOrAbstractStackOrAbstractBooleanVolume(); for (Object o0 : volumes0) { if (o0 instanceof Data && o0 instanceof Element) { builder.traverse((Element)o0, branch, name); } } } // -- directly else if (o instanceof Data && o instanceof Element) { builder.traverse((Element)o, branch, name); } } // - TopVolume Object top = section.getTopVolume(); if (top instanceof Element) { builder.traverse((Element)top, branch, name); } // Register BranchGroup into Connections database builder.conDB().addConnection(new DetachableConnection(name, parent, tg, branch, null, info)); } /** Logging . */ private static Logger log = Logger.getLogger(Section.class); } --- NEW FILE: Tubs.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.TubsType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.ConeSegment; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>tubs</code> AGDD element * connected via JAXB {@link TubsType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Tubs.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Tubs.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Tubs extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof TubsType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); TubsType tubs = (TubsType)element; // not used: tubs.isSensitive(); String lUnit = tubs.getUnitLength(); String aUnit = tubs.getUnitAngle(); float[] rioz = evaluator.valueOf(tubs.getRioZ(), lUnit); float[] profile = evaluator.valueOf(tubs.getProfile(),aUnit); String name0 = tubs.getName(); String name = builder().name(name0); setColor(tubs); if (!isLink(name0, name, parent, tg)) { // Verify reuse use(new ConeSegment(rioz[0],rioz[1],rioz[2],profile[0],profile[0]+profile[1], BuildOptions.granularity(), builder().appearance(name0, rgb(), transparency())), name, parent, tg); } //------------------------------------- TGEO ProcessMediumAndMaterial(element); String ri = evaluator.formatted(rioz[0]); String ro = evaluator.formatted(rioz[1]); String dz = evaluator.formatted(rioz[2]/2.0f); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); String key = _nameCore+";"+ri+";"+ro+";"+dz+";"+phi1+";"+phi2; System.out.println("tubs "+_nameCore+" key: "+key); String agddName=""; if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); System.out.println("Creating tubs "+ agddName); builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeTubs(\""+agddName+"\","+_medName+","+ri+","+ro+","+dz+","+phi1+","+phi2 +");"); } else { FromKeyHash(key); } } /** Logging . */ private static Logger log = Logger.getLogger(Tubs.class); } --- NEW FILE: AGDD.java --- package net.hep.AGDD.TGeoModel.Reps; // Generic Model import net.hep.AGDD.JAXB.AGDDType; import net.hep.AGDD.JAXB.SectionType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>AGDD</code> AGDD element * connected via JAXB {@link AGDDType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: AGDD.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.2 2005/01/20 13:06:40 hrivnac * Box + PosXYZ implemented * * Revision 1.1 2005/01/19 16:06:20 hrivnac * top-level GeometricModel classes added * * </pre> * </font></p> * @version $Id: AGDD.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class AGDD implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { System.out.println("----------------- AGDD traversal"); // Verify element type if (! (element instanceof AGDDType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties AGDDType agdd = (AGDDType)element; String version = agdd.getDTDVersion(); String info = _name; if (version != null && !version.equals("")) { info += " (" + version + ")"; } // Traverse all children and add their representations into branch BranchGroup branch = new BranchGroup(); // - Section (others are used via their references) List sections = agdd.getMediaOrMaterialsOrColormap(); for (Object o : sections) { if (o instanceof Element && o instanceof SectionType) { builder.traverse((Element)o, branch, _name); } } // Register BranchGroup into Connections database builder.conDB().addConnection(new DetachableConnection(_name, parent, tg, branch, null, info)); } /** Logging . */ private static Logger log = Logger.getLogger(AGDD.class); private static String _name = "AGDD"; } --- NEW FILE: MposX.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.JAXB.impl.*; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.*; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposX</code> AGDD element * connected via JAXB {@link MposXType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposX.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposX.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposX extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposXType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposXType pos = (MposXType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] x0 = evaluator.valueOf(pos.getX0(), lUnit); float[] dx = evaluator.valueOf(pos.getDX(), lUnit); float[] yz = evaluator.valueOf(pos.getYZ(), lUnit); float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[1] = yz[0]; xyz[2] = yz[1]; for (int i = 0; i < (int)ncopy[0]; i++) { xyz[0] = x0[0] + dx[0] * i; use(new Position(xyz, rot, s[0], 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot); } } } /** Logging . */ private static Logger log = Logger.getLogger(MposX.class); } --- NEW FILE: Array.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; // Generic Model import net.hep.AGDD.JAXB.ArrayType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.GraXMLJAXBRep; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>array</code> AGDD element * connected via JAXB {@link ArrayType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Array.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.1 2005/02/12 21:32:30 hrivnac * mathematics works * * </pre> * </font></p> * @version $Id: Array.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Array implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder0, Element element, Group tg, String parent) { // Verify builder type if (! (builder0 instanceof TGeoAGDDBuilder)) { log.error(element + " can't be traversed using " + builder0 + " builder"); return; } TGeoAGDDBuilder builder = (TGeoAGDDBuilder)builder0; // Verify element type if (! (element instanceof ArrayType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder.evaluator(); ArrayType array = (ArrayType)element; evaluator.setValues(array.getName(), array.getValues()); } /** Logging . */ private static Logger log = Logger.getLogger(Array.class); } --- NEW FILE: Composition.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; // Generic Model import net.hep.AGDD.JAXB.CompositionType; import net.hep.AGDD.JAXB.*; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import java.util.ArrayList; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>composition</code> AGDD element * connected via JAXB {@link CompositionType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Composition.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/02/13 02:13:09 hrivnac * foraech added * * Revision 1.2 2005/01/20 15:08:28 hrivnac * all mpos added * * Revision 1.1 2005/01/19 16:06:20 hrivnac * top-level GeometricModel classes added * * </pre> * </font></p> * @version $Id: Composition.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Composition implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder0, Element element, Group tg, String parent) { // Verify builder type if (! (builder0 instanceof TGeoAGDDBuilder)) { log.error(element + " can't be traversed using " + builder0 + " builder"); return; } TGeoAGDDBuilder builder = (TGeoAGDDBuilder)builder0; // Verify element type if (! (element instanceof CompositionType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties CompositionType composition = (CompositionType)element; String name = builder.name(composition.getName()); // Traverse all children and add their representations into branch BranchGroup branch = new BranchGroup(); // - Envelope Object envelope = composition.getEnvelope(); if (envelope instanceof Element) { builder.traverse((Element)envelope, branch, name); // Capture the name: if (envelope instanceof net.hep.AGDD.JAXB.VolumeInstance) { String envelopeName = ((net.hep.AGDD.JAXB.VolumeInstance)envelope).getName(); builder.setEnvelope(envelopeName); // Push the parent: System.out.println("Envelope to stack: "+envelopeName); builder.pushComp(envelopeName); } } // - Volume Evaluator evaluator = builder.evaluator(); List<String> variables = new ArrayList<String>(); List volumes = composition.getAbstractDataOrForeachOrAbstractPosition(); for (Object o : volumes) { if (o instanceof Data && o instanceof Element) { builder.traverse((Element)o, branch, name); variables.add(evaluator.lastVariable()); } else if (o instanceof Element) { builder.traverse((Element)o, branch, name); } } // Register BranchGroup into Connections database builder.conDB().addConnection(new DetachableConnection(name, parent, tg, branch, null)); // Roll back variables for (String variable : variables) { evaluator.rollbackVariable(variable); } // Pop the parent: String popped = builder.popComp(); // System.out.println("Envelope from stack: "+popped); } /** Logging . */ private static Logger log = Logger.getLogger(Composition.class); } --- NEW FILE: MposY.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.MposYType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposY</code> AGDD element * connected via JAXB {@link MposYType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposY.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposY.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposY extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposYType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposYType pos = (MposYType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] y0 = evaluator.valueOf(pos.getY0(), lUnit); float[] dy = evaluator.valueOf(pos.getDY(), lUnit); float[] zx = evaluator.valueOf(pos.getZX(), lUnit); float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = new float[3]; xyz[0] = zx[1]; xyz[2] = zx[0]; for (int i = 0; i < (int)ncopy[0]; i++) { xyz[1] = y0[0] + dy[0] * i; use(new Position(xyz, rot, s[0], 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot); } } } /** Logging . */ private static Logger log = Logger.getLogger(MposY.class); } --- NEW FILE: Table.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; // Generic Model import net.hep.AGDD.JAXB.TableType; import net.hep.AGDD.JAXB.RowType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.GraXMLJAXBRep; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Java import java.util.List; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>table</code> AGDD element * connected via JAXB {@link TableType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Table.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.1 2005/02/12 21:32:30 hrivnac * mathematics works * * </pre> * </font></p> * @version $Id: Table.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Table implements GraXMLJAXBRep { public final void traverse(MasterBuilder builder0, Element element, Group tg, String parent) { // Verify builder type if (! (builder0 instanceof TGeoAGDDBuilder)) { log.error(element + " can't be traversed using " + builder0 + " builder"); return; } TGeoAGDDBuilder builder = (TGeoAGDDBuilder)builder0; // Verify element type if (! (element instanceof TableType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder.evaluator(); TableType table = (TableType)element; List rows = table.getRow(); String[] values = new String[rows.size()]; int i = 0; for (Object o : rows) { if (o instanceof RowType) { values[i++] = ((RowType)o).getValues(); } } evaluator.setValues(table.getName(), values); } /** Logging . */ private static Logger log = Logger.getLogger(Table.class); } --- NEW FILE: Cons.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.ConsType; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.BuildOptions; // FreeHEP import org.freehep.j3d.ConeSegment; // Java3D import javax.media.j3d.Group; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>cons</code> AGDD element * connected via JAXB {@link ConsType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Cons.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/03/23 16:20:50 hrivnac * optimisation fixed * * Revision 1.1 2005/01/20 17:54:36 hrivnac * all single solids added * * </pre> * </font></p> * @version $Id: Cons.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Cons extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { setBuilder(builder); // Verify and set builder type if (! (element instanceof ConsType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); ConsType cons = (ConsType)element; // not used: cons.isSensitive(); String lUnit = cons.getUnitLength(); String aUnit = cons.getUnitAngle(); float[] rio1rio2z = evaluator.valueOf(cons.getRio1Rio2Z(), lUnit); float[] profile = evaluator.valueOf(cons.getProfile(), aUnit); String name0 = cons.getName(); String name = builder().name(name0); setColor(cons); String dz = evaluator.formatted(rio1rio2z[4]/2.0f); String ri1 = evaluator.formatted(rio1rio2z[0]); String ri2 = evaluator.formatted(rio1rio2z[2]); String ro1 = evaluator.formatted(rio1rio2z[1]); String ro2 = evaluator.formatted(rio1rio2z[3]); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); if (!isLink(name0, name, parent, tg)) { // Verify reuse use(new ConeSegment(rio1rio2z[0], rio1rio2z[1], rio1rio2z[2], rio1rio2z[3], rio1rio2z[4], profile[0], profile[0] + profile[1], BuildOptions.granularity(), builder().appearance(name0, rgb(), transparency())), name, parent, tg); } //------------------------------------- TGEO ProcessMediumAndMaterial(element); String key = _nameCore+";"+ri1+";"+ro1+";"+ri2+";"+ro2+";"+dz+";"+phi1+";"+phi2; System.out.println("cons "+_nameCore+" key: "+key); String agddName=""; //----------------------- TGEO if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); System.out.println("Creating tubs "+ agddName + " made of "+_medName); builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeCons(\""+agddName+"\","+_medName+"," +dz+","+ri1+","+ri2+","+ro1+"," +ro2+","+phi1+","+phi2+ ");"); AssignColor(agddName); } else { FromKeyHash(key); } } /** Logging . */ private static Logger log = Logger.getLogger(Cons.class); } --- NEW FILE: MposZ.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.TGeoAGDDBuilder; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Position; import net.hep.AGDD.TGeoModel.Positioner; // Generic Model import net.hep.AGDD.JAXB.MposZType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import static java.lang.Math.sin; import static java.lang.Math.cos; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link GraXMLJAXBRep} of <code>mposZ</code> AGDD element * connected via JAXB {@link MposZType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: MposZ.java,v $ * Revision 1.1 2006/02/08 22:31:18 starxml * First cut * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 15:08:28 hrivnac * all mpos added * * </pre> * </font></p> * @version $Id: MposZ.java,v 1.1 2006/02/08 22:31:18 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class MposZ extends Positioner { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { // Verify and set builder type setBuilder(builder); // Verify element type if (! (element instanceof MposZType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = (builder()).evaluator(); MposZType pos = (MposZType)element; String lUnit = pos.getUnitLength(); String aUnit = pos.getUnitAngle(); float[] z0 = evaluator.valueOf(pos.getZ0(), lUnit); float[] dz = evaluator.valueOf(pos.getDZ(), lUnit); String xyS = pos.getXY(); float[] xy = null; if (xyS != null) { xy = evaluator.valueOf(xyS, lUnit); } String rphiS = pos.getRPhi(); float[] rphi = null; if (rphiS != null) { String[] units = new String[2]; units[0] = lUnit; units[1] = aUnit; rphi = evaluator.valueOf(rphiS, units); } float[] ncopy = evaluator.valueOf(pos.getNcopy(), "1"); float[] rot = evaluator.valueOf(pos.getRot(), aUnit); float[] s = evaluator.valueOf(pos.getS(), lUnit); // Position all volumes float[] xyz = {0.0f, 0.0f, 0.0f}; if (xy != null && (xy[0]!=0.0f || xy[1]!=0.0f)) { xyz[0] = xy[0]; xyz[1] = xy[1]; } System.out.println("RPhi: "+String.valueOf(xy[0])+" "+String.valueOf(xy[1])); // Also check if the radius and phi were defined, in which case they have priority //System.out.println("RPhi: "+String.valueOf(rphi[0])+" "+String.valueOf(rphi[1])); if (rphi != null && (rphi[0]!=0.0f || rphi[1]!=0.0f)) { xyz[0] = rphi[0] * (float)cos(rphi[1]); xyz[1] = rphi[0] * (float)sin(rphi[1]); } for (int i = 0; i < (int)ncopy[0]; i++) { xyz[2] = z0[0] + dz[0] * i; use(new Position(xyz, rot, s[0], 0), tg, pos.getVolumeOrIdentifierOrAbstractData(), parent); List vols = pos.getVolumeOrIdentifierOrAbstractData();//System.out.println("Volumes in positioner: "+String.valueOf(vols.size())); for ( Object o : vols) { positionCore(o,xyz,rot); } } } /** Logging . */ private static Logger log = Logger.getLogger(MposZ.class); } --- NEW FILE: AGDDmedium.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // JAXB import javax.xml.bind.Element; ... [truncated message content] |
From: starXML <st...@us...> - 2006-02-08 21:30:08
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25137/AGDD/src/net/hep/AGDD/TGeoModel Added Files: Evaluator.java Position.java Positioner.java Solid.java Log Message: Adding first cut of working components --- NEW FILE: Position.java --- package net.hep.AGDD.TGeoModel; // Java3D import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // Java import static java.lang.Math.sqrt; /** <code>Position<code> is a{@link Transform3D} created from a set of parameters. * <p><font color="#880088"> * <pre> * $Log: Position.java,v $ * Revision 1.1 2006/02/08 21:29:52 starxml * Adding first cut of working components * * Revision 1.3 2005/02/13 18:17:14 hrivnac * javadoc fixes * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 13:06:39 hrivnac * Box + PosXYZ implemented * * </pre> * </font></p> * @version $Id: Position.java,v 1.1 2006/02/08 21:29:52 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Position extends Transform3D { /** Create and setup. * @param pos The xyz translation. * @param rot The xyz rotation. * @param s The radial translation in xy plane. * @param phi The rotation in xy plain. */ public Position(float[] pos, float[] rot, float s, float phi) { if (s != 0) { float r = (float)sqrt(pos[0] * pos[0] + pos[1] * pos[1]); pos[0]= pos[0] + s * pos[1] / r; pos[1]= pos[1] - s * pos[0] / r; } set(UMATRIX, new Vector3d(pos[0], pos[1], pos[2]), 1); Matrix3d tr = new Matrix3d(UMATRIX); Matrix3d tr0 = new Matrix3d(UMATRIX); tr0.rotZ(rot[2] + phi); // System.out.println("From position: "+String.valueOf(rot[2])+" "+ String.valueOf(phi)); tr.mul(tr0); tr0 = new Matrix3d(UMATRIX); tr0.rotY(rot[1]); tr.mul(tr0); tr0 = new Matrix3d(UMATRIX); tr0.rotX(rot[0]); tr.mul(tr0); mul(new Transform3D(tr, new Vector3d(), 1)); } /** The unity {@link Matrix3d}. */ private static final Matrix3d UMATRIX = new Matrix3d(1, 0, 0, 0, 1, 0, 0, 0, 1); } --- NEW FILE: Positioner.java --- package net.hep.AGDD.TGeoModel; import net.hep.AGDD.JAXB.impl.*; // Generic Model import net.hep.AGDD.JAXB.VolumeType; import net.hep.AGDD.JAXB.Data; import net.hep.AGDD.JAXB.CompositionType; import net.hep.AGDD.JAXB.PolyplaneType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // Java3D import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.vecmath.Vector3d; import javax.vecmath.Matrix3d; // JAXB import javax.xml.bind.Element; // Java import java.util.List; import java.util.ArrayList; // Log4J import org.apache.log4j.Logger; /** Common part of GraXML representations {@link GraXMLJAXBRep} of positioning AGDD * elements connected via JAXB generic JAXB * interfaces. * <p><font color="#880088"> * <pre> * $Log: Positioner.java,v $ * Revision 1.1 2006/02/08 21:29:52 starxml * Adding first cut of working components * * Revision 1.6 2005/02/13 18:17:14 hrivnac * javadoc fixes * * Revision 1.5 2005/02/12 23:26:43 hrivnac * variables are properly resolved in parallel structures * * Revision 1.4 2005/02/12 21:32:30 hrivnac * mathematics works * * Revision 1.3 2005/01/20 18:48:21 hrivnac * added rot and transform * * Revision 1.2 2005/01/20 15:08:28 hrivnac * all mpos added * * Revision 1.1 2005/01/20 13:06:39 hrivnac * Box + PosXYZ implemented * * </pre> * </font></p> * @version $Id: Positioner.java,v 1.1 2006/02/08 21:29:52 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public abstract class Positioner implements GraXMLJAXBRep { public abstract void traverse(MasterBuilder builder, Element element, Group tg, String parent); /** Position volumes. * @param position The {@link Position} of the volumes. * @param tg The higher level {@link Group}. * @param volumes The volumes to be placed. * @param parent The parent. */ protected void use(Transform3D position, Group tg, List volumes, String parent) { // Update transformation TransformGroup tr; Transform3D t3d = null; if (tg instanceof TransformGroup) { ((TransformGroup)tg).getTransform(t3d); t3d.mul(position); ((TransformGroup)tg).setTransform(t3d); tr = (TransformGroup)tg; } else { tr = new TransformGroup(position); tg.addChild(tr); } // Traverse all children Evaluator evaluator = builder().evaluator(); List<String> variables = new ArrayList<String>(); for (Object o : volumes) { if (o instanceof Data && o instanceof Element) { builder().traverse((Element)o, tr, parent); variables.add(evaluator.lastVariable()); } else if (o instanceof VolumeType) { VolumeType v = (VolumeType)o; Object vv = v.getName(); if (vv instanceof Element) { builder().traverse((Element)vv, tr, parent); } } } // Roll back variables for (String variable : variables) { evaluator.rollbackVariable(variable); // System.out.println("Var: "+ variable); } } /** Verify that {@link MasterBuilder} type is {@link AGDDBuilder} and * set it. * @param builder The {@link MasterBuilder} to be verified and set. */ protected void setBuilder(MasterBuilder builder) { if (! (builder instanceof TGeoAGDDBuilder)) { log.error("Can't be traversed using " + builder + " builder"); return; } _builder = (TGeoAGDDBuilder)builder; } /** Used {@link AGDDBuilder}. * @return The used {@link AGDDBuilder}. */ protected TGeoAGDDBuilder builder() { return _builder; } private TGeoAGDDBuilder _builder; public static String whatToPosition(VolumeType o) { String whatToPosition=""; VolumeType vt = (VolumeType) o; Object vv = vt.getName(); // get a handle, decide later on what it is // --maxim-- try { CompositionType c = (CompositionType) vv; Object envelope = c.getEnvelope(); if (envelope instanceof Element) { if (envelope instanceof net.hep.AGDD.JAXB.VolumeInstance) { whatToPosition = ((net.hep.AGDD.JAXB.VolumeInstance)envelope).getName(); // System.out.println("Envelope to position: "+whatToPosition); } } } catch(Exception e) { // was not a composition whatToPosition = ((net.hep.AGDD.JAXB.VolumeInstance)vv).getName(); // System.out.println("Volume to position: "+whatToPosition); } return whatToPosition; } public String keyToPosition(VolumeType o) { Evaluator evaluator = (builder()).evaluator(); String what = ""; // by try and catch, find what to position! VolumeType vt = (VolumeType) o; // Get a handle, decide later on what it is: Object v = vt.getName(); try { // Composition? CompositionType c = (CompositionType) v; Object envelope = c.getEnvelope(); if (envelope instanceof Element) { if (envelope instanceof net.hep.AGDD.JAXB.VolumeInstance) { what = ((net.hep.AGDD.JAXB.VolumeInstance)envelope).getName(); // System.out.println("Envelope to position: "+what); v=envelope; } } } catch(Exception e) { // was not a composition, just a plane volume. Assign the name: what = ((net.hep.AGDD.JAXB.VolumeInstance)v).getName(); // System.out.println("Volume to position: "+what); } String key = what; // form the hash key out of name and catenated dimensions, blank for now String[] dim = {""}; // need a dummy to compile with exception throwing String ri1 = ""; String ro1 = ""; String ri2 = ""; String ro2 = ""; String dz = ""; String x1 = ""; String x2 = ""; String y1 = ""; String y2 = ""; // -- try { BoxImpl bi = (BoxImpl) (v); String lUnit = bi.getUnitLength(); float[] x_y_z = evaluator.valueOf(bi.getXYZ(), lUnit); dim = evaluator.formattedScaled(x_y_z, 0.5f); // System.out.println("---- "+dim[0]+" "+dim[1]+" "+dim[2]); key+=";"+dim[0]+";"+dim[1]+";"+dim[2]; return key; } catch(Exception e) { //System.out.println("Not a Box"); } // -- try { TubsImpl ti = (TubsImpl) (v); String lUnit = ti.getUnitLength(); String aUnit = ti.getUnitAngle(); float[] rioz = evaluator.valueOf(ti.getRioZ(), lUnit); float[] profile = evaluator.valueOf(ti.getProfile(), aUnit); ri1 = evaluator.formatted(rioz[0]); ro2 = evaluator.formatted(rioz[1]); dz = evaluator.formatted(rioz[2]/2.0f); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); key+=";"+ri1+";"+ro2+";"+dz+";"+phi1+";"+phi2; return key; } catch(Exception e) { //System.out.println("Not a Tubs"); } // -- try { ConsImpl ci = (ConsImpl) (v); String lUnit = ci.getUnitLength(); String aUnit = ci.getUnitAngle(); float[] rio1rio2z = evaluator.valueOf(ci.getRio1Rio2Z(), lUnit); float[] profile = evaluator.valueOf(ci.getProfile(), aUnit); dz = evaluator.formatted(rio1rio2z[4]/2.0f); ri1 = evaluator.formatted(rio1rio2z[0]); ri2 = evaluator.formatted(rio1rio2z[2]); ro1 = evaluator.formatted(rio1rio2z[1]); ro2 = evaluator.formatted(rio1rio2z[3]); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); key+=";"+ri1+";"+ro1+";"+ri2+";"+ro2+";"+dz+";"+phi1+";"+phi2; return key; } catch(Exception e) { //System.out.println("Not a Cons"); } // -- try { TrdImpl trdi = (TrdImpl) (v); String lUnit = trdi.getUnitLength(); String aUnit = trdi.getUnitAngle(); float[] xmpympz = evaluator.valueOf(trdi.getXmpYmpZ(), lUnit); x1 = evaluator.formatted(xmpympz[0]/2.0f); x2 = evaluator.formatted(xmpympz[1]/2.0f); y1 = evaluator.formatted(xmpympz[2]/2.0f); y2 = evaluator.formatted(xmpympz[3]/2.0f); dz = evaluator.formatted(xmpympz[4]/2.0f); key+=";"+x1+";"+x2+";"+y1+";"+y2+";"+dz; return key; } catch(Exception e) { //System.out.println("Not a Trd"); } // -- try { PconImpl pci = (PconImpl) (v); String lUnit = pci.getUnitLength(); String aUnit = pci.getUnitAngle(); float[] profile = evaluator.valueOf(pci.getProfile(), aUnit); String phi1 = evaluator.formattedRad2Deg(profile[0]); String phi2 = evaluator.formattedRad2Deg(profile[0]+profile[1]); List planes = pci.getPolyplane(); int n = planes.size(); float[] rioz = new float[3]; // to store just one plane! for (Object p : planes) { if (p instanceof PolyplaneType) { rioz = evaluator.valueOf(((PolyplaneType)p).getRioZ(), lUnit); key+=";"+evaluator.formatted(rioz[0])+";"+evaluator.formatted(rioz[1])+";"+evaluator.formatted(rioz[2]); } } key+=";"+phi1+";"+phi2+";"+String.valueOf(n); return key; } catch(Exception e) { //System.out.println("Not a Pcon"); } // -- return key; } public void AddNode(String parent, String daughter, int Ncopy, String [] Position) { (builder()).cxx(parent+"->AddNode("+daughter+","+String.valueOf(Ncopy)+", new TGeoCombiTrans(" +Position[0]+","+Position[1]+","+Position[2] +",unityRotation));"); } public void AddNodeRotation(String parent, String daughter, int Ncopy, String [] Position, String [] Rotation) { String suffix = (Ncopy==1)?"":String.valueOf(Ncopy); String CombiTransName = "ct_"+daughter+suffix; (builder()).cxx(""); (builder()).cxx("TGeoCombiTrans* "+CombiTransName+" = new TGeoCombiTrans();"); (builder()).cxx(parent+"->AddNode("+daughter+","+Ncopy+","+CombiTransName+");"); (builder()).cxx(CombiTransName+"->RotateX("+Rotation[0]+");"); (builder()).cxx(CombiTransName+"->RotateY("+Rotation[1]+");"); (builder()).cxx(CombiTransName+"->RotateZ("+Rotation[2]+");"); (builder()).cxx(CombiTransName+"->SetTranslation("+Position[0]+","+Position[1]+","+Position[2]+");"); (builder()).cxx(""); } public void positionCore(Object o, float[] xyz, float[] rot) { if (o instanceof VolumeType) { String key=keyToPosition((VolumeType)o); // System.out.println("Key: "+key); // if(builder().compStackNotEmpty()) { // System.out.println("Peeking comp: "+ builder().peekComp()); // } String realParent = builder().peekComp(); Evaluator evaluator = (builder()).evaluator(); String[] poz = evaluator.formatted(xyz); String[] rot1 = evaluator.formattedRad2Deg(rot); // System.out.println("Rotation"+" "+rot1[0]+" "+rot1[1]+" "+rot1[2]); int Ncopy = Solid.Ncopy(key); String genName = Solid.FromKeyHash(key); //System.out.println("STAR: positioning: "+genName+" in "+realParent+" with Ncopy="+Ncopy); if(rot[0]==0.0 && rot[1]==0.0 && rot[2]==0.0) { // unity rotation AddNode(realParent, genName, Ncopy, poz); } else { AddNodeRotation(realParent, genName, Ncopy, poz, rot1); } } } public void positionCore(Object o, float[] xyz, float[] rot, float phi) { int rotl=rot.length; float[] adjustedRot = new float[rotl]; for(int i=0;i<rotl;i++) {adjustedRot[i]=rot[i];} adjustedRot[2]+=phi; positionCore(o,xyz,adjustedRot); } /** Logging . */ private static Logger log = Logger.getLogger(Positioner.class); } --- NEW FILE: Solid.java --- package net.hep.AGDD.TGeoModel; import net.hep.AGDD.TGeoModel.Reps.AGDDmedium; import net.hep.AGDD.TGeoModel.Reps.AGDDmaterial; // Generic Model import net.hep.AGDD.JAXB.MediumType; import net.hep.AGDD.JAXB.ColorType; // GraXML import net.hep.graphics.GraXML.GraXMLJAXBRep; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // FreeHEP import org.freehep.j3d.OutlinedShape3DFactory; // JAXB import net.hep.AGDD.JAXB.Material; // Java3D import javax.media.j3d.Node; import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.Link; import javax.media.j3d.Shape3D; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; // Utility import java.util.HashMap; /** Common part of GraXML representations {@link GraXMLJAXBRep} of solid AGDD * elements connected via JAXB generic JAXB interfaces. * <p><font color="#880088"> * <pre> * $Log: Solid.java,v $ * Revision 1.1 2006/02/08 21:29:52 starxml * Adding first cut of working components * * Revision 1.3 2005/03/24 14:24:30 hrivnac * Optimisation optimised * * Revision 1.2 2005/01/20 17:54:36 hrivnac * all single solids added * * Revision 1.1 2005/01/20 13:06:39 hrivnac * Box + PosXYZ implemented * * </pre> * </font></p> * @version $Id: Solid.java,v 1.1 2006/02/08 21:29:52 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public abstract class Solid implements GraXMLJAXBRep { public abstract void traverse(MasterBuilder builder, Element element, Group tg, String parent); /** Use Java3D {@link Node} as a GraXML building block: * <ul> * <li>Put it into {@link Interacter}.</li> * <li>Register it in the {@link net.hep.graphics.GraXML.Optimisator.OptimisationDB} database.</li> * <li>Register it in the {@link ConnectionsDB} database.</li> * </ul> * @param node The Java3D {@link Node} to be used. * @param name The name of the element. * @param parent The name of the parent element. * @param tg The parent {@link Group}. */ protected void use(Node node, String name, String parent, Group tg) { // Get element properties String material = _builder.material(); String info = name + "[" + material + "]"; _nameCore = name; if (name.indexOf(";") > - 1) { _nameCore = name.substring(0, name.indexOf(";")); } // System.out.println("in use: "+_nameCore); // Just register in case of Boolean operation if (_register) { if (node instanceof Shape3D) { _shape = (Shape3D)node; _shape.setAppearance(builder().appearance(name, material)); } else { log.error("Can't be register " + node + " because it is not Shape3D"); } return; } // Create interacting BranchGroup BranchGroup interacter = Interacter.createInteracter(node, MasterBuilder.window(), name, OutlinedShape3DFactory.outlineColor()); // Get link if this BranchGroup is already registered in Optimisation database, // register otherwise Link link = _builder.optDB().addGroup(name, interacter); BranchGroup branch = interacter; // Link doesn't exist in case of no optimisation if (link != null) { branch = new BranchGroup(); branch.addChild(link); } // Register proper BranchGroup into Connections database if (Interacter.interactivity()) { _builder.conDB().addConnection(new DetachableConnection(name, parent, tg, branch, _builder. appearance(_nameCore, material), info)); } else { tg.addChild(branch); } // Register Appearance so that it can be used by higher level conainer (Volume) _builder.setAppearance(builder().appearance(_nameCore, material)); } /** Verify if element is already registered in * {@link et.hep.graphics.GraXML.Optimisator.OptimisationDB} database, * use it if yes. * @param nameCore The name of the element (without ordering extension). * @param name The name of the element (with ordering extension). * @param parent The name of the parent element. * @param tg The parent {@link Group}. * @return Whether there is a link in the database. */ protected final boolean isLink(String nameCore, String name, String parent, Group tg) { Link l = _builder.optDB().getLink(nameCore, name); if (l != null) { if (Interacter.interactivity()) { BranchGroup b = new BranchGroup(); b.addChild(l); _builder.conDB().addConnection(new DetachableConnection(name, parent, tg, b, _builder.appearance(nameCore))); } else { tg.addChild(l); } return true; } return false; } /** Verify that {@link MasterBuilder} type is {@link AGDDBuilder} and * set it. * @param builder The {@link MasterBuilder} to be verified and set. */ protected void setBuilder(MasterBuilder builder) { if (! (builder instanceof TGeoAGDDBuilder)) { log.error("Can't be traversed using " + builder + " builder"); return; } _builder = (TGeoAGDDBuilder)builder; } /** Used {@link AGDDBuilder}. * @return The used {@link AGDDBuilder}. */ protected TGeoAGDDBuilder builder() { return _builder; } private TGeoAGDDBuilder _builder; /** Tell, if just registerring is schedules (as in case of {@link Boolean}). * @return Whether just registerring ismcsheduled. */ public static boolean register() { return _register; } /** In case of {@link Boolean}, just register. * @param register Whether to set registerring mode. */ public static void setRegister(boolean register) { _register = register; _shape = null; } private static boolean _register = false; private boolean _skip = false; protected String _nameCore; // ------------------------------------------ Materials and Media protected String _matName; protected String _medName; protected double _aweight; protected double _zeff; protected double _density; protected double _lambda; protected double _x0; protected AGDDmedium _agddMedium; protected AGDDmaterial _agddMaterial; protected AGDDmedium getAGDDmedium(Element e) { _agddMedium = new AGDDmedium(e); return _agddMedium; } protected AGDDmaterial getAGDDmaterial(AGDDmedium medium) { _agddMaterial = new AGDDmaterial(medium); return _agddMaterial; } protected void AssignColor(String name) { short col[] = rgb(); builder().cxx(name+"->SetLineColor(TColor::GetColor("+col[0]+","+col[1]+","+col[2]+"));"); } protected void ProcessMediumAndMaterial(Element e) { AGDDmedium medium = getAGDDmedium(e); _medName = medium.getName(); if (AGDDmedium.InHash(_medName)==0) { // only construct if not already have done so Integer medNumber = AGDDmedium.ToHash(_medName); System.out.println("Creating medium No."+medNumber.toString()+":"+_medName); AGDDmaterial material = getAGDDmaterial(medium); _matName = material.getName(); if (AGDDmaterial.InHash(_matName)==0) { // only construct if not already have done so Integer matNumber = AGDDmaterial.ToHash(_matName); System.out.println("Creating material No."+matNumber.toString()+":"+_matName); material.Process(matNumber); builder().cxx(material.ctor()); } Integer isvol = medium.isSensitive()?1:0; builder().cxx(medium.ctor(medNumber,_matName,isvol)); } } // -- protected static HashMap _keyHash = new HashMap(1000); protected static HashMap _indexHash = new HashMap(1000); protected static HashMap _copyHash = new HashMap(1000); // -- public static boolean InKeyHash(String key) { return _keyHash.containsKey(key); } public static boolean InIndexHash(String coreName) { return _indexHash.containsKey(coreName); } public static boolean InCopyHash(String indexName) { return _copyHash.containsKey(indexName); } // -- public static String ToKeyHash(String key, String name) { name=Indexed(name); // System.out.println("to key hash "+key+" "+name); _keyHash.put(key, name); return name; } public static String FromKeyHash(String key) { String name=(String) _keyHash.get(key); // System.out.println("from key hash "+key+" "+name); return name; } public static void ToIndexHash(String name) { Integer i=1; // System.out.println("to index hash "+name+" "+i); _indexHash.put(name,i); } // -- public static String FromIndexHash(String key) { String indexedName=""; if(_indexHash.containsKey(key)) { // get value indexedName = (String) _indexHash.get(key); // System.out.println("from index hash "+indexedName); } return indexedName; } public static int Ncopy(String key) { Integer i=1; int i_ret=1; // if(!InKeyHash(key)) { // System.out.println(key+" not in key hash"); // } String name = FromKeyHash(key); // System.out.println("Testing "+key+" in key hash "+name); if(_copyHash.containsKey(name)) { i = (Integer) _copyHash.get(name); _copyHash.put(name,((Integer)(i+1))); i_ret=i+1; // System.out.println("in copy hash "+name+" "+i); } else { _copyHash.put(name,((Integer)(1))); } return i_ret; } public static String Indexed(String name) { Integer i=0; String ind=""; if(_indexHash.containsKey(name)) { // get value i = (Integer) _indexHash.get(name); if(i!=0) { ind=Integer.toString(i); } // System.out.println("in index hash "+name+" "+ind); } // update hash i=i+1; _indexHash.put(name, i); return name+ind; } // -- public boolean skip() {return _skip;} public void setSkip() {_skip=true;} /** The {@link Shape3D} registered for boolean operation. * @return The registered {@link Shape3D}. */ public static Shape3D registeredShape3D() { return _shape; } private static Shape3D _shape; /** Extract and remember color attributes from {@link net.hep.AGDD.JAXB.Solid}. * Try first <em>color</em> attribute, then <em>medium/color</em> attribute. * @param s The colorfull {@link net.hep.AGDD.JAXB.Solid}. */ public void setColor(net.hep.AGDD.JAXB.Solid s) { ColorType color = (ColorType)(s.getColor()); if (color == null) { MediumType medium = (MediumType)(s.getMedium()); color = (ColorType)(medium.getColor()); } if (color != null) { float[] rgb = builder().evaluator().valueOf(color.getRgb(), "1"); _rgb = new short[3]; for (int i = 0; i < 3; i++) { _rgb[i] = (short)rgb[i]; } float[] transparency = builder().evaluator().valueOf(color.getTransparency(), "1"); _transparency = transparency[0]; } } /** Give red-green-blue color components. * @return The threevector of componets 3 * <0; 255>. */ public short[] rgb() { return _rgb; } /** Give transparency color component. * @return The level of transparency <0.0; 1.0>. */ public float transparency() { return _transparency; } private short[] _rgb = null; private float _transparency = 0.0f; /** Logging . */ private static Logger log = Logger.getLogger(Solid.class); } // double a = material.getAweight(); // double z = material.getZeff(); // double rho = material.getDensity(); // double radlen = material.getX0(); // double intlen = material.getLambda(); // System.out.println(" A="+ material.getAweight()+ // " Z="+ material.getZeff()+ // " density="+ material.getDensity()+ // " x0="+ material.getX0()+ // " lambda="+ material.getLambda()); // builder().cxx("TGeoMaterial *"+_matName+" = new TGeoMaterial(\"" // +_matName+"\","+a+","+z+","+rho+","+radlen+","+intlen+");"); // builder().cxx(_matName+"->SetUniqueID("+matNumber.toString()+");"); --- NEW FILE: Evaluator.java --- package net.hep.AGDD.TGeoModel; // GraXML import net.hep.graphics.GraXML.MasterBuilder; // Bean Shell import bsh.Interpreter; import bsh.EvalError; // Java import java.util.Collection; import java.util.HashSet; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; // Formatting strings import java.text.DecimalFormat; /** <code>Evaluator</code> evaluates mathematial formulas in AGDD * attributes. * Following mathematical expressions are supported: * <ul> * <li><code>pi</code></li> * <li><code>e</code></li> * <li><code>sin(x)</code></li> * <li><code>cos(x)</code></li> * <li><code>tan(x)</code></li> * <li><code>asin(x)</code></li> * <li><code>acos(x)</code></li> * <li><code>atan(x)</code></li> * <li><code>atan2(x, y)</code></li> * <li><code>pow(x, y)</code></li> * <li><code>sqrt()</code></li> * <li><code>fmod(x, y)</code></li> * </ul> * <p><font color="#880088"> * <pre> * $Log: Evaluator.java,v $ * Revision 1.1 2006/02/08 21:29:52 starxml * Adding first cut of working components * * Revision 1.8 2005/02/13 18:17:14 hrivnac * javadoc fixes * * Revision 1.7 2005/02/13 12:10:06 hrivnac * new tests results included * * Revision 1.6 2005/02/13 02:13:09 hrivnac * foraech added * * Revision 1.5 2005/02/12 23:26:43 hrivnac * variables are properly resolved in parallel structures * * Revision 1.4 2005/02/12 21:32:30 hrivnac * mathematics works * * Revision 1.3 2005/02/03 13:30:58 hrivnac * rescaling possible * * Revision 1.2 2005/01/20 13:39:13 hrivnac * posRPhiZ added * * Revision 1.1 2005/01/20 13:06:39 hrivnac * Box + PosXYZ implemented * * </pre> * </font></p> * @version $Id: Evaluator.java,v 1.1 2006/02/08 21:29:52 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Evaluator { /** Create <code>Evaluator</code> and register related {@link MasterBuilder}. * @param builder The related {@link MasterBuilder}. */ public Evaluator(MasterBuilder builder) { _format = new java.text.DecimalFormat("#,##0.0###"); } /** Perform actual evaluation, scale he result to proper * value taking into account units, if requested. * @param o The object to be evaluated, it can contain standard mathematical * expressions and XML references to other evaluatable objects. * It can be a single value or an arry separated by ";". * @param units Unit names to scale with, * defaults are <code>mm</code> and <code>radian</code>, * values are scaled to <code>10m</code> and <code>1rad</code>. * @return The evaluated value, 0 if evaluation can't be performed. */ public float[] valueOf(String o, String[] units) { String[] vector = o.split(";"); float[] v = new float[vector.length]; int i = 0; String value; for (String component : vector) { value = valueOf(component); v[i] = new Float(value) * scale(units[i]); i++; } return v; } /** Perform actual evaluation, scale the result to proper * value taking into account units, if requested. * @param o The object to be evaluated, it can contain standard mathematical * expressions and XML references to other evaluatable objects. * It can be a single value or an arry separated by ";". * @param unit Unit name to scale with, * defaults are <code>mm</code> and <code>radian</code>, * values are scaled to <code>10m</code> and <code>1rad</code>. * @return The evaluated value, 0 if evaluation can't be performed. */ public float[] valueOf(String o, String unit) { String[] vector = o.split(";"); float[] v = new float[vector.length]; int i = 0; String value; for (String component : vector) { value = valueOf(component); v[i++] = new Float(value) * scale(unit); } return v; } public String[] formatted(float [] vector) { String[] s = new String[vector.length]; int i = 0; for (float component : vector) { s[i++] = _format.format(component); } return s; } public String[] formattedScaled(float [] vector, float scale) { String[] s = new String[vector.length]; int i = 0; for (float component : vector) { s[i++] = _format.format(component*scale); } return s; } public String formatted(float f) { String s = _format.format(f); return s; } public String formatted(double d) { String s = _format.format(d); return s; } private final float rad2deg = 180f/(float) PI; public String formattedRad2Deg(float f) { String s = _format.format(f*rad2deg); return s; } public String[] formattedRad2Deg(float [] vector) { String[] s = new String[vector.length]; int i = 0; for (float component : vector) { s[i++] = _format.format(component*rad2deg); } return s; } /** Perform one evaluation step according to the nature * of the submitted object. The result can be another formula * or reference. * @param o The object to be evaluated, it can contain standard mathematical * expressions and XML references to other evaluatable objects. * @return The evaluated , 0 if evaluation can't be performed. */ public String valueOf(Object o) { String value = "0.0f"; // It can be a number if (o instanceof Number) { value = o.toString(); } // String should be ready for evaluation else if (o instanceof String) { value = evaluate((String)o); } else { log.error("Can't evaluate (" + o.getClass() + ")" + o + ", returning 0"); } return value; } /** Perform BeanShell evaluation of the mathematical formula. * @param formula The mathematical formula to be evaluated. * @return The resulting number, 0 if evaluation can't be performed. */ private String evaluate(String formula) { String value = "0"; try { Object result = _interpreter.eval(formula); if (result instanceof Number) { value = ((Number)result).toString(); } else if (result instanceof Boolean) { value = (Boolean)result ? "1" : "0"; } else { log.error(formula + "= " + result + " isn't a Number, returning 0"); } } catch (EvalError e) { log.error("Can't evaluate " + formula + ", use 0", e); } return value; } /** Give multiplication scale with respect to default values. * <em>lUnit</em>s' default is <code>dam</code>. * <em>aUnit</em>s' default is <code>1rad</code>. * In case of length values, the result is multiplied by {@link #_rescaleFactor}. * @param unit The name of the unit, * supported units are <code>mm, cm, dm, m, dam, hm, km, radian, degree, 1</code>. * <code>1</code> doesn't scale (scales by <code>1</code>). * @return The multiplication factor to get * <code>10m</code> unit for length (<em>lUnit</em>) and * <code>1rad</code> unit for angle (<em>aUnit</em>). */ private float scale(String unit) { float scale = 1f; if (unit == null) { log.warn("No unit supplied, use 1"); } else if (unit.equals("1")) scale = 1.0f; else if (unit.equals("mm")) scale = 0.0001f * _rescaleFactor; else if (unit.equals("cm")) scale = 0.001f * _rescaleFactor; else if (unit.equals("dm")) scale = 0.01f * _rescaleFactor; else if (unit.equals("m")) scale = 0.1f * _rescaleFactor; else if (unit.equals("dam")) scale = 1.0f * _rescaleFactor; else if (unit.equals("hm")) scale = 10.0f * _rescaleFactor; else if (unit.equals("km")) scale = 100.0f * _rescaleFactor; else if (unit.equals("rad")) scale = 1.0f; else if (unit.equals("deg")) scale = (float)PI/180f; else { log.warn("Can't scale unit: " + unit + ", use 1"); } return scale; } /** Set scalar variable. * @param name The name of variable. * @param value The value of variable, can contain mathematical formulas and other variables. */ public void setValue(String name, String value) { log.debug("Setting: " + name + " = " + value); try { if (_variables.contains(name)) { _interpreter.eval(name + "_bck = " + name + ";"); } else { _interpreter.eval(name + "_bck = 0;"); } _interpreter.eval(name + " = " + value + ";"); } catch (EvalError e) { log.error("Can't set " + name + " = " + value + "", e); } _lastVariable = name; _variables.add(name); // System.out.println("Setting: " + name + " = " + value); } /** Set vector variable. * @param name The name of variable. * @param values The values of variable, can contain mathematical formulas and other variables. */ public void setValues(String name, String values) { log.debug("Setting: " + name + " = " + values); try { if (_variables.contains(name)) { _interpreter.eval(name + "_bck = " + name + ";"); } else { _interpreter.eval(name + "_bck = 0;"); } _interpreter.eval("double[] " + name + " = {" + values.replaceAll(";", ",") + "};"); } catch (EvalError e) { log.error("Can't set " + name + " = {" + values.replaceAll(";", ",") + "}", e); } _lastVariable = name; _variables.add(name); // System.out.println("Setting: " + name + " = " + values); } /** Set matrix variable. * @param name The name of variable. * @param values The values of variable, can contain mathematical formulas and other variables. */ public void setValues(String name, String[] values) { log.debug("Setting: " + name + " = " + values); String table = ""; for (int i = 0; i < values.length; i++) { table += "{" + values[i].replaceAll(";", ",") + "}"; if (i < values.length - 1) { table += ", "; } } try { if (_variables.contains(name)) { _interpreter.eval(name + "_bck = " + name + ";"); } else { _interpreter.eval(name + "_bck = 0;"); } _interpreter.eval("double[][] " + name + " = {" + table + "};"); } catch (EvalError e) { log.error("Can't set " + name + " = {" + table + "}", e); } _lastVariable = name; _variables.add(name); // System.out.println("Setting: " + name + " = " + values); } /** Reset the variable to its previous value. * @param name The name of variable to reset. */ public void rollbackVariable(String name) { if (!_variables.contains(name)) { return; } log.debug("Reseting " + name); try { _interpreter.eval(name + " = " + name + "_bck"); } catch (EvalError e) { log.error("Can't rollback variable " + name, e); } } /** Give last set variable, reset it to null. * @return The last set variable. */ public String lastVariable() { String lv = _lastVariable; _lastVariable = null; return lv; } /** Set factor to be used to scale all length dimensions. * @param rescaleFactor The factor to multiplied to the length value, default is 1. */ public static void setRescaleFactor(float rescaleFactor) { _rescaleFactor = rescaleFactor; } private static float _rescaleFactor = 1f; /** Return the <code>lUnit</code> which scales by <code>1</code>. * @return <code>dam</code>. */ public static String lUnit() { return _lUnit; } /** Return the <code>aUnit</code> which scales by <code>1</code>. * @return <code>rad</code>. */ public static String aUnit() { return _aUnit; } private static String _lUnit = "dam"; private static String _aUnit = "rad"; private static Interpreter _interpreter; private static String _lastVariable; private static Collection<String> _variables = new HashSet<String>(); /** Logging . */ private static Logger log = Logger.getLogger(Evaluator.class); /** Create {@link Interpreter} and define standard mathematical values and * functions. */ static { _interpreter = new Interpreter(); try { _interpreter.set("pi", Math.PI); _interpreter.set("e", Math.E); _interpreter.eval("double sin(double x) {return Math.sin(x);}"); _interpreter.eval("double cos(double x) {return Math.cos(x);}"); _interpreter.eval("double tan(double x) {return Math.tan(x);}"); _interpreter.eval("double asin(double x) {return Math.asin(x);}"); _interpreter.eval("double acos(double x) {return Math.acos(x);}"); _interpreter.eval("double atan(double x) {return Math.atan(x);}"); _interpreter.eval("double atan2(double x, double y) {return Math.atan2(x, y);}"); _interpreter.eval("double pow(double x, double y) {return Math.pow(x, y);}"); _interpreter.eval("double sqrt(double x) {return Math.sqrt(x);}"); _interpreter.eval("double fmod(double x, double y) {return x % y;}"); } catch (EvalError e) { log.error("Can't initialise Interpreter", e); } } private static DecimalFormat _format; } |
From: starXML <st...@us...> - 2006-02-08 21:25:17
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23197/AGDD/src/net/hep/AGDD/TGeoModel Modified Files: TGeoAGDDBuilder.java Log Message: First cut of the TGeoAGDDBuilder Index: TGeoAGDDBuilder.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/TGeoAGDDBuilder.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TGeoAGDDBuilder.java 30 Mar 2005 13:42:56 -0000 1.1 --- TGeoAGDDBuilder.java 8 Feb 2006 21:25:09 -0000 1.2 *************** *** 1,25 **** package net.hep.AGDD.TGeoModel; ! import net.hep.AGDD.GeometricModel.AGDDBuilder; // Log4J import org.apache.log4j.Logger; ! /** <code>TGeoAGDDBuilder</code> extends {@link AGDDBuilder} ! * to provide Root TGeo code generation. * <p><font color="#880088"> * <pre> * $Log$ ! * Revision 1.1 2005/03/30 13:42:56 hrivnac ! * AGDD added * ! * Revision 1.1 2005/03/22 10:18:23 hrivnac * TGeoModel introduced * * </pre> * </font></p> * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public class TGeoAGDDBuilder extends AGDDBuilder { } --- 1,279 ---- package net.hep.AGDD.TGeoModel; ! // GraXML ! import net.hep.graphics.GraXML.MasterBuilder; ! import java.io.*; ! ! // Java3D ! import javax.media.j3d.Group; ! import javax.media.j3d.TransformGroup; ! import javax.media.j3d.Transform3D; ! import javax.media.j3d.Appearance; ! import javax.vecmath.Vector3d; ! import javax.vecmath.Matrix3d; ! ! // JAXB ! import javax.xml.bind.Element; ! ! // Java ! import java.util.Stack; ! //import java.util.List; ! // Log4J import org.apache.log4j.Logger; ! /** <code>AGDDBuilder</code> performs AGDD specific part ! * of the {@link MasterBuilder} building proccess. * <p><font color="#880088"> * <pre> * $Log$ ! * Revision 1.2 2006/02/08 21:25:09 starxml ! * First cut of the TGeoAGDDBuilder * ! * Revision 1.6 2005/03/22 10:18:23 hrivnac * TGeoModel introduced * + * Revision 1.5 2005/02/13 18:17:14 hrivnac + * javadoc fixes + * + * Revision 1.4 2005/01/20 13:06:39 hrivnac + * Box + PosXYZ implemented + * + * Revision 1.3 2005/01/19 16:06:20 hrivnac + * top-level GeometricModel classes added + * + * Revision 1.2 2005/01/04 16:44:13 hrivnac + * XSD documentation added + * + * Revision 1.1 2004/12/07 23:25:03 hrivnac + * new package + * * </pre> * </font></p> * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public class TGeoAGDDBuilder extends MasterBuilder { ! ! public static String GetOutputFileName() { ! return _outputFileName; ! } ! ! private static PrintStream _outPrintStream; ! ! public static PrintStream getPrintStream() { ! return _outPrintStream; ! } ! ! public static void cxx(String s_) { ! _outPrintStream.println(s_); ! } ! ! public static void closeOutput() { ! _outPrintStream.flush(); ! _outPrintStream.close(); ! } ! ! /** Perform configuration. */ ! public void configure() { ! System.out.println("CONFIGURE"); ! // List sections = agdd.getMaterialsOrColormapOrSection(); ! ! } ! ! public void auxiliaryOutput(String filename_) { ! FileOutputStream fos; ! ! // Get the filename base, drop extension and add dot-C: ! int i = filename_.lastIndexOf('/'); ! String base = ""; ! if (i>-1) { base = filename_.substring(i+1);}else{base = filename_;} ! i = base.lastIndexOf('.'); ! if (i>-1) { base = base.substring(0,i)+".C";}else{base = base+"C";} ! ! ! System.out.println("STAR: generated C++ file "+base); ! ! try { ! fos = new FileOutputStream(base); ! _outPrintStream = new PrintStream(fos); ! } ! catch(Exception e) { ! System.err.println("Error when writing to file"); ! } ! ! // Create the header (should put it into a separate code) ! ! cxx("TDataSet *CreateTable() {"); ! cxx("TGeoManager *starManager = new TGeoManager(\"star\",\"XML\");"); ! cxx("TGeoRotation* unityRotation = new TGeoRotation(\"unityRotation\",0.0,0.0,0.0);"); ! ! // cxx("TGeoMaterial *matAIR = new TGeoMaterial(\"AIR\",14.0,7.0,0.1205000E-02);"); ! // cxx("matAIR->SetUniqueID(15);"); ! // cxx("TGeoMedium *medSTANDARD = new TGeoMedium(\"STANDARD\",1,matAIR->GetUniqueID(),0,0,20,20,10,0.24,0.1000000E-01,1.150);"); ! } ! ! public void finish() { ! cxx("gGeoManager->CloseGeometry();"); ! cxx("gGeoManager->SetNsegments(20);"); ! cxx("return new TDataSet();"); ! cxx("}"); ! ! closeOutput(); ! } ! ! ! /** Create unique name, taking into account {@link net.hep.graphics.GraXML.Disconnecter.ConnectionsDB}, ! * append <code>;<i></code> as necessary. ! * @param name The name. ! * @return The unique version of the name. */ ! public String name(String name) { ! if (conDB().getConnection(name) != null) { ! int i = 0; ! while (conDB().getConnection(name + ";" + ++i) != null) {} ! name = name + ";" + i; ! // System.out.println("--"+name); ! } ! return name; ! } ! ! /** Set position so it can be used later. ! * @param v The position {@link Vector3d}. */ ! public void setPosition(Vector3d v) { ! _position = v; ! } ! ! private Vector3d _position = UVECTOR; ! ! /** Set rotation so it can be used later. ! * @param m The rotation {@link Matrix3d}. */ ! public void setRotation(Matrix3d m) { ! _rotation = m; ! } ! ! private Matrix3d _rotation = UMATRIX;; ! ! /** Accumulated transformation. ! * @param tg The original {@link TransformGroup} ! * @return The resulting {@link TransformGroup}. */ ! public TransformGroup transform(Group tg) { ! Transform3D transform = new Transform3D(_rotation, _position, 1); ! TransformGroup tr; ! Transform3D t3d = null; ! if (tg instanceof TransformGroup) { ! ((TransformGroup)tg).getTransform(t3d); ! ((TransformGroup)tg).setTransform(t3d); ! tr = (TransformGroup)tg; ! } ! else { ! tr = new TransformGroup(transform); ! tg.addChild(tr); ! } ! return tr; ! } ! ! // ---------------------------------------------- ! /** Use specified color description to ! * create new {@link Appearance}. ! * @param name The name of the colored object. ! * @param rgb The red, green and blue components within <0; 255>. ! * if null, {@link mMasterBuilder} uses standard strategy.} ! * @param transparency The level of transparency <0.0; 1.0>. ! * @return The created {@link Appearance}. */ ! public Appearance appearance(String name, short[] rgb, float transparency) { ! if (rgb == null) { ! return super.appearance(name); ! } ! return super.appearance(name, rgb[0], rgb[1], rgb[2], transparency); ! } ! // ---------------------------------------------- ! ! ! public void setEnvelope(String envelope) { ! _envelope = envelope; ! } ! ! public String envelope() { ! return _envelope; ! } ! ! private String _envelope = ""; ! ! /** Register material name so it can be looked up by later. ! * @param material The name of the current material. */ ! public void setMaterial(String material) { ! _material = material; ! } ! ! /** Get current (latest) registered material name. ! * @return The current material ame. */ ! public String material() { ! return _material; ! } ! ! private String _material = ""; ! ! /** Get attached {@link Evaluator}. ! * @return The attached {@link Evaluator}. */ ! public Evaluator evaluator() { ! return _evaluator; ! } ! ! private Evaluator _evaluator = new Evaluator(this); ! ! private static String _outputFileName; ! ! public static void SetOutputFileName(String fn_) { ! _outputFileName=fn_; ! } ! ! ! /** Get builder version. ! * @return The version and build time of GDML. */ ! public final String version() { ! return Info.version(); ! } ! ! /** Get AGDD Schema file. ! * @return The AGDD Schema file. */ ! protected String schema() { ! return _schema; ! } ! ! /** Get AGDD JAXB Generic Model package name. ! * @return The package name of the JAXB Generic Model of GDML. */ ! protected String jaxb() { ! return _jaxb; ! } ! ! private static String _jaxb = "net.hep.AGDD.JAXB"; ! ! private static String _schema = "AGDD.xsd"; ! ! /** Zero vector. */ ! public static final Vector3d UVECTOR = new Vector3d(0, 0, 0); ! ! /** Unity matrix */ ! public static final Matrix3d UMATRIX = new Matrix3d(1, 0, 0, ! 0, 1, 0, ! 0, 0, 1); ! ! /** Logging . */ ! private static Logger log = Logger.getLogger(TGeoAGDDBuilder.class); ! ! ! // ! private static Stack<String> _compStack= new Stack<String>(); ! public boolean compStackNotEmpty() {return !_compStack.empty();} ! public boolean compStackIsEmpty() {return _compStack.empty();} ! public String popComp() {return _compStack.pop();} ! public String peekComp() {return _compStack.peek();} ! ! ! public void pushComp(String c) { ! // rely on the fact that top volume should really be a composition : ! if (compStackIsEmpty()) {cxx("gGeoManager->SetTopVolume("+c+");");} ! _compStack.push(c); ! } } |
From: starXML <st...@us...> - 2006-02-08 21:20:22
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/TGeoModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21088/AGDD/src/net/hep/AGDD/TGeoModel/Reps Added Files: Box.java Log Message: This is a first check-in of the working Box rep in the AGDD/TGeo system --- NEW FILE: Box.java --- package net.hep.AGDD.TGeoModel.Reps; import net.hep.AGDD.TGeoModel.Evaluator; import net.hep.AGDD.TGeoModel.Solid; // Generic Model import net.hep.AGDD.JAXB.BoxType; import net.hep.AGDD.JAXB.Material; import net.hep.AGDD.JAXB.Medium; // GraXML import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; // FreeHEP import org.freehep.j3d.Trapezoid; // Java3D import javax.media.j3d.Group; import javax.media.j3d.Shape3D; import javax.media.j3d.Link; import javax.media.j3d.BranchGroup; // JAXB import javax.xml.bind.Element; // Log4J import org.apache.log4j.Logger; /** GraXML representation {@link net.hep.graphics.GraXML.GraXMLJAXBRep} of <code>box</code> AGDD element * connected via JAXB {@link BoxType} generic JAXB * interface. * <p><font color="#880088"> * <pre> * $Log: Box.java,v $ * Revision 1.1 2006/02/08 21:20:14 starxml * This is a first check-in of the working Box rep in the AGDD/TGeo system * * </pre> * </font></p> * @version $Id: Box.java,v 1.1 2006/02/08 21:20:14 starxml Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Box extends Solid { public final void traverse(MasterBuilder builder, Element element, Group tg, String parent) { setBuilder(builder); // Verify and set builder type if (! (element instanceof BoxType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get element properties Evaluator evaluator = builder().evaluator(); BoxType box = (BoxType)element; // not used: box.isSensitive(); String lUnit = box.getUnitLength(); float[] xyz = evaluator.valueOf(box.getXYZ(), lUnit); String name0 = box.getName(); String name = builder().name(name0); setColor(box); String x = evaluator.formatted(xyz[0]/2.0f); String y = evaluator.formatted(xyz[1]/2.0f); String z = evaluator.formatted(xyz[2]/2.0f); if (!isLink(name0, name, parent, tg)) { // Verify reuse use(new Trapezoid(xyz[0], xyz[1], xyz[2], builder().appearance(name0, rgb(), transparency())), name, parent, tg); } //------------------------------------- TGEO ProcessMediumAndMaterial(element); String key = _nameCore+";"+x+";"+y+";"+z; String agddName=""; if (!InKeyHash(key)) { // only construct if not already have done so agddName = ToKeyHash(key,_nameCore); System.out.println("Creating box "+ agddName + " made of "+_medName); builder().cxx("TGeoVolume *"+agddName+" = gGeoManager->MakeBox(\""+agddName+"\","+_medName+","+x+","+y+","+z+");"); AssignColor(agddName); } else { FromKeyHash(key); } } /** Logging . */ private static Logger log = Logger.getLogger(Box.class); } |
From: Julius H. <hr...@us...> - 2006-02-01 11:27:54
|
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/GeometricModel/Reps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27690/net/hep/AGDD/GeometricModel/Reps Modified Files: Section.java Log Message: variables from buildingblocks can be used Index: Section.java =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/GeometricModel/Reps/Section.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Section.java 31 Mar 2005 09:22:20 -0000 1.2 --- Section.java 1 Feb 2006 11:27:43 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- // Generic Model import net.hep.AGDD.JAXB.SectionType; + import net.hep.AGDD.JAXB.BuildingBlockType; import net.hep.AGDD.JAXB.Data; *************** *** 30,33 **** --- 31,37 ---- * <pre> * $Log$ + * Revision 1.3 2006/02/01 11:27:43 hrivnac + * variables from buildingblocks can be used + * * Revision 1.2 2005/03/31 09:22:20 hrivnac * section name fix *************** *** 73,77 **** List volumes = section.getAbstractSolidOrAbstractStackOrAbstractBooleanVolume(); for (Object o : volumes) { ! if (o instanceof Data && o instanceof Element) { builder.traverse((Element)o, branch, name); } --- 77,91 ---- List volumes = section.getAbstractSolidOrAbstractStackOrAbstractBooleanVolume(); for (Object o : volumes) { ! // -- via BuildingBlock ! if (o instanceof BuildingBlockType) { ! List volumes0 = ((BuildingBlockType)o).getAbstractSolidOrAbstractStackOrAbstractBooleanVolume(); ! for (Object o0 : volumes0) { ! if (o0 instanceof Data && o0 instanceof Element) { ! builder.traverse((Element)o0, branch, name); ! } ! } ! } ! // -- directly ! else if (o instanceof Data && o instanceof Element) { builder.traverse((Element)o, branch, name); } |
From: Julius H. <hr...@us...> - 2006-02-01 11:27:54
|
Update of /cvsroot/graxml/DetDescr/AGDD/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27690 Modified Files: index.html Log Message: variables from buildingblocks can be used Index: index.html =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/index.html,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** index.html 24 Nov 2005 16:10:55 -0000 1.16 --- index.html 1 Feb 2006 11:27:43 -0000 1.17 *************** *** 36,40 **** <li><a href="Examples/Identifiers.agdd">Identifiers.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Indentifiers.wrl.gz">Indentifiers.wrl</a></li> <li><a href="Examples/Including.agdd">Including.agdd</a>, ! <a href="Examples/IncludedBuildingBlock.agdd">IncludedBuildingBlock.agdd</a>, <a href="Examples/IncludedComposition.agdd">IncludedComposition.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Including.wrl.gz">Including.wrl</a></li> <li><a href="Examples/MultiplePositioners.agdd">MultiplePositioners.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/MultiplePositioners.wrl.gz">MultiplePositioners.wrl</a></li> --- 36,41 ---- <li><a href="Examples/Identifiers.agdd">Identifiers.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Indentifiers.wrl.gz">Indentifiers.wrl</a></li> <li><a href="Examples/Including.agdd">Including.agdd</a>, ! <a href="Examples/IncludedBuildingBlockVariables.agdd">IncludedBuildingBlockVariables.agdd</a>, ! <a href="Examples/IncludedBuildingBlockSolids.agdd">IncludedBuildingBlockSolids.agdd</a>, <a href="Examples/IncludedComposition.agdd">IncludedComposition.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/Including.wrl.gz">Including.wrl</a></li> <li><a href="Examples/MultiplePositioners.agdd">MultiplePositioners.agdd</a> - <a href="JavaDoc/net/hep/AGDD/Test/doc-files/MultiplePositioners.wrl.gz">MultiplePositioners.wrl</a></li> *************** *** 134,137 **** --- 135,139 ---- <li>mposPhi fixed (thanks to M.Potekhin).</li> <li>pcon, phedra centered in z (thanks to M.Potekhin).</li> + <li>variables from BuildingBlocks are used.</li> </ul> </li> |
Update of /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27690/net/hep/AGDD/Test/data Modified Files: IncludedComposition.agdd Including.agdd Added Files: IncludedBuildingBlockSolids.agdd IncludedBuildingBlockVariables.agdd Removed Files: IncludedBuildingBlock.agdd Log Message: variables from buildingblocks can be used Index: IncludedComposition.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/IncludedComposition.agdd,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IncludedComposition.agdd 23 Nov 2005 16:13:10 -0000 1.1 --- IncludedComposition.agdd 1 Feb 2006 11:27:43 -0000 1.2 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.2 2006/02/01 11:27:43 hrivnac + variables from buildingblocks can be used + Revision 1.1 2005/11/23 16:13:10 hrivnac media and colors added, buildingBlock added *************** *** 17,20 **** <composition name="TEST"> ! <posXYZ X_Y_Z=" 2000; 2000; 0"> <volume name="box"/> </posXYZ> </composition> --- 20,23 ---- <composition name="TEST"> ! <posXYZ X_Y_Z=" 2*var1; 2000; 0"> <volume name="box"/> </posXYZ> </composition> --- NEW FILE: IncludedBuildingBlockSolids.agdd --- <?xml version="1.0" encoding="UTF-8"?> <!-- GraXML AGDD Unit Test: XInclude constituent --> <!-- $Log: IncludedBuildingBlockSolids.agdd,v $ Revision 1.1 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used --> <!-- @version $Id: IncludedBuildingBlockSolids.agdd,v 1.1 2006/02/01 11:27:43 hrivnac Exp $ --> <!-- @author Jul...@ce... --> <buildingBlock> <box name="box" medium="active" X_Y_Z="var1; 2000; 8000"/> </buildingBlock> --- NEW FILE: IncludedBuildingBlockVariables.agdd --- <?xml version="1.0" encoding="UTF-8"?> <!-- GraXML AGDD Unit Test: XInclude constituent --> <!-- $Log: IncludedBuildingBlockVariables.agdd,v $ Revision 1.1 2006/02/01 11:27:43 hrivnac variables from buildingblocks can be used --> <!-- @version $Id: IncludedBuildingBlockVariables.agdd,v 1.1 2006/02/01 11:27:43 hrivnac Exp $ --> <!-- @author Jul...@ce... --> <buildingBlock> <var name="var1" value="1000"/> </buildingBlock> --- IncludedBuildingBlock.agdd DELETED --- Index: Including.agdd =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/src/net/hep/AGDD/Test/data/Including.agdd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Including.agdd 23 Nov 2005 16:13:10 -0000 1.4 --- Including.agdd 1 Feb 2006 11:27:43 -0000 1.5 *************** *** 3,6 **** --- 3,9 ---- <!-- $Log$ + Revision 1.5 2006/02/01 11:27:43 hrivnac + variables from buildingblocks can be used + Revision 1.4 2005/11/23 16:13:10 hrivnac media and colors added, buildingBlock added *************** *** 25,29 **** xmlns:xi="http://www.w3.org/2001/XInclude"> ! <xi:include href="StandardMedias.agdd"/> <xi:include href="StandardMaterials.agdd"/> <xi:include href="StandardColors.agdd"/> --- 28,32 ---- xmlns:xi="http://www.w3.org/2001/XInclude"> ! <xi:include href="StandardMedia.agdd"/> <xi:include href="StandardMaterials.agdd"/> <xi:include href="StandardColors.agdd"/> *************** *** 36,40 **** top_volume = "TEST"> ! <xi:include href="IncludedBuildingBlock.agdd"/> <xi:include href="IncludedComposition.agdd"/> --- 39,44 ---- top_volume = "TEST"> ! <xi:include href="IncludedBuildingBlockVariables.agdd"/> ! <xi:include href="IncludedBuildingBlockSolids.agdd"/> <xi:include href="IncludedComposition.agdd"/> |
From: Julius H. <hr...@us...> - 2006-01-17 17:39:43
|
Update of /cvsroot/graxml/Graphics/GraXML/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396 Modified Files: GraXML-JAXB.jnlp GraXML.jnlp index.html Log Message: tuning WebStart Index: GraXML.jnlp =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXML.jnlp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraXML.jnlp 17 Jan 2006 14:57:44 -0000 1.1 --- GraXML.jnlp 17 Jan 2006 17:39:34 -0000 1.2 *************** *** 2,6 **** <jnlp spec="1.0+" codebase="http://home.cern.ch/hrivnac/Activities/Packages/WebStart" href="GraXML.jnlp"> <information> ! <title>GraXML</title> <vendor>J.Hrivnac</vendor> <homepage href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML"/> --- 2,6 ---- <jnlp spec="1.0+" codebase="http://home.cern.ch/hrivnac/Activities/Packages/WebStart" href="GraXML.jnlp"> <information> ! <title>GraXML - @VERSION@ [@BUILD@]</title> <vendor>J.Hrivnac</vendor> <homepage href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML"/> *************** *** 8,13 **** <description kind="one-line">Framework for manipulation and visualisation of geometrical objects in space.</description> <description kind="short">Framework for manipulation and visualisation of geometrical objects in space.</description> ! <icon href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc/net/hep/graphics/GraXML/doc-files/logo.gif"/> ! <icon kind="splash" href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc/net/hep/graphics/GraXML/doc-files/logo.gif"/> <offline-allowed/> </information> --- 8,12 ---- <description kind="one-line">Framework for manipulation and visualisation of geometrical objects in space.</description> <description kind="short">Framework for manipulation and visualisation of geometrical objects in space.</description> ! <icon kind="default" href="http://home.cern.ch/hrivnac/Activities/Packages/WebStart/GraXML.gif"/> <offline-allowed/> </information> *************** *** 16,20 **** </security> <resources> ! <j2se version="1.5+"/> <jar href="AGDD.jar"/> <jar href="colt.jar"/> --- 15,19 ---- </security> <resources> ! <j2se max-heap-size="536870912" version="1.5+"/> <jar href="AGDD.jar"/> <jar href="colt.jar"/> Index: GraXML-JAXB.jnlp =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXML-JAXB.jnlp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraXML-JAXB.jnlp 17 Jan 2006 14:57:44 -0000 1.1 --- GraXML-JAXB.jnlp 17 Jan 2006 17:39:34 -0000 1.2 *************** *** 2,6 **** <jnlp spec="1.0+" codebase="http://home.cern.ch/hrivnac/Activities/Packages/WebStart" href="GraXML-JAXB.jnlp"> <information> ! <title>GraXML-JAXB</title> <vendor>J.Hrivnac</vendor> <homepage href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML"/> --- 2,6 ---- <jnlp spec="1.0+" codebase="http://home.cern.ch/hrivnac/Activities/Packages/WebStart" href="GraXML-JAXB.jnlp"> <information> ! <title>GraXML-JAXB - @VERSION@ [@BUILD@]</title> <vendor>J.Hrivnac</vendor> <homepage href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML"/> *************** *** 8,13 **** <description kind="one-line">GraXML supporting libraries: JSXB, JAXP.</description> <description kind="short">GraXML supporting libraries: JSXB, JAXP.</description> ! <icon href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc/net/hep/graphics/GraXML/doc-files/logo.gif"/> ! <icon kind="splash" href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc/net/hep/graphics/GraXML/doc-files/logo.gif"/> <offline-allowed/> </information> --- 8,12 ---- <description kind="one-line">GraXML supporting libraries: JSXB, JAXP.</description> <description kind="short">GraXML supporting libraries: JSXB, JAXP.</description> ! <icon kind="default" href="http://home.cern.ch/hrivnac/Activities/Packages/WebStart/GraXML.gif"/> <offline-allowed/> </information> Index: index.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** index.html 17 Jan 2006 14:57:44 -0000 1.4 --- index.html 17 Jan 2006 17:39:34 -0000 1.5 *************** *** 13,17 **** End-user interacts only with two application programs: <b>GraXML.sh</b> interactive display and <b>GraXMLConverter.sh</b>.</p> ! <p>Current version: <b>@VERSION@</b> <small>(@BUILD@)</small></p> </td> <td width="50%"> --- 13,17 ---- End-user interacts only with two application programs: <b>GraXML.sh</b> interactive display and <b>GraXMLConverter.sh</b>.</p> ! <p>Current version: <b>@VERSION@</b> <small>[@BUILD@]</small></p> </td> <td width="50%"> |
From: Julius H. <hr...@us...> - 2006-01-17 17:39:42
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/net/hep/graphics/GraXML/doc-files Modified Files: Guide.html Log Message: tuning WebStart Index: Guide.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files/Guide.html,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Guide.html 17 Jan 2006 14:57:44 -0000 1.9 --- Guide.html 17 Jan 2006 17:39:34 -0000 1.10 *************** *** 13,17 **** one Generic Model. Such Generic Model is then a source for the GraXML Geometric Model. Direct access (without XML files) is possible too. ! The current version is <u><b>@VERSION@</b> <small>(@BUILD@)</small></u>. <ul> <li><a href="#Program%20Overview">Program Overview</a></li> --- 13,17 ---- one Generic Model. Such Generic Model is then a source for the GraXML Geometric Model. Direct access (without XML files) is possible too. ! The current version is <u><b>@VERSION@</b> <small>[@BUILD@]</small></u>. <ul> <li><a href="#Program%20Overview">Program Overview</a></li> |
From: Julius H. <hr...@us...> - 2006-01-17 17:39:42
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/JAS3Plugin/PLUGIN-inf In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/net/hep/graphics/GraXML/JAS3Plugin/PLUGIN-inf Modified Files: plugins.xml Log Message: tuning WebStart Index: plugins.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/JAS3Plugin/PLUGIN-inf/plugins.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** plugins.xml 30 Mar 2005 14:28:46 -0000 1.1 --- plugins.xml 17 Jan 2006 17:39:34 -0000 1.2 *************** *** 7,11 **** <name>GraXML</name> <author>J.Hrivnac</author> ! <version>@VERSION@ (@BUILD@)</version> <description kind="short">GraXML Pluging</description> <description>GraXML Pluging: 3D Event and Detector Display</description> --- 7,11 ---- <name>GraXML</name> <author>J.Hrivnac</author> ! <version>@VERSION@ [@BUILD@]</version> <description kind="short">GraXML Pluging</description> <description>GraXML Pluging: 3D Event and Detector Display</description> |
From: Julius H. <hr...@us...> - 2006-01-17 17:39:41
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Disconnecter In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15396/net/hep/graphics/GraXML/Disconnecter Modified Files: ViewerTreeCellRenderer.java Log Message: tuning WebStart Index: ViewerTreeCellRenderer.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Disconnecter/ViewerTreeCellRenderer.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ViewerTreeCellRenderer.java 30 Mar 2005 12:44:29 -0000 1.1 --- ViewerTreeCellRenderer.java 17 Jan 2006 17:39:34 -0000 1.2 *************** *** 14,17 **** --- 14,20 ---- * <pre> * $Log$ + * Revision 1.2 2006/01/17 17:39:34 hrivnac + * tuning WebStart + * * Revision 1.1 2005/03/30 12:44:29 hrivnac * GraXML introduced *************** *** 71,79 **** private ConnectionsDB _conDB; ! private static final ImageIcon _leaf = new ImageIcon(ClassLoader.getSystemResource("net/hep/graphics/GraXML/GUI/images/leaf.gif")); ! private static final ImageIcon _open = new ImageIcon(ClassLoader.getSystemResource("net/hep/graphics/GraXML/GUI/images/open.gif")); ! private static final ImageIcon _closed = new ImageIcon(ClassLoader.getSystemResource("net/hep/graphics/GraXML/GUI/images/closed.gif")); } --- 74,82 ---- private ConnectionsDB _conDB; ! private ImageIcon _leaf = new ImageIcon(getClass().getClassLoader().getResource("net/hep/graphics/GraXML/GUI/images/leaf.gif")); ! private ImageIcon _open = new ImageIcon(getClass().getClassLoader().getResource("net/hep/graphics/GraXML/GUI/images/open.gif")); ! private ImageIcon _closed = new ImageIcon(getClass().getClassLoader().getResource("net/hep/graphics/GraXML/GUI/images/closed.gif")); } |
From: Julius H. <hr...@us...> - 2006-01-17 17:39:26
|
Update of /cvsroot/graxml/Graphics/GraXML/ant In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15334 Modified Files: build.xml Log Message: tuning WebStart Index: build.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/ant/build.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build.xml 17 Jan 2006 15:16:08 -0000 1.8 --- build.xml 17 Jan 2006 17:39:16 -0000 1.9 *************** *** 288,291 **** --- 288,297 ---- <fileset file="${lib}/*.jar"/> </copy> + <replace file="${user.home}/WWW/Activities/Packages/WebStart/GraXML.jnlp" token="@VERSION@" value="${version}"/> + <replace file="${user.home}/WWW/Activities/Packages/WebStart/GraXML.jnlp" token="@BUILD@" value="${TSTAMP}"/> + <replace file="${user.home}/WWW/Activities/Packages/WebStart/GraXML-JAXB.jnlp" token="@VERSION@" value="${version}"/> + <replace file="${user.home}/WWW/Activities/Packages/WebStart/GraXML-JAXB.jnlp" token="@BUILD@" value="${TSTAMP}"/> + <copy tofile="${user.home}/WWW/Activities/Packages/WebStart/GraXML.gif" + file="${src}/net/hep/graphics/GraXML/doc-files/logo.gif"/> </target> |