gzz.gfx.gl
Class GLVobCoorder

java.lang.Object
  |
  +--gzz.vob.VobCoorder
        |
        +--gzz.vob.AffineVobCoorder
              |
              +--gzz.gfx.gl.GLVobCoorder

public final class GLVobCoorder
extends AffineVobCoorder


Field Summary
static boolean dbg
           
static java.lang.String rcsid
           
 
Constructor Summary
GLVobCoorder()
           
 
Method Summary
 void activate(int cs)
          Cause the given coordinate system to be considered when getCSAt() is called.
 int affineCoordsys(int into, float depth, float cx, float cy, float x_x, float x_y, float y_x, float y_y)
           
 int box(int into, float w, float h)
           
 int buoyOnCircle(int into, int anchor, float cx, float cy, float rad, float px, float py, float shiftamount)
           
 int concat(int parent, int child)
           
 int cull(int parent, int clip)
          Creates a CullingCoordSys using the parent also as the test coordinate system.
 int cull(int parent, int test, int clip)
          Creates a CullingCoordSys with distinct parent and test coordinate systems.
 int distort(int into, float x, float y, float w, float h, float mag, float min)
          A fisheye coordinate system: non-linear magnification.
 void dump()
           
 int getBuoyOnCircleAnchor(int cs)
           
 java.lang.String getCoordSystemStr(int cs)
           
 int getCSAt(int parent, float x, float y, float[] targetcoords)
          Get the topmost activated coordinate system which has parent as a primary ancestor.
 int getParent(int cs)
           
 Vob.RenderInfo getRenderInfo(int cs)
           
 void getSqSize(int cs, float[] into)
          Get the size of the "unit square" of the given coordinate system.
 boolean inverseTransformPoints3_interp(int[] interpList, GLVobCoorder other, float fract, boolean show1, int withCS, float[] points, float[] into)
           
 float[] inverseTransformPoints3(int withCS, float[] points, float[] into)
           
 int invert(int parent)
           
 int nadirOrigin(int into, int nadir)
          Make a nadir rotation of into towards nadir.
 int nadirUnitSq(int into, int nadir)
          Make a nadir rotation around unitsq center towards nadir.
 boolean needInterp(VobCoorder interpTo, int[] interpList)
           
 int orthoBox(int into, float z, float x, float y, float sx, float sy, float w, float h)
           
 void renderInterp(GL.RenderingSurface into, GLVobMap theVobs, int[] csinds, GLVobCoorder other, float fract, boolean standardcoords, boolean showFinal)
           
 void renderInterp(GraphicsAPI.RenderingSurface into, GLVobMap theVobs, int[] csinds, GLVobCoorder other, float fract, boolean standardcoords, boolean showFinal)
           
 int rotate(int into, float degrees)
          Get a subcs rotated clockwise.
 int rotateCentered(int into, float degrees, float x, float y)
           
 int rotateXYZ(int into, float degrees, float x, float y, float z)
           
 int scale(int into, float sx, float sy, float sz)
           
 void setAffineParams(int cs, float depth, float cx, float cy, float x_x, float x_y, float y_x, float y_y)
           
 void setBoxParams(int cs, float w, float h)
           
 void setDistortParams(int cs, float x, float y, float w, float h, float mag, float min)
           
 void setOrthoBoxParams(int cs, float z, float x, float y, float sx, float sy, float w, float h)
           
 void setRotateCenteredParams(int cs, float degrees, float x, float y)
           
 void setRotateParams(int cs, float degrees)
           
 void setScaleParams(int cs, float sx, float sy, float sz)
           
 float timeRender(GL.RenderingSurface into, GLVobMap theVobs, boolean standardcoords, int iters)
           
 boolean transformPoints3_interp(int[] interpList, GLVobCoorder other, float fract, boolean show1, int withCS, float[] points, float[] into)
           
 float[] transformPoints3(int withCS, float[] points, float[] into)
          Transform a point to screen coordinates from the given cs.
 int translateXYZ(int into, float sx, float sy, float sz)
           
 int unitSq(int into)
           
 
Methods inherited from class gzz.vob.AffineVobCoorder
ortho, setOrthoParams
 
