Merge "Omaha #3072 Remove RadarRecord dependency for Radial Mesh." into omaha_14.4.1

Former-commit-id: af46dfd419 [formerly c9696dbd3b] [formerly 791ab4913c] [formerly af46dfd419 [formerly c9696dbd3b] [formerly 791ab4913c] [formerly 4bd68c8bd0 [formerly 791ab4913c [formerly 3a87ec22c684ea4abab3a6328cc50682c5315cb9]]]]
Former-commit-id: 4bd68c8bd0
Former-commit-id: 05c81f432b [formerly 299c77f875] [formerly 8061c2ddd36f44e33ab8f0c40752fafbbbe7409b [formerly ce7812983a]]
Former-commit-id: 98f991d11bbde4854fbbda437ae830942345566a [formerly 374fb4373e]
Former-commit-id: 124d873714
This commit is contained in:
Nate Jensen 2014-06-25 09:54:38 -05:00 committed by Gerrit Code Review
commit 9afe98bf2b
20 changed files with 463 additions and 372 deletions

View file

@ -1,8 +0,0 @@
#Thu Apr 12 17:10:20 CDT 2012
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,20 +2,14 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Radar Collaboration
Bundle-SymbolicName: com.raytheon.uf.viz.collaboration.radar;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.raytheon.uf.viz.collaboration.radar.Activator
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
Require-Bundle: org.eclipse.core.runtime,
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0",
com.raytheon.viz.radar;bundle-version="1.12.1174",
com.raytheon.uf.viz.remote.graphics;bundle-version="1.0.0",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
org.geotools;bundle-version="2.6.4",
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.raytheon.uf.viz.collaboration.display;bundle-version="1.0.0",
com.raytheon.uf.viz.collaboration.comm;bundle-version="1.0.0",
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Eclipse-RegisterBuddy: com.raytheon.uf.viz.core
Require-Bundle: com.raytheon.uf.viz.core;bundle-version="1.14",
com.raytheon.viz.radar;bundle-version="1.14",
com.raytheon.uf.viz.remote.graphics;bundle-version="1.14",
com.raytheon.uf.common.geospatial;bundle-version="1.14",
com.raytheon.uf.viz.collaboration.display;bundle-version="1.13",
com.raytheon.uf.viz.collaboration.comm;bundle-version="1.14"

View file

@ -1,30 +0,0 @@
package com.raytheon.uf.viz.collaboration.radar;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}

View file

