gestalt.render.bin
Class BilateralBin

java.lang.Object
  extended by gestalt.render.bin.BilateralBin
All Implemented Interfaces:
Gestalt, AbstractBin, Drawable

public class BilateralBin
extends java.lang.Object
implements AbstractBin, Gestalt

a bin that handles drawables. in addition this bin stores unsorted drawables in one half of the list and sorted drawables in the other. the bin must be updated as a drawable to execute the sorting algoritm.


Field Summary
 
Fields inherited from interface gestalt.Gestalt
ALPHA, BIN_2D_BACKGROUND, BIN_2D_BACKGROUND_FINISH, BIN_2D_BACKGROUND_SETUP, BIN_2D_FOREGROUND, BIN_2D_FOREGROUND_FINISH, BIN_2D_FOREGROUND_SETUP, BIN_3D, BIN_3D_FINISH, BIN_3D_SETUP, BIN_ARBITRARY, BIN_FRAME_FINISH, BIN_FRAME_SETUP, BIN_NUMBER_OF_DEFAULT_BINS, BITMAP_BLENDFACTOR_DST_ALPHA, BITMAP_BLENDFACTOR_DST_COLOR, BITMAP_BLENDFACTOR_ONE, BITMAP_BLENDFACTOR_ONE_MINUS_DST_ALPHA, BITMAP_BLENDFACTOR_ONE_MINUS_DST_COLOR, BITMAP_BLENDFACTOR_ONE_MINUS_SRC_ALPHA, BITMAP_BLENDFACTOR_ONE_MINUS_SRC_COLOR, BITMAP_BLENDFACTOR_SRC_ALPHA, BITMAP_BLENDFACTOR_SRC_ALPHA_SATURATE, BITMAP_BLENDFACTOR_SRC_COLOR, BITMAP_BLENDFACTOR_ZERO, BITMAP_BLENDMODE_ADD, BITMAP_BLENDMODE_ADD_2, BITMAP_BLENDMODE_MULTIPLY, BITMAP_BLENDMODE_OVERWRITE, BITMAP_COMPONENT_ORDER_BGRA, BITMAP_COMPONENT_ORDER_RGBA, BLUE, CAMERA_A_HANDY_ANGLE, CAMERA_CULLING_BACKFACE, CAMERA_CULLING_FRONT_AND_BACKFACE, CAMERA_CULLING_FRONTFACE, CAMERA_CULLING_NONE, CAMERA_MODE_LOOK_AT, CAMERA_MODE_ROTATE_XYZ, CAMERA_MODE_ROTATION_AXIS, ENGINE_JOGL, EPSILON, FOG_FILTER_EXP, FOG_FILTER_EXP2, FOG_FILTER_LINEAR, FONT_ALIGN_CENTER, FONT_ALIGN_LEFT, FONT_ALIGN_RIGHT, FONT_QUALITY_HIGH, FONT_QUALITY_LOW, FONT_STYLE_BOLD, FONT_STYLE_ITALIC, FONT_STYLE_REGULAR, GREEN, HINT_LEAVE_STATE_UNCHANGED, IMAGE_FILEFORMAT_JPEG, IMAGE_FILEFORMAT_PNG, IMAGE_FILEFORMAT_TGA, INTEL, KEYCODE_0, KEYCODE_1, KEYCODE_2, KEYCODE_3, KEYCODE_4, KEYCODE_5, KEYCODE_6, KEYCODE_7, KEYCODE_8, KEYCODE_9, KEYCODE_A, KEYCODE_B, KEYCODE_C, KEYCODE_D, KEYCODE_DOWN, KEYCODE_E, KEYCODE_ESCAPE, KEYCODE_F, KEYCODE_G, KEYCODE_H, KEYCODE_I, KEYCODE_J, KEYCODE_K, KEYCODE_L, KEYCODE_LEFT, KEYCODE_M, KEYCODE_META, KEYCODE_N, KEYCODE_O, KEYCODE_P, KEYCODE_PAGE_DOWN, KEYCODE_PAGE_UP, KEYCODE_Q, KEYCODE_R, KEYCODE_RIGHT, KEYCODE_S, KEYCODE_SHIFT, KEYCODE_SPACE, KEYCODE_T, KEYCODE_U, KEYCODE_UP, KEYCODE_V, KEYCODE_W, KEYCODE_X, KEYCODE_Y, KEYCODE_Z, LINE_PRIMITIVE_TYPE_LINE_LOOP, LINE_PRIMITIVE_TYPE_LINE_STRIP, LINE_PRIMITIVE_TYPE_LINES, MACOSX, MATERIAL_BLEND_ALPHA, MATERIAL_BLEND_BRIGHTER, MATERIAL_BLEND_CUSTOM, MATERIAL_BLEND_INVERS_MULTIPLY, MATERIAL_BLEND_MULTIPLY, MATERIAL_BLEND_WHITE_INVERT, MATERIAL_NORMAL_NORMALIZE, MATERIAL_NORMAL_RESCALE_NORMALS, MESH_LINE_LOOP, MESH_LINES, MESH_POINTS, MESH_POLYGON, MESH_QUAD_STRIP, MESH_QUADS, MESH_TRIANGLE_FAN, MESH_TRIANGLE_STRIP, MESH_TRIANGLES, MOUSEBUTTON_LEFT, MOUSEBUTTON_MIDDLE, MOUSEBUTTON_RIGHT, MOVIE_DIRECTION_BACKWARDS, MOVIE_DIRECTION_FORWARD, PI, PI_HALF, PICKING_BIN_2D, PICKING_BIN_3D, RED, SHAPE_CUBE_TEXTURE_SAME_FOR_EACH_SIDE, SHAPE_CUBE_TEXTURE_WRAP_AROUND, SHAPE_ORIGIN_BOTTOM_CENTERED, SHAPE_ORIGIN_BOTTOM_LEFT, SHAPE_ORIGIN_BOTTOM_RIGHT, SHAPE_ORIGIN_CENTERED, SHAPE_ORIGIN_CENTERED_LEFT, SHAPE_ORIGIN_CENTERED_RIGHT, SHAPE_ORIGIN_TOP_CENTERED, SHAPE_ORIGIN_TOP_LEFT, SHAPE_ORIGIN_TOP_RIGHT, SHAPE_TRANSFORM_MATRIX, SHAPE_TRANSFORM_MATRIX_AND_ROTATION, SHAPE_TRANSFORM_POSITION_AND_ROTATION, SHAPEBIN_SORT_BY_DISTANCE_TO_CAMERA, SHAPEBIN_SORT_BY_Z_DISTANCE_TO_CAMERAPLANE, SHAPEBIN_SORT_BY_Z_POSITION, SQRT_TWO, TEXTURE_FILTERTYPE_LINEAR, TEXTURE_FILTERTYPE_MIPMAP, TEXTURE_FILTERTYPE_NEAREST, TEXTURE_MEDIA_IMAGE_BGR, TEXTURE_PROPORTION_ARBITRARY, TEXTURE_PROPORTION_POWEROF2, TEXTURE_WRAPMODE_CLAMP, TEXTURE_WRAPMODE_CLAMP_TO_BORDER, TEXTURE_WRAPMODE_REPEAT, TWO_PI, UNDEFINED, USE_DISPLAY_LISTS
 
