[GraXML-commit] Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps TRT.ja
Brought to you by:
hrivnac
From: Julius H. <hr...@us...> - 2008-05-28 13:16:36
|
Update of /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv1254/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps Modified Files: TRT.java Log Message: TRT improved Index: TRT.java =================================================================== RCS file: /cvsroot/graxml/Graphics/JiveEvent/src/net/hep/atlas/graphics/JiveEvent/GeometricModel/Reps/TRT.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** TRT.java 28 May 2008 09:45:03 -0000 1.1 --- TRT.java 28 May 2008 13:16:38 -0000 1.2 *************** *** 65,68 **** --- 65,71 ---- * <pre> * $Log$ + * Revision 1.2 2008/05/28 13:16:38 hrivnac + * TRT improved + * * Revision 1.1 2008/05/28 09:45:03 hrivnac * TRT added *************** *** 107,111 **** float[] rhozs = floats(rhoz.getValue()); float[] drifts = floats(drift.getValue()); ! float[] thrasholds = floats(threshold.getValue()); // Draw all TRTs --- 110,114 ---- float[] rhozs = floats(rhoz.getValue()); float[] drifts = floats(drift.getValue()); ! int[] thresholds = ints( threshold.getValue()); // Draw all TRTs *************** *** 126,142 **** double z1; double r1; // Set base Tg _baseTg = tg(); // Determine, how to draw if (!_asCylinders && !_asLines) { ! if (count < 50) { ! _asCylinders = true; } else { ! _asLines = true; } } // Loop over TRTs for (int i = 0; i < count; i++) { name = "TRT(" + storeGateKey + "/" + subs[i] + "/" + i + ")"; info = name; --- 129,157 ---- double z1; double r1; + boolean barrel; // Set base Tg _baseTg = tg(); // Determine, how to draw + int count0 = count; + if (_thresholdCut) { + count0 = 0; + for (int t : thresholds) { + count0 += t; + } + } if (!_asCylinders && !_asLines) { ! if (count0 < 50) { ! asCylinders(); } else { ! asLines(); } } // Loop over TRTs for (int i = 0; i < count; i++) { + if (_thresholdCut && thresholds[i] == 0) continue; + barrel = !(subs[i] == 0 || subs[i] == 3); + if (!_barrel && barrel) continue; + if (!_endcap && !barrel) continue; name = "TRT(" + storeGateKey + "/" + subs[i] + "/" + i + ")"; info = name; *************** *** 184,188 **** shape = asLine(x0, y0, z0, x1, y1, z1, color); } ! if (_asCylinders) { if (subs[i] == 0 || subs[i] == 3) { shape = asCylinder(abs(r1 - r0) + abs(z1 - z0), drifts[i], phis[i], (x1 + x0) / 2.0, (y1 + y0) / 2.0, (z1 + z0) / 2.0, false); --- 199,203 ---- shape = asLine(x0, y0, z0, x1, y1, z1, color); } ! else { if (subs[i] == 0 || subs[i] == 3) { shape = asCylinder(abs(r1 - r0) + abs(z1 - z0), drifts[i], phis[i], (x1 + x0) / 2.0, (y1 + y0) / 2.0, (z1 + z0) / 2.0, false); *************** *** 192,195 **** --- 207,211 ---- } } + // Use TRT shape.setAppearance(appearance); *************** *** 317,324 **** * If neither cylinder nor line is set, the representation is chosen * according to number of straws: cylinders are created for number ! * of straws smaller then 50. */ ! public static void asCylinders() { ! _asCylinders = true; ! _asLines = false; } --- 333,341 ---- * If neither cylinder nor line is set, the representation is chosen * according to number of straws: cylinders are created for number ! * of straws smaller then 50. ! * Default is <code>false</code>. */ ! public static void asCylinders(boolean cylinders) { ! _asCylinders = cylinders; ! _asLines = !cylinders; } *************** *** 326,338 **** * If neither cylinder nor line is set, the representation is chosen * according to number of straws: cylinders are created for number ! * of straws smaller then 50. */ ! public static void asLines() { ! _asCylinders = false; ! _asLines = true; } ! private static booloean _asCylinders = false; ! private static boolean _asLines = false; private Group _baseTg; --- 343,383 ---- * If neither cylinder nor line is set, the representation is chosen * according to number of straws: cylinders are created for number ! * of straws smaller then 50. ! * Default is <code>false</code>. */ ! public static void asLines(boolean lines) { ! _asLines = lines; ! _asCylinders = !lines; } ! private static boolean _asCylinders = false; ! private static boolean _asLines = false; ! ! /** Set whether to draw all straws or just those over threshold. ! * Default is true, i.e. only straws over threshold are drawn. ! * @param thresholdCut Whether to draw only straws over threshold. */ ! public static void setThresholdCut(boolean thresholdCut) { ! _thresholdCut = thresholdCut; ! } ! ! private static boolean _thresholdCut = true; ! ! /** Set whether to draw barrel straws. ! * Default is <code>true</code>. ! * @param barrel Whether to draw barrel straws. */ ! public static void drawBarrel(boolean barrel) { ! _barrel = barrel; ! } ! ! /** Set whether to draw endcap straws. ! * Default is <code>true</code>. ! * @param barrel Whether to draw endcap straws. */ ! public static void drawEndcap(boolean endcap) { ! _endcap = endcap; ! } ! ! private static boolean _barrel = true; ! ! private static boolean _endcap = true; private Group _baseTg; |