|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcs567.smoke.Smoke
public class Smoke
CS567: Assignment #4 "Interactive Smoke Control" main class. Modify as needed.
| Nested Class Summary | |
|---|---|
(package private) class |
Smoke.MyMouseHandler
Modify this class to improve mouse interaction. |
| Field Summary | |
|---|---|
(package private) SmokeControlForces |
control
|
(package private) static int |
dim
Frame dimensions. |
(package private) boolean |
drawWireframe
Draws wireframe if true, and pixel blocks if false. |
float |
dt
Size of time step (in seconds). |
(package private) javax.swing.JFrame |
frame
Main window frame. |
(package private) cs567.smoke.Smoke.FrameExporter |
frameExporter
Reference to current FrameExporter, or null if no frames being dumped. |
(package private) FluidSolver |
fs
|
(package private) SmokeKeyframe[] |
keyframes
|
(package private) Smoke.MyMouseHandler |
mouseHandler
|
(package private) int |
N_STEPS_PER_FRAME
|
(package private) boolean |
simulate
Toggle to advance simulation. |
| Constructor Summary | |
|---|---|
Smoke(java.lang.String[] imageKeyframes)
Main constructor. |
|
| Method Summary | |
|---|---|
void |
dispatchKey(char key,
java.awt.event.KeyEvent e)
Handles keyboard events, e.g., spacebar toggles simulation/pausing, and escape resets the current Task. |
void |
display(javax.media.opengl.GLAutoDrawable drawable)
Main event loop: OpenGL display + simulation advance. |
void |
displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
GLEventListener implementation |
javax.vecmath.Point2d |
getPoint2d(java.awt.event.MouseEvent e)
Maps mouse event into computational cell using OrthoMap. |
void |
init(javax.media.opengl.GLAutoDrawable drawable)
GLEventListener implementation: Initializes JOGL renderer. |
static void |
main(java.lang.String[] args)
### Ready. |
void |
reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
GLEventListener implementation |
(package private) void |
simulateAndDisplayScene(javax.media.opengl.GL gl)
Simulate then display particle system and any builder adornments. |
void |
start()
Builds/shows window, and starts simulator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
static final int dim
cs567.smoke.Smoke.FrameExporter frameExporter
int N_STEPS_PER_FRAME
public float dt
javax.swing.JFrame frame
boolean simulate
boolean drawWireframe
FluidSolver fs
Smoke.MyMouseHandler mouseHandler
SmokeControlForces control
SmokeKeyframe[] keyframes
| Constructor Detail |
|---|
Smoke(java.lang.String[] imageKeyframes) throws java.io.IOException
imageKeyframes - Image keyframes to use as smoke targets.
java.io.IOException| Method Detail |
|---|
public void start()
public javax.vecmath.Point2d getPoint2d(java.awt.event.MouseEvent e)
public void init(javax.media.opengl.GLAutoDrawable drawable)
init in interface javax.media.opengl.GLEventListener
public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
boolean modeChanged,
boolean deviceChanged)
displayChanged in interface javax.media.opengl.GLEventListener
public void reshape(javax.media.opengl.GLAutoDrawable drawable,
int x,
int y,
int width,
int height)
reshape in interface javax.media.opengl.GLEventListenerpublic void display(javax.media.opengl.GLAutoDrawable drawable)
display in interface javax.media.opengl.GLEventListenervoid simulateAndDisplayScene(javax.media.opengl.GL gl)
public void dispatchKey(char key,
java.awt.event.KeyEvent e)
public static void main(java.lang.String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||