igeo.gui
Class IView

java.lang.Object
  extended by igeo.gui.IView

public class IView
extends java.lang.Object

Class to define view by location, direction, axonometric/perspective mode and perspective angle. An instance of IView is associated with an instance of IPane.

Version:
0.7.1.0;
Author:
Satoru Sugihara

Field Summary
 boolean axonometric
           
 double axonRatio
           
static double defaultAxonRatio
           
static double defaultFar
           
static float[] defaultGLAmbientLight
           
static double[][][] defaultGLBGColor
           
static float[] defaultGLDiffuseLight
           
static float[] defaultGLLightPosition
           
static float[] defaultGLSpecularLight
           
static boolean defaultGLTwoSidedLighting
           
static IGraphicMode defaultMode
           
static double defaultNear
           
static double defaultPersRatio
           
static double defaultViewDistance
           
 double distToTarget
           
 double far
           
 double[][][] glBGColor
           
 double glHeight
           
 double[] glTransformArray
           
 IMatrix4 glTransformMatrix
           
 double glWidth
           
 boolean hide
           
 java.awt.Color javaBGColor1
           
 java.awt.Color javaBGColor2
           
 IGraphicMode mode
           
 double near
           
 IPane pane
           
 double persRatio
           
 double pitch
          yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule
 IVec pos
           
 double roll
          yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule
 boolean rotateAroundTarget
           
 int screenHeight
           
 int screenWidth
           
 int screenX
           
 int screenY
           
 IVec target
           
 boolean useGL
           
 double yaw
          yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule
 
Constructor Summary
IView(double x, double y, double z, double yaw, double pitch)
           
IView(double x, double y, double z, double yaw, double pitch, double roll)
           
IView(double x, double y, double z, double yaw, double pitch, double roll, int screenX, int screenY, int screenWidth, int screenHeight)
           
IView(double x, double y, double z, double yaw, double pitch, double roll, int screenX, int screenY, int screenWidth, int screenHeight, boolean axonometric)
           
 
Method Summary
 void axonometric()
           
 boolean convert(IVecI orig, IVec dest)
          converts 3d coordinates to 2d.
 boolean convert(IVecI orig, IVec2 dest)
          converts 3d coordinates to 2d coordinates of screen whose unit is pixels and whose origin is top left corner and positive Y is downward
 void disableGL()
           
 void disableRotationAroundTarget()
           
 double distanceToTarget()
           
 void draw(javax.media.opengl.GL gl)
           
 void drawBG(javax.media.opengl.GL gl)
           
 void enableGL()
           
 void enableRotationAroundTarget()
           
 void focus(IBoundingBox bb)
           
 IVec frontDirection()
           
 IVec getAngles()
           
 double getAxonometricRatio()
           
static IView getBackView(int screenX, int screenY, int screenWidth, int screenHeight)
           
static IView getBottomView(int screenX, int screenY, int screenWidth, int screenHeight)
           
static IView getDefaultAxonometricView(int screenX, int screenY, int screenWidth, int screenHeight)
           
static IView getDefaultPerspectiveView(int screenX, int screenY, int screenWidth, int screenHeight)
           
static IView getFrontView(int screenX, int screenY, int screenWidth, int screenHeight)
           
static IView getLeftView(int screenX, int screenY, int screenWidth, int screenHeight)
           
 IVec getLocation()
           
 double getPerspectiveRatio()
           
 double getPitch()
           
static IView getRightView(int screenX, int screenY, int screenWidth, int screenHeight)
           
 double getRoll()
           
