Issue #2703 Fix GFE time matching in iscMode.
Former-commit-id:07bc9f075f
[formerlyd8bfdd1a7e
[formerly cbc63092bed92bb35a450c012b5bc882e4c82b35]] Former-commit-id:d8bfdd1a7e
Former-commit-id:2425b9665c
This commit is contained in:
parent
7bdf0b7396
commit
fa6dcaac84
3 changed files with 326 additions and 344 deletions
|
@ -49,9 +49,10 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Feb 19, 2009 chammack Initial creation
|
* Feb 19, 2009 chammack Initial creation
|
||||||
|
* Jan 23, 2014 2703 bsteffen Always get resource time from descriptor.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -117,11 +118,9 @@ public class GFEMapRenderableDisplay extends PlainMapRenderableDisplay
|
||||||
@Override
|
@Override
|
||||||
protected PaintProperties calcPaintDataTime(PaintProperties paintProps,
|
protected PaintProperties calcPaintDataTime(PaintProperties paintProps,
|
||||||
AbstractVizResource<?, ?> rsc) {
|
AbstractVizResource<?, ?> rsc) {
|
||||||
if (dataMgr != null) {
|
// Get time for resource from FramesInfo
|
||||||
// Get time for resource from FramesInfo
|
paintProps.setDataTime(paintProps.getFramesInfo().getTimeForResource(
|
||||||
paintProps.setDataTime(paintProps.getFramesInfo()
|
rsc));
|
||||||
.getTimeForResource(rsc));
|
|
||||||
}
|
|
||||||
|
|
||||||
GFEPaintProperties gfeProps = new GFEPaintProperties(paintProps);
|
GFEPaintProperties gfeProps = new GFEPaintProperties(paintProps);
|
||||||
if (qvTime != null) {
|
if (qvTime != null) {
|
||||||
|
@ -184,4 +183,5 @@ public class GFEMapRenderableDisplay extends PlainMapRenderableDisplay
|
||||||
public void spatialEditorTimeChanged(Date date) {
|
public void spatialEditorTimeChanged(Date date) {
|
||||||
this.refresh();
|
this.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ import com.raytheon.viz.gfe.rsc.GFEResource;
|
||||||
* ------------- -------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Nov 14, 2012 mschenke Initial creation
|
* Nov 14, 2012 mschenke Initial creation
|
||||||
* Feb 26, 2013 1708 randerso Fixed double notification for time change
|
* Feb 26, 2013 1708 randerso Fixed double notification for time change
|
||||||
* Jan 23, 2014 2703 bsteffen Add JAXB Annotations.
|
* Jan 23, 2014 2703 bsteffen Add JAXB Annotations, fix iscMode.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
|
@ -108,6 +108,7 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
||||||
if (resource instanceof GFEResource) {
|
if (resource instanceof GFEResource) {
|
||||||
GFEResource rsc = (GFEResource) resource;
|
GFEResource rsc = (GFEResource) resource;
|
||||||
Parm parm = rsc.getParm();
|
Parm parm = rsc.getParm();
|
||||||
|
Parm iscParm = getIscParm(parm);
|
||||||
DataTime[] rscTimes = new DataTime[descriptorTimes.length];
|
DataTime[] rscTimes = new DataTime[descriptorTimes.length];
|
||||||
for (int i = 0; i < descriptorTimes.length; ++i) {
|
for (int i = 0; i < descriptorTimes.length; ++i) {
|
||||||
IGridData overlapping = parm.overlappingGrid(descriptorTimes[i]
|
IGridData overlapping = parm.overlappingGrid(descriptorTimes[i]
|
||||||
|
@ -116,7 +117,16 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
||||||
TimeRange tr = overlapping.getGridTime();
|
TimeRange tr = overlapping.getGridTime();
|
||||||
rscTimes[i] = new DataTime(tr.getStart().getTime(),
|
rscTimes[i] = new DataTime(tr.getStart().getTime(),
|
||||||
new TimeRange(tr.getStart(), tr.getEnd()));
|
new TimeRange(tr.getStart(), tr.getEnd()));
|
||||||
|
} else if (iscParm != null) {
|
||||||
|
overlapping = iscParm.overlappingGrid(descriptorTimes[i]
|
||||||
|
.getRefTime());
|
||||||
|
if (overlapping != null) {
|
||||||
|
TimeRange tr = overlapping.getGridTime();
|
||||||
|
rscTimes[i] = new DataTime(tr.getStart().getTime(),
|
||||||
|
new TimeRange(tr.getStart(), tr.getEnd()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (timeMap != null) {
|
if (timeMap != null) {
|
||||||
timeMap.put(rsc, rscTimes);
|
timeMap.put(rsc, rscTimes);
|
||||||
|
@ -134,8 +144,17 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
||||||
List<Parm> parms = new ArrayList<Parm>(rscs.size());
|
List<Parm> parms = new ArrayList<Parm>(rscs.size());
|
||||||
for (GFEResource rsc : rscs) {
|
for (GFEResource rsc : rscs) {
|
||||||
if (rsc.getProperties().isVisible()) {
|
if (rsc.getProperties().isVisible()) {
|
||||||
parms.add(rsc.getParm());
|
Parm parm = rsc.getParm();
|
||||||
|
parms.add(parm);
|
||||||
|
Parm iscParm = getIscParm(parm);
|
||||||
|
if (iscParm != null) {
|
||||||
|
parms.add(iscParm);
|
||||||
|
}
|
||||||
tmbResources.add(rsc);
|
tmbResources.add(rsc);
|
||||||
|
DataManager dataManager = parm.getDataManager();
|
||||||
|
if (dataManager.getParmManager().iscMode()) {
|
||||||
|
parms.add(dataManager.getIscDataAccess().getISCParm(parm));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -287,4 +306,12 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
||||||
}
|
}
|
||||||
return new ArrayList<Date>(dateSet);
|
return new ArrayList<Date>(dateSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Parm getIscParm(Parm parm) {
|
||||||
|
DataManager dataManager = parm.getDataManager();
|
||||||
|
if (dataManager.getParmManager().iscMode()) {
|
||||||
|
return dataManager.getIscDataAccess().getISCParm(parm);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ import com.vividsolutions.jts.geom.Envelope;
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------- -------- ----------- --------------------------
|
* ------------- -------- ----------- --------------------------
|
||||||
* Mar 01, 2008 chammack Initial Creation.
|
* Mar 01, 2008 chammack Initial Creation.
|
||||||
* Aug 20, 2008 dglazesk Update for the ColorMap interface change
|
* Aug 20, 2008 dglazesk Update for the ColorMap interface change
|
||||||
|
@ -166,7 +166,9 @@ import com.vividsolutions.jts.geom.Envelope;
|
||||||
* Sep 23, 2013 2363 bsteffen Add more vector configuration options.
|
* Sep 23, 2013 2363 bsteffen Add more vector configuration options.
|
||||||
* Oct 31, 2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
* Oct 31, 2013 2508 randerso Change to use DiscreteGridSlice.getKeys()
|
||||||
* Dec 11, 2013 2621 randerso Removed conditional from getParm so it never returns null
|
* Dec 11, 2013 2621 randerso Removed conditional from getParm so it never returns null
|
||||||
* Jan 23, 2014 2703 bsteffen Allow construction using a resourceData.
|
* Jan 23, 2014 2703 bsteffen Allow construction using a resourceData,
|
||||||
|
* paint using the time in paintProps and
|
||||||
|
* remove dead code in paintInternal
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -488,15 +490,9 @@ public class GFEResource extends
|
||||||
PaintProperties paintProps) throws VizException {
|
PaintProperties paintProps) throws VizException {
|
||||||
|
|
||||||
GFEPaintProperties myPaintProps = (GFEPaintProperties) paintProps;
|
GFEPaintProperties myPaintProps = (GFEPaintProperties) paintProps;
|
||||||
|
this.curTime = myPaintProps.getDataTime();
|
||||||
|
|
||||||
// TODO: Time matching changes for Hazard Services broke display of ISC
|
// No data to be displayed here
|
||||||
// grids when in ISC mode with no Fcst grid present. This fixes the
|
|
||||||
// issue for now but will need to be resolved for Hazard Services
|
|
||||||
|
|
||||||
// this.curTime = myPaintProps.getDataTime();
|
|
||||||
this.curTime = new DataTime(this.dataManager.getSpatialDisplayManager()
|
|
||||||
.getSpatialEditorTime());
|
|
||||||
|
|
||||||
if (curTime == null) {
|
if (curTime == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -519,11 +515,6 @@ public class GFEResource extends
|
||||||
|
|
||||||
this.lastGraphicsTarget = target;
|
this.lastGraphicsTarget = target;
|
||||||
|
|
||||||
// No data to be displayed here
|
|
||||||
if (this.curTime == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
IGridData[] gd = this.parm.getGridInventory(this.curTime
|
IGridData[] gd = this.parm.getGridInventory(this.curTime
|
||||||
.getValidPeriod());
|
.getValidPeriod());
|
||||||
|
|
||||||
|
@ -554,369 +545,333 @@ public class GFEResource extends
|
||||||
.setRenderingOrder(renderingOrder);
|
.setRenderingOrder(renderingOrder);
|
||||||
descriptor.getResourceList().sort();
|
descriptor.getResourceList().sort();
|
||||||
|
|
||||||
if (gd != null) {
|
IGridSlice gs = null;
|
||||||
IGridSlice gs = null;
|
if (dataManager.getParmManager().iscMode() && (gd.length == 0)) {
|
||||||
if (dataManager.getParmManager().iscMode() && (gd.length == 0)) {
|
GridParmInfo gpi = this.parm.getGridInfo();
|
||||||
GridParmInfo gpi = this.parm.getGridInfo();
|
GridType gridType = gpi.getGridType();
|
||||||
GridType gridType = gpi.getGridType();
|
|
||||||
|
|
||||||
IGrid2D dummyGrid = null;
|
IGrid2D dummyGrid = null;
|
||||||
switch (gridType) {
|
switch (gridType) {
|
||||||
case SCALAR:
|
case SCALAR:
|
||||||
dummyGrid = new Grid2DFloat(gpi.getGridLoc().getNx(),
|
dummyGrid = new Grid2DFloat(gpi.getGridLoc().getNx(), gpi
|
||||||
gpi.getGridLoc().getNy(), Float.NaN);
|
.getGridLoc().getNy(), Float.NaN);
|
||||||
gs = new ScalarGridSlice(this.curTime.getValidPeriod(),
|
gs = new ScalarGridSlice(this.curTime.getValidPeriod(),
|
||||||
gpi, new GridDataHistory[] {},
|
gpi, new GridDataHistory[] {},
|
||||||
(Grid2DFloat) dummyGrid);
|
(Grid2DFloat) dummyGrid);
|
||||||
break;
|
break;
|
||||||
case VECTOR:
|
case VECTOR:
|
||||||
dummyGrid = new Grid2DFloat(gpi.getGridLoc().getNx(),
|
dummyGrid = new Grid2DFloat(gpi.getGridLoc().getNx(), gpi
|
||||||
gpi.getGridLoc().getNy(), Float.NaN);
|
.getGridLoc().getNy(), Float.NaN);
|
||||||
gs = new VectorGridSlice(this.curTime.getValidPeriod(),
|
gs = new VectorGridSlice(this.curTime.getValidPeriod(),
|
||||||
gpi, new GridDataHistory[] {},
|
gpi, new GridDataHistory[] {},
|
||||||
(Grid2DFloat) dummyGrid,
|
(Grid2DFloat) dummyGrid, (Grid2DFloat) dummyGrid);
|
||||||
(Grid2DFloat) dummyGrid);
|
break;
|
||||||
break;
|
case WEATHER:
|
||||||
case WEATHER:
|
dummyGrid = new Grid2DByte(gpi.getGridLoc().getNx(), gpi
|
||||||
dummyGrid = new Grid2DByte(gpi.getGridLoc().getNx(),
|
.getGridLoc().getNy());
|
||||||
gpi.getGridLoc().getNy());
|
gs = new WeatherGridSlice(this.curTime.getValidPeriod(),
|
||||||
gs = new WeatherGridSlice(
|
gpi, new GridDataHistory[] {},
|
||||||
this.curTime.getValidPeriod(), gpi,
|
(Grid2DByte) dummyGrid, new WeatherKey[] {});
|
||||||
new GridDataHistory[] {},
|
break;
|
||||||
(Grid2DByte) dummyGrid, new WeatherKey[] {});
|
case DISCRETE:
|
||||||
break;
|
dummyGrid = new Grid2DByte(gpi.getGridLoc().getNx(), gpi
|
||||||
case DISCRETE:
|
.getGridLoc().getNy());
|
||||||
dummyGrid = new Grid2DByte(gpi.getGridLoc().getNx(),
|
gs = new DiscreteGridSlice(this.curTime.getValidPeriod(),
|
||||||
gpi.getGridLoc().getNy());
|
gpi, new GridDataHistory[] {},
|
||||||
gs = new DiscreteGridSlice(
|
(Grid2DByte) dummyGrid, new DiscreteKey[] {});
|
||||||
this.curTime.getValidPeriod(), gpi,
|
break;
|
||||||
new GridDataHistory[] {},
|
default:
|
||||||
(Grid2DByte) dummyGrid, new DiscreteKey[] {});
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else if (gd.length == 0) {
|
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
gs = gd[0].getGridSlice();
|
} else {
|
||||||
|
gs = gd[0].getGridSlice();
|
||||||
|
}
|
||||||
|
if ((gs instanceof VectorGridSlice)
|
||||||
|
|| (gs instanceof ScalarGridSlice)) {
|
||||||
|
|
||||||
|
if (this.gridDisplay != null) {
|
||||||
|
this.gridDisplay.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((gs instanceof VectorGridSlice)
|
if (this.contourDisplay != null) {
|
||||||
|| (gs instanceof ScalarGridSlice)) {
|
this.contourDisplay.dispose();
|
||||||
|
|
||||||
if (this.gridDisplay != null) {
|
|
||||||
this.gridDisplay.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (this.contourDisplay != null) {
|
|
||||||
this.contourDisplay.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.gridDisplay = null;
|
|
||||||
this.contourDisplay = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gs instanceof VectorGridSlice) {
|
this.gridDisplay = null;
|
||||||
VectorGridSlice vectorSlice = (VectorGridSlice) gs;
|
this.contourDisplay = null;
|
||||||
Grid2DBit mask = parm.getDisplayAttributes()
|
}
|
||||||
.getDisplayMask();
|
|
||||||
|
|
||||||
if (dataManager.getParmManager().iscMode() || iscParm) {
|
if (gs instanceof VectorGridSlice) {
|
||||||
vectorSlice = new VectorGridSlice();
|
VectorGridSlice vectorSlice = (VectorGridSlice) gs;
|
||||||
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
Grid2DBit mask = parm.getDisplayAttributes().getDisplayMask();
|
||||||
new GridID(this.parm, this.dataManager
|
|
||||||
.getSpatialDisplayManager()
|
if (dataManager.getParmManager().iscMode() || iscParm) {
|
||||||
.getSpatialEditorTime()), true,
|
vectorSlice = new VectorGridSlice();
|
||||||
vectorSlice);
|
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
||||||
|
new GridID(this.parm, this.curTime.getRefTime()),
|
||||||
|
true, vectorSlice);
|
||||||
|
}
|
||||||
|
|
||||||
|
Grid2DFloat maskedGrid = new Grid2DFloat(vectorSlice
|
||||||
|
.getMagGrid().getXdim(), vectorSlice.getMagGrid()
|
||||||
|
.getYdim(), Float.NaN);
|
||||||
|
maskedGrid.copyWithMask(vectorSlice.getMagGrid(), mask);
|
||||||
|
FloatBuffer mag = maskedGrid.getBuffer();
|
||||||
|
|
||||||
|
Grid2DFloat dirGrid = new Grid2DFloat(vectorSlice.getMagGrid()
|
||||||
|
.getXdim(), vectorSlice.getDirGrid().getYdim(),
|
||||||
|
Float.NaN);
|
||||||
|
dirGrid.copyWithMask(vectorSlice.getDirGrid(), mask);
|
||||||
|
FloatBuffer dir = dirGrid.getBuffer();
|
||||||
|
|
||||||
|
if (visTypes.contains(VisualizationType.IMAGE)) {
|
||||||
|
this.gridDisplay = new GriddedImageDisplay(mag, descriptor,
|
||||||
|
this.gridGeometry);
|
||||||
|
}
|
||||||
|
|
||||||
|
clearVectorDisplays();
|
||||||
|
VectorGraphicsConfig vectorConfig;
|
||||||
|
for (VisualizationType type : visTypes) {
|
||||||
|
switch (type) {
|
||||||
|
case WIND_ARROW:
|
||||||
|
vectorConfig = new VectorGraphicsConfig();
|
||||||
|
double size = getVectorSize("WindArrowDefaultSize");
|
||||||
|
vectorConfig.setBaseSize(size);
|
||||||
|
vectorConfig.setCalmCircleSizeRatio(vectorConfig
|
||||||
|
.getCalmCircleSizeRatio() * BARB_SCALE_FACTOR);
|
||||||
|
vectorConfig.setArrowHeadStaffRatio(ARROW_HEAD_RATIO);
|
||||||
|
vectorConfig.alwaysIncludeCalmCircle();
|
||||||
|
vectorConfig.alwaysIncludeVector();
|
||||||
|
// get the logFactor
|
||||||
|
double logFactor = prefs.getDouble(parm.getParmID()
|
||||||
|
.compositeNameUI() + "_arrowScaling");
|
||||||
|
double maxVal = parm.getGridInfo().getMaxValue();
|
||||||
|
if (logFactor <= 0.0) {
|
||||||
|
vectorConfig.setLinearArrowScaleFactor(size
|
||||||
|
/ maxVal);
|
||||||
|
} else {
|
||||||
|
vectorConfig.setArrowScaler(new LogArrowScalar(
|
||||||
|
size, logFactor, maxVal));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.vectorDisplay.add(new GriddedVectorDisplay(mag,
|
||||||
|
dir, descriptor, MapUtil.getGridGeometry(gs
|
||||||
|
.getGridInfo().getGridLoc()),
|
||||||
|
VECTOR_DENSITY_FACTOR, false,
|
||||||
|
visTypeToDisplayType(type), vectorConfig));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WIND_BARB:
|
||||||
|
vectorConfig = new VectorGraphicsConfig();
|
||||||
|
vectorConfig
|
||||||
|
.setBaseSize(getVectorSize("WindBarbDefaultSize")
|
||||||
|
* BARB_SCALE_FACTOR);
|
||||||
|
vectorConfig.alwaysIncludeCalmCircle();
|
||||||
|
vectorConfig.alwaysIncludeVector();
|
||||||
|
this.vectorDisplay
|
||||||
|
.add(new GriddedVectorDisplay(mag, dir,
|
||||||
|
descriptor, MapUtil.getGridGeometry(gs
|
||||||
|
.getGridInfo().getGridLoc()),
|
||||||
|
VECTOR_DENSITY_FACTOR
|
||||||
|
/ BARB_SCALE_FACTOR, false,
|
||||||
|
visTypeToDisplayType(type),
|
||||||
|
vectorConfig));
|
||||||
|
break;
|
||||||
|
|
||||||
|
case IMAGE:
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
statusHandler.handle(
|
||||||
|
Priority.PROBLEM,
|
||||||
|
"Unsupported Visualization Type: "
|
||||||
|
+ type.toString());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} else if (gs instanceof ScalarGridSlice) {
|
||||||
|
ScalarGridSlice scalarSlice = (ScalarGridSlice) gs;
|
||||||
|
Grid2DBit mask = parm.getDisplayAttributes().getDisplayMask();
|
||||||
|
|
||||||
Grid2DFloat maskedGrid = new Grid2DFloat(vectorSlice
|
if (dataManager.getParmManager().iscMode() || iscParm) {
|
||||||
.getMagGrid().getXdim(), vectorSlice.getMagGrid()
|
scalarSlice = new ScalarGridSlice();
|
||||||
.getYdim(), Float.NaN);
|
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
||||||
maskedGrid.copyWithMask(vectorSlice.getMagGrid(), mask);
|
new GridID(this.parm, this.curTime.getRefTime()),
|
||||||
FloatBuffer mag = maskedGrid.getBuffer();
|
true, scalarSlice);
|
||||||
|
|
||||||
Grid2DFloat dirGrid = new Grid2DFloat(vectorSlice
|
}
|
||||||
.getMagGrid().getXdim(), vectorSlice.getDirGrid()
|
Grid2DFloat scalarGrid = scalarSlice.getScalarGrid();
|
||||||
.getYdim(), Float.NaN);
|
if (scalarGrid != null) {
|
||||||
dirGrid.copyWithMask(vectorSlice.getDirGrid(), mask);
|
Grid2DFloat maskedGrid = new Grid2DFloat(
|
||||||
FloatBuffer dir = dirGrid.getBuffer();
|
scalarGrid.getXdim(), scalarGrid.getYdim(),
|
||||||
|
Float.NaN);
|
||||||
|
maskedGrid.copyWithMask(scalarGrid, mask);
|
||||||
|
|
||||||
|
FloatBuffer fb = maskedGrid.getBuffer();
|
||||||
if (visTypes.contains(VisualizationType.IMAGE)) {
|
if (visTypes.contains(VisualizationType.IMAGE)) {
|
||||||
this.gridDisplay = new GriddedImageDisplay(mag,
|
this.gridDisplay = new GriddedImageDisplay(fb,
|
||||||
descriptor, this.gridGeometry);
|
descriptor, this.gridGeometry);
|
||||||
}
|
}
|
||||||
|
|
||||||
clearVectorDisplays();
|
if (visTypes.contains(VisualizationType.CONTOUR)) {
|
||||||
VectorGraphicsConfig vectorConfig;
|
this.contourDisplay = new GriddedContourDisplay(
|
||||||
for (VisualizationType type : visTypes) {
|
descriptor, this.gridGeometry, fb);
|
||||||
switch (type) {
|
|
||||||
case WIND_ARROW:
|
|
||||||
vectorConfig = new VectorGraphicsConfig();
|
|
||||||
double size = getVectorSize("WindArrowDefaultSize");
|
|
||||||
vectorConfig.setBaseSize(size);
|
|
||||||
vectorConfig.setCalmCircleSizeRatio(vectorConfig
|
|
||||||
.getCalmCircleSizeRatio()
|
|
||||||
* BARB_SCALE_FACTOR);
|
|
||||||
vectorConfig
|
|
||||||
.setArrowHeadStaffRatio(ARROW_HEAD_RATIO);
|
|
||||||
vectorConfig.alwaysIncludeCalmCircle();
|
|
||||||
vectorConfig.alwaysIncludeVector();
|
|
||||||
// get the logFactor
|
|
||||||
double logFactor = prefs.getDouble(parm.getParmID()
|
|
||||||
.compositeNameUI() + "_arrowScaling");
|
|
||||||
double maxVal = parm.getGridInfo().getMaxValue();
|
|
||||||
if (logFactor <= 0.0) {
|
|
||||||
vectorConfig.setLinearArrowScaleFactor(size
|
|
||||||
/ maxVal);
|
|
||||||
} else {
|
|
||||||
vectorConfig.setArrowScaler(new LogArrowScalar(
|
|
||||||
size, logFactor, maxVal));
|
|
||||||
}
|
|
||||||
|
|
||||||
this.vectorDisplay.add(new GriddedVectorDisplay(
|
|
||||||
mag, dir, descriptor, MapUtil
|
|
||||||
.getGridGeometry(gs.getGridInfo()
|
|
||||||
.getGridLoc()),
|
|
||||||
VECTOR_DENSITY_FACTOR, false,
|
|
||||||
visTypeToDisplayType(type), vectorConfig));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case WIND_BARB:
|
|
||||||
vectorConfig = new VectorGraphicsConfig();
|
|
||||||
vectorConfig
|
|
||||||
.setBaseSize(getVectorSize("WindBarbDefaultSize")
|
|
||||||
* BARB_SCALE_FACTOR);
|
|
||||||
vectorConfig.alwaysIncludeCalmCircle();
|
|
||||||
vectorConfig.alwaysIncludeVector();
|
|
||||||
this.vectorDisplay.add(new GriddedVectorDisplay(
|
|
||||||
mag, dir, descriptor, MapUtil
|
|
||||||
.getGridGeometry(gs.getGridInfo()
|
|
||||||
.getGridLoc()),
|
|
||||||
VECTOR_DENSITY_FACTOR / BARB_SCALE_FACTOR,
|
|
||||||
false, visTypeToDisplayType(type),
|
|
||||||
vectorConfig));
|
|
||||||
break;
|
|
||||||
|
|
||||||
case IMAGE:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
statusHandler.handle(
|
|
||||||
Priority.PROBLEM,
|
|
||||||
"Unsupported Visualization Type: "
|
|
||||||
+ type.toString());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (gs instanceof ScalarGridSlice) {
|
}
|
||||||
ScalarGridSlice scalarSlice = (ScalarGridSlice) gs;
|
} else if (gs instanceof DiscreteGridSlice) {
|
||||||
Grid2DBit mask = parm.getDisplayAttributes()
|
DiscreteGridSlice slice = (DiscreteGridSlice) gs;
|
||||||
.getDisplayMask();
|
|
||||||
|
|
||||||
if (dataManager.getParmManager().iscMode() || iscParm) {
|
// Dispose all of the outlineShapes and shadedShapes
|
||||||
scalarSlice = new ScalarGridSlice();
|
for (IWireframeShape shape : outlineShapes.values()) {
|
||||||
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
shape.dispose();
|
||||||
new GridID(this.parm, this.dataManager
|
}
|
||||||
.getSpatialDisplayManager()
|
outlineShapes.clear();
|
||||||
.getSpatialEditorTime()), true,
|
|
||||||
scalarSlice);
|
|
||||||
|
|
||||||
|
for (Collection<IShadedShape> shapeList : shadedShapes.values()) {
|
||||||
|
for (IShadedShape shadedShape : shapeList) {
|
||||||
|
shadedShape.dispose();
|
||||||
}
|
}
|
||||||
Grid2DFloat scalarGrid = scalarSlice.getScalarGrid();
|
shapeList.clear();
|
||||||
if (scalarGrid != null) {
|
}
|
||||||
Grid2DFloat maskedGrid = new Grid2DFloat(
|
shadedShapes.clear();
|
||||||
scalarGrid.getXdim(), scalarGrid.getYdim(),
|
|
||||||
Float.NaN);
|
|
||||||
maskedGrid.copyWithMask(scalarGrid, mask);
|
|
||||||
|
|
||||||
FloatBuffer fb = maskedGrid.getBuffer();
|
Grid2DBit mask = parm.getDisplayAttributes().getDisplayMask();
|
||||||
if (visTypes.contains(VisualizationType.IMAGE)) {
|
|
||||||
this.gridDisplay = new GriddedImageDisplay(fb,
|
if (dataManager.getParmManager().iscMode() || iscParm) {
|
||||||
descriptor, this.gridGeometry);
|
slice = new DiscreteGridSlice();
|
||||||
|
GridID gid = new GridID(parm, this.curTime.getRefTime());
|
||||||
|
mask = dataManager.getIscDataAccess().getCompositeGrid(gid,
|
||||||
|
true, slice);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (DiscreteKey discreteKey : slice.getKeys()) {
|
||||||
|
|
||||||
|
if (discreteKey.isValid()) {
|
||||||
|
outlineShapes.put(discreteKey, target
|
||||||
|
.createWireframeShape(false, this.descriptor));
|
||||||
|
|
||||||
|
Collection<IShadedShape> shapeList = new ArrayList<IShadedShape>();
|
||||||
|
shadedShapes.put(discreteKey, shapeList);
|
||||||
|
|
||||||
|
WxValue wxValue = new DiscreteWxValue(discreteKey, parm);
|
||||||
|
|
||||||
|
List<ImageAttr> fillAttrs = DiscreteDisplayUtil
|
||||||
|
.getFillAttributes(wxValue);
|
||||||
|
|
||||||
|
boolean first = true;
|
||||||
|
for (ImageAttr attr : fillAttrs) {
|
||||||
|
IShadedShape shadedShape = target
|
||||||
|
.createShadedShape(false,
|
||||||
|
this.descriptor.getGridGeometry(),
|
||||||
|
true);
|
||||||
|
shapeList.add(shadedShape);
|
||||||
|
|
||||||
|
IWireframeShape outlineShape = first ? outlineShapes
|
||||||
|
.get(discreteKey) : null;
|
||||||
|
first = false;
|
||||||
|
|
||||||
|
JTSCompiler jtsCompiler = new JTSCompiler(
|
||||||
|
shadedShape, outlineShape, this.descriptor);
|
||||||
|
|
||||||
|
byte[] fillPattern = FillPatterns.getGLPattern(attr
|
||||||
|
.getFillPatternName());
|
||||||
|
|
||||||
|
RGB fillColor = RGBColors.getRGBColor(attr
|
||||||
|
.getColorName());
|
||||||
|
|
||||||
|
Grid2DBit tmpBit = slice.eq(discreteKey).and(mask);
|
||||||
|
|
||||||
|
ReferenceData refData = new ReferenceData(gs
|
||||||
|
.getGridInfo().getGridLoc(),
|
||||||
|
new ReferenceID("temp"), tmpBit);
|
||||||
|
|
||||||
|
jtsCompiler.handle(
|
||||||
|
refData.getPolygons(CoordinateType.LATLON),
|
||||||
|
fillColor);
|
||||||
|
shadedShape.compile();
|
||||||
|
shadedShape.setFillPattern(fillPattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visTypes.contains(VisualizationType.CONTOUR)) {
|
outlineShapes.get(discreteKey).compile();
|
||||||
this.contourDisplay = new GriddedContourDisplay(
|
|
||||||
descriptor, this.gridGeometry, fb);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (gs instanceof DiscreteGridSlice) {
|
}
|
||||||
DiscreteGridSlice slice = (DiscreteGridSlice) gs;
|
} else if (gs instanceof WeatherGridSlice) {
|
||||||
|
WeatherGridSlice slice = (WeatherGridSlice) gs;
|
||||||
|
|
||||||
// Dispose all of the outlineShapes and shadedShapes
|
// Dispose all of the outlineShapes and shadedShapes
|
||||||
for (IWireframeShape shape : outlineShapes.values()) {
|
for (IWireframeShape shape : outlineShapes.values()) {
|
||||||
shape.dispose();
|
shape.dispose();
|
||||||
|
}
|
||||||
|
outlineShapes.clear();
|
||||||
|
|
||||||
|
for (Collection<IShadedShape> shapeList : shadedShapes.values()) {
|
||||||
|
for (IShadedShape shadedShape : shapeList) {
|
||||||
|
shadedShape.dispose();
|
||||||
}
|
}
|
||||||
outlineShapes.clear();
|
shapeList.clear();
|
||||||
|
}
|
||||||
|
shadedShapes.clear();
|
||||||
|
|
||||||
for (Collection<IShadedShape> shapeList : shadedShapes
|
Grid2DBit mask = parm.getDisplayAttributes().getDisplayMask();
|
||||||
.values()) {
|
|
||||||
for (IShadedShape shadedShape : shapeList) {
|
|
||||||
shadedShape.dispose();
|
|
||||||
}
|
|
||||||
shapeList.clear();
|
|
||||||
}
|
|
||||||
shadedShapes.clear();
|
|
||||||
|
|
||||||
Grid2DBit mask = parm.getDisplayAttributes()
|
if (dataManager.getParmManager().iscMode() || iscParm) {
|
||||||
.getDisplayMask();
|
slice = new WeatherGridSlice();
|
||||||
|
GridID gid = new GridID(parm, this.curTime.getRefTime());
|
||||||
|
mask = dataManager.getIscDataAccess().getCompositeGrid(gid,
|
||||||
|
true, slice);
|
||||||
|
}
|
||||||
|
|
||||||
if (dataManager.getParmManager().iscMode() || iscParm) {
|
for (WeatherKey weatherKey : slice.getKeys()) {
|
||||||
slice = new DiscreteGridSlice();
|
|
||||||
GridID gid = new GridID(parm, this.dataManager
|
|
||||||
.getSpatialDisplayManager()
|
|
||||||
.getSpatialEditorTime());
|
|
||||||
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
|
||||||
gid, true, slice);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (DiscreteKey discreteKey : slice.getKeys()) {
|
if (weatherKey.isValid()) {
|
||||||
|
outlineShapes.put(weatherKey, target
|
||||||
|
.createWireframeShape(false, this.descriptor));
|
||||||
|
|
||||||
if (discreteKey.isValid()) {
|
Collection<IShadedShape> shapeList = new ArrayList<IShadedShape>();
|
||||||
outlineShapes.put(discreteKey, target
|
shadedShapes.put(weatherKey, shapeList);
|
||||||
.createWireframeShape(false,
|
|
||||||
this.descriptor));
|
|
||||||
|
|
||||||
Collection<IShadedShape> shapeList = new ArrayList<IShadedShape>();
|
WxValue wxValue = new WeatherWxValue(weatherKey, parm);
|
||||||
shadedShapes.put(discreteKey, shapeList);
|
|
||||||
|
|
||||||
WxValue wxValue = new DiscreteWxValue(discreteKey,
|
List<ImageAttr> fillAttrs = DiscreteDisplayUtil
|
||||||
parm);
|
.getFillAttributes(wxValue);
|
||||||
|
|
||||||
List<ImageAttr> fillAttrs = DiscreteDisplayUtil
|
boolean first = true;
|
||||||
.getFillAttributes(wxValue);
|
for (ImageAttr attr : fillAttrs) {
|
||||||
|
IShadedShape shadedShape = target
|
||||||
|
.createShadedShape(false,
|
||||||
|
this.descriptor.getGridGeometry(),
|
||||||
|
true);
|
||||||
|
shapeList.add(shadedShape);
|
||||||
|
|
||||||
boolean first = true;
|
IWireframeShape outlineShape = first ? outlineShapes
|
||||||
for (ImageAttr attr : fillAttrs) {
|
.get(weatherKey) : null;
|
||||||
IShadedShape shadedShape = target
|
first = false;
|
||||||
.createShadedShape(false,
|
|
||||||
this.descriptor, true);
|
|
||||||
shapeList.add(shadedShape);
|
|
||||||
|
|
||||||
IWireframeShape outlineShape = first ? outlineShapes
|
JTSCompiler jtsCompiler = new JTSCompiler(
|
||||||
.get(discreteKey) : null;
|
shadedShape, outlineShape, this.descriptor);
|
||||||
first = false;
|
|
||||||
|
|
||||||
JTSCompiler jtsCompiler = new JTSCompiler(
|
byte[] fillPattern = FillPatterns.getGLPattern(attr
|
||||||
shadedShape, outlineShape,
|
.getFillPatternName());
|
||||||
this.descriptor);
|
|
||||||
|
|
||||||
byte[] fillPattern = FillPatterns
|
RGB fillColor = RGBColors.getRGBColor(attr
|
||||||
.getGLPattern(attr.getFillPatternName());
|
.getColorName());
|
||||||
|
|
||||||
RGB fillColor = RGBColors.getRGBColor(attr
|
Grid2DBit tmpBit = slice.eq(weatherKey).and(mask);
|
||||||
.getColorName());
|
|
||||||
|
|
||||||
Grid2DBit tmpBit = slice.eq(discreteKey).and(
|
ReferenceData refData = new ReferenceData(gs
|
||||||
mask);
|
.getGridInfo().getGridLoc(),
|
||||||
|
new ReferenceID("temp"), tmpBit);
|
||||||
|
|
||||||
ReferenceData refData = new ReferenceData(gs
|
jtsCompiler.handle(
|
||||||
.getGridInfo().getGridLoc(),
|
refData.getPolygons(CoordinateType.LATLON),
|
||||||
new ReferenceID("temp"), tmpBit);
|
fillColor);
|
||||||
|
shadedShape.compile();
|
||||||
|
shadedShape.setFillPattern(fillPattern);
|
||||||
|
} // next diIdx
|
||||||
|
|
||||||
jtsCompiler.handle(refData
|
outlineShapes.get(weatherKey).compile();
|
||||||
.getPolygons(CoordinateType.LATLON),
|
|
||||||
fillColor);
|
|
||||||
shadedShape.compile();
|
|
||||||
shadedShape.setFillPattern(fillPattern);
|
|
||||||
}
|
|
||||||
|
|
||||||
outlineShapes.get(discreteKey).compile();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (gs instanceof WeatherGridSlice) {
|
|
||||||
WeatherGridSlice slice = (WeatherGridSlice) gs;
|
|
||||||
|
|
||||||
// Dispose all of the outlineShapes and shadedShapes
|
|
||||||
for (IWireframeShape shape : outlineShapes.values()) {
|
|
||||||
shape.dispose();
|
|
||||||
}
|
|
||||||
outlineShapes.clear();
|
|
||||||
|
|
||||||
for (Collection<IShadedShape> shapeList : shadedShapes
|
|
||||||
.values()) {
|
|
||||||
for (IShadedShape shadedShape : shapeList) {
|
|
||||||
shadedShape.dispose();
|
|
||||||
}
|
|
||||||
shapeList.clear();
|
|
||||||
}
|
|
||||||
shadedShapes.clear();
|
|
||||||
|
|
||||||
Grid2DBit mask = parm.getDisplayAttributes()
|
|
||||||
.getDisplayMask();
|
|
||||||
|
|
||||||
if (dataManager.getParmManager().iscMode() || iscParm) {
|
|
||||||
slice = new WeatherGridSlice();
|
|
||||||
GridID gid = new GridID(parm, this.dataManager
|
|
||||||
.getSpatialDisplayManager()
|
|
||||||
.getSpatialEditorTime());
|
|
||||||
mask = dataManager.getIscDataAccess().getCompositeGrid(
|
|
||||||
gid, true, slice);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (WeatherKey weatherKey : slice.getKeys()) {
|
|
||||||
|
|
||||||
if (weatherKey.isValid()) {
|
|
||||||
outlineShapes.put(weatherKey, target
|
|
||||||
.createWireframeShape(false,
|
|
||||||
this.descriptor));
|
|
||||||
|
|
||||||
Collection<IShadedShape> shapeList = new ArrayList<IShadedShape>();
|
|
||||||
shadedShapes.put(weatherKey, shapeList);
|
|
||||||
|
|
||||||
WxValue wxValue = new WeatherWxValue(weatherKey,
|
|
||||||
parm);
|
|
||||||
|
|
||||||
List<ImageAttr> fillAttrs = DiscreteDisplayUtil
|
|
||||||
.getFillAttributes(wxValue);
|
|
||||||
|
|
||||||
boolean first = true;
|
|
||||||
for (ImageAttr attr : fillAttrs) {
|
|
||||||
IShadedShape shadedShape = target
|
|
||||||
.createShadedShape(false,
|
|
||||||
this.descriptor, true);
|
|
||||||
shapeList.add(shadedShape);
|
|
||||||
|
|
||||||
IWireframeShape outlineShape = first ? outlineShapes
|
|
||||||
.get(weatherKey) : null;
|
|
||||||
first = false;
|
|
||||||
|
|
||||||
JTSCompiler jtsCompiler = new JTSCompiler(
|
|
||||||
shadedShape, outlineShape,
|
|
||||||
this.descriptor);
|
|
||||||
|
|
||||||
byte[] fillPattern = FillPatterns
|
|
||||||
.getGLPattern(attr.getFillPatternName());
|
|
||||||
|
|
||||||
RGB fillColor = RGBColors.getRGBColor(attr
|
|
||||||
.getColorName());
|
|
||||||
|
|
||||||
Grid2DBit tmpBit = slice.eq(weatherKey).and(
|
|
||||||
mask);
|
|
||||||
|
|
||||||
ReferenceData refData = new ReferenceData(gs
|
|
||||||
.getGridInfo().getGridLoc(),
|
|
||||||
new ReferenceID("temp"), tmpBit);
|
|
||||||
|
|
||||||
jtsCompiler.handle(refData
|
|
||||||
.getPolygons(CoordinateType.LATLON),
|
|
||||||
fillColor);
|
|
||||||
shadedShape.compile();
|
|
||||||
shadedShape.setFillPattern(fillPattern);
|
|
||||||
} // next diIdx
|
|
||||||
|
|
||||||
outlineShapes.get(weatherKey).compile();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (this.curTime == null) {
|
|
||||||
if (this.gridDisplay != null) {
|
|
||||||
this.gridDisplay.dispose();
|
|
||||||
this.gridDisplay = null;
|
|
||||||
}
|
|
||||||
this.lastDisplayedTime = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float brightness = 1.0f;
|
float brightness = 1.0f;
|
||||||
|
|
Loading…
Add table
Reference in a new issue