nl.tudelft.simulation.dsol.animation.D2
Class GisRenderable2D

java.lang.Object
  extended bynl.tudelft.simulation.dsol.animation.D2.GisRenderable2D
All Implemented Interfaces:
LocatableInterface, Renderable2DInterface

public class GisRenderable2D
extends java.lang.Object
implements Renderable2DInterface, LocatableInterface

This renderable draws CAD/GIS objects.

(c) copyright 2003 Delft University of Technology , the Netherlands.
See for project information www.simulation.tudelft.nl
License of use: General Public License (GPL) , no warranty

Since:
1.4
Version:
1.2 Apr 29, 2004
Author:
Peter Jacobs

Nested Class Summary
 
Nested classes inherited from class nl.tudelft.simulation.dsol.animation.D2.Renderable2DInterface
Renderable2DInterface.Util
 
Field Summary
protected  javax.media.j3d.Bounds bounds
          the bounds of the image
protected  java.awt.geom.Rectangle2D extent
          the cached extent
protected  java.awt.image.BufferedImage image
          the image cached image
protected  nl.tudelft.simulation.language.d3.DirectedPoint location
          the location of the image
protected  nl.javel.gisbeans.map.MapInterface map
          the map to display
protected  java.awt.Dimension screenSize
          the cached screenSize
 
Constructor Summary
GisRenderable2D(SimulatorInterface simulator, java.net.URL mapFile)
          constructs a new GisRenderable2D
 
Method Summary
 boolean contains(java.awt.geom.Point2D pointWorldCoordinates, java.awt.geom.Rectangle2D extent, java.awt.Dimension screen)
          does the shape contain the point
 void destroy()
          destroys an RenderableObject by unsubscribing it from the context.
 javax.media.j3d.Bounds getBounds()
          returns the bounds of the locatable object.
 nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
          returns the location of an object
 LocatableInterface getSource()
          gets the source of this renderable
 void paint(java.awt.Graphics2D graphics, java.awt.geom.Rectangle2D extent, java.awt.Dimension screen, java.awt.image.ImageObserver observer)
          paints the object on a 2D graphics object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected nl.javel.gisbeans.map.MapInterface map
the map to display


image

protected java.awt.image.BufferedImage image
the image cached image


extent

protected java.awt.geom.Rectangle2D extent
the cached extent


screenSize

protected java.awt.Dimension screenSize
the cached screenSize


location

protected nl.tudelft.simulation.language.d3.DirectedPoint location
the location of the image


bounds

protected javax.media.j3d.Bounds bounds
the bounds of the image

Constructor Detail

GisRenderable2D

public GisRenderable2D(SimulatorInterface simulator,
                       java.net.URL mapFile)
constructs a new GisRenderable2D

Parameters:
simulator - the simulator.
mapFile - the mapfile to use.
Method Detail

paint

public void paint(java.awt.Graphics2D graphics,
                  java.awt.geom.Rectangle2D extent,
                  java.awt.Dimension screen,
                  java.awt.image.ImageObserver observer)
Description copied from interface: Renderable2DInterface
paints the object on a 2D graphics object

Specified by:
paint in interface Renderable2DInterface
Parameters:
graphics - the graphics object
extent - the extent of the panel
screen - the screen of the panel
observer - the observer of the renderableInterface
See Also:
#paint(java.awt.Graphics2D, java.awt.geom.Rectangle2D, java.awt.Dimension, java.awt.image.ImageObserver)

getSource

public LocatableInterface getSource()
Description copied from interface: Renderable2DInterface
gets the source of this renderable

Specified by:
getSource in interface Renderable2DInterface
Returns:
Locatable the source
See Also:
Renderable2DInterface.getSource()

getBounds

public javax.media.j3d.Bounds getBounds()
Description copied from interface: LocatableInterface
returns the bounds of the locatable object. The bounds is the not rotated bounds around [0;0;0]

Specified by:
getBounds in interface LocatableInterface
Returns:
BoundingBox include this.getLocation() as center of the box..
See Also:
LocatableInterface.getBounds()

getLocation

public nl.tudelft.simulation.language.d3.DirectedPoint getLocation()
Description copied from interface: LocatableInterface
returns the location of an object

Specified by:
getLocation in interface LocatableInterface
Returns:
DirectedPoint the location
See Also:
LocatableInterface.getLocation()

destroy

public void destroy()
destroys an RenderableObject by unsubscribing it from the context.

Specified by:
destroy in interface Renderable2DInterface

contains

public boolean contains(java.awt.geom.Point2D pointWorldCoordinates,
                        java.awt.geom.Rectangle2D extent,
                        java.awt.Dimension screen)
Description copied from interface: Renderable2DInterface
does the shape contain the point

Specified by:
contains in interface Renderable2DInterface
Parameters:
pointWorldCoordinates - the point in world coordinates. Default implementation is to intersect the 3D bounds on location.z and to return the bounds2D of this intersect.
extent - the extent of the panel.
screen - the screen of the panel.
Returns:
whether the point is in the shape
See Also:
Renderable2DInterface.contains(java.awt.geom.Point2D, java.awt.geom.Rectangle2D, java.awt.Dimension)


Copyright © 2002-2004 Delft University of Technology, the Netherlands. All Rights Reserved.