Constructor Summary
BilateralBin()
           
BilateralBin(int theArrayBlockSize)
           
 
Method Summary
 void add(Drawable theDrawable)
          this method is commonly used to store children of a drawable.
 void add(Drawable[] theDrawables)
           
 void clear()
           
 void draw(GLContext theContext)
          this method is used to draw the drawable, when the context is ready.
 int find(Drawable theDrawable)
           
 Drawable get(int theID)
           
 Drawable[] getDataRef()
           
 float[] getSortData()
          returns the data upon which a sort value is calculated.
 boolean getSortFlag()
           
 float getSortValue()
          returns the last sort value.
 boolean isActive()
          returns whether the drawable is active.
 boolean isSortable()
          returns true if the 'drawable' should be sorted before drawing.
 Drawable remove(Drawable theDrawable)
           
 void remove(Drawable[] theDrawables)
           
 Drawable remove(int theIndex)
           
 void replace(Drawable theDrawableOld, Drawable theDrawableNew)
           
 void set(int theID, Drawable theDrawable)
           
 void setActive(boolean theState)
           
 void setSortFlag(boolean theSortFlag)
           
 void setSortStyle(int theSortStyle)
           
 void setSortValue(float theSortValue)
          caches the current sort value.
 int size()
           
 void swap(Drawable theShapeA, Drawable theShapeB)
           
 void swap(int theIDA, int theIDB)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BilateralBin

public BilateralBin()

BilateralBin

public BilateralBin(int theArrayBlockSize)
Method Detail

setSortFlag

public void setSortFlag(boolean theSortFlag)

getSortFlag

public boolean getSortFlag()

setSortStyle

public void setSortStyle(int theSortStyle)

swap

public void swap(Drawable theShapeA,
                 Drawable theShapeB)
Specified by:
swap in interface AbstractBin

swap

public void swap(int theIDA,
                 int theIDB)
Specified by:
swap in interface AbstractBin

find

public int find(Drawable theDrawable)
Specified by:
find in interface AbstractBin

draw

public void draw(GLContext theContext)
Description copied from interface: Drawable
this method is used to draw the drawable, when the context is ready. although the behavior sometimes varies and doesn t always need to have a visual representation depending on the implementation.

Specified by:
draw in interface Drawable
Parameters:
theContext - GLContext

isActive

public boolean isActive()
Description copied from interface: Drawable
returns whether the drawable is active. it is commonly implemented so that the drawables 'draw' method will be ommitted if 'isActive' return false, although this behavior can vary depending on the implementation.

Specified by:
isActive in interface Drawable
Returns:
boolean

setActive

public void setActive(boolean theState)
Specified by:
setActive in interface AbstractBin

add

public void add(Drawable[] theDrawables)
Specified by:
add in interface AbstractBin

add

public void add(Drawable theDrawable)
Description copied from interface: Drawable
this method is commonly used to store children of a drawable.

Specified by:
add in interface AbstractBin
Specified by:
add in interface Drawable
Parameters:
theDrawable - Drawable

remove

public void remove(Drawable[] theDrawables)
Specified by:
remove in interface AbstractBin

remove

public Drawable remove(int theIndex)
Specified by:
remove in interface AbstractBin

remove

public Drawable remove(Drawable theDrawable)
Specified by:
remove in interface AbstractBin

size

public int size()
Specified by:
size in interface AbstractBin

get

public Drawable get(int theID)
Specified by:
get in interface AbstractBin

set

public void set(int theID,
                Drawable theDrawable)
Specified by:
set in interface AbstractBin

replace

public void replace(Drawable theDrawableOld,
                    Drawable theDrawableNew)
Specified by:
replace in interface AbstractBin

clear

public void clear()
Specified by:
clear in interface AbstractBin

getDataRef

public Drawable[] getDataRef()
Specified by:
getDataRef in interface AbstractBin

toString

public java.lang.String toString()
Specified by:
toString in interface AbstractBin
Overrides:
toString in class java.lang.Object

getSortValue

public float getSortValue()
Description copied from interface: Drawable
returns the last sort value.

Specified by:
getSortValue in interface Drawable
Returns:
float

setSortValue

public void setSortValue(float theSortValue)
Description copied from interface: Drawable
caches the current sort value.

Specified by:
setSortValue in interface Drawable
Parameters:
theSortValue - float

getSortData

public float[] getSortData()
Description copied from interface: Drawable
returns the data upon which a sort value is calculated.

Specified by:
getSortData in interface Drawable
Returns:
float[]

isSortable

public boolean isSortable()
Description copied from interface: Drawable
returns true if the 'drawable' should be sorted before drawing.

Specified by:
isSortable in interface Drawable
Returns:
boolean


processing library gestalt_p5 by Patrick Kochlik + Dennis Paul. (c) 2009