Shape
, java.io.Serializable
LineSegment
, Point
, Polygon
, Polyhedron
public abstract class Polytope extends java.lang.Object implements Shape, java.io.Serializable
Modifier and Type | Field | Description |
---|---|---|
protected int |
D |
|
protected Space |
embeddedSpace |
|
protected Polytope[] |
hyperPlanes |
|
protected Vector |
position |
|
protected Vector[] |
vertices |
These vertices are used in all external representations of the polygon.
|
Modifier | Constructor | Description |
---|---|---|
protected |
Polytope(Polytope[] hyperPlanes) |
Constructs a polytope of dimension D from the D-1 finite "planes" that
constitute it.
|
Modifier and Type | Method | Description |
---|---|---|
protected void |
applyTranslationRotation() |
Calculate transformed vertices from current values of vertices, position,
and orientation.
|
abstract boolean |
contains(Vector v) |
Returns
true if the given vector lies inside the polytope,
false otherwise. |
int |
D() |
The dimension of this polytope, which is not necessarily the dimension
of the space it is embedded in.
|
abstract LineSegment[] |
getEdges() |
|
Space |
getEmbeddedSpace() |
The space defining the vectors used to represent the vertices.
|
Vector |
getPosition() |
Returns the geometric center of the polytope.
|
int |
getVertexCount() |
Number of vertices in the polytrope.
|
Vector[] |
getVertices() |
Returns an array of all vertices of the polytrope.
|
abstract double |
getVolume() |
Returns the (hyper)volume enclosed by the polytope.
|
void |
setPosition(Vector r) |
Sets the position of the geometric center of the polytope.
|
java.lang.String |
toString() |
|
abstract void |
updateVertices() |
This method should be defined by the subclass to calculate the vertices
in accordance with the internal representation of the polytope.
|
protected final Space embeddedSpace
protected final int D
protected final Vector[] vertices
protected final Vector position
protected final Polytope[] hyperPlanes
protected Polytope(Polytope[] hyperPlanes)
public abstract void updateVertices()
protected void applyTranslationRotation()
public Vector[] getVertices()
public void setPosition(Vector r)
setPosition
in interface Shape
public Vector getPosition()
public abstract double getVolume()
public abstract boolean contains(Vector v)
true
if the given vector lies inside the polytope,
false
otherwise.public final int getVertexCount()
public Space getEmbeddedSpace()
public int D()
public abstract LineSegment[] getEdges()
public java.lang.String toString()
toString
in class java.lang.Object