static IView getTopView(int screenX, int screenY, int screenWidth, int screenHeight)
           
 double getYaw()
           
 void hide()
           
 boolean isAxonometric()
           
 boolean isHidden()
           
 IVec location()
           
 IGraphicMode mode()
           
 void moveForward(double dist)
           
 void perspective()
           
 IVec rightDirection()
           
 void set(double x, double y, double z)
           
 void set(double x, double y, double z, double yaw, double pitch)
           
 void set(double x, double y, double z, double yaw, double pitch, double roll)
           
 void set(IVec location)
           
 void set(IVec location, double yaw, double pitch)
           
 void set(IVec location, double yaw, double pitch, double roll)
           
 void setAngle(double yaw, double pitch)
           
 void setAngle(double yaw, double pitch, boolean updateTarget)
           
 void setAngle(double yaw, double pitch, double roll)
           
 void setAngle(double yaw, double pitch, double roll, boolean updateTarget)
           
 void setAxonometric()
           
 void setAxonometric(double x, double y, double z)
           
 void setAxonometric(double x, double y, double z, double axonometricRatio)
           
 void setAxonometric(double x, double y, double z, double yaw, double pitch)
           
 void setAxonometric(double x, double y, double z, double yaw, double pitch, double axonometricRatio)
           
 void setAxonometricRatio(double r)
           
 void setBack()
           
 void setBack(double x, double z)
           
 void setBack(double x, double y, double z)
           
 void setBack(double x, double y, double z, double axonometricRatio)
           
 void setBGColor(java.awt.Color c)
           
 void setBGColor(java.awt.Color[][] c)
           
 void setBGColor(java.awt.Color c1, java.awt.Color c2)
           
 void setBGColor(java.awt.Color c1, java.awt.Color c2, java.awt.Color c3, java.awt.Color c4)
           
 void setBottom()
           
 void setBottom(double x, double y)
           
 void setBottom(double x, double y, double z)
           
 void setBottom(double x, double y, double z, double axonometricRatio)
           
 void setFront()
           
 void setFront(double x, double z)
           
 void setFront(double x, double y, double z)
           
 void setFront(double x, double y, double z, double axonometricRatio)
           
 void setLeft()
           
 void setLeft(double y, double z)
           
 void setLeft(double x, double y, double z)
           
 void setLeft(double x, double y, double z, double axonometricRatio)
           
 void setLocation(double x, double y, double z)
           
 void setLocation(IVecI pt)
           
 void setMode(IGraphicMode m)
           
 void setPane(IPane p)
           
 void setPerspective()
           
 void setPerspective(double perspectiveAngle)
           
 void setPerspective(double x, double y, double z)
           
 void setPerspective(double x, double y, double z, double perspectiveAngle)
           
 void setPerspective(double x, double y, double z, double yaw, double pitch)
           
 void setPerspective(double x, double y, double z, double yaw, double pitch, double perspectiveAngle)
           
 void setPerspectiveAngle(double angle)
           
 void setPerspectiveRatio(double r)
           
 void setRight()
           
 void setRight(double y, double z)
           
 void setRight(double x, double y, double z)
           
 void setRight(double x, double y, double z, double axonometricRatio)
           
 void setScreen(int x, int y, int w, int h)
           
 void setScreenPosition(int x, int y)
           
 void setScreenSize(int w, int h)
           
 void setTarget(double x, double y, double z)
           
 void setTarget(IVecI t)
           
 void setTop()
           
 void setTop(double x, double y)
           
 void setTop(double x, double y, double z)
           
 void setTop(double x, double y, double z, double axonometricRatio)
           
 void show()
           
 IVec target()
           
 void update()
           
 IVec upDirection()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultNear

public static double defaultNear

defaultFar

public static double defaultFar

defaultAxonRatio

public static double defaultAxonRatio

defaultPersRatio

public static double defaultPersRatio

defaultViewDistance

public static double defaultViewDistance

defaultMode

public static IGraphicMode defaultMode

defaultGLLightPosition

public static float[] defaultGLLightPosition

defaultGLAmbientLight

public static float[] defaultGLAmbientLight

defaultGLDiffuseLight

public static float[] defaultGLDiffuseLight

defaultGLSpecularLight

public static float[] defaultGLSpecularLight

defaultGLTwoSidedLighting

public static boolean defaultGLTwoSidedLighting

defaultGLBGColor

public static double[][][] defaultGLBGColor

pos

public IVec pos

yaw

public double yaw
yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule


pitch

public double pitch
yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule


roll

public double roll
yaw-pitch-roll ZXY conversion yaw=0 pitch=0 equals x-axis yaw is rotation around z, pitch is around y, roll is around x, in right hand rule


axonometric

public boolean axonometric

screenX

public int screenX

screenY

public int screenY

screenWidth

public int screenWidth

screenHeight

public int screenHeight

persRatio

