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