fhm.edu.fem.animation
Class GLSpannerRenderer

java.lang.Object
  extended by fhm.edu.fem.animation.GLFEMRenderer
      extended by fhm.edu.fem.animation.GLSpannerRenderer
All Implemented Interfaces:
java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.util.EventListener

public class GLSpannerRenderer
extends GLFEMRenderer

Class Description: This class takes care of actually drawing the spanner

Author:
Thomas Woellert (thomas.woellert@t-online.de), Stefan Weissbach (weissbst@gmx.de)

Field Summary
protected  NodeList aliasIDNodeList
           
protected  boolean drawBackFigure
           
protected  boolean drawNewFigure
           
protected  boolean drawSpannungsbetragColors
           
protected  FEMCalcSpanner femCalc
           
protected  GLColor[] spannungsbetragColors
           
 
Fields inherited from class fhm.edu.fem.animation.GLFEMRenderer
femManager, mouseLButtonDown, mouseRButtonDown, nRange, prevMouseX, prevMouseY, showPointsOnly, showPolygons, transX, transY, useColorMode, viewChangedByUser, viewHeight, viewRotX, viewRotY, viewRotZ, viewWidth, viewX, viewY
 
Constructor Summary
GLSpannerRenderer(FEMCalcSpanner femCalc)
          Create a new OpenGL Spanner Renderer
 
Method Summary
protected  void buildSpannungsbetragsColors(ElementList elementList)
          Build the list of all element colors depending on the elements' spannungsbetrag
protected  boolean createAliasList()
          Create the alias List
protected  void drawContents(GLDrawable drawable)
          Draw the contents
protected  void drawSpannerElements(GLDrawable drawable, ElementList elementList, double zValue, boolean useOriginalCoordinates)
          Draw the spanners current elements
protected  void drawSpannerNodes(GLDrawable drawable, NodeList nodeList, double zValue, boolean useOriginalCoordinates)
          Draw the spanners current nodes
protected  void drawSpannerPolygons(GLDrawable drawable, ElementList fullElementList, double zValue, boolean useOriginalCoordinates)
          Draw the spanner's front real polygons based on the node coordinates
 void keyTyped(java.awt.event.KeyEvent e)
          Automatically called when the user presses a key
 
Methods inherited from class fhm.edu.fem.animation.GLFEMRenderer
display, displayChanged, drawCoordSystem, init, keyPressed, keyReleased, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mousePressed, mouseReleased, reshape, setMidPointFromNodes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

aliasIDNodeList

protected NodeList aliasIDNodeList

drawBackFigure

protected boolean drawBackFigure

drawNewFigure

protected boolean drawNewFigure

drawSpannungsbetragColors

protected boolean drawSpannungsbetragColors

femCalc

protected FEMCalcSpanner femCalc

spannungsbetragColors

protected GLColor[] spannungsbetragColors
Constructor Detail

GLSpannerRenderer

public GLSpannerRenderer(FEMCalcSpanner femCalc)
Create a new OpenGL Spanner Renderer

Parameters:
femCalc, - the calculator we use
Method Detail

buildSpannungsbetragsColors

protected void buildSpannungsbetragsColors(ElementList elementList)
Build the list of all element colors depending on the elements' spannungsbetrag

Parameters:
elementList, - the element list to use

createAliasList

protected boolean createAliasList()
Create the alias List

Returns:
true if all went well, false otherwise

drawContents

protected void drawContents(GLDrawable drawable)
Draw the contents

Specified by:
drawContents in class GLFEMRenderer
Parameters:
drawable, - the main GLDrawable given by OpenGL

drawSpannerElements

protected void drawSpannerElements(GLDrawable drawable,
                                   ElementList elementList,
                                   double zValue,
                                   boolean useOriginalCoordinates)
Draw the spanners current elements

Parameters:
drawable, - the main GLDrawable given by OpenGL
elementList, - the elementList to draw
zValue, - the z-value of the polygon nodes
useOriginalCoordinates, - draw the nodes using their original coordinates

drawSpannerNodes

protected void drawSpannerNodes(GLDrawable drawable,
                                NodeList nodeList,
                                double zValue,
                                boolean useOriginalCoordinates)
Draw the spanners current nodes

Parameters:
drawable, - the main GLDrawable given by OpenGL
nodeList, - the nodelist to draw
zValue, - the z-value of the polygon nodes
useOriginalCoordinates, - draw the nodes using their original coordinates

drawSpannerPolygons

protected void drawSpannerPolygons(GLDrawable drawable,
                                   ElementList fullElementList,
                                   double zValue,
                                   boolean useOriginalCoordinates)
Draw the spanner's front real polygons based on the node coordinates

Parameters:
drawable, - the main GLDrawable given by OpenGL
fullElementList, - the elementList to draw
zValue, - the z-value of the polygon nodes
useOriginalCoordinates, - draw the nodes using their original coordinates

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Automatically called when the user presses a key

Specified by:
keyTyped in interface java.awt.event.KeyListener
Overrides:
keyTyped in class GLFEMRenderer
Parameters:
e, - the key event