public double persRatio

axonRatio

public double axonRatio

near

public double near

far

public double far

target

public IVec target

rotateAroundTarget

public boolean rotateAroundTarget

distToTarget

public double distToTarget

glWidth

public double glWidth

glHeight

public double glHeight

glTransformMatrix

public IMatrix4 glTransformMatrix

glTransformArray

public double[] glTransformArray

useGL

public boolean useGL

hide

public boolean hide

pane

public IPane pane

mode

public IGraphicMode mode

glBGColor

public double[][][] glBGColor

javaBGColor1

public java.awt.Color javaBGColor1

javaBGColor2

public java.awt.Color javaBGColor2
Constructor Detail

IView

public IView(double x,
             double y,
             double z,
             double yaw,
             double pitch,
             double roll,
             int screenX,
             int screenY,
             int screenWidth,
             int screenHeight,
             boolean axonometric)

IView

public IView(double x,
             double y,
             double z,
             double yaw,
             double pitch,
             double roll,
             int screenX,
             int screenY,
             int screenWidth,
             int screenHeight)

IView

public IView(double x,
             double y,
             double z,
             double yaw,
             double pitch,
             double roll)

IView

public IView(double x,
             double y,
             double z,
             double yaw,
             double pitch)
Method Detail

enableGL

public void enableGL()

disableGL

public void disableGL()

setMode

public void setMode(IGraphicMode m)

mode

public IGraphicMode mode()

isHidden

public boolean isHidden()

hide

public void hide()

show

public void show()

setBGColor

public void setBGColor(java.awt.Color c)

setBGColor

public void setBGColor(java.awt.Color c1,
                       java.awt.Color c2)

setBGColor

public void setBGColor(java.awt.Color c1,
                       java.awt.Color c2,
                       java.awt.Color c3,
                       java.awt.Color c4)

setBGColor

public void setBGColor(java.awt.Color[][] c)

setPane

public void setPane(IPane p)

setScreen

public void setScreen(int x,
                      int y,
                      int w,
                      int h)

setScreenSize

public void setScreenSize(int w,
                          int h)

setScreenPosition

public void setScreenPosition(int x,
                              int y)

getAxonometricRatio

public double getAxonometricRatio()

getPerspectiveRatio

public double getPerspectiveRatio()

setAxonometricRatio

public void setAxonometricRatio(double r)

setPerspectiveRatio

public void setPerspectiveRatio(double r)

setPerspectiveAngle

public void setPerspectiveAngle(double angle)

perspective

public void perspective()

axonometric

public void axonometric()

isAxonometric

public boolean isAxonometric()

setTarget

public void setTarget(double x,
                      double y,
                      double z)

setTarget

public void setTarget(IVecI t)

enableRotationAroundTarget

public void enableRotationAroundTarget()

disableRotationAroundTarget

public void disableRotationAroundTarget()

distanceToTarget

public double distanceToTarget()

set

public void set(double x,
                double y,
                double z)

set

public void set(IVec location)

set

public void set(double x,
                double y,
                double z,
                double yaw,
                double pitch)

set

public void set(IVec location,
                double yaw,
                double pitch)

set

public void set(double x,
                double y,
                double z,
                double yaw,
                double pitch,
                double roll)

set

public void set(IVec location,
                double yaw,
                double pitch,
                double roll)

getLocation

public IVec getLocation()

setLocation

public void setLocation(double x,
                        double y,
                        double z)

setLocation

public void setLocation(IVecI pt)

setAngle

public void setAngle(double yaw,
                     double pitch,
                     double roll)

setAngle

public void setAngle(double yaw,
                     double pitch,
                     double roll,
                     boolean updateTarget)

setAngle

public void setAngle(double yaw,
                     double pitch)

setAngle

public void setAngle(double yaw,
                     double pitch,
                     boolean updateTarget)

moveForward

public void moveForward(double dist)

location

public IVec location()

target

public IVec target()

getYaw

public double getYaw()

getPitch

public double getPitch()

getRoll

public double getRoll()

getAngles

public IVec getAngles()

frontDirection

public IVec frontDirection()

rightDirection

public IVec rightDirection()

upDirection

public IVec upDirection()

focus

