graxml-commit Mailing List for GraXML (Page 8)
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-11-05 14:58:51
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27118/net/hep/graphics/GraXML/Java3DExtensions Modified Files: Envelope.java J3DFrame.java Log Message: Envelope richer Index: J3DFrame.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions/J3DFrame.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** J3DFrame.java 12 Oct 2007 23:47:29 -0000 1.9 --- J3DFrame.java 5 Nov 2007 14:58:20 -0000 1.10 *************** *** 46,49 **** --- 46,52 ---- * <pre> * $Log$ + * Revision 1.10 2007/11/05 14:58:20 hrivnac + * Envelope richer + * * Revision 1.9 2007/10/12 23:47:29 hrivnac * monitoring (fps, mb) added *************** *** 359,362 **** --- 362,372 ---- // Java3D Decorations -------------------------------------------------------- + // TBD + public void changeEnvelope(String part) { + enableEnvelope(true); + _envelope.change(part); + } + + /** Switch on/off {@link Envelope}. * @param enable Whether {@link Envelope} should be switched on. */ Index: Envelope.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/Java3DExtensions/Envelope.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Envelope.java 10 Oct 2007 18:47:42 -0000 1.2 --- Envelope.java 5 Nov 2007 14:58:15 -0000 1.3 *************** *** 1,5 **** --- 1,8 ---- package net.hep.graphics.GraXML.Java3DExtensions; + import net.hep.graphics.GraXML.BuildOptions; + // Java3D + import javax.media.j3d.Group; import javax.media.j3d.BranchGroup; import javax.media.j3d.BoundingSphere; *************** *** 8,11 **** --- 11,15 ---- import javax.media.j3d.TransparencyAttributes; import javax.media.j3d.PointAttributes; + import javax.media.j3d.LineAttributes; import javax.media.j3d.Shape3D; import javax.media.j3d.TransformGroup; *************** *** 24,27 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.3 2007/11/05 14:58:15 hrivnac + * Envelope richer + * * Revision 1.2 2007/10/10 18:47:42 hrivnac * if running in a Thread, doesn't exist; ticks on axis *************** *** 49,52 **** --- 56,60 ---- * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ + // TBD: antialiasing public final class Envelope extends BranchGroup { *************** *** 56,59 **** --- 64,69 ---- // To be able to switch on/off setCapability(BranchGroup.ALLOW_DETACH ); + setCapability(Group.ALLOW_CHILDREN_WRITE); + setCapability(Group.ALLOW_CHILDREN_EXTEND); // Colors *************** *** 62,67 **** Appearance transparent = new Appearance(); transparent.setMaterial(new Material(transColor, transColor, transColor, transColor, 1.0f)); ! transparent.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 1.0f)); ! // Grey, Red, Green, Blue Color3f grey = new Color3f(0.8f, 0.8f, 0.8f); Color3f red = new Color3f(1f, 0, 0 ); --- 72,78 ---- Appearance transparent = new Appearance(); transparent.setMaterial(new Material(transColor, transColor, transColor, transColor, 1.0f)); ! transparent.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f)); ! // White, Grey, Red, Green, Blue ! Color3f white = new Color3f(1f, 1f, 1f ); Color3f grey = new Color3f(0.8f, 0.8f, 0.8f); Color3f red = new Color3f(1f, 0, 0 ); *************** *** 69,131 **** Color3f blue = new Color3f(0, 0, 1f ); ! // Texts if (_axis) { ! addLabel("x[m ]", new double[]{_radius, 0, 0 }, green, 0.1, 0.2f, false); ! addLabel("y[m ]", new double[]{0, _radius, 0 }, blue, 0.1, 0.2f, false); ! addLabel("z[m ]", new double[]{0, 0, _length / 2}, red, 0.1, 0.2f, false); ! double r; ! double l; ! int n = (int)(_nTicks * _radius); ! for (int i = 1; i < n; i++) { ! r = _radius * i / n; ! l = _length * i / n / 2; ! addLabel(String.valueOf( r), new double[]{ r, 0, 0}, green, 0.02, 0.5f, true); ! addLabel(String.valueOf( r), new double[]{ 0, r, 0}, blue, 0.02, 0.5f, true); ! addLabel(String.valueOf( l), new double[]{ 0, 0, l}, red, 0.02, 0.5f, true); ! addLabel(String.valueOf(-r), new double[]{-r, 0, 0}, green, 0.02, 0.5f, true); ! addLabel(String.valueOf(-r), new double[]{ 0, -r, 0}, blue, 0.02, 0.5f, true); ! addLabel(String.valueOf(-l), new double[]{ 0, 0, -l}, red, 0.02, 0.5f, true); ! } } ! // Coordinates ! if (_axis) { ! // X ! LineArray lx = new LineArray(2, LineArray.COORDINATES); ! lx.setCoordinate(0, new Point3d(- _radius, 0, 0)); ! lx.setCoordinate(1, new Point3d( _radius, 0, 0)); ! addChild(new Shape3D(lx)); ! // Y ! LineArray ly = new LineArray(2, LineArray.COORDINATES); ! ly.setCoordinate(0, new Point3d(0, - _radius, 0)); ! ly.setCoordinate(1, new Point3d(0, _radius, 0)); ! addChild(new Shape3D(ly)); ! // Z ! LineArray lz = new LineArray(2, LineArray.COORDINATES); ! lz.setCoordinate(0, new Point3d(0, 0, - _length / 2)); ! lz.setCoordinate(1, new Point3d(0, 0, _length / 2)); ! addChild(new Shape3D(lz)); } ! // Transparent Envelope (Cylinder) if (_cylinder) { ! Cylinder cylinder = new Cylinder((float)_radius, (float)_length, transparent); ! Transform3D t3d = new Transform3D(); ! t3d.rotX(Math.PI / 2); ! TransformGroup t = new TransformGroup(t3d); ! t.setTransform(t3d); ! t.addChild(cylinder); ! addChild(t); } } // TBD ! private void addLabel(String text, ! double[] place, ! Color3f color, ! double size, ! float transparency, ! boolean drawPoint) { Appearance appearance = new Appearance(); --- 80,189 ---- Color3f blue = new Color3f(0, 0, 1f ); ! // Axis ! _axisGroup = new BranchGroup(); ! _axisGroup.setCapability(BranchGroup.ALLOW_DETACH); if (_axis) { ! addChild(_axisGroup); } + // X + LineArray lx = new LineArray(2, LineArray.COORDINATES); + lx.setCoordinate(0, new Point3d(- _radius, 0, 0)); + lx.setCoordinate(1, new Point3d( _radius, 0, 0)); + _axisGroup.addChild(new Shape3D(lx)); + // Y + LineArray ly = new LineArray(2, LineArray.COORDINATES); + ly.setCoordinate(0, new Point3d(0, - _radius, 0)); + ly.setCoordinate(1, new Point3d(0, _radius, 0)); + _axisGroup.addChild(new Shape3D(ly)); + // Z + Appearance appearance = new Appearance(); + appearance.setLineAttributes(new LineAttributes(3, LineAttributes.PATTERN_SOLID, false)); + LineArray lz = new LineArray(2, LineArray.COORDINATES); + lz.setCoordinate(0, new Point3d(0, 0, - _length / 2)); + lz.setCoordinate(1, new Point3d(0, 0, _length / 2)); + Shape3D shape = new Shape3D(lz); + shape.setAppearance(appearance); + _axisGroup.addChild(shape); ! // Legend ! _legendGroup = new BranchGroup(); ! _legendGroup.setCapability(BranchGroup.ALLOW_DETACH); ! if (_legend) { ! addChild(_legendGroup); ! } ! _legendGroup.addChild(label("x[m ]", new double[]{_radius, 0, 0 }, green, 0.1, 0.2f, false)); ! _legendGroup.addChild(label("y[m ]", new double[]{0, _radius, 0 }, blue, 0.1, 0.2f, false)); ! _legendGroup.addChild(label("z[m ]", new double[]{0, 0, _length / 2}, red, 0.1, 0.2f, false)); ! double r; ! double l; ! int n = (int)(_nTicks * _radius); ! for (int i = 1; i < n; i++) { ! r = _radius * i / n; ! l = _length * i / n / 2; ! _legendGroup.addChild(label(String.valueOf( r), new double[]{ r, 0, 0}, green, 0.02, 0.5f, true)); ! _legendGroup.addChild(label(String.valueOf( r), new double[]{ 0, r, 0}, blue, 0.02, 0.5f, true)); ! _legendGroup.addChild(label(String.valueOf( l), new double[]{ 0, 0, l}, red, 0.02, 0.5f, true)); ! _legendGroup.addChild(label(String.valueOf(-r), new double[]{-r, 0, 0}, green, 0.02, 0.5f, true)); ! _legendGroup.addChild(label(String.valueOf(-r), new double[]{ 0, -r, 0}, blue, 0.02, 0.5f, true)); ! _legendGroup.addChild(label(String.valueOf(-l), new double[]{ 0, 0, -l}, red, 0.02, 0.5f, true)); } ! // Cylinder ! _cylinderGroup = new BranchGroup(); ! _cylinderGroup.setCapability(BranchGroup.ALLOW_DETACH); if (_cylinder) { ! addChild(_cylinderGroup); } + Cylinder cylinder = new Cylinder((float)_radius, (float)_length, 0, BuildOptions.granularity(), BuildOptions.granularity(), transparent); + Transform3D t3d = new Transform3D(); + t3d.rotX(Math.PI / 2); + TransformGroup t = new TransformGroup(t3d); + t.setTransform(t3d); + t.addChild(cylinder); + _cylinderGroup.addChild(t); } // TBD ! public void change(String part) { ! // Axis ! if (part.equals("Axis")) { ! _axis = ! _axis; ! if (_axis) { ! addChild(_axisGroup); ! } ! else { ! _axisGroup.detach(); ! } ! } ! // Legend ! else if (part.equals("Legend")) { ! _legend = ! _legend; ! if (_legend) { ! addChild(_legendGroup); ! } ! else { ! _legendGroup.detach(); ! } ! } ! // Cylinder ! else if (part.equals("Cylinder")) { ! _cylinder = ! _cylinder; ! if (_cylinder) { ! addChild(_cylinderGroup); ! } ! else { ! _cylinderGroup.detach(); ! } ! } ! } ! ! // TBD ! private TransformGroup label(String text, ! double[] place, ! Color3f color, ! double size, ! float transparency, ! boolean drawPoint) { Appearance appearance = new Appearance(); *************** *** 145,150 **** tg.addChild(label); - - if (drawPoint) { Shape3D point = new Shape3D(); --- 203,206 ---- *************** *** 159,192 **** } ! addChild(tg); } ! /** Set logo on the z-axis. ! * @param logo The text to be shown on z-axis, ! * the default is <code>z</code>. */ ! public static final void setLogo(String logo) { ! _logo = logo; ! } ! private static String _logo = "z"; ! /** Enable/disable x-y-z axis. ! * @param axis If axis should be visible, ! * the default is <code>true</code>. */ ! public static final void setAxis(boolean axis) { ! _axis = axis; ! } ! private static boolean _axis = true; ! /** Enable/disable transparent cylinder. ! * @param cylinder If cylnder should be visible, ! * the default is <code>false</code>. */ ! public static final void setCylinder(boolean cylinder) { ! _cylinder = cylinder; ! } ! ! private static boolean _cylinder = false; // TBD --- 215,233 ---- } ! return tg; } ! private boolean _axis = true; ! private boolean _legend = false; ! ! private boolean _cylinder = false; ! private BranchGroup _axisGroup; ! private BranchGroup _legendGroup; ! private BranchGroup _cylinderGroup; // TBD |
From: Julius H. <hr...@us...> - 2007-11-05 14:58:49
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/Components In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27118/net/hep/graphics/GraXML/GUI/Components Modified Files: EnvelopePanel.java ProjectionPanel.java Log Message: Envelope richer Index: EnvelopePanel.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/Components/EnvelopePanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EnvelopePanel.java 30 Mar 2005 12:44:30 -0000 1.1 --- EnvelopePanel.java 5 Nov 2007 14:58:13 -0000 1.2 *************** *** 18,21 **** --- 18,24 ---- * <pre> * $Log$ + * Revision 1.2 2007/11/05 14:58:13 hrivnac + * Envelope richer + * * Revision 1.1 2005/03/30 12:44:30 hrivnac * GraXML introduced *************** *** 42,69 **** envLabel.setFont(Fonts.BOLD); envLabel.setToolTipText("<html>Set Envelope<br>" ! + "<small>Envelope switches 3D Envelope (Axis) On/Off</small></html>"); ! // On ! JRadioButton onButton = new JRadioButton("On"); ! onButton.setName("Envelope"); ! onButton.addActionListener(listener); ! onButton.setSelected(true); ! onButton.setFont(Fonts.PLAIN); ! onButton.setToolTipText("Switch Envelope On"); ! // Off ! JRadioButton offButton = new JRadioButton("Off"); ! offButton.setName("Envelope"); ! offButton.addActionListener(listener); ! offButton.setSelected(false); ! offButton.setFont(Fonts.PLAIN); ! offButton.setToolTipText("Switch Envelope Off"); ! // Group ! ButtonGroup bg = new ButtonGroup(); ! bg.add(onButton); ! bg.add(offButton); // Panel setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(envLabel); ! add(onButton); ! add(offButton); add(new JLabel(" ")); add(new JLabel(" ")); --- 45,76 ---- envLabel.setFont(Fonts.BOLD); envLabel.setToolTipText("<html>Set Envelope<br>" ! + "<small>Envelope shows/hides 3D Envelope components (Axis/Legend/Cylinder)</small></html>"); ! // Axis ! JRadioButton axisButton = new JRadioButton("Axis"); ! axisButton.setName("Envelope"); ! axisButton.addActionListener(listener); ! axisButton.setSelected(true); ! axisButton.setFont(Fonts.PLAIN); ! axisButton.setToolTipText("Show/Hide Axis"); ! // Legend ! JRadioButton legendButton = new JRadioButton("Legend"); ! legendButton.setName("Envelope"); ! legendButton.addActionListener(listener); ! legendButton.setSelected(false); ! legendButton.setFont(Fonts.PLAIN); ! legendButton.setToolTipText("Show/Hide Legend"); ! // Cylinder ! JRadioButton cylinderButton = new JRadioButton("Cylinder"); ! cylinderButton.setName("Envelope"); ! cylinderButton.addActionListener(listener); ! cylinderButton.setSelected(false); ! cylinderButton.setFont(Fonts.PLAIN); ! cylinderButton.setToolTipText("Show/Hide Cylinder"); // Panel setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(envLabel); ! add(axisButton); ! add(legendButton); ! add(cylinderButton); add(new JLabel(" ")); add(new JLabel(" ")); Index: ProjectionPanel.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/Components/ProjectionPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ProjectionPanel.java 30 Mar 2005 12:44:30 -0000 1.1 --- ProjectionPanel.java 5 Nov 2007 14:58:13 -0000 1.2 *************** *** 17,20 **** --- 17,23 ---- * <pre> * $Log$ + * Revision 1.2 2007/11/05 14:58:13 hrivnac + * Envelope richer + * * Revision 1.1 2005/03/30 12:44:30 hrivnac * GraXML introduced *************** *** 59,63 **** bg.add(perspectiveButton); bg.add(parallelButton); ! //Panel setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(projectionLabel); --- 62,66 ---- bg.add(perspectiveButton); bg.add(parallelButton); ! // Panel setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); add(projectionLabel); |
From: Julius H. <hr...@us...> - 2007-11-05 14:58:46
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27118/net/hep/graphics/GraXML/GUI Modified Files: RootActionListener.java RootWindow.java Log Message: Envelope richer Index: RootWindow.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootWindow.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** RootWindow.java 19 Oct 2007 14:09:13 -0000 1.13 --- RootWindow.java 5 Nov 2007 14:58:13 -0000 1.14 *************** *** 79,82 **** --- 79,85 ---- * <pre> * $Log$ + * Revision 1.14 2007/11/05 14:58:13 hrivnac + * Envelope richer + * * Revision 1.13 2007/10/19 14:09:13 hrivnac * works in WebStart 1.5/1.6 *************** *** 734,739 **** * should be enabled, * the defalt is <code>true</code>. */ ! public void setEnvelope(boolean enable) { ! _j3d.enableEnvelope(enable); } --- 737,743 ---- * should be enabled, * the defalt is <code>true</code>. */ ! // TBD ! public void changeEnvelope(String part) { ! _j3d.changeEnvelope(part); } Index: RootActionListener.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootActionListener.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** RootActionListener.java 10 Oct 2007 18:47:37 -0000 1.4 --- RootActionListener.java 5 Nov 2007 14:58:12 -0000 1.5 *************** *** 40,43 **** --- 40,46 ---- * <pre> * $Log$ + * Revision 1.5 2007/11/05 14:58:12 hrivnac + * Envelope richer + * * Revision 1.4 2007/10/10 18:47:37 hrivnac * if running in a Thread, doesn't exist; ticks on axis *************** *** 390,402 **** else if (name.equals("Envelope")) { ! // On ! if (value.equals("On")) { ! _window.setEnvelope(true); ! } ! ! // Off ! else if (value.equals("Off")) { ! _window.setEnvelope(false); ! } } --- 393,398 ---- else if (name.equals("Envelope")) { ! // Axis, Labels, Cylinder ! _window.changeEnvelope(value); } |
From: Julius H. <hr...@us...> - 2007-11-05 14:58:43
|
Update of /cvsroot/graxml/Graphics/GraXML/src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27118 Modified Files: index.html Log Message: Envelope richer Index: index.html =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/index.html,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** index.html 2 Oct 2007 23:06:46 -0000 1.7 --- index.html 5 Nov 2007 14:58:10 -0000 1.8 *************** *** 18,22 **** <ul> <li><a href="JavaDoc/net/hep/graphics/GraXML/doc-files/Guide.html">Users Guide</a></li> ! <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> --- 18,22 ---- <ul> <li><a href="JavaDoc/net/hep/graphics/GraXML/doc-files/Guide.html">Users Guide</a></li> ! <li>Web Start: <a href="http://home.cern.ch/hrivnac/Activities/Packages/WebStart/GraXML/GraXML.jnlp"><img src="http://javadesktop.org/javanet_images/webstart.small.gif" border="0" alt="Launch Web Start"></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> |
From: Julius H. <hr...@us...> - 2007-11-05 14:58:42
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27118/net/hep/graphics/GraXML Modified Files: MasterBuilder.java Log Message: Envelope richer Index: MasterBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/MasterBuilder.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MasterBuilder.java 12 Oct 2007 15:19:12 -0000 1.17 --- MasterBuilder.java 5 Nov 2007 14:58:12 -0000 1.18 *************** *** 62,65 **** --- 62,68 ---- * <pre> * $Log$ + * Revision 1.18 2007/11/05 14:58:12 hrivnac + * Envelope richer + * * Revision 1.17 2007/10/12 15:19:12 hrivnac * refactoring *************** *** 465,469 **** key = material; } ! // Replicas of he same object have the same color if (key.contains(";")) { key = key.substring(0, key.indexOf(";")); --- 468,472 ---- key = material; } ! // Replicas of the same object have the same color if (key.contains(";")) { key = key.substring(0, key.indexOf(";")); |
From: Julius H. <hr...@us...> - 2007-10-26 23:12:36
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5407/net/hep/atlas/graphics/JiveEvent/GeometricModel Modified Files: Jet0.java Particle.java Log Message: improved Index: Particle.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Particle.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Particle.java 26 Oct 2007 18:52:00 -0000 1.4 --- Particle.java 26 Oct 2007 23:12:33 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- // GraXML import net.hep.graphics.GraXML.BuildOptions; + import net.hep.graphics.GraXML.GlobalOptions; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; *************** *** 28,31 **** --- 29,33 ---- import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; + import javax.media.j3d.TransparencyAttributes; import javax.media.j3d.LineArray; import javax.media.j3d.GeometryArray; *************** *** 57,60 **** --- 59,65 ---- * <pre> * $Log$ + * Revision 1.5 2007/10/26 23:12:33 hrivnac + * improved + * * Revision 1.4 2007/10/26 18:52:00 hrivnac * ETMis added *************** *** 131,135 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), false)); shape.setAppearance(appearance); setAppearance(appearance); --- 136,140 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), GlobalOptions.quality() > 5)); shape.setAppearance(appearance); setAppearance(appearance); *************** *** 199,203 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), false)); shape.setAppearance(appearance); setAppearance(appearance); --- 204,209 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance. setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f)); ! appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), GlobalOptions.quality() > 5)); shape.setAppearance(appearance); setAppearance(appearance); Index: Jet0.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Jet0.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jet0.java 26 Oct 2007 18:51:59 -0000 1.2 --- Jet0.java 26 Oct 2007 23:12:33 -0000 1.3 *************** *** 49,52 **** --- 49,55 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/26 23:12:33 hrivnac + * improved + * * Revision 1.2 2007/10/26 18:51:59 hrivnac * ETMis added *************** *** 230,234 **** } ! private static float _ptFactor = 0.01f; private static float _ptCut = 0.1f; --- 233,237 ---- } ! private static float _ptFactor = 0.05f; private static float _ptCut = 0.1f; *************** *** 236,240 **** private static float _rho = 0.2f; ! private static float _cell = 0.02f; private static BranchGroup _g; --- 239,243 ---- private static float _rho = 0.2f; ! private static float _cell = 0.01f; private static BranchGroup _g; |
From: Julius H. <hr...@us...> - 2007-10-26 23:12:36
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5407/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: S3D.java STC.java Track.java Log Message: improved Index: S3D.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/S3D.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** S3D.java 25 Oct 2007 20:52:14 -0000 1.8 --- S3D.java 26 Oct 2007 23:12:34 -0000 1.9 *************** *** 13,16 **** --- 13,17 ---- // GraXML import net.hep.graphics.GraXML.BuildOptions; + import net.hep.graphics.GraXML.GlobalOptions; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; *************** *** 28,31 **** --- 29,33 ---- import javax.media.j3d.Material; import javax.media.j3d.PointAttributes; + import javax.media.j3d.TransparencyAttributes; import javax.media.j3d.PointArray; import javax.media.j3d.GeometryArray; *************** *** 56,59 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.9 2007/10/26 23:12:34 hrivnac + * improved + * * Revision 1.8 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 134,138 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setPointAttributes(new PointAttributes(pointSize(), false)); shape.setAppearance(appearance); setAppearance(appearance); --- 139,144 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance. setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f)); ! appearance.setPointAttributes(new PointAttributes(pointSize(), GlobalOptions.quality() > 5)); shape.setAppearance(appearance); setAppearance(appearance); Index: STC.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STC.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** STC.java 25 Oct 2007 20:52:14 -0000 1.7 --- STC.java 26 Oct 2007 23:12:34 -0000 1.8 *************** *** 16,19 **** --- 16,20 ---- // GraXML import net.hep.graphics.GraXML.BuildOptions; + import net.hep.graphics.GraXML.GlobalOptions; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; *************** *** 30,33 **** --- 31,35 ---- import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; + import javax.media.j3d.TransparencyAttributes; import javax.media.j3d.LineArray; import javax.media.j3d.GeometryArray; *************** *** 58,61 **** --- 60,66 ---- * <pre> * $Log$ + * Revision 1.8 2007/10/26 23:12:34 hrivnac + * improved + * * Revision 1.7 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 138,142 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); --- 143,148 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance. setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f)); ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, GlobalOptions.quality() > 5)); shape.setAppearance(appearance); setAppearance(appearance); Index: Track.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Track.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Track.java 26 Oct 2007 16:28:31 -0000 1.9 --- Track.java 26 Oct 2007 23:12:34 -0000 1.10 *************** *** 27,30 **** --- 27,31 ---- // GraXML import net.hep.graphics.GraXML.BuildOptions; + import net.hep.graphics.GraXML.GlobalOptions; import net.hep.graphics.GraXML.MasterBuilder; import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; *************** *** 42,45 **** --- 43,47 ---- import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; + import javax.media.j3d.TransparencyAttributes; import javax.media.j3d.LineArray; import javax.media.j3d.GeometryArray; *************** *** 73,76 **** --- 75,81 ---- * <pre> * $Log$ + * Revision 1.10 2007/10/26 23:12:34 hrivnac + * improved + * * Revision 1.9 2007/10/26 16:28:31 hrivnac * Muon and Jets added *************** *** 166,170 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); --- 171,176 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance. setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.0f)); ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, GlobalOptions.quality() > 5)); shape.setAppearance(appearance); setAppearance(appearance); |
From: Julius H. <hr...@us...> - 2007-10-26 18:52:18
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20147/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: Jet.java Added Files: ETMis.java Log Message: ETMis added --- NEW FILE: ETMis.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Particle; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.ETMisType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; // 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.Appearance; import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; 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.exp; import static java.lang.Math.abs; import static java.lang.Math.sin; import static java.lang.Math.cos; 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>ETMisType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.ETMisType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: ETMis.java,v $ * Revision 1.1 2007/10/26 18:52:00 hrivnac * ETMis added * * </pre> * </font></p> * @version $Id: ETMis.java,v 1.1 2007/10/26 18:52:00 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public final class ETMis extends Particle { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof ETMisType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get ETMis properties and Construct Particle ETMisType eTMis = (ETMisType)element; construct("ETMiss", eTMis.getStoreGateKey(), eTMis.getEt(), eTMis.getEtx(), eTMis.getEty()); } /** 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; } /** Give {@link Color3f} to be used for <em>i</em>s line segments. * @param i The line segment number. * @return The {@link Color3f} o be used for <em>i</em>s line segment, * <em>null</em> is colormap is not set. */ protected Color3f color(int i) { if (_colorList == null) { return null; } return new Color3f(_colorMap[_colorList[i]]); } private static Color[] _colorMap; private static int[] _colorList; /** Give pattern of line segments, * the default is {@link LineAttributes}.PATTERN_SOLID. * @return The pattern of line segments. */ public int linePattern() { return _linePattern; } private static int _linePattern = LineAttributes.PATTERN_DASH; /** Give width of line segments, * the default is <code>8</code>. * @return The width of line segments. */ public int lineWidth() { return _lineWidth; } /** Set width of line segments, * the default is <code>8</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { _lineWidth = lineWidth; } private static int _lineWidth = 8; /** Logging . */ private static Logger log = Logger.getLogger(ETMis.class); } Index: Jet.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Jet.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Jet.java 26 Oct 2007 16:28:31 -0000 1.3 --- Jet.java 26 Oct 2007 18:52:00 -0000 1.4 *************** *** 54,57 **** --- 54,60 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/26 18:52:00 hrivnac + * ETMis added + * * Revision 1.3 2007/10/26 16:28:31 hrivnac * Muon and Jets added *************** *** 127,131 **** jet.getEta(), jet.getPhi(), ! jet.getPt()); } --- 130,134 ---- jet.getEta(), jet.getPhi(), ! jet.getEt()); } |
From: Julius H. <hr...@us...> - 2007-10-26 18:52:09
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv20147/net/hep/atlas/graphics/JiveEvent/GeometricModel Modified Files: Jet0.java Particle.java Log Message: ETMis added Index: Particle.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Particle.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Particle.java 26 Oct 2007 16:28:30 -0000 1.3 --- Particle.java 26 Oct 2007 18:52:00 -0000 1.4 *************** *** 8,11 **** --- 8,14 ---- import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; + import net.hep.atlas.graphics.JiveEvent.JAXB.EtType; + import net.hep.atlas.graphics.JiveEvent.JAXB.EtxType; + import net.hep.atlas.graphics.JiveEvent.JAXB.EtyType; // GraXML *************** *** 54,57 **** --- 57,63 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/26 18:52:00 hrivnac + * ETMis added + * * Revision 1.3 2007/10/26 16:28:30 hrivnac * Muon and Jets added *************** *** 125,129 **** appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); --- 131,135 ---- appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), false)); shape.setAppearance(appearance); setAppearance(appearance); *************** *** 149,152 **** --- 155,225 ---- } + /** Construct Java3D representation of this <em>Particle</em>. + * @param type The particle' type (name). + * @param storeGateKey The corresponding <em>StoreGate</em> key. + * @param et The particle' <em>et</em>s. + * @param etx The particle' <em>etx</em>s. + * @param ety The particle' <em>ety</em>s. */ + // TBD: refactor + protected void construct(String type, + String storeGateKey, + EtType et, + EtxType etx, + EtyType ety) { + + // Get Particle properties + float[] ets = floats(et.getValue()); + float[] etxs = floats(etx.getValue()); + float[] etys = floats(ety.getValue()); + + // Draw all Particles + String name = type + "(" + storeGateKey + ")"; + String info = name; + boolean outlinedBckp = Interacter.outlined(); + Interacter.setOutlined(false); + Shape3D shape = new Shape3D(); + LineArray lineArray; + Appearance appearance; + Material material; + Color3f color; + double x = etxs[0]; + double y = etys[0]; + double z = sqrt(ets[0] * ets[0] - x * x - y * y);; + // ColorList is set => get Appearance from Color + if (color(0) == null) { + color = new Color3f(); + appearance = builder().appearance(name, name); + material = appearance.getMaterial(); + material.getSpecularColor(color); + } + // ColorList is not set => get Color from Appearance + else { + color = color(0); + appearance = new Appearance(); + appearance.setMaterial(new Material(color, color, color, color, 1f)); + } + appearance.setLineAttributes(new LineAttributes(lineWidth(), linePattern(), false)); + shape.setAppearance(appearance); + setAppearance(appearance); + lineArray = new LineArray(2, + GeometryArray.COORDINATES| + GeometryArray.COLOR_3| + GeometryArray.NORMALS); + lineArray.setCoordinate(0, new Point3d(0, + 0, + 0)); + lineArray.setCoordinate(1, new Point3d(x / builder().norm(), + y / builder().norm(), + z / builder().norm())); + 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); + + } + /** Give {@link Color3f} to be used for <em>i</em>s line segments. * @param i The line segment number. *************** *** 155,162 **** protected abstract Color3f color(int i); ! /** Give width of line segments, * the default is <code>2</code>. * @return The width of line segments. */ ! public abstract int lineWidth(); /** Logging . */ --- 228,248 ---- protected abstract Color3f color(int i); ! /** Give pattern of line segments, ! * the default is {@link LineAttributes}.PATTERN_SOLID. ! * @return The pattern of line segments. */ ! public int linePattern() { ! return _linePattern; ! } ! ! private static int _linePattern = LineAttributes.PATTERN_SOLID; ! ! /** Give width of line segments. * the default is <code>2</code>. * @return The width of line segments. */ ! public int lineWidth() { ! return _lineWidth; ! } ! ! private static int _lineWidth = 2; /** Logging . */ Index: Jet0.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Jet0.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Jet0.java 26 Oct 2007 16:28:30 -0000 1.1 --- Jet0.java 26 Oct 2007 18:51:59 -0000 1.2 *************** *** 49,52 **** --- 49,55 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/26 18:51:59 hrivnac + * ETMis added + * * Revision 1.1 2007/10/26 16:28:30 hrivnac * Muon and Jets added *************** *** 87,96 **** // - save and restore tg as it may be changed by draw*(...) Group tmpTg = tg(); - float pT = _pt0; for (int i = 0; i < etas.length; i++) { ! if (pts != null) { ! pT = pts[i]; ! } ! drawJet(etas[i], phis[i], pT, type, i); setTg(tmpTg); } --- 90,129 ---- // - save and restore tg as it may be changed by draw*(...) Group tmpTg = tg(); for (int i = 0; i < etas.length; i++) { ! drawJet(etas[i], phis[i], pts[i], type, i); ! setTg(tmpTg); ! } ! ! } ! ! /** Construct Java3D representation of this <em>Jet</em>. ! * @param type The jet' type (name). ! * @param count The number of jets in a set. ! * @param storeGateKey The corresponding <em>StoreGate</em> key. ! * @param eta The jet' <em>eta</em>s. ! * @param phi The jet' <em>phi</em>s. ! * @param et The jet' <em>et</em>s. */ ! protected void construct(String type, ! int count, ! String storeGateKey, ! EtaType eta, ! PhiType phi, ! EtType et) { ! ! // Get Jet properties ! float[] etas = floats(eta.getValue()); ! float[] phis = floats(phi.getValue()); ! float[] ets = null; ! if (et != null) { ! ets = floats(et.getValue()); ! } ! type += "(" + storeGateKey + ")"; ! ! // Draw all Jets ! // - save and restore tg as it may be changed by draw*(...) ! // TBD: refactor ! Group tmpTg = tg(); ! for (int i = 0; i < etas.length; i++) { ! drawJet(etas[i], phis[i], ets[i], type, i); setTg(tmpTg); } *************** *** 201,206 **** private static float _ptCut = 0.1f; - private static float _pt0 = 50.0f; - private static float _rho = 0.2f; --- 234,237 ---- |
From: Julius H. <hr...@us...> - 2007-10-26 16:28:34
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27328/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: Electron.java Event.java Jet.java Photon.java Track.java Added Files: BJet.java Muon.java TauJet.java Removed Files: LAr.java STr.java Log Message: Muon and Jets added --- NEW FILE: Muon.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Particle; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.MuonType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; // 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.Appearance; import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; 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.exp; import static java.lang.Math.abs; import static java.lang.Math.sin; import static java.lang.Math.cos; 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>MuonType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.MuonType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: Muon.java,v $ * Revision 1.1 2007/10/26 16:28:31 hrivnac * Muon and Jets added * * </pre> * </font></p> * @version $Id: Muon.java,v 1.1 2007/10/26 16:28:31 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public final class Muon extends Particle { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof MuonType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Muon properties and Construct Particle MuonType muon = (MuonType)element; construct("Muons", muon.getCount(), muon.getStoreGateKey(), muon.getEta(), muon.getPhi(), muon.getPt()); } /** 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; } /** Give {@link Color3f} to be used for <em>i</em>s line segments. * @param i The line segment number. * @return The {@link Color3f} o be used for <em>i</em>s line segment, * <em>null</em> is colormap is not set. */ protected Color3f color(int i) { if (_colorList == null) { return null; } return new Color3f(_colorMap[_colorList[i]]); } private static Color[] _colorMap; private static int[] _colorList; /** Give width of line segments, * the default is <code>4</code>. * @return The width of line segments. */ public int lineWidth() { return _lineWidth; } /** Set width of line segments, * the default is <code>4</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { _lineWidth = lineWidth; } private static int _lineWidth = 4; /** Logging . */ private static Logger log = Logger.getLogger(Muon.class); } Index: Jet.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Jet.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Jet.java 24 Jan 2007 22:08:16 -0000 1.2 --- Jet.java 26 Oct 2007 16:28:31 -0000 1.3 *************** *** 2,6 **** import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; ! import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveRep; // Generic Model --- 2,6 ---- import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; ! import net.hep.atlas.graphics.JiveEvent.GeometricModel.Jet0; // Generic Model *************** *** 29,32 **** --- 29,33 ---- import javax.media.j3d.GeometryArray; import javax.media.j3d.Appearance; + import javax.media.j3d.TransparencyAttributes; import javax.vecmath.Matrix3d; import javax.vecmath.Vector3d; *************** *** 53,56 **** --- 54,60 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/26 16:28:31 hrivnac + * Muon and Jets added + * * Revision 1.2 2007/01/24 22:08:16 hrivnac * migrated to JAXB 2.0 *************** *** 96,100 **** * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public final class Jet extends JiveRep { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { --- 100,104 ---- * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ ! public final class Jet extends Jet0 { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { *************** *** 109,291 **** } ! // Get Type properties ! JetType jet = (JetType)element; ! EtaType eta = jet.getEta(); ! PhiType phi = jet.getPhi(); ! PtType pt = jet.getPt(); ! // not used: EtType et = jet.getEt(); ! IdType id = jet.getId(); ! // not used: CellsType cels = jet.getCells(); ! CaloClusterType cluster = jet.getCluster(); ! float[] etas = floats(eta.getValue()); ! float[] phis = floats(phi.getValue()); ! float[] pts = floats(pt.getValue()); ! int[] ids = ints( id.getValue()); ! int[] clusters = ints( cluster.getValue()); ! ! // Draw all Jets ! // - save and restore tg as it may be changed by draw*(...) ! Group tmpTg = tg(); ! for (int i = 0; i < etas.length; i++) { ! drawJet(etas[i], phis[i], pts[i], ids[i], clusters[i], i); ! setTg(tmpTg); ! } ! ! } ! ! /** Draw one Jet. ! * @param eta The <code>eta</code> of the Jet axis. ! * @param phi The <code>phi</code> of the Jet axis. ! * @param pt The <code>pt</code> of the Jet. ! * @param cluster The <code>cluster</code> of the Jet. ! * @param i The ordinal number of the Jet. */ ! private void drawJet(float eta, float phi, float pt, int id, int cluster, int i) { ! ! // Get Jet properties ! String name = "jet(" + i + ")"; ! String info = name + ", eta = " + eta + ", phi = " + phi + ", pt = " + pt + ", id = " + id + ", cluster = " + cluster; ! Appearance appearance = builder().appearance(name, name + "Air"); ! float x = _rho * (float)cos(phi); ! float y = _rho * (float)sin(phi); ! float z = _rho / 2 * (float)(exp(eta) - exp(-eta)); ! float r = (float)sqrt(_rho * _rho + z * z); ! float delR = r * _ptFactor * pt; ! float delX = x * delR / r; ! float delY = y * delR / r; ! float delZ = z * delR / r; ! ! // Draw and use Jet according to options ! setAppearance(appearance); ! if (pt > _ptCut) { ! Shape3D shape = _asCone ? drawCone(name, x, y, z, r, phi, delX, delY, delZ, delR, pt) : ! drawLine(name, x, y, z, delX, delY, delZ); ! use(shape, name, info); } ! } ! ! /** Draw one Jet as a {@link ConeSegment}. ! * @param name The name of the Jet. ! * @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 pt The pt of the Jet. ! * @return The {@link ConeSegment} representing the Jet. */ ! private Shape3D drawCone(String name, ! float x, ! float y, ! float z, ! float r, ! float phi, ! float delX, ! float delY, ! float delZ, ! float delR, ! float pt) { ! float cell = 0.05f; // 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 Jet as a line {@link Shape3D}. Change <code>tg</code>. ! * @param name The name of the Jet. ! * @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 Jet. */ ! 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 Jet as {@link ConeSegment}. ! * This is the default. */ ! public static final void asCone() { ! _asCone = true; ! } ! ! /** Set drawing Jet 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 = true; ! ! private static float _ptFactor = 0.01f; ! ! 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 . */ --- 113,135 ---- } ! // Create container ! if (_g == null) { ! _g = new BranchGroup(); ! use(_g, "Jets", "Jet Container"); } + set(builder, _g, "Jets"); ! // Get Jet properties and Construct Jet ! JetType jet = (JetType)element; ! construct("Jets", ! jet.getCount(), ! jet.getStoreGateKey(), ! jet.getEta(), ! jet.getPhi(), ! jet.getPt()); } ! private static BranchGroup _g; /** Logging . */ --- NEW FILE: TauJet.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Jet0; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.TauJetType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtType; import net.hep.atlas.graphics.JiveEvent.JAXB.IdType; import net.hep.atlas.graphics.JiveEvent.JAXB.CellsType; import net.hep.atlas.graphics.JiveEvent.JAXB.CaloClusterType; // 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; // 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.LineArray; import javax.media.j3d.GeometryArray; import javax.media.j3d.Appearance; import javax.media.j3d.TransparencyAttributes; import javax.vecmath.Matrix3d; import javax.vecmath.Vector3d; import javax.vecmath.Vector3f; import javax.vecmath.Point3f; // FreeHEP import org.freehep.j3d.ConeSegment; // Java import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.sqrt; import static java.lang.Math.exp; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation of <code>TauJetType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.TauJetType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: TauJet.java,v $ * Revision 1.1 2007/10/26 16:28:31 hrivnac * Muon and Jets added * * </pre> * </font></p> * @version $Id: TauJet.java,v 1.1 2007/10/26 16:28:31 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class TauJet extends Jet0 { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof TauJetType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Create container if (_g == null) { _g = new BranchGroup(); use(_g, "TauJets", "TauJet Container"); } set(builder, _g, "TauJets"); // Get TauJet properties and Construct TauJet TauJetType tauJet = (TauJetType)element; construct("TauJets", tauJet.getCount(), tauJet.getStoreGateKey(), tauJet.getEta(), tauJet.getPhi(), tauJet.getPt()); } private static BranchGroup _g; /** Logging . */ private static Logger log = Logger.getLogger(TauJet.class); } --- NEW FILE: BJet.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Jet0; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.BJetType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtType; import net.hep.atlas.graphics.JiveEvent.JAXB.IdType; import net.hep.atlas.graphics.JiveEvent.JAXB.CellsType; import net.hep.atlas.graphics.JiveEvent.JAXB.CaloClusterType; // 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; // 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.LineArray; import javax.media.j3d.GeometryArray; import javax.media.j3d.Appearance; import javax.media.j3d.TransparencyAttributes; import javax.vecmath.Matrix3d; import javax.vecmath.Vector3d; import javax.vecmath.Vector3f; import javax.vecmath.Point3f; // FreeHEP import org.freehep.j3d.ConeSegment; // Java import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.sqrt; import static java.lang.Math.exp; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** GraXML representation of <code>BJetType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.BJetType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: BJet.java,v $ * Revision 1.1 2007/10/26 16:28:31 hrivnac * Muon and Jets added * * </pre> * </font></p> * @version $Id: BJet.java,v 1.1 2007/10/26 16:28:31 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ public final class BJet extends Jet0 { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof BJetType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Create container if (_g == null) { _g = new BranchGroup(); use(_g, "BJets", "BJet Container"); } set(builder, _g, "BJets"); // Get BJet properties and Construct BJet BJetType bJet = (BJetType)element; construct("BJets", bJet.getCount(), bJet.getStoreGateKey(), bJet.getEta(), bJet.getPhi(), bJet.getPt()); } private static BranchGroup _g; /** Logging . */ private static Logger log = Logger.getLogger(BJet.class); } Index: Track.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Track.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Track.java 25 Oct 2007 20:52:14 -0000 1.8 --- Track.java 26 Oct 2007 16:28:31 -0000 1.9 *************** *** 73,76 **** --- 73,79 ---- * <pre> * $Log$ + * Revision 1.9 2007/10/26 16:28:31 hrivnac + * Muon and Jets added + * * Revision 1.8 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 126,130 **** PolylineYType y = track.getPolylineY(); PolylineZType z = track.getPolylineZ(); ! NumPolylineType n = track.getNumPolyline();log.info(x.getValue()); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); --- 129,133 ---- PolylineYType y = track.getPolylineY(); PolylineZType z = track.getPolylineZ(); ! NumPolylineType n = track.getNumPolyline(); float[] xs = floats(x.getValue()); float[] ys = floats(y.getValue()); Index: Event.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Event.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Event.java 25 Oct 2007 20:52:14 -0000 1.3 --- Event.java 26 Oct 2007 16:28:31 -0000 1.4 *************** *** 14,17 **** --- 14,18 ---- import net.hep.graphics.GraXML.Disconnecter.DetachableConnection; import net.hep.graphics.GraXML.Disconnecter.ConnectionsDB; + import net.hep.graphics.GraXML.Java3DExtensions.Interactivity.Interacter; // Java3D *************** *** 28,31 **** --- 29,35 ---- * <pre> * $Log$ + * Revision 1.4 2007/10/26 16:28:31 hrivnac + * Muon and Jets added + * * Revision 1.3 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 56,59 **** --- 60,66 ---- public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { + + // Set options + Interacter.setOutlined(false); // Set values *************** *** 68,81 **** // Get Type properties EventType event = (EventType)element; ! String version = event.getVersion(); ! String name = _name; if (_ord > 0) { name += "." + _ord; } _ord++; ! String info = name; ! if (version != null && !version.equals("")) { ! info += "(" + version + ")"; ! } // Traverse all children and add their representations into branch --- 75,88 ---- // Get Type properties EventType event = (EventType)element; ! String version = event.getVersion(); ! String runNumber = event.getRunNumber(); ! String eventNumber = event.getEventNumber(); ! String dateTime = event.getDateTime(); ! String name = "Event(" + runNumber + "/" + eventNumber + ")"; if (_ord > 0) { name += "." + _ord; } _ord++; ! String info = "release = " + version + ", dateTime = " + dateTime; // Traverse all children and add their representations into branch *************** *** 95,100 **** } - private static String _name = "Event"; - private static short _ord = 0; --- 102,105 ---- Index: Electron.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Electron.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Electron.java 25 Oct 2007 20:52:14 -0000 1.2 --- Electron.java 26 Oct 2007 16:28:31 -0000 1.3 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/26 16:28:31 hrivnac + * Muon and Jets added + * * Revision 1.2 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 82,88 **** } ! // Get Type properties and Construct Particle ElectronType electron = (ElectronType)element; ! construct("Electron", electron.getCount(), electron.getStoreGateKey(), --- 85,91 ---- } ! // Get Electron properties and Construct Particle ElectronType electron = (ElectronType)element; ! construct("Electrons", electron.getCount(), electron.getStoreGateKey(), *************** *** 117,121 **** /** Give width of line segments, ! * the default is <code>2</code>. * @return The width of line segments. */ public int lineWidth() { --- 120,124 ---- /** Give width of line segments, ! * the default is <code>4</code>. * @return The width of line segments. */ public int lineWidth() { *************** *** 124,128 **** /** Set width of line segments, ! * the default is <code>2</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { --- 127,131 ---- /** Set width of line segments, ! * the default is <code>4</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { *************** *** 130,134 **** } ! private static int _lineWidth = 2; /** Logging . */ --- 133,137 ---- } ! private static int _lineWidth = 4; /** Logging . */ --- STr.java DELETED --- --- LAr.java DELETED --- Index: Photon.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Photon.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Photon.java 25 Oct 2007 20:52:14 -0000 1.2 --- Photon.java 26 Oct 2007 16:28:31 -0000 1.3 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/26 16:28:31 hrivnac + * Muon and Jets added + * * Revision 1.2 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 82,88 **** } ! // Get Type properties and Construct Particle PhotonType photon = (PhotonType)element; ! construct("Photon", photon.getCount(), photon.getStoreGateKey(), --- 85,91 ---- } ! // Get Photon properties and Construct Particle PhotonType photon = (PhotonType)element; ! construct("Photons", photon.getCount(), photon.getStoreGateKey(), *************** *** 117,121 **** /** Give width of line segments, ! * the default is <code>2</code>. * @return The width of line segments. */ public int lineWidth() { --- 120,124 ---- /** Give width of line segments, ! * the default is <code>4</code>. * @return The width of line segments. */ public int lineWidth() { *************** *** 124,128 **** /** Set width of line segments, ! * the default is <code>2</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { --- 127,131 ---- /** Set width of line segments, ! * the default is <code>4</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { *************** *** 130,134 **** } ! private static int _lineWidth = 2; /** Logging . */ --- 133,137 ---- } ! private static int _lineWidth = 4; /** Logging . */ |
From: Julius H. <hr...@us...> - 2007-10-26 16:28:32
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27328/net/hep/atlas/graphics/JiveEvent/GeometricModel Modified Files: JiveEventBuilder.java Particle.java Added Files: Jet0.java Log Message: Muon and Jets added Index: JiveEventBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/JiveEventBuilder.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** JiveEventBuilder.java 25 Oct 2007 13:57:25 -0000 1.10 --- JiveEventBuilder.java 26 Oct 2007 16:28:30 -0000 1.11 *************** *** 3,6 **** --- 3,7 ---- // GraXML import net.hep.graphics.GraXML.MasterBuilder; + import net.hep.graphics.GraXML.BuildOptions; import net.hep.graphics.GraXML.Java3DExtensions.SelectedColor; *************** *** 22,25 **** --- 23,29 ---- * <pre> * $Log$ + * Revision 1.11 2007/10/26 16:28:30 hrivnac + * Muon and Jets added + * * Revision 1.10 2007/10/25 13:57:25 hrivnac * Photon,Electron added *************** *** 73,77 **** public void configure() { _pdg = new PDG(); ! SelectedColor.setPalette(SelectedColor.ATLANTIS); } --- 77,81 ---- public void configure() { _pdg = new PDG(); ! BuildOptions.setColorPerMaterial(true); } *************** *** 114,119 **** } ! /** Get renormalisation factor. ! * @return The renormalisation factor. */ public double norm() { return _norm; --- 118,123 ---- } ! /** Get renormalisation factor (100). ! * @return The renormalisation factor (100). */ public double norm() { return _norm; Index: Particle.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Particle.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Particle.java 25 Oct 2007 20:52:14 -0000 1.2 --- Particle.java 26 Oct 2007 16:28:30 -0000 1.3 *************** *** 50,57 **** import org.apache.log4j.Logger; ! /** Common part of GraXML representation sof Particle Types * <p><font color="#880088"> * <pre> * $Log$ * Revision 1.2 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis --- 50,60 ---- import org.apache.log4j.Logger; ! /** Common part of GraXML representations of Particle Types * <p><font color="#880088"> * <pre> * $Log$ + * Revision 1.3 2007/10/26 16:28:30 hrivnac + * Muon and Jets added + * * Revision 1.2 2007/10/25 20:52:14 hrivnac * reads well XML files and data from Atlantis *************** *** 72,79 **** * @param type The particle' type (name). * @param count The number of particles in a set. ! * @param storeGateKey The corresponding <em>StoreGate</key>. ! * @param eta The particle' <em>eta</em>. ! * @param phi The particle' <em>phi</em>. ! * @param pt The particle' <em>pt</em>. */ protected void construct(String type, int count, --- 75,82 ---- * @param type The particle' type (name). * @param count The number of particles in a set. ! * @param storeGateKey The corresponding <em>StoreGate</em> key. ! * @param eta The particle' <em>eta</em>s. ! * @param phi The particle' <em>phi</em>s. ! * @param pt The particle' <em>pt</em>s. */ protected void construct(String type, int count, *************** *** 83,87 **** PtType pt) { ! // Get Type properties float[] etas = floats(eta.getValue()); float[] phis = floats(phi.getValue()); --- 86,90 ---- PtType pt) { ! // Get Particle properties float[] etas = floats(eta.getValue()); float[] phis = floats(phi.getValue()); --- NEW FILE: Jet0.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.JetType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtType; import net.hep.atlas.graphics.JiveEvent.JAXB.IdType; import net.hep.atlas.graphics.JiveEvent.JAXB.CellsType; import net.hep.atlas.graphics.JiveEvent.JAXB.CaloClusterType; // 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; // 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.LineArray; import javax.media.j3d.GeometryArray; import javax.media.j3d.Appearance; import javax.media.j3d.TransparencyAttributes; import javax.vecmath.Matrix3d; import javax.vecmath.Vector3d; import javax.vecmath.Vector3f; import javax.vecmath.Point3f; // FreeHEP import org.freehep.j3d.ConeSegment; // Java import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.sqrt; import static java.lang.Math.exp; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** Common part of GraXML representations of Jet Types * <p><font color="#880088"> * <pre> * $Log: Jet0.java,v $ * Revision 1.1 2007/10/26 16:28:30 hrivnac * Muon and Jets added * * </pre> * </font></p> * @version $Id: Jet0.java,v 1.1 2007/10/26 16:28:30 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public abstract class Jet0 extends JiveRep { public abstract void traverse(MasterBuilder builder, Object element, Group tg, String parent); /** Construct Java3D representation of this <em>Jet</em>. * @param type The jet' type (name). * @param count The number of jets in a set. * @param storeGateKey The corresponding <em>StoreGate</em> key. * @param eta The jet' <em>eta</em>s. * @param phi The jet' <em>phi</em>s. * @param pt The jet' <em>pt</em>s. */ protected void construct(String type, int count, String storeGateKey, EtaType eta, PhiType phi, PtType pt) { // Get Jet properties float[] etas = floats(eta.getValue()); float[] phis = floats(phi.getValue()); float[] pts = null; if (pt != null) { pts = floats(pt.getValue()); } type += "(" + storeGateKey + ")"; // Draw all Jets // - save and restore tg as it may be changed by draw*(...) Group tmpTg = tg(); float pT = _pt0; for (int i = 0; i < etas.length; i++) { if (pts != null) { pT = pts[i]; } drawJet(etas[i], phis[i], pT, type, i); setTg(tmpTg); } } /** Draw one Jet. * @param eta The <code>eta</code> of the Jet axis. * @param phi The <code>phi</code> of the Jet axis. * @param pt The <code>pt</code> of the Jet. * @param type The type of the Jet. * @param i The ordinal number of the Jet. */ private void drawJet(float eta, float phi, float pt, String type, int i) { // Get Jet properties String name = type + "[" + i + "]"; String info = "eta = " + eta + ", phi = " + phi + ", pt = " + pt; Appearance appearance = builder().appearance(name, type); appearance. setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.NICEST, 0.5f)); float rho = _rho / (float) builder().norm(); float x = _rho * (float)cos(phi); float y = _rho * (float)sin(phi); float z = _rho / 2 * (float)(exp(eta) - exp(-eta)); float r = (float)sqrt(_rho * _rho + z * z); float delR = r * _ptFactor * pt; float delX = x * delR / r; float delY = y * delR / r; float delZ = z * delR / r; // Draw and use Jet0 according to options setAppearance(appearance); if (pt > _ptCut) { Shape3D shape = drawCone(name, x, y, z, r, phi, delX, delY, delZ, delR, pt) ; use(shape, name, info); } } /** Draw one Jet0 as a {@link ConeSegment}. * @param name The name of the Jet0. * @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 pt The pt of the Jet0. * @return The {@link ConeSegment} representing the Jet0. */ private Shape3D drawCone(String name, float x, float y, float z, float r, float phi, float delX, float delY, float delZ, float delR, float pt) { 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; } /** 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. Jet0s with smaller pt are not drawn. * @param ptCut The minimal pt of the Jet0 to be drawn, * the default is <code>0.1</code>. */ public static final void setPtCut(float ptCut) { _ptCut = ptCut; } private static float _ptFactor = 0.01f; private static float _ptCut = 0.1f; private static float _pt0 = 50.0f; private static float _rho = 0.2f; private static float _cell = 0.02f; private static BranchGroup _g; 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(Jet0.class); } |
From: Julius H. <hr...@us...> - 2007-10-26 16:28:30
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv27328/net/hep/atlas/graphics/JiveEvent/Schema Modified Files: event.xsd Log Message: Muon and Jets added Index: event.xsd =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** event.xsd 25 Oct 2007 20:52:14 -0000 1.6 --- event.xsd 26 Oct 2007 16:28:31 -0000 1.7 *************** *** 4,7 **** --- 4,10 ---- <!-- $Log$ + Revision 1.7 2007/10/26 16:28:31 hrivnac + Muon and Jets added + Revision 1.6 2007/10/25 20:52:14 hrivnac reads well XML files and data from Atlantis *************** *** 97,101 **** <xs:element ref="weight" /> </xs:sequence> ! <xs:attribute name="count" type="xs:string" default="" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> --- 100,104 ---- <xs:element ref="weight" /> </xs:sequence> ! <xs:attribute name="count" type="xs:int" default="1" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> *************** *** 378,382 **** <xs:element ref="id" /> </xs:sequence> ! <xs:attribute name="count" type="xs:string" default="" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> --- 381,385 ---- <xs:element ref="id" /> </xs:sequence> ! <xs:attribute name="count" type="xs:int" default="1" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> *************** *** 501,505 **** <xs:element ref="trackKey" /> </xs:sequence> ! <xs:attribute name="count" type="xs:string" default="" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> --- 504,508 ---- <xs:element ref="trackKey" /> </xs:sequence> ! <xs:attribute name="count" type="xs:int" default="1" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> *************** *** 858,862 **** <xs:element ref="stripWidth" /> </xs:sequence> ! <xs:attribute name="count" type="xs:string" default="" /> <xs:attribute name="storeGateKey" type="xs:string" default="" /> </xs:complexType> --- 861,865 ---- <xs:element ref="stripWidth" /> </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-25 20:52:30
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7975/net/hep/atlas/graphics/JiveEvent/GeometricModel Modified Files: Particle.java Log Message: reads well XML files and data from Atlantis Index: Particle.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Particle.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Particle.java 25 Oct 2007 13:57:25 -0000 1.1 --- Particle.java 25 Oct 2007 20:52:14 -0000 1.2 *************** *** 54,57 **** --- 54,60 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.1 2007/10/25 13:57:25 hrivnac * Photon,Electron added *************** *** 66,70 **** public abstract void traverse(MasterBuilder builder, Object element, Group tg, String parent); ! /** TBD */ protected void construct(String type, int count, --- 69,79 ---- public abstract void traverse(MasterBuilder builder, Object element, Group tg, String parent); ! /** Construct Java3D representation of this <em>Particle</em>. ! * @param type The particle' type (name). ! * @param count The number of particles in a set. ! * @param storeGateKey The corresponding <em>StoreGate</key>. ! * @param eta The particle' <em>eta</em>. ! * @param phi The particle' <em>phi</em>. ! * @param pt The particle' <em>pt</em>. */ protected void construct(String type, int count, *************** *** 88,92 **** Appearance appearance; Material material; ! Color3f color = new Color3f(); double x; double y; --- 97,101 ---- Appearance appearance; Material material; ! Color3f color; double x; double y; *************** *** 102,105 **** --- 111,115 ---- // ColorList is set => get Appearance from Color if (color(i) == null) { + color = new Color3f(); appearance = builder().appearance(name, name); material = appearance.getMaterial(); *************** *** 108,116 **** // ColorList is not set => get Color from Appearance else { - appearance = new Appearance(); color = color(i); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, true)); shape.setAppearance(appearance); setAppearance(appearance); --- 118,126 ---- // ColorList is not set => get Color from Appearance else { color = color(i); + appearance = new Appearance(); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); *************** *** 136,143 **** } ! /** TBD */ protected abstract Color3f color(int i); ! /** TBD */ public abstract int lineWidth(); --- 146,158 ---- } ! /** Give {@link Color3f} to be used for <em>i</em>s line segments. ! * @param i The line segment number. ! * @return The {@link Color3f} o be used for <em>i</em>s line segment, ! * <em>null</em> is colormap is not set. */ protected abstract Color3f color(int i); ! /** Give width of line segments, ! * the default is <code>2</code>. ! * @return The width of line segments. */ public abstract int lineWidth(); |
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7975/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: Electron.java Event.java Photon.java S3D.java STC.java Track.java Log Message: reads well XML files and data from Atlantis Index: STC.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STC.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** STC.java 25 Oct 2007 13:57:27 -0000 1.6 --- STC.java 25 Oct 2007 20:52:14 -0000 1.7 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.7 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.6 2007/10/25 13:57:27 hrivnac * Photon,Electron added *************** *** 120,127 **** Appearance appearance; Material material; ! Color3f color = new Color3f(); for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color ! if (_colorList == null) { appearance = builder().appearance(name, name); material = appearance.getMaterial(); --- 123,131 ---- Appearance appearance; Material material; ! Color3f color; for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color ! if (color(i) == null) { ! color = new Color3f(); appearance = builder().appearance(name, name); material = appearance.getMaterial(); *************** *** 130,138 **** // ColorList is not set => get Color from Appearance else { appearance = new Appearance(); - color = new Color3f(_colorMap[_colorList[i]]); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(_lineWidth, LineAttributes.PATTERN_SOLID, true)); shape.setAppearance(appearance); setAppearance(appearance); --- 134,142 ---- // ColorList is not set => get Color from Appearance else { + color = color(i); appearance = new Appearance(); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); *************** *** 166,173 **** --- 170,195 ---- } + /** Give {@link Color3f} to be used for <em>i</em>s line segments. + * @param i The line segment number. + * @return The {@link Color3f} o be used for <em>i</em>s line segment, + * <em>null</em> is colormap is not set. */ + protected Color3f color(int i) { + if (_colorList == null) { + return null; + } + return new Color3f(_colorMap[_colorList[i]]); + } + private static Color[] _colorMap; private static int[] _colorList; + /** Give width of line segments, + * the default is <code>2</code>. + * @return The width of line segments. */ + public int lineWidth() { + return _lineWidth; + } + /** Set width of line segments, * the default is <code>2</code>. Index: S3D.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/S3D.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** S3D.java 25 Oct 2007 13:57:27 -0000 1.7 --- S3D.java 25 Oct 2007 20:52:14 -0000 1.8 *************** *** 56,59 **** --- 56,62 ---- * <pre> * $Log$ + * Revision 1.8 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.7 2007/10/25 13:57:27 hrivnac * Photon,Electron added *************** *** 116,123 **** Appearance appearance; Material material; ! Color3f color = new Color3f(); for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color ! if (_colorList == null) { appearance = builder().appearance(name, name); material = appearance.getMaterial(); --- 119,127 ---- Appearance appearance; Material material; ! Color3f color; for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color ! if (color(i) == null) { ! color = new Color3f(); appearance = builder().appearance(name, name); material = appearance.getMaterial(); *************** *** 126,134 **** // ColorList is not set => get Color from Appearance else { appearance = new Appearance(); - color = new Color3f(_colorMap[_colorList[i]]); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setPointAttributes(new PointAttributes(_pointSize, true)); shape.setAppearance(appearance); setAppearance(appearance); --- 130,138 ---- // ColorList is not set => get Color from Appearance else { + color = color(i); appearance = new Appearance(); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setPointAttributes(new PointAttributes(pointSize(), false)); shape.setAppearance(appearance); setAppearance(appearance); *************** *** 154,164 **** } private static Color[] _colorMap; private static int[] _colorList; /** Set size of points, * the default is <code>4</code>. ! * @param lineWidth The size of points. */ public static void setPointSize(int pointSize) { _pointSize = pointSize; --- 158,186 ---- } + /** Give {@link Color3f} to be used for <em>i</em>s line segments. + * @param i The line segment number. + * @return The {@link Color3f} o be used for <em>i</em>s line segment, + * <em>null</em> is colormap is not set. */ + protected Color3f color(int i) { + if (_colorList == null) { + return null; + } + return new Color3f(_colorMap[_colorList[i]]); + } + private static Color[] _colorMap; private static int[] _colorList; + /** Give size of points, + * the default is <code>4</code>. + * @return The size of points. */ + public static int pointSize() { + return _pointSize; + } + /** Set size of points, * the default is <code>4</code>. ! * @param pointSize The size of points. */ public static void setPointSize(int pointSize) { _pointSize = pointSize; Index: Track.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Track.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Track.java 25 Oct 2007 13:57:27 -0000 1.7 --- Track.java 25 Oct 2007 20:52:14 -0000 1.8 *************** *** 73,76 **** --- 73,79 ---- * <pre> * $Log$ + * Revision 1.8 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.7 2007/10/25 13:57:27 hrivnac * Photon,Electron added *************** *** 98,101 **** --- 101,105 ---- * @version $Id$ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ + // TBD: antialising public final class Track extends JiveRep { *************** *** 118,132 **** // Get Type properties TrackType track = (TrackType)element; ! 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; // Draw all Tracks --- 122,134 ---- // Get Type properties TrackType track = (TrackType)element; ! String storeGateKey = track.getStoreGateKey(); ! PolylineXType x = track.getPolylineX(); ! PolylineYType y = track.getPolylineY(); ! PolylineZType z = track.getPolylineZ(); ! NumPolylineType n = track.getNumPolyline();log.info(x.getValue()); ! float[] xs = floats(x.getValue()); ! float[] ys = floats(y.getValue()); ! float[] zs = floats(z.getValue()); ! int[] ns = ints( n.getValue()); // Draw all Tracks *************** *** 139,156 **** Appearance appearance; Material material; ! Color3f color = new Color3f(); ! 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 + "]"; shape = new Shape3D(); // ColorList is set => get Appearance from Color ! if (_colorList == null) { appearance = builder().appearance(name, name); material = appearance.getMaterial(); --- 141,157 ---- Appearance appearance; Material material; ! Color3f color; ! int j; // j traverses new Point3ds ! int l = 0; // l traverses xs, ys, zs // Loop over Tracks ! for (int k = 0; k < ns.length; k++) { // Draw all Tracks name = "Track(" + storeGateKey + "/" + k + ")"; ! info = name + "[1-" + ns[k] + "]"; shape = new Shape3D(); + color = color(); // ColorList is set => get Appearance from Color ! if (color == null) { ! color = new Color3f(); appearance = builder().appearance(name, name); material = appearance.getMaterial(); *************** *** 160,170 **** else { appearance = new Appearance(); - color = new Color3f(_colorMap[_colorList[_colorI++]]); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(_lineWidth, LineAttributes.PATTERN_SOLID, true)); shape.setAppearance(appearance); setAppearance(appearance); ! lineArray = new LineArray(2 * n, GeometryArray.COORDINATES| GeometryArray.COLOR_3| --- 161,170 ---- else { appearance = new Appearance(); appearance.setMaterial(new Material(color, color, color, color, 1f)); } ! appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, false)); shape.setAppearance(appearance); setAppearance(appearance); ! lineArray = new LineArray(2 * ns[k], GeometryArray.COORDINATES| GeometryArray.COLOR_3| *************** *** 172,180 **** j = 0; // Construct Track ! for (int i = 0; i < n; i++) { ! if (i > 0 && i < n - 1) { ! lineArray.setCoordinate(j, new Point3d(xs[i] / builder().norm(), ! ys[i] / builder().norm(), ! zs[i] / builder().norm())); lineArray.setColor(j, color); lineArray.setNormal(j, new Vector3f(0, 0, 0)); --- 172,180 ---- j = 0; // Construct Track ! for (int i = 0; i < ns[k]; i++) { ! if (i > 0 && i < ns[k] - 1) { ! lineArray.setCoordinate(j, new Point3d(xs[l] / builder().norm(), ! ys[l] / builder().norm(), ! zs[l] / builder().norm())); lineArray.setColor(j, color); lineArray.setNormal(j, new Vector3f(0, 0, 0)); *************** *** 182,192 **** j++; } ! lineArray.setCoordinate(j, new Point3d(xs[i] / builder().norm(), ! ys[i] / builder().norm(), ! zs[i] / builder().norm())); lineArray.setColor(j, color); lineArray.setNormal(j, new Vector3f(0, 0, 0)); shape.addGeometry(lineArray); j++; } // Use Track --- 182,193 ---- j++; } ! lineArray.setCoordinate(j, new Point3d(xs[l] / builder().norm(), ! ys[l] / builder().norm(), ! zs[l] / builder().norm())); lineArray.setColor(j, color); lineArray.setNormal(j, new Vector3f(0, 0, 0)); shape.addGeometry(lineArray); j++; + l++; } // Use Track *************** *** 195,201 **** // TBD: check pt, use pt if (_text) { ! _end = new Vector3d(xs[n - 1] / builder().norm(), ! ys[n - 1] / builder().norm(), ! zs[n - 1] / builder().norm()); Group tmpTg = tg(); BranchGroup bg = drawText(name, 0, name); --- 196,202 ---- // TBD: check pt, use pt if (_text) { ! _end = new Vector3d(xs[l - 1] / builder().norm(), ! ys[l - 1] / builder().norm(), ! zs[l - 1] / builder().norm()); Group tmpTg = tg(); BranchGroup bg = drawText(name, 0, name); *************** *** 335,348 **** } - /** 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 . */ // TBD: 1.5 - private int signum(double x) { - if (x > 0) return 1; - else if (x < 0) return -1; - else return 0; - } - public static final void setTextPtCut(float textPtCut) { _textPtCut = textPtCut; --- 336,339 ---- *************** *** 374,377 **** --- 365,378 ---- } + /** Give {@link Color3f} to be used for <em>i</em>s line segments. + * @return The {@link Color3f} o be used for <em>i</em>s line segment, + * <em>null</em> is colormap is not set. */ + protected Color3f color() { + if (_colorList == null) { + return null; + } + return new Color3f(_colorMap[_colorList[_colorI++]]); + } + private static Color[] _colorMap; *************** *** 380,383 **** --- 381,391 ---- private static int _colorI; + /** Give width of line segments, + * the default is <code>2</code>. + * @return The width of line segments. */ + public int lineWidth() { + return _lineWidth; + } + /** Set width of line segments, * the default is <code>2</code>. Index: Event.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Event.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Event.java 24 Jan 2007 22:08:16 -0000 1.2 --- Event.java 25 Oct 2007 20:52:14 -0000 1.3 *************** *** 28,31 **** --- 28,34 ---- * <pre> * $Log$ + * Revision 1.3 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.2 2007/01/24 22:08:16 hrivnac * migrated to JAXB 2.0 *************** *** 92,101 **** } - /** Logging . */ - private static Logger log = Logger.getLogger(Event.class); - private static String _name = "Event"; private static short _ord = 0; } --- 95,104 ---- } private static String _name = "Event"; private static short _ord = 0; + /** Logging . */ + private static Logger log = Logger.getLogger(Event.class); + } Index: Electron.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Electron.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Electron.java 25 Oct 2007 13:57:26 -0000 1.1 --- Electron.java 25 Oct 2007 20:52:14 -0000 1.2 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.1 2007/10/25 13:57:26 hrivnac * Photon,Electron added *************** *** 98,102 **** } ! /** TBD */ protected Color3f color(int i) { if (_colorList == null) { --- 101,108 ---- } ! /** Give {@link Color3f} to be used for <em>i</em>s line segments. ! * @param i The line segment number. ! * @return The {@link Color3f} o be used for <em>i</em>s line segment, ! * <em>null</em> is colormap is not set. */ protected Color3f color(int i) { if (_colorList == null) { *************** *** 110,114 **** private static int[] _colorList; ! /** TBD */ public int lineWidth() { return _lineWidth; --- 116,122 ---- private static int[] _colorList; ! /** Give width of line segments, ! * the default is <code>2</code>. ! * @return The width of line segments. */ public int lineWidth() { return _lineWidth; Index: Photon.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Photon.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Photon.java 25 Oct 2007 13:57:26 -0000 1.1 --- Photon.java 25 Oct 2007 20:52:14 -0000 1.2 *************** *** 58,61 **** --- 58,64 ---- * <pre> * $Log$ + * Revision 1.2 2007/10/25 20:52:14 hrivnac + * reads well XML files and data from Atlantis + * * Revision 1.1 2007/10/25 13:57:26 hrivnac * Photon,Electron added *************** *** 98,102 **** } ! /** TBD */ protected Color3f color(int i) { if (_colorList == null) { --- 101,108 ---- } ! /** Give {@link Color3f} to be used for <em>i</em>s line segments. ! * @param i The line segment number. ! * @return The {@link Color3f} o be used for <em>i</em>s line segment, ! * <em>null</em> is colormap is not set. */ protected Color3f color(int i) { if (_colorList == null) { *************** *** 110,114 **** private static int[] _colorList; ! /** TBD */ public int lineWidth() { return _lineWidth; --- 116,122 ---- private static int[] _colorList; ! /** Give width of line segments, ! * the default is <code>2</code>. ! * @return The width of line segments. */ public int lineWidth() { return _lineWidth; |
From: Julius H. <hr...@us...> - 2007-10-25 20:52:30
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7975/net/hep/atlas/graphics/JiveEvent/Schema Modified Files: event.xsd Log Message: reads well XML files and data from Atlantis Index: event.xsd =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** event.xsd 25 Oct 2007 13:57:27 -0000 1.5 --- event.xsd 25 Oct 2007 20:52:14 -0000 1.6 *************** *** 4,7 **** --- 4,10 ---- <!-- $Log$ + Revision 1.6 2007/10/25 20:52:14 hrivnac + reads well XML files and data from Atlantis + Revision 1.5 2007/10/25 13:57:27 hrivnac Photon,Electron added *************** *** 1002,1006 **** [...2084 lines suppressed...] <xs:simpleType> --- 5485,5489 ---- </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:float" default="0.0" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> *************** *** 5510,5514 **** </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:float" default="1.0" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> --- 5513,5517 ---- </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:float" default="0.0" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> |
From: Julius H. <hr...@us...> - 2007-10-25 13:57:58
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26213/net/hep/atlas/graphics/JiveEvent/GeometricModel Modified Files: JiveEventBuilder.java Added Files: Particle.java Log Message: Photon,Electron added Index: JiveEventBuilder.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/JiveEventBuilder.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** JiveEventBuilder.java 15 Oct 2007 15:45:42 -0000 1.9 --- JiveEventBuilder.java 25 Oct 2007 13:57:25 -0000 1.10 *************** *** 22,25 **** --- 22,28 ---- * <pre> * $Log$ + * Revision 1.10 2007/10/25 13:57:25 hrivnac + * Photon,Electron added + * * Revision 1.9 2007/10/15 15:45:42 hrivnac * cleaning *************** *** 76,81 **** * @return The list of (embedded) demostration files. */ public String[] demos() { ! //String[] demos = {"net/hep/atlas/graphics/JiveEvent/Test/data/JiveXML_5200_01388.xml"}; ! String[] demos = {}; return demos; } --- 79,84 ---- * @return The list of (embedded) demostration files. */ public String[] demos() { ! String[] demos = {"net/hep/atlas/graphics/JiveEvent/Test/data/JiveXML_5200_01388.xml", ! "net/hep/atlas/graphics/JiveEvent/Test/data/JiveXML_5200_01391_forJulius.xml"}; return demos; } --- NEW FILE: Particle.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel; 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.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; // 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.Appearance; import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; 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.exp; import static java.lang.Math.abs; import static java.lang.Math.sin; import static java.lang.Math.cos; import static java.lang.Math.sqrt; import static java.lang.Math.signum; import static java.lang.Math.PI; // Log4J import org.apache.log4j.Logger; /** Common part of GraXML representation sof Particle Types * <p><font color="#880088"> * <pre> * $Log: Particle.java,v $ * Revision 1.1 2007/10/25 13:57:25 hrivnac * Photon,Electron added * * </pre> * </font></p> * @version $Id: Particle.java,v 1.1 2007/10/25 13:57:25 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public abstract class Particle extends JiveRep { public abstract void traverse(MasterBuilder builder, Object element, Group tg, String parent); /** TBD */ protected void construct(String type, int count, String storeGateKey, EtaType eta, PhiType phi, PtType pt) { // Get Type properties float[] etas = floats(eta.getValue()); float[] phis = floats(phi.getValue()); float[] pts = floats(pt.getValue()); // Draw all Particles String name = type + "(" + storeGateKey + ")"; String info = name + "[1-" + count + "]"; boolean outlinedBckp = Interacter.outlined(); Interacter.setOutlined(false); Shape3D shape = new Shape3D(); LineArray lineArray; Appearance appearance; Material material; Color3f color = new Color3f(); double x; double y; double z; for (int i = 0; i < count; i++) { // (eta,phi,pt) -> (x,y,z) if (phis[i] < 0) { phis[i] = 2 * (float)PI + phis[i]; } x = pts[i] * cos(phis[i]); y = pts[i] * sin(phis[i]); z = pts[i] / 2 * (exp(etas[i]) - exp(-etas[i])); // ColorList is set => get Appearance from Color if (color(i) == null) { appearance = builder().appearance(name, name); material = appearance.getMaterial(); material.getSpecularColor(color); } // ColorList is not set => get Color from Appearance else { appearance = new Appearance(); color = color(i); appearance.setMaterial(new Material(color, color, color, color, 1f)); } appearance.setLineAttributes(new LineAttributes(lineWidth(), LineAttributes.PATTERN_SOLID, true)); shape.setAppearance(appearance); setAppearance(appearance); lineArray = new LineArray(2, GeometryArray.COORDINATES| GeometryArray.COLOR_3| GeometryArray.NORMALS); lineArray.setCoordinate(0, new Point3d(0, 0, 0)); lineArray.setCoordinate(1, new Point3d(x / builder().norm(), y / builder().norm(), z / builder().norm())); 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); } /** TBD */ protected abstract Color3f color(int i); /** TBD */ public abstract int lineWidth(); /** Logging . */ private static Logger log = Logger.getLogger(Particle.class); } |
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26213/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: S3D.java STC.java STr.java Track.java Added Files: Electron.java Photon.java Log Message: Photon,Electron added Index: STC.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STC.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** STC.java 16 Oct 2007 10:12:58 -0000 1.5 --- STC.java 25 Oct 2007 13:57:27 -0000 1.6 *************** *** 55,61 **** * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.STCType} generic JAXB interface. ! * <p><font color="#880088">signum * <pre> * $Log$ * Revision 1.5 2007/10/16 10:12:58 hrivnac * usable with java 1.5 --- 55,64 ---- * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.STCType} generic JAXB interface. ! * <p><font color="#880088"> * <pre> * $Log$ + * Revision 1.6 2007/10/25 13:57:27 hrivnac + * Photon,Electron added + * * Revision 1.5 2007/10/16 10:12:58 hrivnac * usable with java 1.5 *************** *** 117,121 **** Appearance appearance; Material material; ! Color3f color = null;; for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color --- 120,124 ---- Appearance appearance; Material material; ! Color3f color = new Color3f(); for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color Index: S3D.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/S3D.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** S3D.java 16 Oct 2007 10:12:58 -0000 1.6 --- S3D.java 25 Oct 2007 13:57:27 -0000 1.7 *************** *** 53,59 **** * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.S3DType} generic JAXB interface. ! * <p><font color="#880088">signum * <pre> * $Log$ * Revision 1.6 2007/10/16 10:12:58 hrivnac * usable with java 1.5 --- 53,62 ---- * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.S3DType} generic JAXB interface. ! * <p><font color="#880088"> * <pre> * $Log$ + * Revision 1.7 2007/10/25 13:57:27 hrivnac + * Photon,Electron added + * * Revision 1.6 2007/10/16 10:12:58 hrivnac * usable with java 1.5 *************** *** 113,117 **** Appearance appearance; Material material; ! Color3f color = null;; for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color --- 116,120 ---- Appearance appearance; Material material; ! Color3f color = new Color3f(); for (int i = 0; i < count; i++) { // ColorList is set => get Appearance from Color Index: Track.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/Track.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Track.java 17 Oct 2007 13:22:00 -0000 1.6 --- Track.java 25 Oct 2007 13:57:27 -0000 1.7 *************** *** 70,76 **** * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.TrackType} generic JAXB interface. ! * <p><font color="#880088">signum * <pre> * $Log$ * Revision 1.6 2007/10/17 13:22:00 hrivnac * using only Java 1.6; Tracks grouped --- 70,79 ---- * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.TrackType} generic JAXB interface. ! * <p><font color="#880088"> * <pre> * $Log$ + * Revision 1.7 2007/10/25 13:57:27 hrivnac + * Photon,Electron added + * * Revision 1.6 2007/10/17 13:22:00 hrivnac * using only Java 1.6; Tracks grouped *************** *** 115,119 **** // Get Type properties TrackType track = (TrackType)element; - int count = track.getCount(); String storeGateKey = track.getStoreGateKey(); PolylineXType x = track.getPolylineX(); --- 118,121 ---- *************** *** 137,141 **** Appearance appearance; Material material; ! Color3f color = null; int j; // Loop over Tracks --- 139,143 ---- Appearance appearance; Material material; ! Color3f color = new Color3f(); int j; // Loop over Tracks --- NEW FILE: Electron.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Particle; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.ElectronType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; // 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.Appearance; import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; 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.exp; import static java.lang.Math.abs; import static java.lang.Math.sin; import static java.lang.Math.cos; 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>ElectronType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.ElectronType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: Electron.java,v $ * Revision 1.1 2007/10/25 13:57:26 hrivnac * Photon,Electron added * * </pre> * </font></p> * @version $Id: Electron.java,v 1.1 2007/10/25 13:57:26 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public final class Electron extends Particle { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof ElectronType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Type properties and Construct Particle ElectronType electron = (ElectronType)element; construct("Electron", electron.getCount(), electron.getStoreGateKey(), electron.getEta(), electron.getPhi(), electron.getPt()); } /** 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; } /** TBD */ protected Color3f color(int i) { if (_colorList == null) { return null; } return new Color3f(_colorMap[_colorList[i]]); } private static Color[] _colorMap; private static int[] _colorList; /** TBD */ public int lineWidth() { return _lineWidth; } /** Set width of line segments, * the default is <code>2</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { _lineWidth = lineWidth; } private static int _lineWidth = 2; /** Logging . */ private static Logger log = Logger.getLogger(Electron.class); } Index: STr.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/STr.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** STr.java 16 Oct 2007 10:12:58 -0000 1.6 --- STr.java 25 Oct 2007 13:57:27 -0000 1.7 *************** *** 60,63 **** --- 60,66 ---- * <pre> * $Log$ + * Revision 1.7 2007/10/25 13:57:27 hrivnac + * Photon,Electron added + * * Revision 1.6 2007/10/16 10:12:58 hrivnac * usable with java 1.5 *************** *** 106,110 **** public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { ! // Set values set(builder, tg, parent); --- 109,113 ---- public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { ! if (0 == 0) return; // Set values set(builder, tg, parent); *************** *** 161,168 **** 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); --- 164,171 ---- 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); --- NEW FILE: Photon.java --- package net.hep.atlas.graphics.JiveEvent.GeometricModel.Reps; import net.hep.atlas.graphics.JiveEvent.GeometricModel.JiveEventBuilder; import net.hep.atlas.graphics.JiveEvent.GeometricModel.Particle; // Generic Model import net.hep.atlas.graphics.JiveEvent.JAXB.PhotonType; import net.hep.atlas.graphics.JiveEvent.JAXB.KineType; import net.hep.atlas.graphics.JiveEvent.JAXB.PhiType; import net.hep.atlas.graphics.JiveEvent.JAXB.EtaType; import net.hep.atlas.graphics.JiveEvent.JAXB.PtType; // 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.Appearance; import javax.media.j3d.Material; import javax.media.j3d.LineAttributes; 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.exp; import static java.lang.Math.abs; import static java.lang.Math.sin; import static java.lang.Math.cos; 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>PhotonType</code> * JiveEvent Type connected via JAXB * {@link net.hep.atlas.graphics.JiveEvent.JAXB.PhotonType} generic JAXB interface. * <p><font color="#880088"> * <pre> * $Log: Photon.java,v $ * Revision 1.1 2007/10/25 13:57:26 hrivnac * Photon,Electron added * * </pre> * </font></p> * @version $Id: Photon.java,v 1.1 2007/10/25 13:57:26 hrivnac Exp $ * @author <a href="mailto:Jul...@ce...">J.Hrivnac</a> */ // TBD: use HEP3D public final class Photon extends Particle { public final void traverse(MasterBuilder builder, Object element, Group tg, String parent) { // Set values set(builder, tg, parent); // Verify element type if (! (element instanceof PhotonType)) { log.error(element + " can't be traversed using " + getClass().getName() + " representation"); return; } // Get Type properties and Construct Particle PhotonType photon = (PhotonType)element; construct("Photon", photon.getCount(), photon.getStoreGateKey(), photon.getEta(), photon.getPhi(), photon.getPt()); } /** 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; } /** TBD */ protected Color3f color(int i) { if (_colorList == null) { return null; } return new Color3f(_colorMap[_colorList[i]]); } private static Color[] _colorMap; private static int[] _colorList; /** TBD */ public int lineWidth() { return _lineWidth; } /** Set width of line segments, * the default is <code>2</code>. * @param lineWidth The width of line segments. */ public static void setLineWidth(int lineWidth) { _lineWidth = lineWidth; } private static int _lineWidth = 2; /** Logging . */ private static Logger log = Logger.getLogger(Photon.class); } |
From: Julius H. <hr...@us...> - 2007-10-25 13:57:28
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv26213/net/hep/atlas/graphics/JiveEvent/Schema Modified Files: event.xsd Log Message: Photon,Electron added Index: event.xsd =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/Schema/event.xsd,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** event.xsd 4 Oct 2007 16:17:41 -0000 1.4 --- event.xsd 25 Oct 2007 13:57:27 -0000 1.5 *************** *** 4,7 **** --- 4,10 ---- <!-- $Log$ + Revision 1.5 2007/10/25 13:57:27 hrivnac + Photon,Electron added + Revision 1.4 2007/10/04 16:17:41 hrivnac Atlantis can export colors to GraXML *************** *** 202,206 **** [...2110 lines suppressed...] <xs:simpleType> --- 5482,5486 ---- </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:float" default="1.0" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> *************** *** 5507,5511 **** </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:int" default="1" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> --- 5510,5514 ---- </xs:simpleType> </xs:attribute> ! <xs:attribute name="multiple" type="xs:float" default="1.0" /> <xs:attribute name="unit" default="NONE"> <xs:simpleType> |
From: Julius H. <hr...@us...> - 2007-10-19 14:11:33
|
Update of /cvsroot/graxml/DetDescr/GDML/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6452 Modified Files: build.xml Log Message: works in WebStart 1.5/1.6 Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/GDML/ant/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 17 Oct 2007 13:19:43 -0000 1.13 --- build.xml 19 Oct 2007 14:11:35 -0000 1.14 *************** *** 24,27 **** --- 24,36 ---- <pathelement path="${Java3D.vecmath}"/> <pathelement path="${Log4J.core}"/> + <!-- Java 1.5 --> + <pathelement path="${JAXP-2.0.api}"/> + <pathelement path="${JAXB-2.0.api}"/> + <pathelement path="${JAXB-2.0.libs}"/> + <pathelement path="${JAXB-2.0.impl}"/> + <pathelement path="${JAXB-2.0.xjc}"/> + <pathelement path="${JWSDP.activation}"/> + <pathelement path="${JWSDP.jsr173}"/> + <!-- --> <pathelement path="${CLASSPATH}"/> <fileset dir="${lib}"> *************** *** 63,66 **** --- 72,84 ---- <fileset file="${Java3D.vecmath}"/> <fileset file="${Log4J.core}"/> + <!-- Java 1.5 --> + <fileset file="${JAXP-2.0.api}"/> + <fileset file="${JAXB-2.0.api}"/> + <fileset file="${JAXB-2.0.libs}"/> + <fileset file="${JAXB-2.0.impl}"/> + <fileset file="${JAXB-2.0.xjc}"/> + <fileset file="${JWSDP.activation}"/> + <fileset file="${JWSDP.jsr173}"/> + <!-- --> </copy> <mkdir dir="${lib}/i386"/> |
From: Julius H. <hr...@us...> - 2007-10-19 14:11:10
|
Update of /cvsroot/graxml/DetDescr/AGDD/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6407 Modified Files: build.xml Log Message: works in WebStart 1.5/1.6 Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/AGDD/ant/build.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** build.xml 17 Oct 2007 13:19:17 -0000 1.17 --- build.xml 19 Oct 2007 14:11:12 -0000 1.18 *************** *** 24,27 **** --- 24,36 ---- <pathelement path="${Java3D.vecmath}"/> <pathelement path="${Log4J.core}"/> + <!-- Java 1.5 --> + <pathelement path="${JAXP-2.0.api}"/> + <pathelement path="${JAXB-2.0.api}"/> + <pathelement path="${JAXB-2.0.libs}"/> + <pathelement path="${JAXB-2.0.impl}"/> + <pathelement path="${JAXB-2.0.xjc}"/> + <pathelement path="${JWSDP.activation}"/> + <pathelement path="${JWSDP.jsr173}"/> + <!-- --> <pathelement path="${CLASSPATH}"/> <fileset dir="${lib}"> *************** *** 67,70 **** --- 76,88 ---- <fileset file="${Java3D.vecmath}"/> <fileset file="${Log4J.core}"/> + <!-- Java 1.5 --> + <fileset file="${JAXP-2.0.api}"/> + <fileset file="${JAXB-2.0.api}"/> + <fileset file="${JAXB-2.0.libs}"/> + <fileset file="${JAXB-2.0.impl}"/> + <fileset file="${JAXB-2.0.xjc}"/> + <fileset file="${JWSDP.activation}"/> + <fileset file="${JWSDP.jsr173}"/> + <!-- --> </copy> <mkdir dir="${lib}/i386"/> |
From: Julius H. <hr...@us...> - 2007-10-19 14:10:53
|
Update of /cvsroot/graxml/DetDescr/JiveGeometry/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv6047 Modified Files: build.xml Log Message: works in WebStart 1.5/1.6 Index: build.xml =================================================================== RCS file: /cvsroot/graxml/DetDescr/JiveGeometry/ant/build.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** build.xml 17 Oct 2007 13:19:02 -0000 1.7 --- build.xml 19 Oct 2007 14:10:55 -0000 1.8 *************** *** 23,26 **** --- 23,35 ---- <pathelement path="${Java3D.vecmath}"/> <pathelement path="${Log4J.core}"/> + <!-- Java 1.5 --> + <pathelement path="${JAXP-2.0.api}"/> + <pathelement path="${JAXB-2.0.api}"/> + <pathelement path="${JAXB-2.0.libs}"/> + <pathelement path="${JAXB-2.0.impl}"/> + <pathelement path="${JAXB-2.0.xjc}"/> + <pathelement path="${JWSDP.activation}"/> + <pathelement path="${JWSDP.jsr173}"/> + <!-- --> <pathelement path="${CLASSPATH}"/> <fileset dir="${lib}"> *************** *** 61,64 **** --- 70,82 ---- <fileset file="${Java3D.vecmath}"/> <fileset file="${Log4J.core}"/> + <!-- Java 1.5 --> + <fileset file="${JAXP-2.0.api}"/> + <fileset file="${JAXB-2.0.api}"/> + <fileset file="${JAXB-2.0.libs}"/> + <fileset file="${JAXB-2.0.impl}"/> + <fileset file="${JAXB-2.0.xjc}"/> + <fileset file="${JWSDP.activation}"/> + <fileset file="${JWSDP.jsr173}"/> + <!-- --> </copy> <mkdir dir="${lib}/i386"/> |
From: Julius H. <hr...@us...> - 2007-10-19 14:10:17
|
Update of /cvsroot/graxml/Graphics/JiveEvent/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5626 Modified Files: build.xml Log Message: works in WebStart 1.5/1.6 Index: build.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/ant/build.xml,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** build.xml 17 Oct 2007 13:18:41 -0000 1.13 --- build.xml 19 Oct 2007 14:10:19 -0000 1.14 *************** *** 24,27 **** --- 24,36 ---- <pathelement path="${Java3D.vecmath}"/> <pathelement path="${Log4J.core}"/> + <!-- Java 1.5 --> + <pathelement path="${JAXP-2.0.api}"/> + <pathelement path="${JAXB-2.0.api}"/> + <pathelement path="${JAXB-2.0.libs}"/> + <pathelement path="${JAXB-2.0.impl}"/> + <pathelement path="${JAXB-2.0.xjc}"/> + <pathelement path="${JWSDP.activation}"/> + <pathelement path="${JWSDP.jsr173}"/> + <!-- --> <pathelement path="${CLASSPATH}"/> <fileset dir="${lib}"> *************** *** 63,66 **** --- 72,84 ---- <fileset file="${Java3D.vecmath}"/> <fileset file="${Log4J.core}"/> + <!-- Java 1.5 --> + <fileset file="${JAXP-2.0.api}"/> + <fileset file="${JAXB-2.0.api}"/> + <fileset file="${JAXB-2.0.libs}"/> + <fileset file="${JAXB-2.0.impl}"/> + <fileset file="${JAXB-2.0.xjc}"/> + <fileset file="${JWSDP.activation}"/> + <fileset file="${JWSDP.jsr173}"/> + <!-- --> </copy> <mkdir dir="${lib}/i386"/> |
From: Julius H. <hr...@us...> - 2007-10-19 14:09:27
|
Update of /cvsroot/graxml/Graphics/GraXML/ant In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5474 Modified Files: build.xml Log Message: works in WebStart 1.5/1.6 Index: build.xml =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/ant/build.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** build.xml 17 Oct 2007 13:17:58 -0000 1.19 --- build.xml 19 Oct 2007 14:09:29 -0000 1.20 *************** *** 12,16 **** <property name="env.ANT_SITE" value="dist"/> <property file="ant/config-${env.ANT_SITE}.properties"/> ! <property name="version" value="pre-3.1.11"/> <property name="atlantis.lib" value="/home/hrivnac/work/Graphics/AtlantisJava/AtlantisJava-09-08-12/lib"/> --- 12,16 ---- <property name="env.ANT_SITE" value="dist"/> <property file="ant/config-${env.ANT_SITE}.properties"/> ! <property name="version" value="3.1.10.1"/> <property name="atlantis.lib" value="/home/hrivnac/work/Graphics/AtlantisJava/AtlantisJava-09-08-12/lib"/> *************** *** 33,36 **** --- 33,45 ---- <pathelement path="${JiveEvent.core}"/> <pathelement path="${JiveGeometry.core}"/> + <!-- Java 1.5 --> + <pathelement path="${JAXP-2.0.api}"/> + <pathelement path="${JAXB-2.0.api}"/> + <pathelement path="${JAXB-2.0.libs}"/> + <pathelement path="${JAXB-2.0.impl}"/> + <pathelement path="${JAXB-2.0.xjc}"/> + <pathelement path="${JWSDP.activation}"/> + <pathelement path="${JWSDP.jsr173}"/> + <!-- --> <pathelement path="${CLASSPATH}"/> <fileset dir="${lib}"> *************** *** 79,82 **** --- 88,100 ---- <fileset file="${JiveEvent.core}"/> <fileset file="${JiveGeometry.core}"/> + <!-- Java 1.5 --> + <fileset file="${JAXP-2.0.api}"/> + <fileset file="${JAXB-2.0.api}"/> + <fileset file="${JAXB-2.0.libs}"/> + <fileset file="${JAXB-2.0.impl}"/> + <fileset file="${JAXB-2.0.xjc}"/> + <fileset file="${JWSDP.activation}"/> + <fileset file="${JWSDP.jsr173}"/> + <!-- --> </copy> <mkdir dir="${lib}/i386"/> *************** *** 209,213 **** vecmath.jar xercesImpl.jar"/> ! </copy> <copy todir="${atlantis.lib}/i386"> <fileset dir="${lib}/i386" includes="*.so"/> --- 227,238 ---- vecmath.jar xercesImpl.jar"/> ! <!-- Java 1.5 --> ! <fileset dir="${lib}" includes="jaxp-api.jar ! jaxb-api.jar ! jaxb-impl.jar ! jaxb-xjc.jar ! jsr173_1.0_api.jar ! activation.jar"/> ! </copy> <copy todir="${atlantis.lib}/i386"> <fileset dir="${lib}/i386" includes="*.so"/> *************** *** 242,245 **** --- 267,276 ---- <include name="vecmath.jar"/> <include name="xercesImpl.jar"/> + <include name="jars/jaxp-api.jar"/> + <include name="jars/jaxb-api.jar"/> + <include name="jars/jaxb-impl.jar"/> + <include name="jars/jaxb-xjc.jar"/> + <include name="jars/jsr173_1.0_api.jar"/> + <include name="jars/activation.jar"/> </tarfileset> <tarfileset dir="${lib}/i386" prefix="lib/i386"> |
From: Julius H. <hr...@us...> - 2007-10-19 14:09:14
|
Update of /cvsroot/graxml/Graphics/GraXML/src In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5401 Modified Files: GraXML.jnlp Log Message: works in WebStart 1.5/1.6 Index: GraXML.jnlp =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/GraXML.jnlp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraXML.jnlp 17 Oct 2007 13:21:17 -0000 1.10 --- GraXML.jnlp 19 Oct 2007 14:09:12 -0000 1.11 *************** *** 8,12 **** <description kind="one-line">Framework for manipulation and visualisation of geometrical objects in space.</description> <description kind="short">Framework for manipulation and visualisation of geometrical objects in space.</description> ! <icon kind="default" href="http://cern.ch/hrivnac/Activities/Packages/WebStart/GraXML.gif"/> <offline-allowed/> </information> --- 8,12 ---- <description kind="one-line">Framework for manipulation and visualisation of geometrical objects in space.</description> <description kind="short">Framework for manipulation and visualisation of geometrical objects in space.</description> ! <icon kind="default" href="http://cern.ch/hrivnac/Activities/Packages/WebStart/GraXML/GraXML.gif"/> <offline-allowed/> </information> *************** *** 33,36 **** --- 33,40 ---- <extension href="http://download.java.net/media/java3d/webstart/release/java3d-1.5.1.jnlp"/> </resources> + <resources> + <j2se version="1.5"/> + <extension href="http://cern.ch/hrivnac/Activities/Packages/WebStart/JAXB/jaxb.jnlp"/> + </resources> <application-desc main-class="net.hep.graphics.GraXML.FrontEnd.GraXML"/> </jnlp> |
From: Julius H. <hr...@us...> - 2007-10-19 14:09:12
|
Update of /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv5401/net/hep/graphics/GraXML/GUI Modified Files: RootWindow.java Log Message: works in WebStart 1.5/1.6 Index: RootWindow.java =================================================================== RCS file: /cvsroot/graxml/Graphics/GraXML/src/net/hep/graphics/GraXML/GUI/RootWindow.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RootWindow.java 17 Oct 2007 13:21:17 -0000 1.12 --- RootWindow.java 19 Oct 2007 14:09:13 -0000 1.13 *************** *** 79,82 **** --- 79,85 ---- * <pre> * $Log$ + * Revision 1.13 2007/10/19 14:09:13 hrivnac + * works in WebStart 1.5/1.6 + * * Revision 1.12 2007/10/17 13:21:17 hrivnac * using only Java 1.6 *************** *** 296,302 **** public final void showEmbedded(String file) { try { ! ViewerTreeFactory.connectionManager().hide("GraXML"); ! show(new SceneGroup(_demos.get(file))); ! ViewerTreeFactory.connectionManager().show("GraXML"); } catch (GraXMLException e) { --- 299,310 ---- public final void showEmbedded(String file) { try { ! if (ViewerTreeFactory.connectionManager() != null) { ! ViewerTreeFactory.connectionManager().hide("GraXML"); ! show(new SceneGroup(_demos.get(file))); ! ViewerTreeFactory.connectionManager().show("GraXML"); ! } ! else { ! show(new SceneGroup(_demos.get(file))); ! } } catch (GraXMLException e) { |