Merge "Issue #2199 Fixed subgridding calculation and made so data smoothing is done once instead of every paint" into development

Former-commit-id: 3d3e29b59fdac2e97d9783e1b102fe3227c4197d
This commit is contained in:
Nate Jensen 2013-07-25 13:22:37 -05:00 committed by Gerrit Code Review
commit 4f8cf1230f
4 changed files with 51 additions and 43 deletions

View file

@ -5,19 +5,18 @@ Bundle-SymbolicName: com.raytheon.viz.core.contours;singleton:=true
Bundle-Version: 1.12.1174.qualifier Bundle-Version: 1.12.1174.qualifier
Bundle-Activator: com.raytheon.viz.core.contours.Activator Bundle-Activator: com.raytheon.viz.core.contours.Activator
Bundle-Vendor: Raytheon Bundle-Vendor: Raytheon
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.viz.ui Require-Bundle: org.eclipse.core.runtime,
Eclipse-BuddyPolicy: ext, global org.eclipse.ui,
Require-Bundle: org.eclipse.ui, com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
org.eclipse.core.runtime, com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
com.raytheon.viz.core, com.raytheon.uf.common.status;bundle-version="1.12.1174",
org.apache.commons.lang, com.raytheon.uf.common.util;bundle-version="1.12.1174",
org.geotools, com.raytheon.uf.viz.core;bundle-version="1.12.1174",
javax.measure, com.raytheon.edex.meteolib;bundle-version="1.12.1174"
com.raytheon.viz.ui,
com.raytheon.edex.meteolib
Bundle-ActivationPolicy: lazy Bundle-ActivationPolicy: lazy
Export-Package: com.raytheon.viz.core.contours, Export-Package: com.raytheon.viz.core.contours,
com.raytheon.viz.core.contours.cmenu,
com.raytheon.viz.core.contours.rsc.displays, com.raytheon.viz.core.contours.rsc.displays,
com.raytheon.viz.core.contours.util com.raytheon.viz.core.contours.util
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: com.raytheon.viz.core.interval,
com.raytheon.viz.core.style.contour

View file

@ -59,6 +59,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 10, 2008 #1233 chammack Initial creation * Jul 10, 2008 #1233 chammack Initial creation
* Jul 18, 2013 #2199 mschenke Made code only smooth data once
* *
* </pre> * </pre>
* *
@ -86,6 +87,8 @@ public abstract class ContourRenderable implements IRenderable {
private final String uuid; private final String uuid;
private IDataRecord[] data;
// This is the width of CONUS // This is the width of CONUS
private static final double METERS_AT_BASE_ZOOMLEVEL = 5878649.0; private static final double METERS_AT_BASE_ZOOMLEVEL = 5878649.0;
@ -120,6 +123,20 @@ public abstract class ContourRenderable implements IRenderable {
this.requestMap = new HashMap<String, ContourCreateRequest>(); this.requestMap = new HashMap<String, ContourCreateRequest>();
} }
private IDataRecord[] getContourData() throws VizException {
if (data == null) {
data = getData();
if (data != null) {
GeneralGridGeometry gridGeometry = getGridGeometry();
ContourPreferences contourPrefs = getPreferences();
if (gridGeometry != null && contourPrefs != null) {
data = smoothData(data, gridGeometry, contourPrefs);
}
}
}
return data;
}
/** /**
* Set color * Set color
* *
@ -254,11 +271,6 @@ public abstract class ContourRenderable implements IRenderable {
|| contourGroup[i].lastDensity != density || contourGroup[i].lastDensity != density
|| pdRatio > 2 || pdRatio < 0.5) { || pdRatio > 2 || pdRatio < 0.5) {
IDataRecord[] dataRecord = getData();
if (dataRecord == null) {
return;
}
GeneralGridGeometry gridGeometry = getGridGeometry(); GeneralGridGeometry gridGeometry = getGridGeometry();
ContourPreferences contourPrefs = getPreferences(); ContourPreferences contourPrefs = getPreferences();
@ -267,8 +279,10 @@ public abstract class ContourRenderable implements IRenderable {
return; return;
} }
dataRecord = smoothData(dataRecord, gridGeometry, IDataRecord[] dataRecord = getContourData();
contourPrefs); if (dataRecord == null) {
return;
}
ContourGroup cg = null; ContourGroup cg = null;
// generate the identifier // generate the identifier

View file

@ -95,6 +95,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Jun 26, 2013 #1999 dgilling Replace native fortran strmpak call * Jun 26, 2013 #1999 dgilling Replace native fortran strmpak call
* with java port. * with java port.
* *
* Jul 18, 2013 2199 mschenke Ensured contouring is only occurring over visible area
* </pre> * </pre>
* *
* @author chammack * @author chammack
@ -666,8 +667,25 @@ public class ContourSupport {
GridGeometry2D imageGeometry2D = GridGeometry2D GridGeometry2D imageGeometry2D = GridGeometry2D
.wrap(imageGridGeometry); .wrap(imageGridGeometry);
GridGeometry2D mapGeometry2D = GridGeometry2D.wrap(mapGridGeometry);
// Start with a grid envelope in screen space0
GridEnvelope2D screenGridEnvelope = new GridEnvelope2D(
(int) Math.floor(workingExtent.getMinX()),
(int) Math.floor(workingExtent.getMinY()),
(int) Math.ceil(workingExtent.getWidth()),
(int) Math.ceil(workingExtent.getHeight()));
// intersect with mapGeometry so we only have points on the actual
// display
screenGridEnvelope = new GridEnvelope2D(
screenGridEnvelope.intersection(mapGeometry2D
.getGridRange2D()));
// convert from screen grid space to screen crs space.
Envelope2D screenCRSEnvelope = mapGeometry2D
.gridToWorld(screenGridEnvelope);
org.opengis.geometry.Envelope subgridCRSEnvelope = MapUtil org.opengis.geometry.Envelope subgridCRSEnvelope = MapUtil
.reprojectAndIntersect(mapGridGeometry.getEnvelope(), .reprojectAndIntersect(screenCRSEnvelope,
imageGridGeometry.getEnvelope()); imageGridGeometry.getEnvelope());
GridEnvelope2D subgridEnv = imageGeometry2D GridEnvelope2D subgridEnv = imageGeometry2D

View file

@ -1,23 +0,0 @@
/**
* 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.
**/
/**
* Provides contouring support
*/
package com.raytheon.viz.core.contours.cmenu;