|
CubeTwister 2.0alpha142 2012-02-11 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.geom3d.Shape3D
public class Shape3D
Represents a 3 dimensional shape consisting of an arbitrary number of planar and convex vertices.
| Constructor Summary | |
|---|---|
Shape3D(float[] coords,
int[][] faces,
java.awt.Color[][] colors)
Creates a new Shape3D object. |
|
Shape3D(float[] coords,
int[][] faces,
java.awt.Color[][] colors,
int reducedFaceCount)
Creates a new Shape3D object. |
|
| Method Summary | |
|---|---|
void |
addVisibleFacesTo(java.util.List<Face3D> v,
Transform3D t,
Point3D observer)
Adds all vertices to the vector that are visible when this Shape3D is transformed by the given Transform3D. |
float[] |
getCoords()
|
int |
getFaceCount()
|
Face3D[] |
getFaces()
|
java.awt.Color |
getFillColor(int face)
|
int[][] |
getVertices()
|
boolean |
isRecuced()
|
boolean |
isVisible()
|
boolean |
isWireframe()
|
void |
setAction(int face,
java.awt.event.ActionListener action)
|
void |
setBorderColor(int face,
java.awt.Color color)
|
void |
setFillColor(int face,
java.awt.Color color)
|
void |
setReduced(boolean b)
|
void |
setTransform(Transform3D t)
|
void |
setVisible(boolean b)
|
void |
setWireframe(boolean b)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Shape3D(float[] coords,
int[][] faces,
java.awt.Color[][] colors)
coords - Coordinate data for the shape. Each group of
three entries describe a vector x, y, z
in three dimensional space.faces - Faces of the shape. Each entry in the first dimension
of this array describes a face. Each entry in the second
dimension of this array represents a vertex at the
borderline of the face. Each vertex is the index of a
vector in the coords array. The vertices of the face
must be indicated in clockwise direction. All vertices
must be on the same plane and the boundary of the face
must be convex.colors - The colors for each face. For each face, two colors
can be specified: a fill color (index 0 of the inner array)
and a wireframe color (index 1 of the inner array).
public Shape3D(float[] coords,
int[][] faces,
java.awt.Color[][] colors,
int reducedFaceCount)
coords - Coordinate data for the shape. Each group of
three entries describe a vector x, y, z
in three dimensional space.faces - Faces of the shape. Each entry in the first dimension
of this array describes a face. Each entry in the second
dimension of this array represents a vertex at the
borderline of the face. Each vertex is the index of a
vector in the coords array. The vertices of the face
must be indicated in clockwise direction. All vertices
must be on the same plane and the boundary of the face
must be convex.colors - The colors for each face. For each face, two colors
can be specified: a fill color (index 0 of the inner array)
and a wireframe color (index 1 of the inner array).reducedFaceCount - The shape will only draw reducedFaceCount colors,
if the attribute isReduced is set to true.| Method Detail |
|---|
public float[] getCoords()
public int[][] getVertices()
public Face3D[] getFaces()
public boolean isVisible()
public void setVisible(boolean b)
public boolean isRecuced()
public void setReduced(boolean b)
public void setTransform(Transform3D t)
public void addVisibleFacesTo(java.util.List<Face3D> v,
Transform3D t,
Point3D observer)
addVisibleFacesTo in interface Node3Dv - The vector to which the vertices are added.t - This transform is applied to the vertices
before they are tested for visibility
and added to the list.observer - Coords of the observer.
public void setAction(int face,
java.awt.event.ActionListener action)
public java.awt.Color getFillColor(int face)
public void setFillColor(int face,
java.awt.Color color)
public void setBorderColor(int face,
java.awt.Color color)
public int getFaceCount()
public boolean isWireframe()
public void setWireframe(boolean b)
|
(c) Werner Randelshofer. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||