Issue #2199 Fixed subgridding calculation and made so data smoothing is done once instead of every paint
Amend: Added comments Change-Id: Ieb045b1a8f8271adba804cacd6f47996ffae4cf5 Former-commit-id: 2cc61515015e125816b76c560900744258dbd2f1
This commit is contained in:
parent
d0fb138b5e
commit
d3df3e97c8
4 changed files with 51 additions and 43 deletions
|
@ -5,19 +5,18 @@ Bundle-SymbolicName: com.raytheon.viz.core.contours;singleton:=true
|
|||
Bundle-Version: 1.12.1174.qualifier
|
||||
Bundle-Activator: com.raytheon.viz.core.contours.Activator
|
||||
Bundle-Vendor: Raytheon
|
||||
Eclipse-RegisterBuddy: com.raytheon.viz.core, com.raytheon.viz.ui
|
||||
Eclipse-BuddyPolicy: ext, global
|
||||
Require-Bundle: org.eclipse.ui,
|
||||
org.eclipse.core.runtime,
|
||||
com.raytheon.viz.core,
|
||||
org.apache.commons.lang,
|
||||
org.geotools,
|
||||
javax.measure,
|
||||
com.raytheon.viz.ui,
|
||||
com.raytheon.edex.meteolib
|
||||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.ui,
|
||||
com.raytheon.uf.common.datastorage;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.util;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.viz.core;bundle-version="1.12.1174",
|
||||
com.raytheon.edex.meteolib;bundle-version="1.12.1174"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
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.util
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.viz.core.interval,
|
||||
com.raytheon.viz.core.style.contour
|
||||
|
|
|
@ -59,6 +59,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 10, 2008 #1233 chammack Initial creation
|
||||
* Jul 18, 2013 #2199 mschenke Made code only smooth data once
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -86,6 +87,8 @@ public abstract class ContourRenderable implements IRenderable {
|
|||
|
||||
private final String uuid;
|
||||
|
||||
private IDataRecord[] data;
|
||||
|
||||
// This is the width of CONUS
|
||||
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>();
|
||||
}
|
||||
|
||||
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
|
||||
*
|
||||
|
@ -254,11 +271,6 @@ public abstract class ContourRenderable implements IRenderable {
|
|||
|| contourGroup[i].lastDensity != density
|
||||
|| pdRatio > 2 || pdRatio < 0.5) {
|
||||
|
||||
IDataRecord[] dataRecord = getData();
|
||||
if (dataRecord == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralGridGeometry gridGeometry = getGridGeometry();
|
||||
ContourPreferences contourPrefs = getPreferences();
|
||||
|
||||
|
@ -267,8 +279,10 @@ public abstract class ContourRenderable implements IRenderable {
|
|||
return;
|
||||
}
|
||||
|
||||
dataRecord = smoothData(dataRecord, gridGeometry,
|
||||
contourPrefs);
|
||||
IDataRecord[] dataRecord = getContourData();
|
||||
if (dataRecord == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ContourGroup cg = null;
|
||||
// generate the identifier
|
||||
|
|
|
@ -91,10 +91,11 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Apr 26, 2010 #4583 rjpeter Replaced fortran fortconbuf with java port.
|
||||
* Mar 04, 2011 #7747 njensen Cached subgrid envelopes
|
||||
* Jul 09, 2012 DR14940 M.Porricelli Adjust arrow size for streamlines
|
||||
* Feb 15, 2013 1638 mschenke Moved edex.common Util functions into common Util
|
||||
* Feb 15, 2013 1638 mschenke Moved edex.common Util functions into common Util
|
||||
* Jun 26, 2013 #1999 dgilling Replace native fortran strmpak call
|
||||
* with java port.
|
||||
*
|
||||
* Jul 18, 2013 2199 mschenke Ensured contouring is only occurring over visible area
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -666,8 +667,25 @@ public class ContourSupport {
|
|||
GridGeometry2D imageGeometry2D = GridGeometry2D
|
||||
.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
|
||||
.reprojectAndIntersect(mapGridGeometry.getEnvelope(),
|
||||
.reprojectAndIntersect(screenCRSEnvelope,
|
||||
imageGridGeometry.getEnvelope());
|
||||
|
||||
GridEnvelope2D subgridEnv = imageGeometry2D
|
||||
|
|
|
@ -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;
|
Loading…
Add table
Reference in a new issue