@ -21,11 +21,11 @@ package com.raytheon.uf.viz.collaboration.radar.mesh;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.serialization.annotations.DynamicSerialize;
import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement;
import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent;
import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData;
/**
* Event class used to specify the creation of a radar radial mesh
@ -34,9 +34,11 @@ import com.raytheon.uf.viz.remote.graphics.events.ICreationEvent;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 16, 2012 mschenke Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 16, 2012 mschenke Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -77,37 +79,29 @@ public class CreateRadarRadialMesh extends AbstractDispatchingObjectEvent
@DynamicSerializeElement
private GeneralGridGeometry targetGeometry;
/**
* @return the radarRecord
*/
public RadarRecord getRadarRecord() {
RadarRecord radarRecord = new RadarRecord();
public RadialMeshData getMeshData() {
RadialMeshData radarRecord = new RadialMeshData();
radarRecord.setAngleData(angleData);
radarRecord.setFormat(format);
radarRecord.setGateResolution(gateResolution);
radarRecord.setJstart(jstart);
radarRecord.setBinWidth(gateResolution);
radarRecord.setFirstBin(jstart);
radarRecord.setLatitude(latitude);
radarRecord.setLongitude(longitude);
radarRecord.setNumBins(numBins);
radarRecord.setNumRadials(numRadials);
radarRecord.setTrueElevationAngle(trueElevationAngle);
radarRecord.setTiltAngle(trueElevationAngle);
return radarRecord;
}
/**
* @param radarRecord
* the radarRecord to set
*/
public void setRadarRecord(RadarRecord radarRecord) {
public void setMeshData(RadialMeshData radarRecord) {
this.angleData = radarRecord.getAngleData();
this.format = radarRecord.getFormat();
this.gateResolution = radarRecord.getGateResolution();
this.jstart = radarRecord.getJstart();
this.format = "Radial";
this.gateResolution = radarRecord.getBinWidth();
this.jstart = radarRecord.getFirstBin();
this.latitude = radarRecord.getLatitude();
this.longitude = radarRecord.getLongitude();
this.numBins = radarRecord.getNumBins();
this.numRadials = radarRecord.getNumRadials();
this.trueElevationAngle = radarRecord.getTrueElevationAngle();
this.trueElevationAngle = radarRecord.getTiltAngle();
}
/**

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.collaboration.radar.mesh;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
@ -38,9 +37,11 @@ import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 13, 2012 mschenke Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 13, 2012 mschenke Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -57,19 +58,19 @@ public class DispatchingRadarMeshExtension extends
*
* @see
* com.raytheon.viz.radar.rsc.image.IRadialMeshExtension#constructMesh(com
* .raytheon.uf.common.dataplugin.radar.RadarRecord,
* .raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData,
* org.geotools.coverage.grid.GeneralGridGeometry)
*/
@Override
public IMesh constructMesh(RadarRecord radarData,
public IMesh constructMesh(RadialMeshData meshData,
GeneralGridGeometry targetGeometry) throws VizException {
DispatchingMesh wrapping = new DispatchingMesh(target
.getWrappedObject().getExtension(IRadialMeshExtension.class)
.constructMesh(radarData, targetGeometry),
.constructMesh(meshData, targetGeometry),
target.getDispatcher());
CreateRadarRadialMesh create = RemoteGraphicsEventFactory.createEvent(
CreateRadarRadialMesh.class, wrapping);
create.setRadarRecord(radarData);
create.setMeshData(meshData);
create.setTargetGeometry(targetGeometry);
target.dispatch(create);
return wrapping;

View file

@ -35,9 +35,11 @@ import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Apr 17, 2012 mschenke Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Apr 17, 2012 mschenke Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -56,7 +58,7 @@ public class RadarGraphicsExtRenderingHandler extends
dataManager.putRenderableObject(
meshId,
target.getExtension(IRadialMeshExtension.class)
.constructMesh(event.getRadarRecord(),
.constructMesh(event.getMeshData(),
event.getTargetGeometry()));
} catch (VizException e) {
Activator.statusHandler.handle(Priority.PROBLEM,

View file

@ -20,18 +20,14 @@
package com.raytheon.uf.viz.kml.export.graphics.ext.radar;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.referencing.FactoryException;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.projection.RadarProjectionFactory;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.kml.export.graphics.KmlGraphicsTarget;
import com.raytheon.uf.viz.kml.export.graphics.ext.KmlMesh;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Creates a KMLMesh by constructing a RadialBinCRS based CrigGeometry object.
@ -40,9 +36,11 @@ import com.vividsolutions.jts.geom.Coordinate;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 6, 2012 bsteffen Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 06, 2012 bsteffen Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -58,21 +56,16 @@ public class KmlRadialMeshExtension extends
return Compatibilty.TARGET_COMPATIBLE;
}
@Override
public IMesh constructMesh(RadarRecord record,
public IMesh constructMesh(RadialMeshData meshData,
GeneralGridGeometry targetGeometry) throws VizException {
GridGeometry2D imageGeometry;
try {
imageGeometry = RadarProjectionFactory
.constructGridGeometry(new Coordinate(
record.getLongitude(), record.getLatitude()),
record.getAngleData(), record.getGateResolution(),
record.getTrueElevationAngle(),
record.getNumBins(), true);
return new KmlMesh(meshData.getGridGeometry());
} catch (FactoryException e) {
throw new VizException(e);
}
return new KmlMesh(imageGeometry);
}
}

View file

@ -1,7 +0,0 @@
#Tue May 25 15:06:45 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -1,21 +1,12 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: RadarGL Plug-in
Bundle-Name: Radar GL Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.radar.gl;singleton:=true
Bundle-Version: 1.12.1174.qualifier
Bundle-Activator: com.raytheon.uf.viz.radar.gl.Activator
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Require-Bundle: org.eclipse.core.runtime,
com.raytheon.viz.radar;bundle-version="1.11.31",
com.raytheon.viz.core.gl;bundle-version="1.11.31",
com.raytheon.uf.viz.core;bundle-version="1.12.2",
javax.media.opengl;bundle-version="1.1.0",
org.eclipse.ui,
com.raytheon.viz.core;bundle-version="1.12.2",
org.geotools;bundle-version="2.6.4",
javax.measure;bundle-version="1.0.0",
com.raytheon.uf.common.util;bundle-version="1.12.1112",
com.raytheon.uf.common.colormap;bundle-version="1.12.1120",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: com.raytheon.viz.radar;bundle-version="1.14",
com.raytheon.viz.core.gl;bundle-version="1.14",
com.raytheon.uf.viz.core;bundle-version="1.14",
com.raytheon.uf.common.geospatial;bundle-version="1.14"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy

View file

@ -1,50 +0,0 @@
package com.raytheon.uf.viz.radar.gl;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.raytheon.uf.viz.radar.gl";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View file

@ -21,7 +21,6 @@ package com.raytheon.uf.viz.radar.gl;
import org.geotools.coverage.grid.GeneralGridGeometry;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
@ -34,9 +33,11 @@ import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 19, 2010 mschenke Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 19, 2010 mschenke Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -51,20 +52,14 @@ public class GLRadialMeshExtension extends GraphicsExtension<IGLTarget>
* (non-Javadoc)
*
* @see
* com.raytheon.viz.radar.IRadarGraphicsFactoryAdapter#constructMesh(com
* .raytheon.uf.viz.core.cache.CacheObject,
* com.raytheon.uf.viz.core.drawables.IDescriptor)
* com.raytheon.viz.radar.rsc.image.IRadialMeshExtension#constructMesh(com
* .raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData,
* org.geotools.coverage.grid.GeneralGridGeometry)
*/
@Override
public IMesh constructMesh(RadarRecord radarData,
public IMesh constructMesh(RadialMeshData meshData,
GeneralGridGeometry targetGeometry) throws VizException {
String format = radarData.getFormat();
if ("Radial".equals(format)) {
return RadarRadialMesh.getMesh(radarData, targetGeometry);
} else {
throw new VizException(
"Cannot construct radial meshes for non radial RadarRecords");
}
return RadarRadialMesh.getMesh(meshData, targetGeometry);
}
/*

View file

@ -19,7 +19,6 @@
**/
package com.raytheon.uf.viz.radar.gl;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
@ -27,17 +26,20 @@ import javax.media.opengl.GL;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.referencing.crs.ProjectedCRS;
import org.opengis.referencing.operation.MathTransform;
import org.opengis.referencing.operation.TransformException;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.util.RadarUtil;
import com.raytheon.uf.common.geospatial.CRSCache;
import com.raytheon.uf.common.geospatial.MapUtil;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.viz.core.gl.AbstractGLMesh;
import com.raytheon.viz.core.gl.SharedCoordMap.SharedCoordinateKey;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData;
/**
* Mesh for radar data. Uses GL_TRIANGLE_STRIPS. density is every 2^n-th bin,
@ -45,10 +47,12 @@ import com.raytheon.viz.core.gl.SharedCoordMap.SharedCoordinateKey;
*
*
* <pre>
*
* SOFTWARE HISTORY Date Ticket# Engineer Description ------------ ----------
* ----------- -------------------------- Jun 10, 2010 mschenke Initial creation
* OCT 09, 2012 15018 kshresth
* * Date Ticket# Engineer Description
* ------------- -------- ----------- -------------- ------------
* Jun 10, 2010 mschenke Initial creation
* Oct 09, 2012 15018 kshresth
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
* </pre>
*
* @author mschenke
@ -56,60 +60,28 @@ import com.raytheon.viz.core.gl.SharedCoordMap.SharedCoordinateKey;
*/
public class RadarRadialMesh extends AbstractGLMesh {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(RadarRadialMesh.class);
private static class CacheKey {
private final float latitude;
private final float longitude;
private final int hashCode;
private final int numBins;
private final int numRadials;
private final int gateResolution;
private final float trueElevationAngle;
private final int jStart;
private final float[] angleData;
private final RadialMeshData data;
private final GeneralGridGeometry gridGeometry;
public CacheKey(float latitude, float longitude, int numBins,
int numRadials, int gateResolution, float trueElevationAngle,
int jStart, float[] angleData, GeneralGridGeometry gridGeometry) {
this.latitude = latitude;
this.longitude = longitude;
this.numBins = numBins;
this.numRadials = numRadials;
this.gateResolution = gateResolution;
this.trueElevationAngle = trueElevationAngle;
this.jStart = jStart;
this.angleData = angleData;
public CacheKey(RadialMeshData data, GeneralGridGeometry gridGeometry) {
this.data = data;
this.gridGeometry = gridGeometry;
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + Arrays.hashCode(angleData);
hashCode = prime * hashCode + gateResolution;
hashCode = prime * hashCode + jStart;
hashCode = prime * hashCode + Float.floatToIntBits(latitude);
hashCode = prime * hashCode + Float.floatToIntBits(longitude);
hashCode = prime * hashCode + numBins;
hashCode = prime * hashCode + numRadials;
hashCode = prime * hashCode
+ Float.floatToIntBits(trueElevationAngle);
hashCode = prime * hashCode + gridGeometry.hashCode();
this.hashCode = hashCode;
}
@Override
public int hashCode() {
return hashCode;
final int prime = 31;
int result = 1;
result = prime * result + ((data == null) ? 0 : data.hashCode());
result = prime * result
+ ((gridGeometry == null) ? 0 : gridGeometry.hashCode());
return result;
}
@Override
@ -121,57 +93,42 @@ public class RadarRadialMesh extends AbstractGLMesh {
if (getClass() != obj.getClass())
return false;
CacheKey other = (CacheKey) obj;
if (hashCode != other.hashCode)
if (data == null) {
if (other.data != null)
return false;
} else if (!data.equals(other.data))
return false;
if (gateResolution != other.gateResolution)
if (gridGeometry == null) {
if (other.gridGeometry != null)
return false;
} else if (!gridGeometry.equals(other.gridGeometry))
return false;
if (jStart != other.jStart)
return false;
if (latitude != other.latitude)
return false;
if (longitude != other.longitude)
return false;
if (numBins != other.numBins)
return false;
if (numRadials != other.numRadials)
return false;
if (Float.floatToIntBits(trueElevationAngle) != Float
.floatToIntBits(other.trueElevationAngle))
return false;
if (!Arrays.equals(angleData, other.angleData))
return false;
if (gridGeometry != null && other.gridGeometry == null) {
return false;
}
if (gridGeometry == null && other.gridGeometry != null) {
return false;
}
if (gridGeometry != null
&& !gridGeometry.equals(other.gridGeometry)) {
return false;
}
return true;
}
}
private static Map<CacheKey, RadarRadialMesh> cache = new HashMap<CacheKey, RadarRadialMesh>();
/** The record to build the mesh for */
private RadarRecord record;
private RadialMeshData data;
private CacheKey cacheKey;
public RadarRadialMesh(RadarRecord record,
public RadarRadialMesh(RadialMeshData data,
GeneralGridGeometry targetGeometry, CacheKey cacheKey)
throws VizException {
super(GL.GL_TRIANGLE_STRIP);
this.record = record;
this.data = data;
this.cacheKey = cacheKey;
initialize(
RadarUtil.constructGridGeometry(record.getCRS(),
RadarUtil.calculateExtent(record),
Math.max(record.getNumBins(), record.getNumRadials())),
targetGeometry);
ProjectedCRS crs = CRSCache.getInstance().constructStereographic(
MapUtil.AWIPS_EARTH_RADIUS, MapUtil.AWIPS_EARTH_RADIUS,
data.getLatitude(), data.getLongitude());
GridGeometry2D gridGeometry = RadarUtil.constructGridGeometry(crs,
RadarUtil.calculateExtent(data.getNumBins(),
data.getFirstBin(), data.getBinWidth(),
(double) data.getTiltAngle(), "Radial"), Math.max(
data.getNumBins(), data.getNumRadials()));
initialize(gridGeometry, targetGeometry);
}
@Override
@ -185,7 +142,7 @@ public class RadarRadialMesh extends AbstractGLMesh {
float dX = (1.0f / (key.horizontalDivisions));
// set up our angle data for the radials
float[] angles = record.getAngleData();
float[] angles = data.getAngleData();
int height = 2 * verticalDivisions;
int width = horizontalDivisions;
@ -222,13 +179,13 @@ public class RadarRadialMesh extends AbstractGLMesh {
sinAngles[sinAngles.length - 1] = Math.sin(Math.toRadians(lastAngle));
// precalculated bin value
double calculatedVal = record.getNumBins() * record.getGateResolution()
* Math.cos(Math.toRadians(record.getTrueElevationAngle()));
double calculatedVal = data.getNumBins() * data.getBinWidth()
* Math.cos(Math.toRadians(data.getTiltAngle()));
double startRange = 0;
if (record.getJstart() != null) {
startRange = record.getJstart() * record.getGateResolution()
* Math.cos(Math.toRadians(record.getTrueElevationAngle()));
if (data.getFirstBin() != 0) {
startRange = data.getFirstBin() * data.getFirstBin()
* Math.cos(Math.toRadians(data.getTiltAngle()));
}
double rangeHigh = startRange, rangeLow;
@ -273,30 +230,27 @@ public class RadarRadialMesh extends AbstractGLMesh {
protected SharedCoordinateKey generateKey(GridGeometry2D imageGeometry,
MathTransform mt) {
try {
return new SharedCoordinateKey(record.getNumRadials(),
getNumVerticalDivisions(mt, record));
return new SharedCoordinateKey(data.getNumRadials(),
getNumVerticalDivisions(mt));
} catch (Exception e) {
statusHandler
.handle(Priority.PROBLEM,
"Error calculating divisions needed for radar, defaulting to 10",
e);
return new SharedCoordinateKey(record.getNumRadials(), 10);
return new SharedCoordinateKey(data.getNumRadials(), 10);
}
}
private static final double THRESHOLD = 0.1;
private int getNumVerticalDivisions(MathTransform toLatLon,
RadarRecord record) throws Exception {
float[] angles = record.getAngleData();
int numBins = record.getNumBins();
int startBin = 0;
if (record.getJstart() != null) {
startBin = record.getJstart();
}
private int getNumVerticalDivisions(MathTransform toLatLon)
throws Exception {
float[] angles = data.getAngleData();
int numBins = data.getNumBins();
int startBin = data.getFirstBin();
double calculatedVal = record.getGateResolution()
* Math.cos(Math.toRadians(record.getTrueElevationAngle()));
double calculatedVal = data.getBinWidth()
* Math.cos(Math.toRadians(data.getTiltAngle()));
double[] in = new double[2];
double[] out = new double[3];
@ -396,33 +350,19 @@ public class RadarRadialMesh extends AbstractGLMesh {
}
}
public static RadarRadialMesh getMesh(RadarRecord radarData,
public static RadarRadialMesh getMesh(RadialMeshData data,
GeneralGridGeometry targetGeometry) throws VizException {
float latitude = radarData.getLatitude();
float longitude = radarData.getLongitude();
int numBins = radarData.getNumBins();
int numRadials = radarData.getNumRadials();
int gateResolution = radarData.getGateResolution();
float trueElevationAngle = radarData.getTrueElevationAngle();
Integer jStart = radarData.getJstart();
if (jStart == null) {
jStart = 0;
// check if numBins and numRadials equals to zero, then angleData does
// not exist
if (data.getNumBins() == 0 && data.getNumRadials() == 0) {
return null;
}
//check if numBins and numRadials equals to zero, then angleData does not exist
if (numBins == 0 && numRadials == 0 ) {
return null;
}
float[] angleData = radarData.getAngleData();
CacheKey key = new CacheKey(latitude, longitude, numBins, numRadials,
gateResolution, trueElevationAngle, jStart, angleData,
targetGeometry);
CacheKey key = new CacheKey(data, targetGeometry);
synchronized (cache) {
RadarRadialMesh mesh = cache.get(key);
if (mesh == null) {
// System.out.println("Mesh Cache miss");
mesh = new RadarRadialMesh(radarData, targetGeometry, key);
mesh = new RadarRadialMesh(data, targetGeometry, key);
cache.put(key, mesh);
} else {
mesh.use();
@ -435,6 +375,6 @@ public class RadarRadialMesh extends AbstractGLMesh {
@Override
public RadarRadialMesh clone(GeneralGridGeometry targetGeometry)
throws VizException {
return getMesh(record, targetGeometry);
return getMesh(data, targetGeometry);
}
}

View file

@ -1,7 +0,0 @@
#Thu Mar 26 11:01:38 CDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,11 +2,11 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Radar Plug-in
Bundle-SymbolicName: com.raytheon.viz.radar;singleton:=true
Bundle-Version: 1.12.1174.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Activator: com.raytheon.viz.radar.Activator
Bundle-Vendor: Raytheon
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization, com.raytheon.uf.viz.core
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Export-Package: com.raytheon.viz.radar,
com.raytheon.viz.radar.interrogators,
com.raytheon.viz.radar.rsc,
@ -16,38 +16,35 @@ Export-Package: com.raytheon.viz.radar,
com.raytheon.viz.radar.ui,
com.raytheon.viz.radar.ui.xy,
com.raytheon.viz.radar.util
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
org.eclipse.ui;bundle-version="3.8.2",
com.raytheon.uf.common.serialization;bundle-version="1.12.1174",
com.raytheon.uf.common.units;bundle-version="1.0.0",
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.0.0";visibility:=reexport,
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
com.raytheon.uf.common.topo;bundle-version="1.12.1174",
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
com.raytheon.uf.viz.d2d.core;bundle-version="1.12.1174",
com.raytheon.uf.viz.d2d.ui;bundle-version="1.12.1174",
com.raytheon.viz.ui;bundle-version="1.12.1174",
com.raytheon.uf.viz.xy;bundle-version="1.12.1174",
com.raytheon.viz.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.viz.productbrowser;bundle-version="1.12.1174",
com.raytheon.viz.core.graphing;bundle-version="1.12.1174",
com.raytheon.uf.viz.points;bundle-version="1.0.0",
com.raytheon.uf.viz.ui.menus;bundle-version="1.12.1174",
com.raytheon.viz.awipstools;bundle-version="1.12.1174",
org.apache.batik;bundle-version="1.6.0",
com.raytheon.uf.common.units,
com.raytheon.uf.common.colormap,
com.raytheon.uf.common.geospatial;bundle-version="1.14",
com.raytheon.uf.common.util;bundle-version="1.14",
com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.dataplugin.radar;bundle-version="1.14";visibility:=reexport,
com.raytheon.uf.common.datastorage;bundle-version="1.14",
com.raytheon.uf.common.pointdata;bundle-version="1.13",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.14",
com.raytheon.uf.common.topo;bundle-version="1.14",
com.raytheon.uf.viz.core;bundle-version="1.14",
com.raytheon.uf.viz.d2d.core,
com.raytheon.uf.viz.d2d.ui,
com.raytheon.viz.ui;bundle-version="1.14",
com.raytheon.uf.viz.xy;bundle-version="1.14",
com.raytheon.viz.pointdata;bundle-version="1.14",
com.raytheon.uf.viz.productbrowser;bundle-version="1.14",
com.raytheon.viz.core.graphing,
com.raytheon.uf.viz.points,
com.raytheon.uf.viz.ui.menus,
com.raytheon.viz.awipstools,
org.apache.batik;bundle-version="1.6",
com.raytheon.uf.common.wxmath,
com.raytheon.uf.common.style;bundle-version="1.0.0",
com.raytheon.uf.common.derivparam;bundle-version="1.14.0",
com.raytheon.uf.viz.datacube;bundle-version="1.14.0"
Import-Package: com.raytheon.uf.common.comm,
com.raytheon.uf.common.inventory.exception,
com.raytheon.viz.core.contours.util,
com.raytheon.viz.core.rsc,
com.raytheon.uf.common.style,
com.raytheon.uf.common.derivparam;bundle-version="1.14",
com.raytheon.uf.viz.datacube;bundle-version="1.14",
com.raytheon.uf.common.inventory;bundle-version="1.14",
com.raytheon.uf.common.comm,
com.raytheon.viz.core.contours;bundle-version="1.14"
Import-Package: com.raytheon.viz.core.rsc,
com.raytheon.viz.core.rsc.jts

View file

@ -148,4 +148,10 @@
value="Monospaced-regular-12">
</fontDefinition>
</extension>
<extension
point="com.raytheon.uf.viz.core.graphicsExtension">
<graphicsExtension
class="com.raytheon.viz.radar.rsc.image.GeneralRadialMeshExtension">
</graphicsExtension>
</extension>
</plugin>

View file

@ -0,0 +1,68 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.radar.rsc.image;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.opengis.referencing.FactoryException;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.IMapMeshExtension;
/**
*
* Default implementation of {@link IRadialMeshExtension} that just delegates to
* {@link IMapMeshExtension}.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Jun 24, 2014 3072 bsteffen Initial creation
*
* </pre>
*
* @author bsteffen
* @version 1.0
*/
public class GeneralRadialMeshExtension extends
GraphicsExtension<IGraphicsTarget> implements IRadialMeshExtension {
@Override
public int getCompatibilityValue(IGraphicsTarget target) {
return Compatibilty.GENERIC;
}
@Override
public IMesh constructMesh(RadialMeshData meshData,
GeneralGridGeometry targetGeometry) throws VizException {
try {
return target.getExtension(IMapMeshExtension.class).constructMesh(
meshData.getGridGeometry(), targetGeometry);
} catch (FactoryException e) {
throw new VizException(e);
}
}
}

View file

@ -19,12 +19,18 @@
**/
package com.raytheon.viz.radar.rsc.image;
import java.util.Arrays;
import org.geotools.coverage.grid.GeneralGridGeometry;
import org.geotools.coverage.grid.GridGeometry2D;
import org.opengis.referencing.FactoryException;
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
import com.raytheon.uf.common.dataplugin.radar.projection.RadarProjectionFactory;
import com.raytheon.uf.viz.core.IMesh;
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension.IGraphicsExtensionInterface;
import com.raytheon.uf.viz.core.exception.VizException;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Interface for constructing radial meshes for radar records
@ -33,9 +39,11 @@ import com.raytheon.uf.viz.core.exception.VizException;
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Nov 16, 2011 mschenke Initial creation
* Date Ticket# Engineer Description
* ------------- -------- ----------- --------------------------
* Nov 16, 2011 mschenke Initial creation
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -46,14 +54,202 @@ import com.raytheon.uf.viz.core.exception.VizException;
public interface IRadialMeshExtension extends IGraphicsExtensionInterface {
/**
* Construct a mesh to be used for the radar record on the descriptor
* Construct a mesh to be used for the radial data on the targetGeometry
*
* @param radarData
* @param descriptor
* @return
* @throws VizException
*/
public IMesh constructMesh(RadarRecord radarData,
public IMesh constructMesh(RadialMeshData meshData,
GeneralGridGeometry targetGeometry) throws VizException;
public static class RadialMeshData{
/** longitude of center point of radial data. */
private float longitude;
/** latitude of center point of radial data. */
private float latitude;
/** angle(in degrees) of each radial */
private float[] angleData;
/** number of bins */
private int numBins;
/** number of radials */
private int numRadials;
/** width of the bins(in meters) */
private int binWidth;
/** Angle above ground of the tilt of the mesh */
private float tiltAngle;
/**
* When 0 the mesh will start in the center, a larger number will cause
* the mesh to begin firstBin*binWidth meters from the center.
*/
private int firstBin = 0;
public RadialMeshData() {
}
public RadialMeshData(RadarRecord record) {
longitude = record.getLongitude();
latitude = record.getLatitude();
angleData = record.getAngleData();
numBins = record.getNumBins();
numRadials = record.getNumRadials();
binWidth = record.getGateResolution();
tiltAngle = record.getTrueElevationAngle();
Integer jStart = record.getJstart();
if (jStart != null) {
firstBin = jStart;
}
}
public float getLongitude() {
return longitude;
}
public void setLongitude(float longitude) {
this.longitude = longitude;
}
public float getLatitude() {
return latitude;
}
public void setLatitude(float latitude) {
this.latitude = latitude;
}
public float[] getAngleData() {
return angleData;
}
public void setAngleData(float[] angleData) {
this.angleData = angleData;
}
public int getNumBins() {
return numBins;
}
public void setNumBins(int numBins) {
this.numBins = numBins;
}
public int getNumRadials() {
return numRadials;
}
public void setNumRadials(int numRadials) {
this.numRadials = numRadials;
}
public int getBinWidth() {
return binWidth;
}
public void setBinWidth(int binWidth) {
this.binWidth = binWidth;
}
public float getTiltAngle() {
return tiltAngle;
}
public void setTiltAngle(float tiltAngle) {
this.tiltAngle = tiltAngle;
}
public int getFirstBin() {
return firstBin;
}
public void setFirstBin(int firstBin) {
this.firstBin = firstBin;
}
public GridGeometry2D getGridGeometry() throws FactoryException {
return RadarProjectionFactory.constructGridGeometry(new Coordinate(
longitude, latitude), angleData, binWidth, tiltAngle,
numBins, true);
}
@Override
public RadialMeshData clone() {
RadialMeshData clone = new RadialMeshData();
clone.setLongitude(longitude);
clone.setLatitude(latitude);
clone.setAngleData(angleData);
clone.setNumBins(numBins);
clone.setNumRadials(numRadials);
clone.setBinWidth(binWidth);
clone.setTiltAngle(tiltAngle);
clone.setFirstBin(firstBin);
return clone;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + Arrays.hashCode(angleData);
result = prime * result + binWidth;
result = prime * result + firstBin;
result = prime * result + Float.floatToIntBits(latitude);
result = prime * result + Float.floatToIntBits(longitude);
result = prime * result + numBins;
result = prime * result + numRadials;
result = prime * result + Float.floatToIntBits(tiltAngle);
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
RadialMeshData other = (RadialMeshData) obj;
if (!Arrays.equals(angleData, other.angleData))
return false;
if (binWidth != other.binWidth)
return false;
if (firstBin != other.firstBin)
return false;
if (Float.floatToIntBits(latitude) != Float
.floatToIntBits(other.latitude))
return false;
if (Float.floatToIntBits(longitude) != Float
.floatToIntBits(other.longitude))
return false;
if (numBins != other.numBins)
return false;
if (numRadials != other.numRadials)
return false;
if (Float.floatToIntBits(tiltAngle) != Float
.floatToIntBits(other.tiltAngle))
return false;
return true;
}
@Override
public String toString() {
return "RadialMeshData [longitude=" + longitude + ", latitude="
+ latitude + ", numBins=" + numBins + ", numRadials="
+ numRadials + ", binWidth=" + binWidth + ", tiltAngle="
+ tiltAngle + ", firstBin=" + firstBin + "]";
}
}
}

View file

@ -56,6 +56,7 @@ import com.raytheon.viz.radar.interrogators.RadarRadialInterrogator;
import com.raytheon.viz.radar.rsc.RadarImageResource;
import com.raytheon.viz.radar.rsc.RadarProductFactory;
import com.raytheon.viz.radar.rsc.RadarResourceData;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData;
import com.vividsolutions.jts.geom.Coordinate;
/**
@ -71,6 +72,8 @@ import com.vividsolutions.jts.geom.Coordinate;
* Jul 31, 2013 2190 mschenke Convert interrogate string "msl" to
* Measure and put in as "height"
* Jun 11, 2014 2061 bsteffen Move rangeable methods here.
* Jun 24, 2014 3072 bsteffen Remove RadarRecord dependency for Radial
* Mesh
*
* </pre>
*
@ -244,7 +247,7 @@ public class RadarRadialResource extends RadarImageResource<MapDescriptor>
public IMesh buildMesh(IGraphicsTarget target, VizRadarRecord radarRecord)
throws VizException {
return target.getExtension(IRadialMeshExtension.class).constructMesh(
radarRecord, descriptor.getGridGeometry());
new RadialMeshData(radarRecord), descriptor.getGridGeometry());
}
@Override

View file

@ -31,6 +31,13 @@ import com.raytheon.uf.common.geospatial.MapUtil;
/**
* A series of methods to help in the processing and tiling of radar data.
*
*
* <pre>
* * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------- ------------
* Jun 20, 2014 3072 mweeks Updates to remove caculateExtent's dependence on RadarRecord.
* </pre>
*
* @author brockwoo
* @version 1.0
*/
@ -236,17 +243,20 @@ public class RadarUtil {
}
public static double calculateExtent(RadarRecord radarData) {
int numBins = radarData.getNumBins();
if (radarData.getJstart() != null) {
numBins += radarData.getJstart();
}
double maxExtent = radarData.getGateResolution() * numBins
* Math.cos(Math.toRadians(radarData.getTrueElevationAngle()));
return calculateExtent(radarData.getNumBins(), radarData.getJstart(), radarData.getGateResolution(),
(double)radarData.getTrueElevationAngle(), radarData.getFormat());
}
if ("Raster".equals(radarData.getFormat())) {
public static double calculateExtent(int numBins, Integer startBin, Integer gateResolution,
Double elevationAngle, String format) {
if (startBin != null) {
numBins += startBin;
}
double maxExtent = gateResolution * numBins
* Math.cos(Math.toRadians(elevationAngle));
if ("Raster".equals(format)) {
maxExtent /= 2;
}
return maxExtent;
}

View file

@ -31,6 +31,7 @@ import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.viz.radar.VizRadarRecord;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension.RadialMeshData;
/**
* TODO Add Description
@ -48,6 +49,7 @@ import com.raytheon.viz.radar.rsc.image.IRadialMeshExtension;
* 09-04-2012 B. Hebbard Add getGridGeometry() to descriptor per OB12.9.1 RTS
* change IRadialMeshExtension.constructMesh 2nd param
* 06/16/2014 #2061 bsteffen update IRangeableResource
* 06/24/2014 #2061 bsteffen Remove RadarRecord dependency for Radial Mesh
*
* </pre>
*
@ -166,7 +168,8 @@ public class RadarRadialResource extends RadarImageResource<MapDescriptor> {
public IMesh buildMesh(IGraphicsTarget target, VizRadarRecord radarRecord)
throws VizException {
return target.getExtension(IRadialMeshExtension.class).constructMesh(
radarRecord, ((IMapDescriptor) descriptor).getGridGeometry());
new RadialMeshData(radarRecord),
((IMapDescriptor) descriptor).getGridGeometry());
}
}