public void focus(IBoundingBox bb)

convert

public boolean convert(IVecI orig,
                       IVec2 dest)
converts 3d coordinates to 2d coordinates of screen whose unit is pixels and whose origin is top left corner and positive Y is downward

Returns:
returns if result is inside screen

convert

public boolean convert(IVecI orig,
                       IVec dest)
converts 3d coordinates to 2d. Putting depth in z component of the second argument

Returns:
returns if result is inside screen

drawBG

public void drawBG(javax.media.opengl.GL gl)

draw

public void draw(javax.media.opengl.GL gl)

update

public void update()

setTop

public void setTop()

setTop

public void setTop(double x,
                   double y)

setTop

public void setTop(double x,
                   double y,
                   double z)

setTop

public void setTop(double x,
                   double y,
                   double z,
                   double axonometricRatio)

setBottom

public void setBottom()

setBottom

public void setBottom(double x,
                      double y)

setBottom

public void setBottom(double x,
                      double y,
                      double z)

setBottom

public void setBottom(double x,
                      double y,
                      double z,
                      double axonometricRatio)

setLeft

public void setLeft()

setLeft

public void setLeft(double y,
                    double z)

setLeft

public void setLeft(double x,
                    double y,
                    double z)

setLeft

public void setLeft(double x,
                    double y,
                    double z,
                    double axonometricRatio)

setRight

public void setRight()

setRight

public void setRight(double y,
                     double z)

setRight

public void setRight(double x,
                     double y,
                     double z)

setRight

public void setRight(double x,
                     double y,
                     double z,
                     double axonometricRatio)

setFront

public void setFront()

setFront

public void setFront(double x,
                     double z)

setFront

public void setFront(double x,
                     double y,
                     double z)

setFront

public void setFront(double x,
                     double y,
                     double z,
                     double axonometricRatio)

setBack

public void setBack()

setBack

public void setBack(double x,
                    double z)

setBack

public void setBack(double x,
                    double y,
                    double z)

setBack

public void setBack(double x,
                    double y,
                    double z,
                    double axonometricRatio)

setPerspective

public void setPerspective()

setPerspective

public void setPerspective(double x,
                           double y,
                           double z)

setPerspective

public void setPerspective(double x,
                           double y,
                           double z,
                           double yaw,
                           double pitch)

setPerspective

public void setPerspective(double perspectiveAngle)

setPerspective

public void setPerspective(double x,
                           double y,
                           double z,
                           double perspectiveAngle)

setPerspective

public void setPerspective(double x,
                           double y,
                           double z,
                           double yaw,
                           double pitch,
                           double perspectiveAngle)

setAxonometric

public void setAxonometric()

setAxonometric

public void setAxonometric(double x,
                           double y,
                           double z)

setAxonometric

public void setAxonometric(double x,
                           double y,
                           double z,
                           double axonometricRatio)

setAxonometric

public void setAxonometric(double x,
                           double y,
                           double z,
                           double yaw,
                           double pitch)

setAxonometric

public void setAxonometric(double x,
                           double y,
                           double z,
                           double yaw,
                           double pitch,
                           double axonometricRatio)

getTopView

public static IView getTopView(int screenX,
                               int screenY,
                               int screenWidth,
                               int screenHeight)

getBottomView

public static IView getBottomView(int screenX,
                                  int screenY,
                                  int screenWidth,
                                  int screenHeight)

getLeftView

public static IView getLeftView(int screenX,
                                int screenY,
                                int screenWidth,
                                int screenHeight)

getRightView

public static IView getRightView(int screenX,
                                 int screenY,
                                 int screenWidth,
                                 int screenHeight)

getFrontView

public static IView getFrontView(int screenX,
                                 int screenY,
                                 int screenWidth,
                                 int screenHeight)

getBackView

public static IView getBackView(int screenX,
                                int screenY,
                                int screenWidth,
                                int screenHeight)

getDefaultAxonometricView

public static IView getDefaultAxonometricView(int screenX,
                                              int screenY,
                                              int screenWidth,
                                              int screenHeight)

getDefaultPerspectiveView

public static IView getDefaultPerspectiveView(int screenX,
                                              int screenY,
                                              int screenWidth,
                                              int screenHeight)