Methods inherited from class gzz.vob.VobCoorder
scale, setScaleParams, setTranslateParams, setTranslateParams, transformPoint, transformPoints2, translate, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rcsid

public static final java.lang.String rcsid
See Also:
Constant Field Values

dbg

public static boolean dbg
Constructor Detail

GLVobCoorder

public GLVobCoorder()
Method Detail

activate

public void activate(int cs)
Description copied from class: VobCoorder
Cause the given coordinate system to be considered when getCSAt() is called.

Specified by:
activate in class VobCoorder

getCSAt

public int getCSAt(int parent,
                   float x,
                   float y,
                   float[] targetcoords)
Description copied from class: VobCoorder
Get the topmost activated coordinate system which has parent as a primary ancestor. This is defined as follows:
          1) Inverse transform into the coordinate system; in there, clip
             against the unit square and project to the plane z=0

          2) Transform the projected point back into screen coordinates, making
             note of the z coordinate.
            

Specified by:
getCSAt in class VobCoorder
Returns:
Coordinate system number, or -1 if none.

getParent

public int getParent(int cs)

getCoordSystemStr

public java.lang.String getCoordSystemStr(int cs)

affineCoordsys

public int affineCoordsys(int into,
                          float depth,
                          float cx,
                          float cy,
                          float x_x,
                          float x_y,
                          float y_x,
                          float y_y)
Specified by:
affineCoordsys in class AffineVobCoorder

setAffineParams

public void setAffineParams(int cs,
                            float depth,
                            float cx,
                            float cy,
                            float x_x,
                            float x_y,
                            float y_x,
                            float y_y)
Specified by:
setAffineParams in class AffineVobCoorder

rotate

public int rotate(int into,
                  float degrees)
Description copied from class: AffineVobCoorder
Get a subcs rotated clockwise.

Specified by:
rotate in class AffineVobCoorder

setRotateParams

public void setRotateParams(int cs,
                            float degrees)
Specified by:
setRotateParams in class AffineVobCoorder

rotateCentered

public int rotateCentered(int into,
                          float degrees,
                          float x,
                          float y)

setRotateCenteredParams

public void setRotateCenteredParams(int cs,
                                    float degrees,
                                    float x,
                                    float y)

rotateXYZ

public int rotateXYZ(int into,
                     float degrees,
                     float x,
                     float y,
                     float z)

translateXYZ

public int translateXYZ(int into,
                        float sx,
                        float sy,
                        float sz)

buoyOnCircle

public int buoyOnCircle(int into,
                        int anchor,
                        float cx,
                        float cy,
                        float rad,
                        float px,
                        float py,
                        float shiftamount)

getBuoyOnCircleAnchor

public int getBuoyOnCircleAnchor(int cs)

nadirOrigin

public int nadirOrigin(int into,
                       int nadir)
Make a nadir rotation of into towards nadir. That is, at each moment of time, nadirOrigin(a, b) is equivalent to rotate(a, X) for some angle. The angle is determined so that the positive y direction from (0,0) of the rotated coordinate system points towards the origin of the nadir coordinate system.

Parameters:
into - The coordinate system for which a rotated child is to be constructed.
nadir - The coordinate system towards whose origin the positive y coordinate axis of the rotated CS should point.

nadirUnitSq

public int nadirUnitSq(int into,
                       int nadir)
Make a nadir rotation around unitsq center towards nadir.


scale

public int scale(int into,
                 float sx,
                 float sy,
                 float sz)
Specified by:
scale in class AffineVobCoorder

setScaleParams

public void setScaleParams(int cs,
                           float sx,
                           float sy,
                           float sz)
Specified by:
setScaleParams in class AffineVobCoorder

box

public int box(int into,
               float w,
               float h)
Overrides:
box in class VobCoorder

setBoxParams

public void setBoxParams(int cs,
                         float w,
                         float h)
Overrides:
setBoxParams in class VobCoorder

unitSq

public int unitSq(int into)
Overrides:
unitSq in class VobCoorder

orthoBox

public int orthoBox(int into,
                    float z,
                    float x,
                    float y,
                    float sx,
                    float sy,
                    float w,
                    float h)
Specified by:
orthoBox in class VobCoorder

