|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcs5643.rigidbody.ImageBlocker
public class ImageBlocker
Converts an image into Block objects, and identifies connected components to generate RigidBody objects. NOTE: YOU DON'T HAVE TO (or want to!) MODIFY THIS CODE.
Nested Class Summary | |
---|---|
(package private) class |
ImageBlocker.ScanlineCCBuilder
Finds connected components by unifying row/column fragment labels via iterative minimization of row/col fragment labels using expansion moves. |
Field Summary | |
---|---|
(package private) Block[][] |
B
Block[i][j] with null for massless/background Blocks. |
(package private) java.util.ArrayList<java.util.HashSet<Block>> |
components
Resulting sets of connected Block components. |
(package private) com.sun.opengl.util.texture.spi.TGAImage |
image
Image in question. |
(package private) int |
M
#Rows |
(package private) int |
N
#Columns |
Constructor Summary | |
---|---|
ImageBlocker(java.lang.String tgaFilename)
|
Method Summary | |
---|---|
void |
addComponentRigidBodies(RigidBodySystem R)
Constructs new RigidBody objects for each connected component of Blocks, and adds each to the RigidBodySystem. |
java.util.ArrayList<Block> |
getBlocks()
Nonempty Blocks of image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
com.sun.opengl.util.texture.spi.TGAImage image
int M
int N
Block[][] B
java.util.ArrayList<java.util.HashSet<Block>> components
Constructor Detail |
---|
public ImageBlocker(java.lang.String tgaFilename) throws java.io.IOException
tgaFilename
- TGA image filename (RGB, uncompressed)
containing rigid image elements on a white background.
java.io.IOException
Method Detail |
---|
public java.util.ArrayList<Block> getBlocks()
public void addComponentRigidBodies(RigidBodySystem R)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |