org.deegree_impl.services.wts
Class WTSScene_Impl

java.lang.Object
  extended byorg.deegree_impl.services.wts.WTSScene_Impl
All Implemented Interfaces:
WTSScene

public class WTSScene_Impl
extends java.lang.Object
implements WTSScene

The WTSScene_Impl represents the basic class for creation of a 3D terrain model in the sense of the OGC Web Terrain Service specification. A WTS scene is defined by a terrain model and a date determining the light condions. Additional elements are 3D or 2.5D-features that are placed into the scene, atmospheric conditions influencing the light and visibility (e.g. fog, rain etc.) and additional light placed into the scene (e.g. street lights, spots, lighted windows etc.).

-----------------------------------------------------------------------

Version:
$Revision: 1.12 $ $Date: 2004/04/27 15:40:39 $
Author:
Katharina Lupp, Andreas Poth

Field Summary
private  java.lang.Object background
           
private  java.util.Calendar calendar
           
private  java.util.ArrayList conditions
           
private  GM_Envelope envelope
           
private  java.util.ArrayList feature
           
private  java.util.ArrayList lights
           
private  java.util.ArrayList terrain
           
private  ViewPoint viewPoint
           
 
Constructor Summary
WTSScene_Impl(Shape3D[] terrain, Group[] feature, ViewPoint viewPoint)
          Creates a new instance of WTSScene_Impl
WTSScene_Impl(Shape3D[] terrain, Group[] feature, ViewPoint viewPoint, java.util.Calendar calendar)
          Creates a new instance of WTSScene_Impl
WTSScene_Impl(Shape3D[] terrain, Group[] feature, ViewPoint viewPoint, java.util.Calendar calendar, AtmosphericCondition[] conditions)
          Creates a new instance of WTSScene_Impl
WTSScene_Impl(Shape3D[] terrain, Group[] feature, ViewPoint viewPoint, java.util.Calendar calendar, AtmosphericCondition[] conditions, Light[] lights)
          Creates a new instance of WTSScene_Impl
WTSScene_Impl(Shape3D[] terrain, Group[] feature, ViewPoint viewPoint, java.util.Calendar calendar, AtmosphericCondition[] conditions, Light[] lights, java.lang.Object background)
          Creates a new instance of WTSScene_Impl
 
Method Summary
 void addAtmosphericCondition(AtmosphericCondition condition)
          adds a atmospheric condition to the scene.
 void addFeature(Group feature)
          adds a feature that shall be rendered. the first feature to be set shall be the digital elevation model
 void addLight(Light light)
          adds a light to the scene. this can be ambient, directional and point light.
