org.geotools.renderer
Class ScreenMap

Object
  extended by ScreenMap

public class ScreenMap
extends Object

The screenmap is a packed bitmap of the screen, one bit per pixels. It can be used to avoid rendering a lot of very small features in the same pixel.

The screenmap can be used two ways:

When checkAndSet returns false the geometry sits in a pixel that has been already populated and can be skipped.

Author:
jeichar, Andrea Aime - OpenGeo

Constructor Summary
ScreenMap(int x, int y, int width, int height)
           
ScreenMap(int x, int y, int width, int height, MathTransform mt)
           
ScreenMap(ScreenMap original, int expandBy)
           
 
Method Summary
 boolean canSimplify(Envelope envelope)
           
 boolean checkAndSet(Envelope envelope)
           
 boolean checkAndSet(int x, int y)
          Checks if the geometry should be skipped.
 boolean get(int x, int y)
          Returns true if the pixel at location x,y is set or out of bounds.
 Geometry getSimplifiedShape(double minx, double miny, double maxx, double maxy, GeometryFactory geometryFactory, Class geometryType)
          Returns geometry suitable for rendering the pixel that has just been occupied.
 void set(int x, int y, boolean value)
          Sets location at position x,y to the value.
 void setSpans(double spanX, double spanY)
           
 void setTransform(MathTransform mt)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScreenMap

public ScreenMap(int x,
                 int y,
                 int width,
                 int height,
                 MathTransform mt)

ScreenMap

public ScreenMap(ScreenMap original,
                 int expandBy)

ScreenMap

public ScreenMap(int x,
                 int y,
                 int width,
                 int height)
Method Detail

setTransform

public void setTransform(MathTransform mt)

checkAndSet

public boolean checkAndSet(Envelope envelope)
                    throws TransformException
Throws:
TransformException

canSimplify

public boolean canSimplify(Envelope envelope)

setSpans

public void setSpans(double spanX,
                     double spanY)

checkAndSet

public boolean checkAndSet(int x,
                           int y)
Checks if the geometry should be skipped. If the test returns true it means the geometry sits in a pixel that has already been used


get

public boolean get(int x,
                   int y)
Returns true if the pixel at location x,y is set or out of bounds.


getSimplifiedShape

public Geometry getSimplifiedShape(double minx,
                                   double miny,
                                   double maxx,
                                   double maxy,
                                   GeometryFactory geometryFactory,
                                   Class geometryType)
Returns geometry suitable for rendering the pixel that has just been occupied. The geometry is designed to actually fill the pixel

Parameters:
minx -
miny -
maxx -
maxy -
geometryFactory -
geometryType -
Returns:

set

public void set(int x,
                int y,
                boolean value)
Sets location at position x,y to the value.



Copyright © 1996-2014 Geotools. All Rights Reserved.