Commit c55794d2 authored by rink's avatar rink
Browse files

add a trajectory form for tracer display only

parent 9b6b8b9d
......@@ -77,6 +77,8 @@ public class TrajectoryManager {
public static final int CYLINDER = TrajectoryParams.CYLINDER;
public static final int DEFORM_RIBBON = TrajectoryParams.DEFORM_RIBBON;
public static final int POINT = TrajectoryParams.POINT;
public static final int TRACER = TrajectoryParams.TRACER;
public static final int TRACER_POINT = TrajectoryParams.TRACER_POINT;
public static final String PPOP_TRAJECTORY_START_POINTS_FILE = "visad.trajectory.startPointsFile";
public static final String PROP_TRAJECTORY_PARAM_FILE_1 = "visad.trajectory.paramFile1";
......@@ -2438,6 +2440,12 @@ public class TrajectoryManager {
else if (propStr.equals("POINT")) {
trajParams.setTrajectoryForm(TrajectoryParams.POINT);
}
else if (propStr.equals("TRACER")) {
trajParams.setTrajectoryForm(TrajectoryParams.TRACER);
}
else if (propStr.equals("TRACER_POINT")) {
trajParams.setTrajectoryForm(TrajectoryParams.TRACER_POINT);
}
}
propStr = prop.getProperty("Method");
......
......@@ -64,6 +64,8 @@ public class TrajectoryParams {
public static final int CYLINDER = 2;
public static final int DEFORM_RIBBON = 3;
public static final int POINT = 4;
public static final int TRACER = 5;
public static final int TRACER_POINT = 6;
double trajVisibilityTimeWindow = 86400.0;
double trajRefreshInterval = 86400.0;
......
......@@ -1407,6 +1407,9 @@ System.out.println("Texture.BASE_LEVEL_LINEAR = " + Texture.BASE_LEVEL_LINEAR);
TrajectoryManager trajMan = new TrajectoryManager(renderer, trajParams, flowInfoList, dataDomainLength, times[0], altitudeToDisplayZ, dspCoordSys);
trcrEnabled = (trcrEnabled && (trajForm == TrajectoryManager.LINE)) && trajForm != TrajectoryManager.POINT;
if (trajForm == TrajectoryManager.TRACER || trajForm == TrajectoryManager.TRACER_POINT) {
trcrEnabled = true;
}
if (autoSizeTrcr && trcrEnabled) {
listener = new FixGeomSizeAppearanceJ3D(pCntrl, this, mouseBehav);
......@@ -1442,12 +1445,18 @@ System.out.println("Texture.BASE_LEVEL_LINEAR = " + Texture.BASE_LEVEL_LINEAR);
arrays = trajMan.computeTrajectories(k, timeAccum, times, timeSteps);
if (trajMan.getNumberOfTrajectories() > 0) {
if (trajForm == TrajectoryManager.TRACER_POINT) {
trcrArray = trajMan.makePointGeometry();
}
else {
achrArrays = new ArrayList<float[]>();
trcrArray = trajMan.makeTracerGeometry(achrArrays, direction, trcrSize, dspScale, true);
trcrArray = TrajectoryManager.scaleGeometry(trcrArray, achrArrays, (float)(1.0/scale));
}
}
GraphicsModeControl mode = (GraphicsModeControl) info.mode.clone();
mode.setPointSize(5f, false);
if ((k==0) || (timeAccum >= trajRefreshInterval)) { // for non steady state trajectories (refresh frequency)
avHandler.setNoneVisibleIndex(i);
......@@ -1458,19 +1467,23 @@ System.out.println("Texture.BASE_LEVEL_LINEAR = " + Texture.BASE_LEVEL_LINEAR);
if (trcrEnabled) {
Object group = switB.getChild(i);
BranchGroup trcrBG = addToDetachableGroup(group, trcrArray, mode, info.constant_alpha, info.constant_color);
if (listener != null && trcrArray != null) {
if (listener != null && trcrArray != null && achrArrays != null) {
listener.add(trcrBG, trcrArray, achrArrays, mode, info.constant_alpha, info.constant_color);
}
}
BranchGroup branch = (BranchGroup) branches.get(i);
addToGroup(branch, arrays[0], mode, info.constant_alpha, info.constant_color);
if (trajForm == TrajectoryManager.CYLINDER) {
// cylinder elbows
addToGroup(branch, arrays[2], mode, info.constant_alpha, info.constant_color);
}
if (trajForm != TrajectoryManager.TRACER && trajForm != TrajectoryManager.TRACER_POINT) {
BranchGroup node = (BranchGroup) swit.getChild(i);
node.addChild(branch);
}
if (trajForm == TrajectoryManager.CYLINDER) {
BranchGroup auxBrnch = (BranchGroup) makeBranch();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment