Package HAL.Gui
Class OpenGL3DWindow
- java.lang.Object
-
- HAL.Gui.OpenGL3DWindow
-
-
Constructor Summary
Constructors Constructor Description OpenGL3DWindow(int xPix, int yPix, int xDim, int yDim, int zDim)
the below constructors are variants of the above constructor with default values for some of the argumentsOpenGL3DWindow(int xPix, int yPix, int xDim, int yDim, int zDim, boolean active)
OpenGL3DWindow(java.lang.String title, int xPix, int yPix, int xDim, int yDim, int zDim)
OpenGL3DWindow(java.lang.String title, int xPix, int yPix, int xDim, int yDim, int zDim, boolean active)
creates a new OpenGL2DWindow
-
Method Summary
Modifier and Type Method Description void
CelSphere(double x, double y, double z, double rad, int color)
draws a circle with a white dot and background black border to mark the outline of a cellvoid
Circle(double x, double y, double z, double rad, int color)
draws a circle centered around x,y, subsequent circles will be drawn over topvoid
Circle(double x, double y, double z, double rad, ColorIntGenerator ColorGen)
draws a circle centered around x,y, subsequent circles will be drawn over top, the ColorGen function is used to generate the color of the circle and will not be called if the Gui is not activevoid
Clear(int color)
usually called before any other draw commands, sets the screen to a color.void
ClearBox(int clearColor, int lineColor)
usually called before any other draw commands, sets the screen to a color.void
Close()
closes the guivoid
FanShape(float centerX, float centerY, float centerZ, float scale, float[] points, int color)
draws a fan shape around the center x and y, using the array of points to define the edges of the fan.void
FanShape(float centerX, float centerY, float centerZ, float scale, float[] points, int color, float xdisp, float ydisp, float zdisp)
draws a fan shape around the center x and y, using the array of points to define the edges of the fan.boolean
IsActive()
returns whether the Gui is active (whether it exists)boolean
IsClosed()
returns true if the close button has been clicked in the Guiboolean
IsWrapX()
boolean
IsWrapY()
boolean
IsWrapZ()
int
Length()
void
Line(double x1, double y1, double z1, double x2, double y2, double z2, int color)
draws a line between (x1,y1,z1) and (x2,y2,z2)void
LineStrip(double[] xs, double[] ys, double[] zs, int color)
draws a series of lines between all x,y,z tripletsvoid
LineStrip(double[] coords, int color)
draws a series of lines between all x,y,z triplets, coords should store triplets as x,y,z,x,y,z...void
RectangleXY(double x1, double y1, double x2, double y2, double z, int color)
draws a rectangle between (x1,y1,z) and (x2,y2,z)void
RectangleXZ(double x1, double z1, double x2, double z2, double y, int color)
void
RectangleYZ(double y1, double z1, double y2, double z2, double x, int color)
void
SetPixXY(int x, int y, int color)
void
SetPixXZ(int x, int z, int color)
void
SetPixYZ(int y, int z, int color)
void
TickPause(int millis)
call this once per step of your model, and the function will ensure that your model runs at the rate provided in millis.void
ToGIF(java.lang.String path)
saves the current state image to a GIF image, call Update firstvoid
ToJPG(java.lang.String path)
saves the current state image to a JPG, call Update firstvoid
ToPNG(java.lang.String path)
saves the current state image to a PNG, call Update firstvoid
Update()
renders all draw commands to the windowint
Xdim()
int
Ydim()
int
Zdim()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface HAL.Interfaces.Grid3D
ApplyHood, ApplyHood, ApplyHoodMapped, ApplyRectangle, BoundaryIs, ContainsValidI, ContainsValidI, ConvI, ConvXpt, ConvXsq, ConvYpt, ConvYsq, ConvZpt, ConvZsq, DispX, DispY, DispZ, Dist, DistSquared, GetHoodI, I, I, In, In, InWrap, InWrap, ItoX, ItoY, ItoZ, MapHood, MapHood, MapHood, MapHood, RandomHoodI, WrapI
-
-
-
-
Constructor Detail
-
OpenGL3DWindow
public OpenGL3DWindow(java.lang.String title, int xPix, int yPix, int xDim, int yDim, int zDim, boolean active)
creates a new OpenGL2DWindow- Parameters:
title
- the title that will appear at the top of the window (default "")xPix
- the length of the window in screen pixelsyPix
- the height of the window in screen pixelsxDim
- the length that the window will represent for drawing, should match the xDim of the modelyDim
- the height that the window will represent for drawing, should match the yDim of the modelzDim
- the depth that the window will represent for drawing, should match the zDim of the modelactive
- if set to false, the OpenGL2DWindow will not actually render and its methods will be skipped (default true)
-
OpenGL3DWindow
public OpenGL3DWindow(int xPix, int yPix, int xDim, int yDim, int zDim)
the below constructors are variants of the above constructor with default values for some of the arguments
-
OpenGL3DWindow
public OpenGL3DWindow(int xPix, int yPix, int xDim, int yDim, int zDim, boolean active)
-
OpenGL3DWindow
public OpenGL3DWindow(java.lang.String title, int xPix, int yPix, int xDim, int yDim, int zDim)
-
-
Method Detail
-
TickPause
public void TickPause(int millis)
call this once per step of your model, and the function will ensure that your model runs at the rate provided in millis. the function will take the amount time between calls into account to ensure a consistent tick rate.
-
Clear
public void Clear(int color)
usually called before any other draw commands, sets the screen to a color.
-
ClearBox
public void ClearBox(int clearColor, int lineColor)
usually called before any other draw commands, sets the screen to a color. and draws a box around the grid domain
-
Update
public void Update()
renders all draw commands to the window
-
IsClosed
public boolean IsClosed()
returns true if the close button has been clicked in the Gui
-
Close
public void Close()
closes the gui
-
IsActive
public boolean IsActive()
returns whether the Gui is active (whether it exists)
-
CelSphere
public void CelSphere(double x, double y, double z, double rad, int color)
draws a circle with a white dot and background black border to mark the outline of a cell
-
Circle
public void Circle(double x, double y, double z, double rad, int color)
draws a circle centered around x,y, subsequent circles will be drawn over top
-
Circle
public void Circle(double x, double y, double z, double rad, ColorIntGenerator ColorGen)
draws a circle centered around x,y, subsequent circles will be drawn over top, the ColorGen function is used to generate the color of the circle and will not be called if the Gui is not active
-
FanShape
public void FanShape(float centerX, float centerY, float centerZ, float scale, float[] points, int color)
draws a fan shape around the center x and y, using the array of points to define the edges of the fan. used as part of the circle function
-
SetPixXY
public void SetPixXY(int x, int y, int color)
-
SetPixXZ
public void SetPixXZ(int x, int z, int color)
-
SetPixYZ
public void SetPixYZ(int y, int z, int color)
-
RectangleXY
public void RectangleXY(double x1, double y1, double x2, double y2, double z, int color)
draws a rectangle between (x1,y1,z) and (x2,y2,z)
-
RectangleXZ
public void RectangleXZ(double x1, double z1, double x2, double z2, double y, int color)
-
RectangleYZ
public void RectangleYZ(double y1, double z1, double y2, double z2, double x, int color)
-
FanShape
public void FanShape(float centerX, float centerY, float centerZ, float scale, float[] points, int color, float xdisp, float ydisp, float zdisp)
draws a fan shape around the center x and y, using the array of points to define the edges of the fan. used as part of the circle function
-
Line
public void Line(double x1, double y1, double z1, double x2, double y2, double z2, int color)
draws a line between (x1,y1,z1) and (x2,y2,z2)
-
LineStrip
public void LineStrip(double[] xs, double[] ys, double[] zs, int color)
draws a series of lines between all x,y,z triplets
-
LineStrip
public void LineStrip(double[] coords, int color)
draws a series of lines between all x,y,z triplets, coords should store triplets as x,y,z,x,y,z...
-
ToPNG
public void ToPNG(java.lang.String path)
saves the current state image to a PNG, call Update first
-
ToJPG
public void ToJPG(java.lang.String path)
saves the current state image to a JPG, call Update first
-
ToGIF
public void ToGIF(java.lang.String path)
saves the current state image to a GIF image, call Update first
-
-