Public Member Functions | |
DrawObject (final int numberOfEdges) | |
boolean | equals (Object o) |
Appearance | getAppearance () |
Edge[] | getEdges () |
Vertex[] | getPosition () |
void | scale (float factor) |
void | setAppearance (Appearance appearance) |
void | setPosition (Vertex[] position) |
void | transform (float[][] matrix) |
void | updateCentroid () |
Static Public Member Functions | |
static float[][] | MatrixMultiply (float mat1[][], float mat2[][]) |
Protected Member Functions | |
void | applyColor (PGraphics g, DrawSettings drawSettings) |
Protected Attributes | |
Appearance | appearance |
Vertex | position [] |
Static Private Attributes | |
static final long | serialVersionUID = -1917773602783043823L |
Base class for all drawable model parts (Line / Triangle)
Definition at line 21 of file DrawObject.java.
edu.tum.cs.vis.model.util.DrawObject.DrawObject | ( | final int | numberOfEdges | ) | [inline] |
Constructor which initializes position array to numberOfEdges
items.
Definition at line 43 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.applyColor | ( | PGraphics | g, |
DrawSettings | drawSettings | ||
) | [inline, protected] |
Apply the color of appearance member to the PApplet. Called before drawing a DrawObject.
g | Graphics to draw on |
drawSettings | If != null this draw settings are used instead of the color from appearance |
Definition at line 81 of file DrawObject.java.
boolean edu.tum.cs.vis.model.util.DrawObject.equals | ( | Object | o | ) | [inline] |
Definition at line 152 of file DrawObject.java.
Definition at line 177 of file DrawObject.java.
Edge [] edu.tum.cs.vis.model.util.DrawObject.getEdges | ( | ) | [inline] |
Get edge vectors. Each vector points from one edge point to the next one. For a triangle you will get 3 edges representing the outer line.
Reimplemented in edu.tum.cs.vis.model.util.Triangle.
Definition at line 259 of file DrawObject.java.
Vertex [] edu.tum.cs.vis.model.util.DrawObject.getPosition | ( | ) | [inline] |
Definition at line 184 of file DrawObject.java.
static float [][] edu.tum.cs.vis.model.util.DrawObject.MatrixMultiply | ( | float | mat1[][], |
float | mat2[][] | ||
) | [inline, static] |
Multiplies the two given matrix. Must have correct size for multiplying.
mat1 | matrix 1 |
mat2 | matrix 2 |
Definition at line 56 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.scale | ( | float | factor | ) | [inline] |
Scales all coordinates of the position points by the given factor
factor | The Scale factor |
Definition at line 194 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.setAppearance | ( | Appearance | appearance | ) | [inline] |
appearance | the appearance to set |
Definition at line 207 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.setPosition | ( | Vertex[] | position | ) | [inline] |
Sets the position array of this object and calls updateNormalVector
position | new position of this object. |
Definition at line 217 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.transform | ( | float | matrix[][] | ) | [inline] |
Apply 4x4 transformation matrix to the position vectors of this object
matrix | the transformation matrix |
Definition at line 228 of file DrawObject.java.
void edu.tum.cs.vis.model.util.DrawObject.updateCentroid | ( | ) | [inline] |
Recalculates the and centroid. Called automatically when calling setPosition
. If you modify the position array directly, call this afterwards.
Reimplemented in edu.tum.cs.vis.model.util.Triangle.
Definition at line 247 of file DrawObject.java.
Color or texture of the object
Definition at line 35 of file DrawObject.java.
Vertex edu.tum.cs.vis.model.util.DrawObject.position[] [protected] |
the position points of the object
Definition at line 30 of file DrawObject.java.
final long edu.tum.cs.vis.model.util.DrawObject.serialVersionUID = -1917773602783043823L [static, private] |
auto generated
Reimplemented in edu.tum.cs.vis.model.util.Triangle, and edu.tum.cs.vis.model.util.Line.
Definition at line 25 of file DrawObject.java.