de.fhg.igd.earth.view
Class JavaProjector

java.lang.Object
  extended byde.fhg.igd.earth.view.Projector
      extended byde.fhg.igd.earth.view.JavaProjector
Direct Known Subclasses:
CubeProjector, SphereProjector

public abstract class JavaProjector
extends Projector

This is an abstract class that represents a Java3D projector. Title : Earth Copyright : Copyright (c) 2001 Organisation : IGD FhG

Version:
: 1.0
Author:
: Werner Beutel

Field Summary
private  boolean autoFocus_
           
protected  javax.media.j3d.Canvas3D canvas3D_
           
protected  boolean checkDetailLevels_
           
protected  Vector detachedBranchGroups_
           
protected  Vector detailGroups_
           
protected  float distance_
           
protected  Vector distanceDetailGroups_
           
private  boolean dlod_
           
protected  JLabel fpsLabel_
           
private  long frameNumber_
           
private  long frameTime_
           
private  boolean lod_
           
protected  javax.media.j3d.BoundingSphere mainBounds_
           
protected  boolean newUniverse
           
protected  JLabel positionLabel_
           
protected  javax.media.j3d.View view_
           
protected  JSlider zoomSlider_
           
protected  JComponent zoomSliderPanel_
           
 
Fields inherited from class de.fhg.igd.earth.view.Projector
container_, containerHeight_, containerWidth_, enabled_, firstTime_, model_, projectorManager_
 
Constructor Summary
JavaProjector(JComponent container)
          Creates an instance of this class
 
Method Summary
 void addFPSLabel(JLabel label)
          adds the frames per second label (GUI)
private  void addGlobalLights(javax.media.j3d.BranchGroup objRoot)
          adds default global lights to the J3D branch group
 void addPositionLabel(JLabel label)
          adds the geo position label (GUI)
private  void autoFocus()
          calculates the focus
 void calcFPS()
          calculates the frames per second
private  void checkBranchGroupDetached(Node node)
          Checks if the branch group of the given node is already detached
protected  void checkErasedChildren(Group group)
          Checks for erased children in the given group
protected abstract  boolean checkLatchGroup(Node node)
          update LATCH GROUP
 void delete()
          Deletes this projector
 void enableAutoFocus(boolean b)
          Enables or Disables the AutoFocus
 void enableDLOD(boolean b)
          Enables or Disables the DistanceLevelOfDetail
 void enableLOD(boolean b)
          Enables or Disables the LevelOfDetail
 JSlider getZoomSlider()
          gets the zoom slider (GUI)
private  void insertChild(Node node, javax.media.j3d.Node jNode)
          Inserts a new NODE into the J3D model node (jNode)
private  boolean loopLinkExists(ModelGraphObject mgObject)
          Returns true if the given model graph object has a projector link.
protected abstract  cMatrix4d PixelTransformer(cMatrix4d x)
          This mehtod is called by updateTransformGroup() to transform a matrix for a special projector.
protected abstract  cPoint3d[] PixelTransformer(cPoint3d[] x)
          This mehtod is called by updateTransformGroup() to transform a point field for a special projector.
protected abstract  cVector3f[] PixelTransformer(cVector3f[] x)
          This mehtod is called by updateTransformGroup() to transform a vector field for a special projector.
private  void reinsertDetachedBranchGroups()
          Reinserts the detached branch group into the J3D model
 void renderOnce()
          Calls the render engine to render one frame
 void resizeContainer(int x, int y)
          GUI
 void saveSnapshot()
           
private  void setAppearance(Shape shape, javax.media.j3d.Appearance app, javax.media.j3d.PolygonAttributes pa)
          sets the appearance (app) and the polygon attributes (pa) of a shape
 void setDistance(float distance)
          sets the distance form center
 void setLOD(int level)
          set the level of detail
 void setPositionLabel(String text)
          sets the position label
protected abstract  void setViewPosition(double longitude, double latitude)
          sets the view position
 void setZoomSliderPanel(JComponent container)
          sets the zoom slider panel (GUI)
 void update()
          updates the projector
private  void update(Node node)
          update NODE
private  void updateAppearance(Shape shape)
          updates the appearance of a shape
protected  void updateBranchGroup(BranchGroup branchGroup)
          update BRANCH GROUP
protected  void updateGroup(Group group)
          update GROUP
protected abstract  void updateModelGraph(ModelGraph model)
          update MODEL GRAPH
protected  void updatePolygon(Polygon polygon)
          update POLYGON
protected  void updatePrimitive(Primitive primitive)
          update PRIMITIVE
protected  void updateSwitchGroup(SwitchGroup switchGroup)
          update SWITCH GROUP
protected  void updateText(Text text)
          update TEXT
protected  void updateTransformGroup(TransformGroup transformGroup)
          update TRANSFORM GROUP
 
Methods inherited from class de.fhg.igd.earth.view.Projector
getIdentName, resizePanelEvent, setModel, setProjectorManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

canvas3D_

protected javax.media.j3d.Canvas3D canvas3D_

view_

protected javax.media.j3d.View view_

detachedBranchGroups_

protected Vector detachedBranchGroups_

newUniverse

protected boolean newUniverse

detailGroups_

protected Vector detailGroups_

distanceDetailGroups_