private  void createDayLight()
          creates the light that results from the sun (direct light) and the ambient of the sky.
 AtmosphericCondition[] getAtmosphericConditions()
          gets the atmospheric conditions for the rendering.
 GM_Position[] getBackFrame()
          returns the four corner coordinates of farest frame the viewer sees and that contains data
 java.lang.Object getBackground()
          returns the background object of the scene. this may be a Background, a Shape3D or null if no background is defined.
 java.util.Calendar getDate()
          get the date and the time for determining time depending the light conditions of the scene
 GM_Envelope getEnvelope()
          returns the envelope od the scene.
 Group[] getFeatures()
          returns the <Format> element
 GM_Position[] getFrontBorderFrame()
          returns the four corner coordinates of frame the viewer sees next to him and that contains data
 Light[] getLights()
          returns the lights of the scene
 Shape3D[] getTerrain()
          returns the features that constructs the terrain model of the scene
 ViewPoint getViewPoint()
          gets the position of the viewer, the directions he looks and his field of view in radians
 void setAtmosphericConditions(AtmosphericCondition[] conditions)
          sets the atmospheric conditions for the rendering. e.g. if a clear day (maybe summer late morning) is assumed there will be very sharp shadows. if vice versa a cloudy day (let's say autumn late afternoon) with some poor rain and a bit fog is assumed there won't be sharp shadows but some kind of 'gray curtain' over the scene.
 void setBackground(Background background)
          sets the Background object of the scene
 void setDate(java.util.Calendar calendar)
          set the date and the time for determining time depending the light conditions of the scene
 void setFeatures(Group[] features)
          sets the features that shall be rendered. the first feature of the array shall be the digital elevation model
 void setLights(Light[] lights)
          sets the lights of the scene. this can be ambient, directional and point light.
 void setTerrain(Shape3D feature)
          sets the terrain of the WTS-Scene as Shape3D object containing an appearence
 void setViewPoint(ViewPoint viewPoint)
          defines the position of the viewer and the point he looks at.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

calendar

private java.util.Calendar calendar

conditions

private java.util.ArrayList conditions

feature

private java.util.ArrayList feature

terrain

private java.util.ArrayList terrain

lights

private java.util.ArrayList lights

viewPoint

private ViewPoint viewPoint

background

private java.lang.Object background

envelope

private GM_Envelope envelope
Constructor Detail

WTSScene_Impl

public WTSScene_Impl(Shape3D[] terrain,
                     Group[] feature,
                     ViewPoint viewPoint)
Creates a new instance of WTSScene_Impl

Parameters:
terrain - Shape3D object(s) representing the scenes terrain.
feature - feature that shall be published in the scene
viewPoint - object that describes the viewers position and the point he looks at

WTSScene_Impl

public WTSScene_Impl(Shape3D[] terrain,
                     Group[] feature,
                     ViewPoint viewPoint,
                     java.util.Calendar calendar)
Creates a new instance of WTSScene_Impl

Parameters:
terrain - Shape3D object(s) representing the scenes terrain.
feature - feature that shall be published in the scene
viewPoint - object that describes the viewers position and the point he looks at
calendar - describtion of the date and time for which the scene shall be rendered --> light conditions

WTSScene_Impl

public WTSScene_Impl(Shape3D[] terrain,
                     Group[] feature,
                     ViewPoint viewPoint,
                     java.util.Calendar calendar,
                     AtmosphericCondition[] conditions)
Creates a new instance of WTSScene_Impl

Parameters:
terrain - Shape3D object(s) representing the scenes terrain.
feature - feature that shall be published in the scene
viewPoint - object that describes the viewers position and the point he looks at
calendar - describtion of the date and time for which the scene shall be rendered --> light conditions
conditions - atmospheric conditions like fog, dust, rain etc. of the scene

WTSScene_Impl

public WTSScene_Impl(Shape3D[] terrain,
                     Group[] feature,
                     ViewPoint viewPoint,
                     java.util.Calendar calendar,
                     AtmosphericCondition[] conditions,
                     Light[] lights)
Creates a new instance of WTSScene_Impl

Parameters:
terrain - Shape3D object(s) representing the scenes terrain.
feature - feature that shall be published in the scene
viewPoint - object that describes the viewers position and the point he looks at
calendar - describtion of the date and time for which the scene shall be rendered --> light conditions
conditions - atmospheric conditions like fog, dust, rain etc. of the scene
lights - lights in addition to sun and ambient light (e.g. street lights, spots etc.)

WTSScene_Impl

public WTSScene_Impl(Shape3D[] terrain,
                     Group[] feature,
                     ViewPoint viewPoint,
                     java.util.Calendar calendar,
                     AtmosphericCondition[] conditions,
                     Light[] lights,
                     java.lang.Object background)
Creates a new instance of WTSScene_Impl

Parameters:
terrain - Shape3D object(s) representing the scenes terrain.
feature - feature that shall be published in the scene
viewPoint - object that describes the viewers position and the point he looks at
calendar - describtion of the date and time for which the scene shall be rendered --> light conditions
conditions - atmospheric conditions like fog, dust, rain etc. of the scene
lights - lights in addition to sun and ambient light (e.g. street lights, spots etc.)
background - scene background; have to be a Shape3D or a Background
Method Detail

createDayLight

private void createDayLight()
creates the light that results from the sun (direct light) and the ambient of the sky.


getFeatures

public Group[] getFeatures()
returns the <Format> element

Specified by:
getFeatures in interface WTSScene
Returns:
the features published into the scene

setFeatures

public void setFeatures(Group[] features)
sets the features that shall be rendered. the first feature of the array shall be the digital elevation model

Specified by:
setFeatures in interface WTSScene
Parameters:
features - features to publish into the scene

addFeature

public void addFeature(Group feature)
adds a feature that shall be rendered. the first feature to be set shall be the digital elevation model

Specified by:
addFeature in interface WTSScene
Parameters:
feature - feature to publish into the scene

getBackground

public java.lang.Object getBackground()
returns the background object of the scene. this may be a Background, a Shape3D or null if no background is defined.

Specified by:
getBackground in interface WTSScene

setBackground

public void setBackground(Background background)
sets the Background object of the scene

Specified by:
setBackground in interface WTSScene

getAtmosphericConditions

public AtmosphericCondition[] getAtmosphericConditions()
gets the atmospheric conditions for the rendering.

Specified by:
getAtmosphericConditions in interface WTSScene
Returns:
atmospheric conditions of the scene

setAtmosphericConditions

public void setAtmosphericConditions(AtmosphericCondition[] conditions)
sets the atmospheric conditions for the rendering. e.g. if a clear day (maybe summer late morning) is assumed there will be very sharp shadows. if vice versa a cloudy day (let's say autumn late afternoon) with some poor rain and a bit fog is assumed there won't be sharp shadows but some kind of 'gray curtain' over the scene.

at the moment it isn't specified how to define atmospheric conditions in a standarized form so just an Object is submitted to the method.

Specified by:
setAtmosphericConditions in interface WTSScene
Parameters:
conditions - atmospheric conditions of the scene like fog, rain etc.

addAtmosphericCondition

public void addAtmosphericCondition(AtmosphericCondition condition)
adds a atmospheric condition to the scene.

Specified by:
addAtmosphericCondition in interface WTSScene
Parameters:
condition - atmospheric conditions of the scene like fog, rain etc.
See Also:
WTSScene.setAtmosphericConditions(AtmosphericCondition[])

getDate

public java.util.Calendar getDate()
get the date and the time for determining time depending the light conditions of the scene

Specified by:
getDate in interface WTSScene
Returns:
describtion of the date and time for which the scene shall be rendered --> light conditions

setDate

public void setDate(java.util.Calendar calendar)
set the date and the time for determining time depending the light conditions of the scene

Specified by:
setDate in interface WTSScene
Parameters:
calendar - describtion of the date and time for which the scene shall be rendered --> light conditions

setTerrain

public void setTerrain(Shape3D feature)
sets the terrain of the WTS-Scene as Shape3D object containing an appearence

Specified by:
setTerrain in interface WTSScene
Parameters:
feature - Shape3D object representing the scenes terrain.

getTerrain

public Shape3D[] getTerrain()
returns the features that constructs the terrain model of the scene

Specified by:
getTerrain in interface WTSScene
Returns:
Shape3D object(s) representing the scenes terrain.

getViewPoint

public ViewPoint getViewPoint()
gets the position of the viewer, the directions he looks and his field of view in radians

Specified by:
getViewPoint in interface WTSScene
Returns:
object that describes the viewers position and the point he looks at

setViewPoint

public void setViewPoint(ViewPoint viewPoint)
defines the position of the viewer and the point he looks at.

Specified by:
setViewPoint in interface WTSScene
Parameters:
viewPoint - object that describes the viewers position and the point he looks at

addLight

public void addLight(Light light)
adds a light to the scene. this can be ambient, directional and point light.

Specified by:
addLight in interface WTSScene
Parameters:
light - a light in addition to sun and basic ambient light (e.g. street lights, spots etc.)

getLights

public Light[] getLights()
returns the lights of the scene

Specified by:
getLights in interface WTSScene
Returns:
lights including sun and basic ambient light (e.g. street lights, spots etc.)

setLights

public void setLights(Light[] lights)
sets the lights of the scene. this can be ambient, directional and point light.

Specified by:
setLights in interface WTSScene
Parameters:
lights - lights in addition to sun and basic ambient light (e.g. street lights, spots etc.)

getEnvelope

public GM_Envelope getEnvelope()
returns the envelope od the scene.

Specified by:
getEnvelope in interface WTSScene

getFrontBorderFrame

public GM_Position[] getFrontBorderFrame()
returns the four corner coordinates of frame the viewer sees next to him and that contains data

Specified by:
getFrontBorderFrame in interface WTSScene

getBackFrame

public GM_Position[] getBackFrame()
returns the four corner coordinates of farest frame the viewer sees and that contains data

Specified by:
getBackFrame in interface WTSScene