graxml-commit Mailing List for GraXML (Page 11)
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...> - 2007-10-09 17:17:54
|
Update of /cvsroot/graxml/Graphics/GraXML/src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16219 Modified Files: GraXML.jnlp GraXML.sh GraXMLConverter.sh Log Message: both i386 and amd64 Linux supported; using Java3D 1.5.1 Index: GraXML.jnlp =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXML.jnlp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** GraXML.jnlp 26 Sep 2007 15:48:38 -0000 1.7 --- GraXML.jnlp 9 Oct 2007 17:17:50 -0000 1.8 *************** *** 15,19 **** </security> <resources> ! <j2se max-heap-size="536870912" version="1.5+"/> <jar href="jars/AGDD.jar"/> <jar href="jars/bool.jar"/> --- 15,19 ---- </security> <resources> ! <j2se max-heap-size="536870912" version="1.6+"/> <jar href="jars/AGDD.jar"/> <jar href="jars/bool.jar"/> *************** *** 30,53 **** <jar href="jars/jlfgr.jar"/> <jar href="jars/log4j-1.2.8.jar"/> - <jar href="jars/relaxngDatatype.jar"/> <jar href="jars/xercesImpl.jar"/> <jar href="jars/xml-apis.jar"/> ! <jar href="jars/xsdlib.jar"/> ! <jar href="jars/activation.jar"/> ! <jar href="jars/jaxb-api.jar"/> ! <jar href="jars/jaxb-impl.jar"/> ! <jar href="jars/jaxb-impl.jar"/> ! <jar href="jars/jaxb1-impl.jar"/> ! <jar href="jars/jaxb-xjc.jar"/> ! <jar href="jars/jaxp-api.jar"/> ! <jar href="jars/jsr173_api.jar"/> ! <jar href="jars/jaxb-api.jar"/> ! <jar href="jars/jaxb-impl.jar"/> ! <jar href="jars/jaxb-impl.jar"/> ! <jar href="jars/jaxb1-impl.jar"/> ! <jar href="jars/jaxb-xjc.jar"/> ! <jar href="jars/jaxp-api.jar"/> ! <jar href="jars/jsr173_api.jar"/> ! <extension href="http://download.java.net/media/java3d/webstart/release/java3d-1.3-latest.jnlp"/> </resources> <application-desc main-class="net.hep.graphics.GraXML.FrontEnd.GraXML"/> --- 30,36 ---- <jar href="jars/jlfgr.jar"/> <jar href="jars/log4j-1.2.8.jar"/> <jar href="jars/xercesImpl.jar"/> <jar href="jars/xml-apis.jar"/> ! <extension href="http://download.java.net/media/java3d/webstart/release/java3d-1.5.1.jnlp"/> </resources> <application-desc main-class="net.hep.graphics.GraXML.FrontEnd.GraXML"/> Index: GraXMLConverter.sh =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXMLConverter.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GraXMLConverter.sh 23 Nov 2005 16:16:49 -0000 1.2 --- GraXMLConverter.sh 9 Oct 2007 17:17:50 -0000 1.3 *************** *** 1,9 **** #!/bin/sh if [ "X${GRAXML_HOME}" = "X" ]; then GRAXML_HOME=`dirname $0`/.. fi ! export LD_LIBRARY_PATH=${GRAXML_HOME}/lib:${JAVA_HOME}/jre/lib/i386/xawt:${LD_LIBRARY_PATH} java -Xmx512M -jar ${GRAXML_HOME}/lib/GraXMLConverter.exe.jar $* --- 1,14 ---- #!/bin/sh + ARCH="i386" + if [ `uname -p` = "x86_64" ]; then + ARCH="amd64" + fi + if [ "X${GRAXML_HOME}" = "X" ]; then GRAXML_HOME=`dirname $0`/.. fi ! export LD_LIBRARY_PATH=${GRAXML_HOME}/lib/${ARCH}:${JAVA_HOME}/jre/lib/${ARCH}/xawt:${LD_LIBRARY_PATH} java -Xmx512M -jar ${GRAXML_HOME}/lib/GraXMLConverter.exe.jar $* Index: GraXML.sh =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXML.sh,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GraXML.sh 23 Nov 2005 16:16:49 -0000 1.2 --- GraXML.sh 9 Oct 2007 17:17:50 -0000 1.3 *************** *** 1,9 **** #!/bin/sh if [ "X${GRAXML_HOME}" = "X" ]; then GRAXML_HOME=`dirname $0`/.. fi ! export LD_LIBRARY_PATH=${GRAXML_HOME}/lib:${JAVA_HOME}/jre/lib/i386/xawt:${LD_LIBRARY_PATH} java -Xmx512M -jar ${GRAXML_HOME}/lib/GraXMLDisplay.exe.jar $* --- 1,14 ---- #!/bin/sh + ARCH="i386" + if [ `uname -p` = "x86_64" ]; then + ARCH="amd64" + fi + if [ "X${GRAXML_HOME}" = "X" ]; then GRAXML_HOME=`dirname $0`/.. fi ! export LD_LIBRARY_PATH=${GRAXML_HOME}/lib/${ARCH}:${JAVA_HOME}/jre/lib/${ARCH}/xawt:${LD_LIBRARY_PATH} java -Xmx512M -jar ${GRAXML_HOME}/lib/GraXMLDisplay.exe.jar $* |
From: Julius H. <hr...@us...> - 2007-10-09 17:17:54
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16219/net/hep/graphics/GraXML Modified Files: GlobalOptions.java MasterBuilder.java Log Message: both i386 and amd64 Linux supported; using Java3D 1.5.1 Index: MasterBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/MasterBuilder.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** MasterBuilder.java 2 Oct 2007 18:43:40 -0000 1.14 --- MasterBuilder.java 9 Oct 2007 17:17:50 -0000 1.15 *************** *** 62,65 **** --- 62,68 ---- * <pre> * $Log$ + * Revision 1.15 2007/10/09 17:17:50 hrivnac + * both i386 and amd64 Linux supported; using Java3D 1.5.1 + * * Revision 1.14 2007/10/02 18:43:40 hrivnac * connection from Atlantis introduced *************** *** 468,472 **** // Report about results time = System.currentTimeMillis() - time; ! log.info("\n"); log.info(count() + " elements processed"); log.info("Optimised:\n" + optDB().toString()); --- 471,475 ---- // Report about results time = System.currentTimeMillis() - time; ! System.out.println(""); log.info(count() + " elements processed"); log.info("Optimised:\n" + optDB().toString()); Index: GlobalOptions.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GlobalOptions.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GlobalOptions.java 30 Mar 2005 12:44:29 -0000 1.1 --- GlobalOptions.java 9 Oct 2007 17:17:50 -0000 1.2 *************** *** 5,8 **** --- 5,11 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/09 17:17:50 hrivnac + * both i386 and amd64 Linux supported; using Java3D 1.5.1 + * * Revision 1.1 2005/03/30 12:44:29 hrivnac * GraXML introduced *************** *** 122,125 **** --- 125,129 ---- r += "graphical, Quality = " + _quality + ", Optimisation = " + _optimisation + ")"; r += " using Java " + System.getProperty("java.version") + " from " + System.getProperty("java.vendor"); + r += " runnig on " + System.getProperty("os.name") + " " + System.getProperty("os.arch") + "/"+ System.getProperty("os.version"); return r; } |
From: Julius H. <hr...@us...> - 2007-10-09 17:17:54
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16219/net/hep/graphics/GraXML/Java3DExtensions Modified Files: J3DFrame.java Log Message: both i386 and amd64 Linux supported; using Java3D 1.5.1 Index: J3DFrame.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions/J3DFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** J3DFrame.java 18 Jan 2007 16:04:59 -0000 1.5 --- J3DFrame.java 9 Oct 2007 17:17:51 -0000 1.6 *************** *** 41,44 **** --- 41,47 ---- * <pre> * $Log$ + * Revision 1.6 2007/10/09 17:17:51 hrivnac + * both i386 and amd64 Linux supported; using Java3D 1.5.1 + * * Revision 1.5 2007/01/18 16:04:59 hrivnac * clean button added *************** *** 102,107 **** /** Create the basic environment. */ public J3DFrame() { ! setRoot(); ! setLights(); } --- 105,110 ---- /** Create the basic environment. */ public J3DFrame() { ! setRoot(); ! setLights(); } *************** *** 307,319 **** private double _scale; ! private static double _frontLimit0 = 0.1; ! private static double _backLimit0 = 1.0; ! private static double _frontCut0 = 0.1; ! private static double _backCut0 = 1.0; ! private static double _scale0 = 0.1; // Java3D Decorations -------------------------------------------------------- --- 310,322 ---- private double _scale; ! private static double _frontLimit0 = 0.0001; ! private static double _backLimit0 = 1000.0; ! private static double _frontCut0 = 0.0001; ! private static double _backCut0 = 1000.0; ! private static double _scale0 = 1.0; // Java3D Decorations -------------------------------------------------------- |
From: Julius H. <hr...@us...> - 2007-10-09 17:17:54
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16219/net/hep/graphics/GraXML/FrontEnd Modified Files: GraXMLThread.java Log Message: both i386 and amd64 Linux supported; using Java3D 1.5.1 Index: GraXMLThread.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd/GraXMLThread.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GraXMLThread.java 3 Oct 2007 15:41:42 -0000 1.3 --- GraXMLThread.java 9 Oct 2007 17:17:50 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/09 17:17:50 hrivnac + * both i386 and amd64 Linux supported; using Java3D 1.5.1 + * * Revision 1.3 2007/10/03 15:41:42 hrivnac * works in multithreaded env *************** *** 65,70 **** * @return The singleton instance. */ public static GraXMLThread instance() { ! if (_instance == null) { ! _instance = new GraXMLThread(); } return _instance; --- 68,79 ---- * @return The singleton instance. */ public static GraXMLThread instance() { ! try { ! if (_instance == null) { ! _instance = new GraXMLThread(); ! } ! } ! catch (UnsatisfiedLinkError e) { ! RootWindow.reportException("Can't start GraXML because Java3D is not available", e, log); ! _instance = null; } return _instance; |
From: Julius H. <hr...@us...> - 2007-10-09 17:17:54
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16219/net/hep/graphics/GraXML/GUI Modified Files: RootWindow.java Log Message: both i386 and amd64 Linux supported; using Java3D 1.5.1 Index: RootWindow.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootWindow.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RootWindow.java 3 Oct 2007 15:41:42 -0000 1.7 --- RootWindow.java 9 Oct 2007 17:17:50 -0000 1.8 *************** *** 50,54 **** // Validator ! import com.sun.msv.verifier.ValidityViolation; // SAX --- 50,54 ---- // Validator ! //JH import com.sun.msv.verifier.ValidityViolation; // SAX *************** *** 78,81 **** --- 78,84 ---- * <pre> * $Log$ + * Revision 1.8 2007/10/09 17:17:50 hrivnac + * both i386 and amd64 Linux supported; using Java3D 1.5.1 + * * Revision 1.7 2007/10/03 15:41:42 hrivnac * works in multithreaded env *************** *** 237,241 **** /** Setup Java3D. */ private final void setup() { - log.info("setup"); setMenu(getContentPane()); setCursor(); --- 240,243 ---- *************** *** 243,247 **** _j3d.setUniverse(); _j3d.attachWindow(this); - log.info("setup -end"); } --- 245,248 ---- *************** *** 633,642 **** if (e instanceof UnmarshalException) { Throwable ee = ((UnmarshalException)e).getLinkedException(); ! if (ee instanceof com.sun.msv.verifier.ValidityViolation) { ! l.error(ee); ! l.error("\tline = " + ((ValidityViolation)ee).getLineNumber()); ! l.error("\tcolumn = " + ((ValidityViolation)ee).getColumnNumber()); ! } ! else if (ee instanceof SAXParseException) { l.error(ee); l.error("\tline = " + ((SAXParseException)ee).getLineNumber()); --- 634,638 ---- if (e instanceof UnmarshalException) { Throwable ee = ((UnmarshalException)e).getLinkedException(); ! if (ee instanceof SAXParseException) { l.error(ee); l.error("\tline = " + ((SAXParseException)ee).getLineNumber()); |
From: Julius H. <hr...@us...> - 2007-10-08 19:42:41
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv14908/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: S3D.java STC.java STr.java Track.java Log Message: moved to Java 1.6; fixed Track Index: S3D.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/S3D.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** S3D.java 4 Oct 2007 16:17:40 -0000 1.2 --- S3D.java 8 Oct 2007 19:42:38 -0000 1.3 *************** *** 55,58 **** --- 55,61 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/08 19:42:38 hrivnac + * moved to Java 1.6; fixed Track + * * Revision 1.2 2007/10/04 16:17:40 hrivnac * Atlantis can export colors to GraXML *************** *** 81,90 **** // Get Type properties ! S3DType S3D = (S3DType)element; ! int count = S3D.getCount(); ! String storeGateKey = S3D.getStoreGateKey(); ! XType x = S3D.getX(); ! YType y = S3D.getY(); ! ZType z = S3D.getZ(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); --- 84,93 ---- // Get Type properties ! S3DType s3d = (S3DType)element; ! int count = s3d.getCount(); ! String storeGateKey = s3d.getStoreGateKey(); ! XType x = s3d.getX(); ! YType y = s3d.getY(); ! ZType z = s3d.getZ(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); *************** *** 105,109 **** Color3f color; for (int i = 0; i < count; i++) { ! color = new Color3f(_colors[i]); pointArray = new PointArray(1, GeometryArray.COORDINATES| --- 108,112 ---- Color3f color; for (int i = 0; i < count; i++) { ! color = new Color3f(_colorMap[_colorList[i]]); pointArray = new PointArray(1, GeometryArray.COORDINATES| *************** *** 119,129 **** } ! /** Set {@link Color}s to be used for points. ! * @param colors The array of {@link Color}s. */ ! public static void setColors(Color[] colors) { ! _colors = colors; } ! private static Color[] _colors; /** Logging . */ --- 122,136 ---- } ! /** Set {@link Color}s to be used for line segments. ! * @param colorMap The array of {@link Color}s. ! * @param colorList The array of {@link Color}s indexes. */ ! public static void setColors(Color[] colorMap, int[] colorList) { ! _colorMap = colorMap; ! _colorList = colorList; } ! private static Color[] _colorMap; ! ! private static int[] _colorList; /** Logging . */ Index: STr.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STr.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** STr.java 2 Oct 2007 18:41:04 -0000 1.4 --- STr.java 8 Oct 2007 19:42:38 -0000 1.5 *************** *** 3,6 **** --- 3,7 ---- import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; + import static net.hep.atlas.graphics.JiveEvent.GeometricModel.Evaluator.SCALE; // Generic Model *************** *** 14,17 **** --- 15,21 ---- import net.hep.atlas.graphics.JiveEvent.JAXB.ZVertexType; import net.hep.atlas.graphics.JiveEvent.JAXB.CodeType; + import net.hep.atlas.graphics.JiveEvent.JAXB.XType; + import net.hep.atlas.graphics.JiveEvent.JAXB.YType; + import net.hep.atlas.graphics.JiveEvent.JAXB.ZType; // GraXML *************** *** 30,39 **** --- 34,51 ---- import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; + import javax.media.j3d.LineArray; + import javax.media.j3d.GeometryArray; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; + import javax.vecmath.Vector3f; + import javax.vecmath.Point3f; + import javax.vecmath.Color3f; // FreeHEP import hep.graphics.j3d.Helix; + // AWT + import java.awt.Color; + // Java import static java.lang.Math.toRadians; *************** *** 49,52 **** --- 61,67 ---- * <pre> * $Log$ + * Revision 1.5 2007/10/08 19:42:38 hrivnac + * moved to Java 1.6; fixed Track + * * Revision 1.4 2007/10/02 18:41:04 hrivnac * S3D added *************** *** 259,262 **** --- 274,289 ---- private static double _textSizeFactor = 10.0f; + /** Set {@link Color}s to be used for line segments. + * @param colorMap The array of {@link Color}s. + * @param colorList The array of {@link Color}s indexes. */ + public static void setColors(Color[] colorMap, int[] colorList) { + _colorMap = colorMap; + _colorList = colorList; + } + + private static Color[] _colorMap; + + private static int[] _colorList; + /** Logging . */ private static Logger log = Logger.getLogger(STr.class); Index: STC.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STC.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** STC.java 4 Oct 2007 16:19:09 -0000 1.1 --- STC.java 8 Oct 2007 19:42:38 -0000 1.2 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/08 19:42:38 hrivnac + * moved to Java 1.6; fixed Track + * * Revision 1.1 2007/10/04 16:19:09 hrivnac * more complete interface to Atlantis *************** *** 81,93 **** // Get Type properties ! STCType STC = (STCType)element; ! int count = STC.getCount(); ! String storeGateKey = STC.getStoreGateKey(); ! X0Type x0 = STC.getX0(); ! Y0Type y0 = STC.getY0(); ! Z0Type z0 = STC.getZ0(); ! X1Type x1 = STC.getX1(); ! Y1Type y1 = STC.getY1(); ! Z1Type z1 = STC.getZ1(); float[] x0s = floats(x0.getValue()); float[] y0s = floats(y0.getValue()); --- 84,96 ---- // Get Type properties ! STCType stc = (STCType)element; ! int count = stc.getCount(); ! String storeGateKey = stc.getStoreGateKey(); ! X0Type x0 = stc.getX0(); ! Y0Type y0 = stc.getY0(); ! Z0Type z0 = stc.getZ0(); ! X1Type x1 = stc.getX1(); ! Y1Type y1 = stc.getY1(); ! Z1Type z1 = stc.getZ1(); float[] x0s = floats(x0.getValue()); float[] y0s = floats(y0.getValue()); *************** *** 111,115 **** Color3f color; for (int i = 0; i < count; i++) { ! color = new Color3f(_colors[i]); lineArray = new LineArray(2, GeometryArray.COORDINATES| --- 114,118 ---- Color3f color; for (int i = 0; i < count; i++) { ! color = new Color3f(_colorMap[_colorList[i]]); lineArray = new LineArray(2, GeometryArray.COORDINATES| *************** *** 134,143 **** /** Set {@link Color}s to be used for line segments. ! * @param colors The array of {@link Color}s. */ ! public static void setColors(Color[] colors) { ! _colors = colors; } ! private static Color[] _colors; /** Logging . */ --- 137,150 ---- /** Set {@link Color}s to be used for line segments. ! * @param colorMap The array of {@link Color}s. ! * @param colorList The array of {@link Color}s indexes. */ ! public static void setColors(Color[] colorMap, int[] colorList) { ! _colorMap = colorMap; ! _colorList = colorList; } ! private static Color[] _colorMap; ! ! private static int[] _colorList; /** Logging . */ Index: Track.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Track.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Track.java 4 Oct 2007 16:19:09 -0000 1.1 --- Track.java 8 Oct 2007 19:42:38 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; + import static net.hep.atlas.graphics.JiveEvent.GeometricModel.Evaluator.SCALE; // Generic Model *************** *** 21,25 **** import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineZType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; ! import net.hep.atlas.graphics.JiveEvent.JAXB.Z0Type; // GraXML --- 22,28 ---- import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineZType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; ! import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineXType; ! import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineYType; ! import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineZType; // GraXML *************** *** 38,47 **** --- 41,58 ---- import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; + import javax.media.j3d.LineArray; + import javax.media.j3d.GeometryArray; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; + import javax.vecmath.Vector3f; + import javax.vecmath.Point3f; + import javax.vecmath.Color3f; // FreeHEP import hep.graphics.j3d.Helix; + // AWT + import java.awt.Color; + // Java import static java.lang.Math.toRadians; *************** *** 61,64 **** --- 72,78 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/08 19:42:38 hrivnac + * moved to Java 1.6; fixed Track + * * Revision 1.1 2007/10/04 16:19:09 hrivnac * more complete interface to Atlantis *************** *** 83,86 **** --- 97,169 ---- // Get Type properties TrackType track = (TrackType)element; + int count = track.getCount(); + String storeGateKey = track.getStoreGateKey(); + PolylineXType x = track.getPolylineX(); + PolylineYType y = track.getPolylineY(); + PolylineZType z = track.getPolylineZ(); + String[] xx = x.getValue().split(","); + String[] yy = y.getValue().split(","); + String[] zz = z.getValue().split(","); + float[] xs; + float[] ys; + float[] zs; + int n; + String name; + String info; + boolean outlinedBckp = Interacter.outlined(); + Interacter.setOutlined(false); + Shape3D shape; + LineArray lineArray; + Color3f color; + int j; + // Loop over Tracks + for (int k = 0; k < xx.length; k++) { + xs = floats(xx[k]); + ys = floats(yy[k]); + zs = floats(zz[k]); + n = xs.length; + // Draw all Tracks + name = "Track(" + storeGateKey + "/" + k + ")"; + info = name + "[1-" + n + "]"; + // Color is handled directly + //Appearance appearance = builder().appearance(name, name); + //setAppearance(appearance); + //shape.setAppearance(appearance); + shape = new Shape3D(); + lineArray = new LineArray(2 * n, + GeometryArray.COORDINATES| + GeometryArray.COLOR_3| + GeometryArray.NORMALS); + color = new Color3f(_colorMap[_colorList[_colorI++]]); + j = 0; + // Construct Track + for (int i = 0; i < n; i++) { + if (i > 0 && i < n - 1) { + lineArray.setCoordinate(j, new Point3f(xs[i] / SCALE, + ys[i] / SCALE, + zs[i] / SCALE)); + lineArray.setColor(j, color); + lineArray.setNormal(j, new Vector3f(0, 0, 0)); + j++; + shape.addGeometry(lineArray); + } + lineArray.setCoordinate(j, new Point3f(xs[i] / SCALE, + ys[i] / SCALE, + zs[i] / SCALE)); + lineArray.setColor(j, color); + lineArray.setNormal(j, new Vector3f(0, 0, 0)); + j++; + shape.addGeometry(lineArray); + } + // Use Track + use(shape, name, info); + } + // Clean + Interacter.setOutlined(outlinedBckp); + + /* TBD: do that as well + + // Get Type properties + TrackType track = (TrackType)element; int count = track.getCount(); String storeGateKey = track.getStoreGateKey(); *************** *** 136,139 **** --- 219,224 ---- use(shape, name + "Lines", info); + */ + } *************** *** 229,232 **** --- 314,332 ---- private static double _textSizeFactor = 10.0f; + /** Set {@link Color}s to be used for line segments. + * @param colorMap The array of {@link Color}s. + * @param colorList The array of {@link Color}s indexes. */ + public static void setColors(Color[] colorMap, int[] colorList) { + _colorMap = colorMap; + _colorList = colorList; + _colorI = 0; + } + + private static Color[] _colorMap; + + private static int[] _colorList; + + private static int _colorI; + /** Logging . */ private static Logger log = Logger.getLogger(Track.class); |
From: Julius H. <hr...@us...> - 2007-10-08 12:41:14
|
Update of /cvsroot/graxml/DetDescr/JiveGeometry/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6260 Modified Files: build.xml Removed Files: generator.xml Log Message: moved to Java 1.6 --- generator.xml DELETED --- Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/JiveGeometry/ant/build.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** build.xml 26 Jan 2007 19:32:47 -0000 1.4 --- build.xml 8 Oct 2007 12:41:14 -0000 1.5 *************** *** 23,33 **** <pathelement path="${Java3D.utils}"/> <pathelement path="${Java3D.vecmath}"/> - <pathelement path="${JAXP-2.0.api}"/> - <pathelement path="${JAXB-2.0.api}"/> - <pathelement path="${JAXB-2.0.impl}"/> - <pathelement path="${JAXB-2.0.impl1}"/> - <pathelement path="${JAXB-2.0.xjc}"/> - <pathelement path="${JWSDP.relax}"/> - <pathelement path="${JWSDP.xsd}"/> <pathelement path="${Log4J.core}"/> <pathelement path="${CLASSPATH}"/> --- 23,26 ---- *************** *** 70,80 **** <fileset file="${Java3D.vecmath}"/> <fileset dir="${Java3D.libdir}"/> - <fileset file="${JAXP-2.0.api}"/> - <fileset file="${JAXB-2.0.api}"/> - <fileset file="${JAXB-2.0.impl}"/> - <fileset file="${JAXB-2.0.impl1}"/> - <fileset file="${JAXB-2.0.xjc}"/> - <fileset file="${JWSDP.relax}"/> - <fileset file="${JWSDP.xsd}"/> <fileset file="${Log4J.core}"/> </copy> --- 63,66 ---- *************** *** 94,99 **** depends="init" description="Generate JAXB classes"> ! <ant antfile="ant/generator.xml" ! target="generate0"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/atlas/graphics/JiveGeometry/Schema/AGeometry.xsd"/> --- 80,84 ---- depends="init" description="Generate JAXB classes"> ! <ant antfile="${config.db}/standard.xml" target="standard.jaxb" inheritRefs="true"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/atlas/graphics/JiveGeometry/Schema/AGeometry.xsd"/> *************** *** 229,235 **** <group title="Geometric Model" packages="net.hep.atlas.graphics.JiveGeometry.GeometricModel*"/> <group title="Test" packages="net.hep.atlas.graphics.JiveGeometry.Test*"/> ! <link href="http://java.sun.com/j2se/1.5.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> - <link href="http://java.sun.com/xml/jaxb/api"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://hrivnac.home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc"/> --- 214,219 ---- <group title="Geometric Model" packages="net.hep.atlas.graphics.JiveGeometry.GeometricModel*"/> <group title="Test" packages="net.hep.atlas.graphics.JiveGeometry.Test*"/> ! <link href="http://java.sun.com/j2se/1.6.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://hrivnac.home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc"/> |
From: Julius H. <hr...@us...> - 2007-10-08 12:38:49
|
Update of /cvsroot/graxml/Graphics/JiveEvent/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5051 Modified Files: build.xml Removed Files: generator.xml Log Message: moved to Java 1.6 --- generator.xml DELETED --- Index: build.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/ant/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 26 Jan 2007 19:32:28 -0000 1.10 --- build.xml 8 Oct 2007 12:38:50 -0000 1.11 *************** *** 16,19 **** --- 16,20 ---- <path id="classpath.build"> <pathelement path="${GraXML.core}"/> + <pathelement path="${JiveGeometry.core}"/> <pathelement path="${Xerces.API}"/> <pathelement path="${Xerces.Impl}"/> *************** *** 23,33 **** <pathelement path="${Java3D.utils}"/> <pathelement path="${Java3D.vecmath}"/> - <pathelement path="${JAXP-2.0.api}"/> - <pathelement path="${JAXB-2.0.api}"/> - <pathelement path="${JAXB-2.0.impl}"/> - <pathelement path="${JAXB-2.0.impl1}"/> - <pathelement path="${JAXB-2.0.xjc}"/> - <pathelement path="${JWSDP.relax}"/> - <pathelement path="${JWSDP.xsd}"/> <pathelement path="${Log4J.core}"/> <pathelement path="${CLASSPATH}"/> --- 24,27 ---- *************** *** 62,65 **** --- 56,60 ---- <copy todir="${lib}"> <fileset file="${GraXML.core}"/> + <fileset file="${JiveGeometry.core}"/> <fileset file="${Xerces.API}"/> <fileset file="${Xerces.Impl}"/> *************** *** 70,81 **** <fileset file="${Java3D.vecmath}"/> <fileset dir="${Java3D.libdir}"/> ! <fileset file="${JAXP-2.0.api}"/> ! <fileset file="${JAXB-2.0.api}"/> ! <fileset file="${JAXB-2.0.impl}"/> ! <fileset file="${JAXB-2.0.impl1}"/> ! <fileset file="${JAXB-2.0.xjc}"/> ! <fileset file="${JWSDP.relax}"/> ! <fileset file="${JWSDP.xsd}"/> ! <fileset file="${Log4J.core}"/> </copy> <copy todir="${etc}" flatten="true"> --- 65,69 ---- <fileset file="${Java3D.vecmath}"/> <fileset dir="${Java3D.libdir}"/> ! <fileset file="${Log4J.core}"/> </copy> <copy todir="${etc}" flatten="true"> *************** *** 94,99 **** depends="init" description="Generate JAXB classes"> ! <ant antfile="ant/generator.xml" ! target="generate0"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd"/> --- 82,86 ---- depends="init" description="Generate JAXB classes"> ! <ant antfile="${config.db}/standard.xml" target="standard.jaxb" inheritRefs="true"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd"/> *************** *** 127,131 **** <fileset dir="${build}" includes="**/*.properties"/> <fileset dir="${src}" includes="net/hep/atlas/graphics/JiveEvent/Schema/event.xsd"/> ! <fileset dir="${src}" includes="net/hep/atlas/graphics/JiveEvent/Test/data/test_eventFast.xml"/> </jar> </target> --- 114,118 ---- <fileset dir="${build}" includes="**/*.properties"/> <fileset dir="${src}" includes="net/hep/atlas/graphics/JiveEvent/Schema/event.xsd"/> ! <fileset dir="${src}" includes="net/hep/atlas/graphics/JiveEvent/Test/data/ttbar_t1_full_01.xml"/> </jar> </target> *************** *** 229,235 **** <group title="Geometric Model" packages="net.hep.atlas.graphics.JiveEvent.GeometricModel*"/> <group title="Test" packages="net.hep.atlas.graphics.JiveEvent.Test*"/> ! <link href="http://java.sun.com/j2se/1.5.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> - <link href="http://java.sun.com/xml/jaxb/api"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://hrivnac.home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc"/> --- 216,221 ---- <group title="Geometric Model" packages="net.hep.atlas.graphics.JiveEvent.GeometricModel*"/> <group title="Test" packages="net.hep.atlas.graphics.JiveEvent.Test*"/> ! <link href="http://java.sun.com/j2se/1.6.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://hrivnac.home.cern.ch/hrivnac/Activities/Packages/GraXML/JavaDoc"/> |
From: Julius H. <hr...@us...> - 2007-10-08 12:35:35
|
Update of /cvsroot/graxml/DetDescr/GDML/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv3853 Modified Files: build.xml Removed Files: generator.xml Log Message: moved to Java 1.6 --- generator.xml DELETED --- Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/ant/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 26 Jan 2007 19:33:05 -0000 1.10 --- build.xml 8 Oct 2007 12:35:27 -0000 1.11 *************** *** 24,34 **** <pathelement path="${Java3D.utils}"/> <pathelement path="${Java3D.vecmath}"/> - <pathelement path="${JAXP-2.0.api}"/> - <pathelement path="${JAXB-2.0.api}"/> - <pathelement path="${JAXB-2.0.impl}"/> - <pathelement path="${JAXB-2.0.impl1}"/> - <pathelement path="${JAXB-2.0.xjc}"/> - <pathelement path="${JWSDP.relax}"/> - <pathelement path="${JWSDP.xsd}"/> <pathelement path="${Log4J.core}"/> <pathelement path="${CLASSPATH}"/> --- 24,27 ---- *************** *** 72,82 **** <fileset file="${Java3D.vecmath}"/> <fileset dir="${Java3D.libdir}"/> - <fileset file="${JAXP-2.0.api}"/> - <fileset file="${JAXB-2.0.api}"/> - <fileset file="${JAXB-2.0.impl}"/> - <fileset file="${JAXB-2.0.impl1}"/> - <fileset file="${JAXB-2.0.xjc}"/> - <fileset file="${JWSDP.relax}"/> - <fileset file="${JWSDP.xsd}"/> <fileset file="${Log4J.core}"/> </copy> --- 65,68 ---- *************** *** 94,99 **** depends="init" description="Generate JAXB classes"> ! <ant antfile="ant/generator.xml" ! target="generate0"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/geant4/GDML/Schema/gdml.xsd"/> --- 80,84 ---- depends="init" description="Generate JAXB classes"> ! <ant antfile="${config.db}/standard.xml" target="standard.jaxb" inheritRefs="true"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/geant4/GDML/Schema/gdml.xsd"/> *************** *** 218,224 **** <group title="Geometric Model" packages="net.hep.geant4.GDML.GeometricModel*"/> <group title="Test" packages="net.hep.geant4.GDML.Test*"/> ! <link href="http://java.sun.com/j2se/1.5.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> - <link href="http://java.sun.com/xml/jaxb/api"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://www.beanshell.org/javadoc"/> --- 203,208 ---- <group title="Geometric Model" packages="net.hep.geant4.GDML.GeometricModel*"/> <group title="Test" packages="net.hep.geant4.GDML.Test*"/> ! <link href="http://java.sun.com/j2se/1.6.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://www.beanshell.org/javadoc"/> |
From: Julius H. <hr...@us...> - 2007-10-08 12:31:17
|
Update of /cvsroot/graxml/DetDescr/AGDD/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2212 Modified Files: build.xml Removed Files: generator.xml Log Message: moved to Java 1.6 --- generator.xml DELETED --- Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/ant/build.xml,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** build.xml 26 Jan 2007 19:33:20 -0000 1.14 --- build.xml 8 Oct 2007 12:31:13 -0000 1.15 *************** *** 24,34 **** <pathelement path="${Java3D.utils}"/> <pathelement path="${Java3D.vecmath}"/> - <pathelement path="${JAXP-2.0.api}"/> - <pathelement path="${JAXB-2.0.api}"/> - <pathelement path="${JAXB-2.0.impl}"/> - <pathelement path="${JAXB-2.0.impl1}"/> - <pathelement path="${JAXB-2.0.xjc}"/> - <pathelement path="${JWSDP.relax}"/> - <pathelement path="${JWSDP.xsd}"/> <pathelement path="${Log4J.core}"/> <pathelement path="${CLASSPATH}"/> --- 24,27 ---- *************** *** 76,86 **** <fileset file="${Java3D.vecmath}"/> <fileset dir="${Java3D.libdir}"/> - <fileset file="${JAXP-2.0.api}"/> - <fileset file="${JAXB-2.0.api}"/> - <fileset file="${JAXB-2.0.impl}"/> - <fileset file="${JAXB-2.0.impl1}"/> - <fileset file="${JAXB-2.0.xjc}"/> - <fileset file="${JWSDP.relax}"/> - <fileset file="${JWSDP.xsd}"/> <fileset file="${Log4J.core}"/> </copy> --- 69,72 ---- *************** *** 99,104 **** depends="init" description="Generate JAXB classes"> ! <ant antfile="ant/generator.xml" ! target="generate0"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/AGDD/Schema/AGDD.xsd"/> --- 85,89 ---- depends="init" description="Generate JAXB classes"> ! <ant antfile="${config.db}/standard.xml" target="standard.jaxb"> <property name="dir" value="${build}"/> <property name="schema" value="${src}/net/hep/AGDD/Schema/AGDD.xsd"/> *************** *** 230,236 **** <group title="Test" packages="net.hep.AGDD.Test*"/> <group title="Utilities" packages="net.hep.AGDD.Utils*"/> ! <link href="http://java.sun.com/j2se/1.5.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> - <link href="http://java.sun.com/xml/jaxb/api"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://www.beanshell.org/javadoc"/> --- 215,220 ---- <group title="Test" packages="net.hep.AGDD.Test*"/> <group title="Utilities" packages="net.hep.AGDD.Utils*"/> ! <link href="http://java.sun.com/j2se/1.6.0/docs/api"/> <link href="http://java.sun.com/products/java-media/3D/forDevelopers/J3D_1_3_API/j3dapi/"/> <link href="http://logging.apache.org/log4j/docs/api"/> <link href="http://www.beanshell.org/javadoc"/> |
From: Julius H. <hr...@us...> - 2007-10-04 16:19:08
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24345/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Added Files: STC.java Track.java Log Message: more complete interface to Atlantis --- NEW FILE: STC.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; import static net.hep.atlas.graphics.JiveEvent.GeometricModel.Evaluator.SCALE; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.STCType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.X0Type; import net.hep.atlas.graphics.JiveEvent.JAXB.Y0Type; import net.hep.atlas.graphics.JiveEvent.JAXB.Z0Type; import net.hep.atlas.graphics.JiveEvent.JAXB.X1Type; import net.hep.atlas.graphics.JiveEvent.JAXB.Y1Type; import net.hep.atlas.graphics.JiveEvent.JAXB.Z1Type; // GraXML import net.hep.graphics.GraXML.BuildOptions; 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.Java3DExtensions.BillboardGroup; // Java3D import javax.media.j3d.Shape3D; import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; import javax.media.j3d.LineArray; import javax.media.j3d.GeometryArray; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; import javax.vecmath.Vector3f; import javax.vecmath.Point3f; import javax.vecmath.Color3f; // AWT import java.awt.Color; // Java import static java.lang.Math.toRadians; import static java.lang.Math.log; import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.lang.Math.signum; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation of <code>STCType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.STCType} generic JAXB interface. * <p><font color="#880088">signum * <pre> * $Log: STC.java,v $ * Revision 1.1 2007/10/04 16:19:09 hrivnac * more complete interface to Atlantis * * </pre> * </font></p> * @version $Id: STC.java,v 1.1 2007/10/04 16:19:09 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D // TBD: use static colors only if they are set public final class STC extends JiveRep { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof STCType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Type properties STCType STC = (STCType)element; int count = STC.getCount(); String storeGateKey = STC.getStoreGateKey(); X0Type x0 = STC.getX0(); Y0Type y0 = STC.getY0(); Z0Type z0 = STC.getZ0(); X1Type x1 = STC.getX1(); Y1Type y1 = STC.getY1(); Z1Type z1 = STC.getZ1(); float[] x0s = floats(x0.getValue()); float[] y0s = floats(y0.getValue()); float[] z0s = floats(z0.getValue()); float[] x1s = floats(x1.getValue()); float[] y1s = floats(y1.getValue()); float[] z1s = floats(z1.getValue()); // Draw all STCs Point3d[] points = new Point3d[count]; String name = "STC(" + storeGateKey + ")"; String info = name + "[1-" + count + "]"; // Color is handled directly //Appearance appearance = builder().appearance(name, name); //setAppearance(appearance); //shape.setAppearance(appearance); boolean outlinedBckp = Interacter.outlined(); Interacter.setOutlined(false); Shape3D shape = new Shape3D(); LineArray lineArray; Color3f color; for (int i = 0; i < count; i++) { color = new Color3f(_colors[i]); lineArray = new LineArray(2, GeometryArray.COORDINATES| GeometryArray.COLOR_3| GeometryArray.NORMALS); lineArray.setCoordinate(0, new Point3f(x0s[i] / SCALE, y0s[i] / SCALE, z0s[i] / SCALE)); lineArray.setCoordinate(1, new Point3f(x1s[i] / SCALE, y1s[i] / SCALE, z1s[i] / SCALE)); lineArray.setColor(0, color); lineArray.setColor(1, color); lineArray.setNormal(0, new Vector3f(0, 0, 0)); lineArray.setNormal(1, new Vector3f(0, 0, 0)); shape.addGeometry(lineArray); } use(shape, name, info); Interacter.setOutlined(outlinedBckp); } /** Set {@link Color}s to be used for line segments. * @param colors The array of {@link Color}s. */ public static void setColors(Color[] colors) { _colors = colors; } private static Color[] _colors; /** Logging . */ private static Logger log = Logger.getLogger(STC.class); } --- NEW FILE: Track.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.TrackType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.BarcodeType; import net.hep.atlas.graphics.JiveEvent.JAXB.Chi2Type; import net.hep.atlas.graphics.JiveEvent.JAXB.CotThetaType; import net.hep.atlas.graphics.JiveEvent.JAXB.CovMatrixType; import net.hep.atlas.graphics.JiveEvent.JAXB.D0Type; import net.hep.atlas.graphics.JiveEvent.JAXB.HitsType; import net.hep.atlas.graphics.JiveEvent.JAXB.IdType; import net.hep.atlas.graphics.JiveEvent.JAXB.NumHitsType; import net.hep.atlas.graphics.JiveEvent.JAXB.NumPolylineType; import net.hep.atlas.graphics.JiveEvent.JAXB.Phi0Type; import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineXType; import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineYType; import net.hep.atlas.graphics.JiveEvent.JAXB.PolylineZType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; import net.hep.atlas.graphics.JiveEvent.JAXB.Z0Type; // GraXML import net.hep.graphics.GraXML.BuildOptions; 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.Java3DExtensions.BillboardGroup; // Java3D import javax.media.j3d.Shape3D; import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; // FreeHEP import hep.graphics.j3d.Helix; // Java import static java.lang.Math.toRadians; import static java.lang.Math.log; import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.lang.Math.signum; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation of <code>TrackType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.TrackType} generic JAXB interface. * <p><font color="#880088">signum * <pre> * $Log: Track.java,v $ * Revision 1.1 2007/10/04 16:19:09 hrivnac * more complete interface to Atlantis * * </pre> * </font></p> * @version $Id: Track.java,v 1.1 2007/10/04 16:19:09 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Track extends JiveRep { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof TrackType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Type properties TrackType track = (TrackType)element; int count = track.getCount(); String storeGateKey = track.getStoreGateKey(); KineType kine = track.getKine(); BarcodeType barcode = track.getBarcode(); Chi2Type chi2 = track.getChi2(); CotThetaType cotTheta = track.getCotTheta(); CovMatrixType covMatrix = track.getCovMatrix(); D0Type d0 = track.getD0(); HitsType hits = track.getHits(); IdType id = track.getId(); NumHitsType numHits = track.getNumHits(); NumPolylineType numPolyline = track.getNumPolyline(); Phi0Type phi0 = track.getPhi0(); PolylineXType polylineX = track.getPolylineX(); PolylineYType polylineY = track.getPolylineY(); PolylineZType polylineZ = track.getPolylineZ(); PtType pt = track.getPt(); Z0Type z0 = track.getZ0(); float[] pts = floats(pt.getValue()); float[] d0s = floats(d0.getValue()); float[] phi0s = floats(phi0.getValue()); float[] z0s = floats(z0.getValue()); float[] cotThetas = floats(cotTheta.getValue()); float[] chi2s = floats(chi2.getValue()); // Draw all Tracks // - save and restore tg as it may be changed by draw*(...) Group tmpTg = tg(); String name = "track(" + storeGateKey + ")"; String info = name; // TBD: add data Appearance appearance = builder().appearance(name, name); setAppearance(appearance); Shape3D shape = new Shape3D(); shape.setAppearance(appearance); float eta; boolean first = true; for (int i = 0; i < count; i++) { if (pts[i] > _ptCut) { eta = -(float)(log(sqrt(cotThetas[i] * cotThetas[i] + 1.0) - cotThetas[i])); if (phi0s[i] < 0) { phi0s[i] = 2 * (float)PI + phi0s[i]; } shape.addGeometry(drawHelix((int)signum(pts[i]), eta, phi0s[i], abs(pts[i]), phi0s[i], d0s[i], z0s[i], 0).getGeometry()); if (first && _text && pts[i] > _textPtCut) { first = false; BranchGroup bg = drawText(name, pts[i], storeGateKey); use(bg, name + "Txt", name); } setTg(tmpTg); } } use(shape, name + "Lines", info); } /** Draw one Track as a {@link Helix}. * @param charge The <code>charge</code> of the Track. * @param eta The <code>eta</code> of the Track. * @param phi The <code>phi</code> of the Track. * @param pt The <code>pt</code> of the Track. * @param phiV The <code>phi</code> of the Track vertex. * @param rhoV The <code>rho</code> of the Track vertex. * @param zV The <code>pt</code> of the Track vertex. * @param code The particle <code>code</code> of the Track. * @return The {@link Helix} representing the Track. */ private Shape3D drawHelix(int charge, float eta, float phi, float pt, float phiV, float rhoV, float zV, int code) { Helix helix = new Helix(charge, eta, phi, pt, phiV, rhoV, zV, 2, BuildOptions.granularity(), appearance()); _end = helix.end(); return helix; } /** Draw one Track {@link BillboardGroup}. * @param name The name of the Track. * @param pt The <code>pt</code> of the Track. * @param legenda The particle <code>name</code> of the Track to be shown. * @return The {@link BillboardGroup} representing the Track. */ private BillboardGroup drawText(String name, double pt, String legenda) { // Create Billboard BillboardGroup bb = new BillboardGroup(legenda, appearance(), new BoundingSphere(new Point3d(0, 0, 0), 100)); // Define its place at the end of Helix Transform3D it3d = new Transform3D(); double textSize = _textSizeFactor; if (pt < 1) { textSize = _textSizeFactor * pt; } it3d.set(1f / textSize, _end); TransformGroup it = new TransformGroup(it3d); tg().addChild(it); setTg(it); // Return Billboard return bb; } private Vector3d _end; /** Set <code>pt</code> cut. Tracks with smaller pt are not drawn. * @param ptCut The minimal pt of the Track to be drawn, * the default is <code>0.5</code>. */ public static final void setPtCut(float ptCut) { _ptCut = ptCut; } /** Set <code>pt</code> cut for text. Tracks with smaller pt are described with text. * @param textPtCut The minimal pt of the Track to have textual description, * the default is <code>1.0</code>. * @see #setText . */ public static final void setTextPtCut(float textPtCut) { _textPtCut = textPtCut; } /** Set text description drawing. * @param text Whether draw text description of the STr, * the default is <code>true</code>. * @see #setTextPtCut . */ public static final void setText(boolean text) { _text = text; } private static float _ptCut = 0.5f; private static float _textPtCut = 1.0f; private static boolean _text = true; private static double _textSizeFactor = 10.0f; /** Logging . */ private static Logger log = Logger.getLogger(Track.class); } |
From: Julius H. <hr...@us...> - 2007-10-04 16:19:07
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv24345/net/hep/atlas/graphics/JiveEvent/GeometricModel Added Files: Evaluator.java Log Message: more complete interface to Atlantis --- NEW FILE: Evaluator.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel; // GraXML import net.hep.graphics.GraXML.MasterBuilder; // Log4J import org.apache.log4j.Logger; /** <code>Evaluator</code> handles mathematics in JiveEvent * attributes. * <p><font color="#880088"> * <pre> * $Log: Evaluator.java,v $ * Revision 1.1 2007/10/04 16:19:09 hrivnac * more complete interface to Atlantis * * </pre> * </font></p> * @version $Id: Evaluator.java,v 1.1 2007/10/04 16:19:09 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class Evaluator { public static float SCALE = 1000f; /** Logging . */ private static Logger log = Logger.getLogger(Evaluator.class); } |
From: Julius H. <hr...@us...> - 2007-10-04 16:17:42
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23683/net/hep/atlas/graphics/JiveEvent/Schema Modified Files: event.xsd Log Message: Atlantis can export colors to GraXML Index: event.xsd =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** event.xsd 2 Oct 2007 18:41:04 -0000 1.3 --- event.xsd 4 Oct 2007 16:17:41 -0000 1.4 *************** *** 4,7 **** --- 4,10 ---- <!-- $Log$ + Revision 1.4 2007/10/04 16:17:41 hrivnac + Atlantis can export colors to GraXML + Revision 1.3 2007/10/02 18:41:04 hrivnac S3D added *************** *** 810,814 **** <xs:element ref="numBarcodes" /> </xs:sequence> ! <xs:attribute name="count" type="xs:string" default="" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> --- 813,817 ---- <xs:element ref="numBarcodes" /> </xs:sequence> ! <xs:attribute name="count" type="xs:int" default="1" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> |
From: Julius H. <hr...@us...> - 2007-10-04 16:17:41
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv23683/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: S3D.java Log Message: Atlantis can export colors to GraXML Index: S3D.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/S3D.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** S3D.java 2 Oct 2007 18:41:03 -0000 1.1 --- S3D.java 4 Oct 2007 16:17:40 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; + import static net.hep.atlas.graphics.JiveEvent.GeometricModel.Evaluator.SCALE; // Generic Model *************** *** 26,34 **** import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; ! // FreeHEP ! import org.freehep.j3d.PointSet; // Java --- 27,40 ---- import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; + import javax.media.j3d.PointArray; + import javax.media.j3d.GeometryArray; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; + import javax.vecmath.Vector3f; + import javax.vecmath.Point3f; + import javax.vecmath.Color3f; ! // AWT ! import java.awt.Color; // Java *************** *** 49,52 **** --- 55,61 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/04 16:17:40 hrivnac + * Atlantis can export colors to GraXML + * * Revision 1.1 2007/10/02 18:41:03 hrivnac * S3D added *************** *** 56,59 **** --- 65,70 ---- * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ + // TBD: use HEP3D + // TBD: use static colors only if they are set public final class S3D extends JiveRep { *************** *** 71,80 **** // Get Type properties S3DType S3D = (S3DType)element; ! int count = S3D.getCount(); ! String storeGateKey = S3D.getStoreGateKey(); ! KineType kine = S3D.getKine(); ! XType x = S3D.getX(); ! YType y = S3D.getY(); ! ZType z = S3D.getZ(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); --- 82,90 ---- // Get Type properties S3DType S3D = (S3DType)element; ! int count = S3D.getCount(); ! String storeGateKey = S3D.getStoreGateKey(); ! XType x = S3D.getX(); ! YType y = S3D.getY(); ! ZType z = S3D.getZ(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); *************** *** 84,97 **** Point3d[] points = new Point3d[count]; String name = "S3D(" + storeGateKey + ")"; ! String info = name; // TBD: add data ! Appearance appearance = builder().appearance(name, name); ! setAppearance(appearance); for (int i = 0; i < count; i++) { ! points[i] = new Point3d(xs[i], ys[i], zs[i]); } ! use(new PointSet(points, appearance), name, info); ! } /** Logging . */ private static Logger log = Logger.getLogger(S3D.class); --- 94,130 ---- Point3d[] points = new Point3d[count]; String name = "S3D(" + storeGateKey + ")"; ! String info = name + "[1-" + count + "]"; ! // Color is handled directly ! //Appearance appearance = builder().appearance(name, name); ! //setAppearance(appearance); ! // Color is handled directly ! boolean outlinedBckp = Interacter.outlined(); ! Interacter.setOutlined(false); ! Shape3D shape = new Shape3D(); ! PointArray pointArray; ! Color3f color; for (int i = 0; i < count; i++) { ! color = new Color3f(_colors[i]); ! pointArray = new PointArray(1, ! GeometryArray.COORDINATES| ! GeometryArray.COLOR_3); ! pointArray.setCoordinate(0, new Point3f(xs[i] / SCALE, ! ys[i] / SCALE, ! zs[i] / SCALE)); ! pointArray.setColor(0, color); ! shape.addGeometry(pointArray); } ! use(shape, name, info); ! } + /** Set {@link Color}s to be used for points. + * @param colors The array of {@link Color}s. */ + public static void setColors(Color[] colors) { + _colors = colors; + } + + private static Color[] _colors; + /** Logging . */ private static Logger log = Logger.getLogger(S3D.class); |
From: Julius H. <hr...@us...> - 2007-10-03 15:41:40
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32008/net/hep/graphics/GraXML/FrontEnd Modified Files: GraXMLThread.java Log Message: works in multithreaded env Index: GraXMLThread.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd/GraXMLThread.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GraXMLThread.java 2 Oct 2007 23:06:46 -0000 1.2 --- GraXMLThread.java 3 Oct 2007 15:41:42 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/03 15:41:42 hrivnac + * works in multithreaded env + * * Revision 1.2 2007/10/02 23:06:46 hrivnac * GraXML4Atlantis packaged *************** *** 34,54 **** /** Basic Contructor. Create {@link Thread} and registers * itself as a singleton instance. */ ! GraXMLThread(SceneGroup sg) { super("GraXML"); log.info("Starting GraXMLThread " + GlobalOptions.report() + " ..."); init(); _root = new RootWindow(MasterBuilder.j3d()); ! _sg = sg; start(); } - private SceneGroup _sg; - /** Open {@link RootWindow}. */ public void run() { ! _root.open(_sg); } ! /** Give {@link RootWindow}. * @return The {@link RootWindow}. */ public RootWindow root() { --- 37,55 ---- /** Basic Contructor. Create {@link Thread} and registers * itself as a singleton instance. */ ! GraXMLThread() { super("GraXML"); log.info("Starting GraXMLThread " + GlobalOptions.report() + " ..."); init(); _root = new RootWindow(MasterBuilder.j3d()); ! _root.openInit(); start(); } /** Open {@link RootWindow}. */ public void run() { ! _root.openThread(); } ! /** Give {@link RootWindow}. * @return The {@link RootWindow}. */ public RootWindow root() { *************** *** 63,69 **** /** Give singleton instance. * @return The singleton instance. */ ! public static GraXMLThread instance(SceneGroup sg) { if (_instance == null) { ! _instance = new GraXMLThread(sg); } return _instance; --- 64,70 ---- /** Give singleton instance. * @return The singleton instance. */ ! public static GraXMLThread instance() { if (_instance == null) { ! _instance = new GraXMLThread(); } return _instance; |
From: Julius H. <hr...@us...> - 2007-10-03 15:41:40
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32008/net/hep/graphics/GraXML/GUI Modified Files: RootWindow.java Log Message: works in multithreaded env Index: RootWindow.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootWindow.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RootWindow.java 2 Oct 2007 23:06:46 -0000 1.6 --- RootWindow.java 3 Oct 2007 15:41:42 -0000 1.7 *************** *** 78,81 **** --- 78,84 ---- * <pre> * $Log$ + * Revision 1.7 2007/10/03 15:41:42 hrivnac + * works in multithreaded env + * * Revision 1.6 2007/10/02 23:06:46 hrivnac * GraXML4Atlantis packaged *************** *** 177,184 **** // Window Opening ----------------------------------------------------------- ! /** Open this window. */ public final void open() { log.info("Opening RootWindow ..."); setup(); _interpreter.run(); } --- 180,198 ---- // Window Opening ----------------------------------------------------------- ! /** Open this window. Performs both phases. */ public final void open() { log.info("Opening RootWindow ..."); + openInit(); + openThread(); + } + + /** Open this window. First phase - should be performed + * before any other action. */ + public final void openInit() { setup(); + } + + /** Open this window. Second phase - starts thread. */ + public final void openThread() { _interpreter.run(); } *************** *** 223,227 **** /** Setup Java3D. */ private final void setup() { ! log.info("Opening RootWindow ..."); setMenu(getContentPane()); setCursor(); --- 237,241 ---- /** Setup Java3D. */ private final void setup() { ! log.info("setup"); setMenu(getContentPane()); setCursor(); *************** *** 229,232 **** --- 243,247 ---- _j3d.setUniverse(); _j3d.attachWindow(this); + log.info("setup -end"); } *************** *** 256,259 **** --- 271,281 ---- } + /** Show {@link BranchGroup}. + * @param topGroup The {@link BranchGroup} to show. */ + public final void show(BranchGroup topGroup) { + _j3d.attachGroup(topGroup); + addTree(); + } + /** Reload the last file. */ public final void reShow() { *************** *** 269,279 **** } - /** Show {@link BranchGroup}. - * @param topGroup The {@link BranchGroup} to show. */ - public final void show(BranchGroup topGroup) { - _j3d.attachGroup(topGroup); - addTree(); - } - // Operations ---------------------------------------------------------------- --- 291,294 ---- *************** *** 461,465 **** /** Add Tree. */ ! public final void addTree() {System.out.println("xxx" + _j3d.conDB()); _j3d.conDB().buildTree(); JTree tree = ViewerTreeFactory.createTree(this); --- 476,480 ---- /** Add Tree. */ ! public final void addTree() { _j3d.conDB().buildTree(); JTree tree = ViewerTreeFactory.createTree(this); |
From: Julius H. <hr...@us...> - 2007-10-03 15:41:40
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv32008/net/hep/graphics/GraXML Modified Files: SceneGroup.java Log Message: works in multithreaded env Index: SceneGroup.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/SceneGroup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SceneGroup.java 2 Oct 2007 18:43:40 -0000 1.3 --- SceneGroup.java 3 Oct 2007 15:41:42 -0000 1.4 *************** *** 28,31 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/03 15:41:42 hrivnac + * works in multithreaded env + * * Revision 1.3 2007/10/02 18:43:40 hrivnac * connection from Atlantis introduced *************** *** 121,124 **** --- 124,128 ---- // Call Builder try { + log.info("Building Geometric Model ..."); MasterBuilder builder = MasterBuilder.createBuilder(builderName); // Build using DOM or JAXB |
From: Julius H. <hr...@us...> - 2007-10-02 23:06:48
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19724/net/hep/graphics/GraXML/FrontEnd Modified Files: GraXMLThread.java Log Message: GraXML4Atlantis packaged Index: GraXMLThread.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd/GraXMLThread.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraXMLThread.java 2 Oct 2007 18:45:40 -0000 1.1 --- GraXMLThread.java 2 Oct 2007 23:06:46 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/02 23:06:46 hrivnac + * GraXML4Atlantis packaged + * * Revision 1.1 2007/10/02 18:45:40 hrivnac * connection from Atlantis introduced *************** *** 27,73 **** * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public final class GraXMLThread implements Runnable { /** Basic Contructor. Create {@link Thread} and registers * itself as a singleton instance. */ ! GraXMLThread() { ! _t = new Thread(this, "GraXML"); ! _t.start(); ! } ! ! /** Create {@link GraXML} and run forever. */ ! public void run() { log.info("Starting GraXMLThread " + GlobalOptions.report() + " ..."); init(); _root = new RootWindow(MasterBuilder.j3d()); ! _root.open(); ! _instance = this; ! try { ! while (true) { ! if (_group != null && ! _shown) { ! _root.show(_group); ! _shown = true; ! } ! Thread.sleep(500); ! } ! } ! catch (InterruptedException e) { ! log.warn("GraXML interrupted"); ! } } ! /** Show data (comming usually from <em>Atlantis</am>). ! * @param element The top level element of the JAXB tree. ! * @param builderName The name of {@link masterBuilder} to be used ! * to traverse JAXB tree. */ ! public void show(Object element, ! String builderName) { ! try { ! _group = new SceneGroup(element, builderName); ! _shown = false; ! } ! catch (GraXMLException e) { ! log.error("Can't show " + element + " using " + builderName, e); ! } } --- 30,57 ---- * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public final class GraXMLThread extends Thread { /** Basic Contructor. Create {@link Thread} and registers * itself as a singleton instance. */ ! GraXMLThread(SceneGroup sg) { ! super("GraXML"); log.info("Starting GraXMLThread " + GlobalOptions.report() + " ..."); init(); _root = new RootWindow(MasterBuilder.j3d()); ! _sg = sg; ! start(); } ! private SceneGroup _sg; ! ! /** Open {@link RootWindow}. */ ! public void run() { ! _root.open(_sg); ! } ! ! /** Give {@link RootWindow}. ! * @return The {@link RootWindow}. */ ! public RootWindow root() { ! return _root; } *************** *** 79,85 **** /** Give singleton instance. * @return The singleton instance. */ ! public static GraXMLThread instance() { if (_instance == null) { ! _instance = new GraXMLThread(); } return _instance; --- 63,69 ---- /** Give singleton instance. * @return The singleton instance. */ ! public static GraXMLThread instance(SceneGroup sg) { if (_instance == null) { ! _instance = new GraXMLThread(sg); } return _instance; *************** *** 90,99 **** private RootWindow _root; - private SceneGroup _group; - - private boolean _shown = true; - - Thread _t; - /** Logging . */ private static Logger log = Logger.getLogger(GraXMLThread.class); --- 74,77 ---- |
From: Julius H. <hr...@us...> - 2007-10-02 23:06:47
|
Update of /cvsroot/graxml/Graphics/GraXML/src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19724 Modified Files: index.html Log Message: GraXML4Atlantis packaged Index: index.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/index.html,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** index.html 26 Sep 2007 15:48:38 -0000 1.6 --- index.html 2 Oct 2007 23:06:46 -0000 1.7 *************** *** 20,23 **** --- 20,24 ---- <li><a href="http://home.cern.ch/hrivnac/Activities/Packages/WebStart/GraXML/GraXML.jnlp">WebStart</a> (run using <code>javaws</code> command).</li> <li>The latest <a href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML-dist.tar.gz">full distribution</a> (ready to run).</li> + <li>The latest <a href="http://home.cern.ch/hrivnac/Activities/Packages/GraXML2Atlantis.tar.gz">usable with <a href="http://cern.ch/atlantis">Atlantis</a></a>.</li> <li><a href="Gallery">Gallery</a></li> <li>Documentation: |
From: Julius H. <hr...@us...> - 2007-10-02 23:06:46
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19724/net/hep/graphics/GraXML/doc-files Modified Files: Guide.html Log Message: GraXML4Atlantis packaged Index: Guide.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/doc-files/Guide.html,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Guide.html 26 Sep 2007 15:48:40 -0000 1.20 --- Guide.html 2 Oct 2007 23:06:47 -0000 1.21 *************** *** 928,931 **** --- 928,932 ---- <li>Clean button added.</li> <li>Migrated to JAXB 2.0.</li> + <li>Capable running with Atlantis.</li> </ul> <li>Bug fixes:</li> |
From: Julius H. <hr...@us...> - 2007-10-02 23:06:46
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19724/net/hep/graphics/GraXML/GUI Modified Files: RootWindow.java Log Message: GraXML4Atlantis packaged Index: RootWindow.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootWindow.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** RootWindow.java 18 Jan 2007 16:04:59 -0000 1.5 --- RootWindow.java 2 Oct 2007 23:06:46 -0000 1.6 *************** *** 78,81 **** --- 78,84 ---- * <pre> * $Log$ + * Revision 1.6 2007/10/02 23:06:46 hrivnac + * GraXML4Atlantis packaged + * * Revision 1.5 2007/01/18 16:04:59 hrivnac * clean button added *************** *** 458,462 **** /** Add Tree. */ ! public final void addTree() { _j3d.conDB().buildTree(); JTree tree = ViewerTreeFactory.createTree(this); --- 461,465 ---- /** Add Tree. */ ! public final void addTree() {System.out.println("xxx" + _j3d.conDB()); _j3d.conDB().buildTree(); JTree tree = ViewerTreeFactory.createTree(this); |
From: Julius H. <hr...@us...> - 2007-10-02 23:06:17
|
Update of /cvsroot/graxml/Graphics/GraXML/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv19555 Modified Files: build.xml Log Message: GraXML4Atlantis packaged Index: build.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/ant/build.xml,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** build.xml 26 Sep 2007 15:48:22 -0000 1.15 --- build.xml 2 Oct 2007 23:06:18 -0000 1.16 *************** *** 14,17 **** --- 14,19 ---- <property name="version" value="pre-3.1.11"/> + <property name="atlantis.lib" value="/home/hrivnac/work/Graphics/AtlantisJava/AtlantisJava-09-08-12/lib"/> + <path id="classpath.build"> <pathelement path="${CyberX3D.core}"/> *************** *** 206,209 **** --- 208,239 ---- <fileset dir="${src}" includes="log4j.properties"/> </jar> + <copy todir="${atlantis.lib}"> + <fileset dir="${lib}" includes="*.so"/> + <fileset dir="${lib}" includes="activation.jar + bool.jar + bsh-2.0b1.jar + colt.jar + cx3djava100a.jar + freehep-hep3d.jar + freehep-j3d.jar + GraXML.jar + j3dcore.jar + j3dutils.jar + jaxb1-impl.jar + jaxb-api.jar + jaxb-impl.jar + jaxb-xjc.jar + jaxp-api.jar + JiveEvent.jar + JiveGeometry.jar + jlfgr.jar + jsr173_api.jar + log4j-1.2.8.jar + relaxngDatatype.jar + vecmath.jar + xercesImpl.jar + xml-apis.jar + xsdlib.jar"/> + </copy> </target> *************** *** 214,217 **** --- 244,279 ---- description="Create complete distribution"> <ant antfile="${config.db}/standard.xml" target="standard.dist" inheritRefs="true"/> + <tar tarfile="${top}/${name}4Atlantis.tar.gz" + longfile="gnu" + compression="gzip"> + <tarfileset dir="${lib}" prefix="lib"> + <include name="*.so"/> + <include name="activation.jar"/> + <include name="bool.jar"/> + <include name="bsh-2.0b1.jar"/> + <include name="colt.jar"/> + <include name="cx3djava100a.jar"/> + <include name="freehep-hep3d.jar"/> + <include name="freehep-j3d.jar"/> + <include name="GraXML.jar"/> + <include name="j3dcore.jar"/> + <include name="j3dutils.jar"/> + <include name="jaxb1-impl.jar"/> + <include name="jaxb-api.jar"/> + <include name="jaxb-impl.jar"/> + <include name="jaxb-xjc.jar"/> + <include name="jaxp-api.jar"/> + <include name="JiveEvent.jar"/> + <include name="JiveGeometry.jar"/> + <include name="jlfgr.jar"/> + <include name="jsr173_api.jar"/> + <include name="log4j-1.2.8.jar"/> + <include name="relaxngDatatype.jar"/> + <include name="vecmath.jar"/> + <include name="xercesImpl.jar"/> + <include name="xml-apis.jar"/> + <include name="xsdlib.jar"/> + </tarfileset> + </tar> </target> |
From: Julius H. <hr...@us...> - 2007-10-02 18:45:38
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/FrontEnd In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5318/net/hep/graphics/GraXML/FrontEnd Added Files: GraXMLThread.java Log Message: connection from Atlantis introduced --- NEW FILE: GraXMLThread.java --- package net.hep.graphics.GraXML.FrontEnd; import java.util.List; import java.util.Hashtable; import java.util.Enumeration; // GraXML import net.hep.graphics.GraXML.GraXMLException; import net.hep.graphics.GraXML.GlobalOptions; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.SceneGroup; import net.hep.graphics.GraXML.GUI.RootWindow; // Log4J import org.apache.log4j.Logger; /** <code>GraXMLThread</code> runs {@link GraXML} * in a thread. It is a <em>Singleton</em>. * <p><font color="#880088"> * <pre> * $Log: GraXMLThread.java,v $ * Revision 1.1 2007/10/02 18:45:40 hrivnac * connection from Atlantis introduced * * </pre> * </font></p> * @version $Id: GraXMLThread.java,v 1.1 2007/10/02 18:45:40 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class GraXMLThread implements Runnable { /** Basic Contructor. Create {@link Thread} and registers * itself as a singleton instance. */ GraXMLThread() { _t = new Thread(this, "GraXML"); _t.start(); } /** Create {@link GraXML} and run forever. */ public void run() { log.info("Starting GraXMLThread " + GlobalOptions.report() + " ..."); init(); _root = new RootWindow(MasterBuilder.j3d()); _root.open(); _instance = this; try { while (true) { if (_group != null && ! _shown) { _root.show(_group); _shown = true; } Thread.sleep(500); } } catch (InterruptedException e) { log.warn("GraXML interrupted"); } } /** Show data (comming usually from <em>Atlantis</am>). * @param element The top level element of the JAXB tree. * @param builderName The name of {@link masterBuilder} to be used * to traverse JAXB tree. */ public void show(Object element, String builderName) { try { _group = new SceneGroup(element, builderName); _shown = false; } catch (GraXMLException e) { log.error("Can't show " + element + " using " + builderName, e); } } /** Initialise. */ private void init() { MasterBuilder.setBuilders(); } /** Give singleton instance. * @return The singleton instance. */ public static GraXMLThread instance() { if (_instance == null) { _instance = new GraXMLThread(); } return _instance; } private static GraXMLThread _instance; private RootWindow _root; private SceneGroup _group; private boolean _shown = true; Thread _t; /** Logging . */ private static Logger log = Logger.getLogger(GraXMLThread.class); } |
From: Julius H. <hr...@us...> - 2007-10-02 18:43:39
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv4371/net/hep/graphics/GraXML Modified Files: MasterBuilder.java SceneGroup.java Log Message: connection from Atlantis introduced Index: SceneGroup.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/SceneGroup.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SceneGroup.java 14 Jan 2007 17:04:57 -0000 1.2 --- SceneGroup.java 2 Oct 2007 18:43:40 -0000 1.3 *************** *** 28,31 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/02 18:43:40 hrivnac + * connection from Atlantis introduced + * * Revision 1.2 2007/01/14 17:04:57 hrivnac * embedded demos included *************** *** 111,114 **** --- 114,138 ---- } + /** Parse XML file and create {@link BranchGroup}. + * @param element The top element of JAXB tree. */ + // TBD: refactor + public SceneGroup(Object element, + String builderName) throws GraXMLException { + // Call Builder + try { + MasterBuilder builder = MasterBuilder.createBuilder(builderName); + // Build using DOM or JAXB + if (builder != null) { + builder.build(element, this); + } + else { + log.warn("Can't create builder for " + element); + } + } + catch (FactoryConfigurationError e) { + RootWindow.reportException("Can't create builder for " + element, e, log); + } + } + /** Logging . */ private static Logger log = Logger.getLogger(SceneGroup.class); Index: MasterBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/MasterBuilder.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** MasterBuilder.java 25 Jan 2007 18:44:56 -0000 1.13 --- MasterBuilder.java 2 Oct 2007 18:43:40 -0000 1.14 *************** *** 62,65 **** --- 62,68 ---- * <pre> * $Log$ + * Revision 1.14 2007/10/02 18:43:40 hrivnac + * connection from Atlantis introduced + * * Revision 1.13 2007/01/25 18:44:56 hrivnac * so that AGDD JAXB 2.0 works *************** *** 213,216 **** --- 216,244 ---- } + /** Create {@link MasterBuilder} subclass instance suitable pro supplied builder name. + * Factory method. + * <br><img src="doc-files/Builders.gif"> + * @param builderName The name of the {@link MasterBuilder subclass}. + * @return The proper {@link MasterBuilder} to build Geometric Model. + * @throws GraXMLException If {@link MasterBuilder} can't be found or created. */ + // TBD: refactor + public static final MasterBuilder createBuilder(String builderName) throws GraXMLException { + try { + _builder = (MasterBuilder)(Class.forName(builderName).newInstance()); + } + catch (ClassNotFoundException e) { + throw new GraXMLException("Builder for " + builderName + " not found", e); + } + catch (InstantiationException e) { + throw new GraXMLException("Builder for " + builderName + " can't be created", e); + } + catch (IllegalAccessException e) { + throw new GraXMLException("Builder for " + builderName + " can't be accessed", e); + } + log.info("Using " + builderName + " " + _builder.version() + " ..."); + _builder.configure(); + return _builder; + } + /** Give {@link MasterBuilder} subclass instance suitable pro supplied xml file. * @return The current associated @link MasterBuilder} subclass instance, *************** *** 405,408 **** --- 433,481 ---- } + /** Build Geometric Model {@link BranchGroup} from JAXB + * Generic Model. + * If {@link RootWindow} exists, builds graphical SceneGraph, + * otherwise only non-graphical one. + * @param element The JAXB top-level element. + * @param document The DOM {@link Document} containing the Generic Model. + * @param group The {@link BranchGroup} to be filled with the Geometric Model. + * @throws GraXMLException If Geometric Model can't be build. */ + // TBD: JAXB currently doesn't use Document + // TBD: refactor with other build()s + public final void build(Object element, + BranchGroup group) throws GraXMLException { + + //auxiliaryOutput(file); + //setSource(file); + _group = group; + + // If RootWindow exists, run in graphical mode + if (_window == null) { + Config.setGraphical(false); + } + else if (!Config.configured()) { + Config.set(); + } + log.info("Constructing and Optimizing Geometric Model (see sysout for progress report, GraXML.log for detailed messages) ..."); + // Do build + long time = System.currentTimeMillis(); + if (jaxb() != null) { + traverse(element, _group, ""); + } + else { + throw new GraXMLException("JAXB model doesn't exist - can't traverse"); + } + // Report about results + time = System.currentTimeMillis() - time; + log.info("\n"); + log.info(count() + " elements processed"); + log.info("Optimised:\n" + optDB().toString()); + log.debug("Stripified:\n" + org.freehep.j3d.Solid.stripifier().getStripifierStats()); + System.gc(); + 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(); + } + // Configurator ------------------------------------------------------------- |
From: Julius H. <hr...@us...> - 2007-10-02 18:41:04
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv2885/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: LAr.java STr.java Added Files: S3D.java Log Message: S3D added --- NEW FILE: S3D.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.S3DType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.XType; import net.hep.atlas.graphics.JiveEvent.JAXB.YType; import net.hep.atlas.graphics.JiveEvent.JAXB.ZType; // GraXML import net.hep.graphics.GraXML.BuildOptions; 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.Java3DExtensions.BillboardGroup; // Java3D import javax.media.j3d.Shape3D; import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.TransformGroup; import javax.media.j3d.Transform3D; import javax.media.j3d.BoundingSphere; import javax.media.j3d.Appearance; import javax.vecmath.Point3d; import javax.vecmath.Vector3d; // FreeHEP import org.freehep.j3d.PointSet; // Java import static java.lang.Math.toRadians; import static java.lang.Math.log; import static java.lang.Math.abs; import static java.lang.Math.sqrt; import static java.lang.Math.signum; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation of <code>S3DType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.S3DType} generic JAXB interface. * <p><font color="#880088">signum * <pre> * $Log: S3D.java,v $ * Revision 1.1 2007/10/02 18:41:03 hrivnac * S3D added * * </pre> * </font></p> * @version $Id: S3D.java,v 1.1 2007/10/02 18:41:03 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class S3D extends JiveRep { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof S3DType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Type properties S3DType S3D = (S3DType)element; int count = S3D.getCount(); String storeGateKey = S3D.getStoreGateKey(); KineType kine = S3D.getKine(); XType x = S3D.getX(); YType y = S3D.getY(); ZType z = S3D.getZ(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); float[] zs = floats(z.getValue()); // Draw all S3Ds Point3d[] points = new Point3d[count]; String name = "S3D(" + storeGateKey + ")"; String info = name; // TBD: add data Appearance appearance = builder().appearance(name, name); setAppearance(appearance); for (int i = 0; i < count; i++) { points[i] = new Point3d(xs[i], ys[i], zs[i]); } use(new PointSet(points, appearance), name, info); } /** Logging . */ private static Logger log = Logger.getLogger(S3D.class); } Index: STr.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STr.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** STr.java 24 Jan 2007 22:08:16 -0000 1.3 --- STr.java 2 Oct 2007 18:41:04 -0000 1.4 *************** *** 37,42 **** // Java - // import static java.lang.Math.signum; // TBD: 1.5 import static java.lang.Math.toRadians; // Log4J --- 37,42 ---- // Java import static java.lang.Math.toRadians; + import static java.lang.Math.PI; // Log4J *************** *** 49,52 **** --- 49,55 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/02 18:41:04 hrivnac + * S3D added + * * Revision 1.3 2007/01/24 22:08:16 hrivnac * migrated to JAXB 2.0 *************** *** 54,58 **** * Revision 1.2 2007/01/11 14:08:22 hrivnac * version 0.1.3 ! * * Revision 1.1 2005/03/30 13:10:21 hrivnac * JiveEvent introduced --- 57,61 ---- * Revision 1.2 2007/01/11 14:08:22 hrivnac * version 0.1.3 ! *signum * Revision 1.1 2005/03/30 13:10:21 hrivnac * JiveEvent introduced *************** *** 138,144 **** // Get STr properties ! String legenda = builder().pdg().name(code); String name = "str(" + legenda + "[" + i + "])"; ! int charge = builder().pdg().charge(code);; String info = name + ", eta = " + eta + ", phi = " + phi + ", pt = " + pt + ", chage = " + charge + ", id = " + id; Appearance appearance = builder().appearance(name, name + "Line"); --- 141,153 ---- // Get STr properties ! if (phi < 0) { ! phi = 2 * (float)PI + phi; ! } ! if (phiV < 0) { ! phiV = 2 * (float)PI + phiV; ! } ! String legenda = builder().pdg().name(code); String name = "str(" + legenda + "[" + i + "])"; ! int charge = builder().pdg().charge(code); String info = name + ", eta = " + eta + ", phi = " + phi + ", pt = " + pt + ", chage = " + charge + ", id = " + id; Appearance appearance = builder().appearance(name, name + "Line"); *************** *** 253,262 **** private static Logger log = Logger.getLogger(STr.class); - // TBD: 1.5 - private int signum(double x) { - if (x > 0) return 1; - else if (x < 0) return -1; - else return 0; - } - } --- 262,264 ---- Index: LAr.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/LAr.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** LAr.java 24 Jan 2007 22:08:16 -0000 1.1 --- LAr.java 2 Oct 2007 18:41:03 -0000 1.2 *************** *** 6,9 **** --- 6,15 ---- // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.LArType; + import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; + import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; + import net.hep.atlas.graphics.JiveEvent.JAXB.EnergyType; + import net.hep.atlas.graphics.JiveEvent.JAXB.IdType; + import net.hep.atlas.graphics.JiveEvent.JAXB.LayerType; + import net.hep.atlas.graphics.JiveEvent.JAXB.SubType; // GraXML *************** *** 11,15 **** import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; ! import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; // Java3D --- 17,24 ---- import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; ! import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; ! ! // JiveGeometry ! import net.hep.atlas.graphics.JiveGeometry.GeometricModel.JiveGeometryBuilder; // Java3D *************** *** 33,38 **** --- 42,50 ---- import static java.lang.Math.sin; import static java.lang.Math.cos; + import static java.lang.Math.sinh; import static java.lang.Math.sqrt; import static java.lang.Math.exp; + import static java.lang.Math.log; + import static java.lang.Math.abs; import static java.lang.Math.PI; *************** *** 46,49 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/02 18:41:03 hrivnac + * S3D added + * * Revision 1.1 2007/01/24 22:08:16 hrivnac * migrated to JAXB 2.0 *************** *** 55,61 **** public final class LAr extends JiveRep { ! public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) {} - /** Logging . */ private static Logger log = Logger.getLogger(LAr.class); --- 70,305 ---- public final class LAr extends JiveRep { ! public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { ! ! // Set values ! set(builder, tg, parent); ! ! // Verify element type ! if (! (element instanceof LArType)) { ! log.error(element + " can't be traversed using " + getClass().getName() + " representation"); ! return; ! } ! ! // Get Type properties ! LArType lar = (LArType)element; ! EtaType eta = lar.getEta(); ! PhiType phi = lar.getPhi(); ! EnergyType energy = lar.getEnergy(); ! IdType id = lar.getId(); ! LayerType layer = lar.getLayer(); ! SubType sub = lar.getSub(); ! float[] etas = floats(eta.getValue()); ! float[] phis = floats(phi.getValue()); ! float[] energies = floats(energy.getValue()); ! int[] ids = ints( id.getValue()); ! int[] layers = ints( layer.getValue()); ! int[] subs = ints( sub.getValue()); ! ! ! // Draw all LArs ! // - save and restore tg as it may be changed by draw*(...) ! Group tmpTg = tg(); ! for (int i = 0; i < etas.length; i++) { ! drawLAr(etas[i], phis[i], energies[i], ids[i], layers[i], subs[i]); ! setTg(tmpTg); ! } ! ! } ! ! /** Draw one LAr. ! * @param eta The <code>eta</code> of the LAr axis. ! * @param phi The <code>phi</code> of the LAr axis. ! * @param energy The <code>energy</code> of the LAr. ! * @param id The <code>id</code> of the LAr. ! * @param layer The <code>layer</code> of the LAr. ! * @param sub The <code>sub</code> of the LAr.*/ ! private void drawLAr(float eta, float phi, float energy, int id, int layer, int sub) { ! ! // Get LAr properties ! String name = "lar" + id + "[" + layer + "/" + sub + "]"; ! String info = name + ", eta = " + eta + ", phi = " + phi + ", energy = " + energy + ", id = " + id; ! Appearance appearance = builder().appearance(name, name + "Air"); ! float[] rMM = getR(layer, sub); ! if (rMM == null) { ! //log.error("Can't draw LAr layer " + layer + " as it has not been recorded in JiveGeometry"); TBD ! return; ! } ! float rMin = rMM[0]; ! float rMax = rMM[1]; ! float zMin = rMM[2]; ! float zMax = rMM[3]; ! ! float zr = zMin / rMin; ! float etaMin = (float)log(zr + sqrt(1 + zr * zr)); ! float z; ! float r; ! if (abs(eta) <= etaMin) { ! z = zMin; ! r = zMin / (float)sinh(eta); ! } ! else { ! z = rMin * (float)sinh(eta); ! r = rMin; ! } ! if (eta < 0) { ! z = -z; ! } ! ! float x = r * (float)cos(phi); ! float y = r * (float)sin(phi); ! float delR = 0.1f * r; ! float delX = x * delR / r; ! float delY = y * delR / r; ! float delZ = z * delR / r; ! ! // Draw and use LAr according to options ! setAppearance(appearance); ! if (energy > _ptCut) { ! Shape3D shape = _asCone ? drawCone(name, x, y, z, rMin, phi, delX, delY, delZ, delR, energy) : ! drawLine(name, x, y, z, delX, delY, delZ); ! use(shape, name, info); ! } ! ! } ! ! /** TBD */ ! private float[] getR(int layer, int sub) { ! float[] r = new float[]{0f, 0f, 0f, 0f}; ! try { ! r[0] = (float)JiveGeometryBuilder.rMin("LAr_" + layer + "_" + sub); ! r[1] = (float)JiveGeometryBuilder.rMax("LAr_" + layer + "_" + sub); ! r[2] = (float)JiveGeometryBuilder.zMin("LAr_" + layer + "_" + sub); ! r[3] = (float)JiveGeometryBuilder.zMax("LAr_" + layer + "_" + sub); ! } ! catch (Exception e) { ! r = null; ! } ! return r; ! } ! ! /** Draw one LAr as a {@link ConeSegment}. ! * @param name The name of the LAr. ! * @param x The x-coordinate of the Cone start point. ! * @param y The y-coordinate of the Cone start point. ! * @param z The z-coordinate of the Cone start point. ! * @param r The r-coordinate of the Cone start point. ! * @param phi The phi-coordinate of the Cone. ! * @param delX The x-length of the Cone. ! * @param delY The y-length of the Cone. ! * @param delZ The z-length of the Cone. ! * @param delR The r-length of the Cone. ! * @param energy The energy of the LAr. ! * @return The {@link ConeSegment} representing the LAr. */ ! private Shape3D drawCone(String name, ! float x, ! float y, ! float z, ! float r, ! float phi, ! float delX, ! float delY, ! float delZ, ! float delR, ! float energy) { ! float cell = 0.005f; // TBD: better ! ConeSegment cone = new ConeSegment(0, ! 0, ! cell, ! cell * (1f + delR / r), ! delR, ! 0, ! 2*PI, ! BuildOptions.granularity() / 2, ! appearance()); ! Matrix3d m = new Matrix3d(UMATRIX); ! Matrix3d m0 = new Matrix3d(UMATRIX); ! m0.rotZ(phi + (float)(PI / 2f)); ! m.mul(m0); ! m0 = new Matrix3d(UMATRIX); ! m0.rotX(Math.atan2(_rho, z)); ! m.mul(m0); ! TransformGroup it = new TransformGroup(new Transform3D(m, ! new Vector3d(x + delX / 2, ! y + delY / 2, ! z + delZ / 2), ! 1)); ! tg().addChild(it); ! setTg(it); ! return cone; ! } ! ! /** Draw one LAr as a line {@link Shape3D}. Change <code>tg</code>. ! * @param name The name of the LAr. ! * @param x The x-coordinate of the Cone start point. ! * @param y The y-coordinate of the Cone start point. ! * @param z The z-coordinate of the Cone start point. ! * @param delX The x-length of the Cone. ! * @param delY The y-length of the Cone. ! * @param delZ The z-length of the Cone. ! * @return The line {@link Shape3D} representing the LAr. */ ! private Shape3D drawLine(String name, ! float x, ! float y, ! float z, ! float delX, ! float delY, ! float delZ) { ! ! LineArray lineArray = new LineArray(2, ! GeometryArray.COORDINATES| ! GeometryArray.NORMALS); ! lineArray.setCoordinate(0, new Point3f(x, ! y, ! z)); ! lineArray.setCoordinate(1, new Point3f(x + delX, ! y + delY, ! z + delZ)); ! lineArray.setNormal(0, new Vector3f(0, 0, 0)); ! lineArray.setNormal(1, new Vector3f(0, 0, 0)); ! Shape3D line = new Shape3D(); ! line.setGeometry(lineArray); ! line.setAppearance(appearance()); ! return line; ! } ! ! /** Set drawing LAr as {@link ConeSegment}. ! * This is the default. */ ! public static final void asCone() { ! _asCone = true; ! } ! ! /** Set drawing LAr as line {@link Shape3D}. */ ! public static final void asLine() { ! _asCone = false; ! } ! ! /** Set factor for magnifying <code>pt</code> ! * to get {@link ConeSegment} length. ! * @param ptFactor The factor for magnifying <code>pt</code> ! * to get {@link ConeSegment} length, ! * the default is <code>0.01</code>. */ ! public static final void setPtFactor(float ptFactor) { ! _ptFactor = ptFactor; ! } ! ! /** Set <code>pt</code> cut. Jets with smaller pt are not drawn. ! * @param ptCut The minimal pt of the Jet to be drawn, ! * the default is <code>0.1</code>. */ ! public static final void setPtCut(float ptCut) { ! _ptCut = ptCut; ! } ! ! private static boolean _asCone = false; ! ! private static float _ptFactor = 1.0f; ! ! private static float _ptCut = 0.1f; ! ! private static float _rho = 1.0f; ! ! private static final Matrix3d UMATRIX = new Matrix3d(1.0, 0.0, 0.0, ! 0.0, 1.0, 0.0, ! 0.0, 0.0, 1.0); /** Logging . */ private static Logger log = Logger.getLogger(LAr.class); |