protected Vector distanceDetailGroups_

checkDetailLevels_

protected boolean checkDetailLevels_

distance_

protected float distance_

mainBounds_

protected javax.media.j3d.BoundingSphere mainBounds_

zoomSlider_

protected JSlider zoomSlider_

zoomSliderPanel_

protected JComponent zoomSliderPanel_

positionLabel_

protected JLabel positionLabel_

fpsLabel_

protected JLabel fpsLabel_

lod_

private boolean lod_

dlod_

private boolean dlod_

autoFocus_

private boolean autoFocus_

frameNumber_

private long frameNumber_

frameTime_

private long frameTime_
Constructor Detail

JavaProjector

public JavaProjector(JComponent container)
Creates an instance of this class

Method Detail

resizeContainer

public void resizeContainer(int x,
                            int y)
GUI

Overrides:
resizeContainer in class Projector

saveSnapshot

public void saveSnapshot()

renderOnce

public void renderOnce()
Calls the render engine to render one frame


setLOD

public void setLOD(int level)
set the level of detail

Parameters:
level -

setDistance

public void setDistance(float distance)
sets the distance form center

Parameters:
distance -

update

public void update()
updates the projector

Specified by:
update in class Projector

update

private void update(Node node)
update NODE

Parameters:
node -

updateModelGraph

protected abstract void updateModelGraph(ModelGraph model)
update MODEL GRAPH

Parameters:
model -

checkLatchGroup

protected abstract boolean checkLatchGroup(Node node)
update LATCH GROUP

Parameters:
node -

checkErasedChildren

protected void checkErasedChildren(Group group)
Checks for erased children in the given group

Parameters:
group -

updateBranchGroup

protected void updateBranchGroup(BranchGroup branchGroup)
update BRANCH GROUP

Parameters:
branchGroup -

updateGroup

protected void updateGroup(Group group)
update GROUP

Parameters:
group -

updateTransformGroup

protected void updateTransformGroup(TransformGroup transformGroup)
update TRANSFORM GROUP

Parameters:
transformGroup -

updateSwitchGroup

protected void updateSwitchGroup(SwitchGroup switchGroup)
update SWITCH GROUP

Parameters:
switchGroup -

updatePolygon

protected void updatePolygon(Polygon polygon)
update POLYGON

Parameters:
polygon -

updatePrimitive

protected void updatePrimitive(Primitive primitive)
update PRIMITIVE

Parameters:
primitive -

updateText

protected void updateText(Text text)
update TEXT

Parameters:
text -

setAppearance

private void setAppearance(Shape shape,
                           javax.media.j3d.Appearance app,
                           javax.media.j3d.PolygonAttributes pa)
sets the appearance (app) and the polygon attributes (pa) of a shape

Parameters:
shape -
app -
pa -

updateAppearance

private void updateAppearance(Shape shape)
updates the appearance of a shape

Parameters:
shape -

insertChild

private void insertChild(Node node,
                         javax.media.j3d.Node jNode)
Inserts a new NODE into the J3D model node (jNode)

Parameters:
node -
jNode -

checkBranchGroupDetached

private void checkBranchGroupDetached(Node node)
Checks if the branch group of the given node is already detached

Parameters:
node -

reinsertDetachedBranchGroups

private void reinsertDetachedBranchGroups()
Reinserts the detached branch group into the J3D model


loopLinkExists

private boolean loopLinkExists(ModelGraphObject mgObject)
Returns true if the given model graph object has a projector link.


addGlobalLights

private void addGlobalLights(javax.media.j3d.BranchGroup objRoot)
adds default global lights to the J3D branch group


PixelTransformer

protected abstract cMatrix4d PixelTransformer(cMatrix4d x)
This mehtod is called by updateTransformGroup() to transform a matrix for a special projector.


PixelTransformer

protected abstract cPoint3d[] PixelTransformer(cPoint3d[] x)
This mehtod is called by updateTransformGroup() to transform a point field for a special projector.


PixelTransformer

protected abstract cVector3f[] PixelTransformer(cVector3f[] x)
This mehtod is called by updateTransformGroup() to transform a vector field for a special projector.


setZoomSliderPanel

public void setZoomSliderPanel(JComponent container)
sets the zoom slider panel (GUI)


getZoomSlider

public JSlider getZoomSlider()
gets the zoom slider (GUI)


addPositionLabel

public void addPositionLabel(JLabel label)
adds the geo position label (GUI)


addFPSLabel

public void addFPSLabel(JLabel label)
adds the frames per second label (GUI)


calcFPS

public void calcFPS()
calculates the frames per second


autoFocus

private void autoFocus()
calculates the focus


setViewPosition

protected abstract void setViewPosition(double longitude,
                                        double latitude)
sets the view position

Parameters:
longitude -
latitude -

setPositionLabel

public void setPositionLabel(String text)
sets the position label

Parameters:
text -

enableLOD

public void enableLOD(boolean b)
Enables or Disables the LevelOfDetail


enableDLOD

public void enableDLOD(boolean b)
Enables or Disables the DistanceLevelOfDetail


enableAutoFocus

public void enableAutoFocus(boolean b)
Enables or Disables the AutoFocus


delete

public void delete()
Deletes this projector

Specified by:
delete in class Projector


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.