setOrthoBoxParams

public void setOrthoBoxParams(int cs,
                              float z,
                              float x,
                              float y,
                              float sx,
                              float sy,
                              float w,
                              float h)
Specified by:
setOrthoBoxParams in class VobCoorder

getSqSize

public void getSqSize(int cs,
                      float[] into)
Description copied from class: VobCoorder
Get the size of the "unit square" of the given coordinate system. This is the size that the unit square of unitSqCS() would be in the given coordinate system.

Specified by:
getSqSize in class VobCoorder

distort

public int distort(int into,
                   float x,
                   float y,
                   float w,
                   float h,
                   float mag,
                   float min)
A fisheye coordinate system: non-linear magnification.

Parameters:
into - The parent coordinate system, inside which this cs is
mag - The magnification at its largest, i.e. in the center of the rectangle defined by x, y, w, h
min - The magnification at its smallest, i.e. far away from the origin.

setDistortParams

public void setDistortParams(int cs,
                             float x,
                             float y,
                             float w,
                             float h,
                             float mag,
                             float min)

concat

public int concat(int parent,
                  int child)

invert

public int invert(int parent)

cull

public int cull(int parent,
                int clip)
Description copied from class: VobCoorder
Creates a CullingCoordSys using the parent also as the test coordinate system.

Overrides:
cull in class VobCoorder

cull

public int cull(int parent,
                int test,
                int clip)
Description copied from class: VobCoorder
Creates a CullingCoordSys with distinct parent and test coordinate systems. Exluding the test for drawing, the CullingCoordSys works like its parent coordinate system. E.g. CullingCoordSys returns its parents box.

This coordsys will not necessarily be drawn if the boxes of the test and clip coordinate systems do not intersect. However, this is not guaranteed; the only thing guaranteed is that if the boxes of the test and clip coordinate systems *do* intersect, the CullingCoordsys will be drawn.

The default implementation (although this may change in the future) in VobCoorder is to simply return parent.

Overrides:
cull in class VobCoorder
Parameters:
parent - ID of the coordinate system which points will be transformed, if CullingCoordSys is shown
test - ID of the coordinate system whose box is tested against the clip coordinate system.
clip - ID of the coordinate system whose box is tested against the test coordinate system.

dump

public void dump()
Specified by:
dump in class VobCoorder

renderInterp

public void renderInterp(GraphicsAPI.RenderingSurface into,
                         GLVobMap theVobs,
                         int[] csinds,
                         GLVobCoorder other,
                         float fract,
                         boolean standardcoords,
                         boolean showFinal)

renderInterp

public void renderInterp(GL.RenderingSurface into,
                         GLVobMap theVobs,
                         int[] csinds,
                         GLVobCoorder other,
                         float fract,
                         boolean standardcoords,
                         boolean showFinal)

timeRender

public float timeRender(GL.RenderingSurface into,
                        GLVobMap theVobs,
                        boolean standardcoords,
                        int iters)

getRenderInfo

public Vob.RenderInfo getRenderInfo(int cs)
Specified by:
getRenderInfo in class VobCoorder

needInterp

public boolean needInterp(VobCoorder interpTo,
                          int[] interpList)
Specified by:
needInterp in class VobCoorder

transformPoints3

public float[] transformPoints3(int withCS,
                                float[] points,
                                float[] into)
Description copied from class: VobCoorder
Transform a point to screen coordinates from the given cs.

Overrides:
transformPoints3 in class VobCoorder

inverseTransformPoints3

public float[] inverseTransformPoints3(int withCS,
                                       float[] points,
                                       float[] into)
Overrides:
inverseTransformPoints3 in class VobCoorder
Returns:
True, if a reasonable inverse was found.

transformPoints3_interp

public boolean transformPoints3_interp(int[] interpList,
                                       GLVobCoorder other,
                                       float fract,
                                       boolean show1,
                                       int withCS,
                                       float[] points,
                                       float[] into)

inverseTransformPoints3_interp

public boolean inverseTransformPoints3_interp(int[] interpList,
                                              GLVobCoorder other,
                                              float fract,
                                              boolean show1,
                                              int withCS,
                                              float[] points,
                                              float[] into)