de.grogra.imp3d.objects
Class GRSMesh
java.lang.Object
de.grogra.persistence.ShareableBase
de.grogra.graph.impl.ContextDependentBase
de.grogra.imp3d.objects.GRSMesh
- All Implemented Interfaces:
- ContextDependent, Polygons, Polygonization, Manageable, Shareable
public class GRSMesh
- extends ContextDependentBase
- implements Polygons
A GRSMesh looks for GRSVertex
nodes in its object context (see Polygons),
interprets them as a graph rotation system, and computes
the corresponding polygonal mesh.
The precise semantics is as follows: The object context is represented by a
MeshNode. The GRSMesh looks
for all GRSVertex nodes which are directly connected by an edge
with the MeshNode, the latter being the source of the edge.
All found vertices are taken as vertices of the mesh, their location is
obtained by the translational component of their transformation
(see Null.transform). For each vertex,
the list GRSVertex.neighbors defines its
cyclic neighborhood, i.e., all vertices which are connected with the current
vertex by an edge of a mesh polygon, sorted in counter-clockwise order when
seen from above.
When a polygon of a GRSMesh has more than three edges, an
additional vertex will be inserted at the center of the polygon vertices.
For every polygon edge, a triangle is created using the edge and the
additional central vertex.
The implementation of GRSMesh cannot handle neighborhoods
of more than 63 vertices. In practice, this should not pose any problem.
- Author:
- Ole Kniemeyer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
$TYPE
public static final GRSMesh.Type $TYPE
GRSMesh
public GRSMesh()
dependsOnContext
public boolean dependsOnContext()
- Description copied from interface:
ContextDependent
- Determines whether this object actually depends on context.
- Specified by:
dependsOnContext in interface ContextDependent
- Returns:
true iff this object depends on context
getManageableType
public ManageableType getManageableType()
- Specified by:
getManageableType in interface Manageable
polygonize
public void polygonize(ContextDependent source,
GraphState gs,
PolygonArray out,
int flags,
float flatness)
- Description copied from interface:
Polygonization
- Performs the polygonization of the source into polygons.
The field
out.userObject is not modified.
- Specified by:
polygonize in interface Polygonization
- Parameters:
source - the data source as reported by a previous invocation of
Polygonizable.getPolygonizableSource(GraphState)
with the same gsgs - the current graph stateout - the polygons are written to outflags - combination of bit masksflatness - a parameter for the degree of flatness, a typical value is 1
writeStamp
public void writeStamp(Cache.Entry cache,
GraphState gs)
- Description copied from interface:
ContextDependent
- Writes a stamp of the context into
cache. Based on
this stamp, a cache detects whether the context of this
object has changed or not.
- Specified by:
writeStamp in interface ContextDependent- Overrides:
writeStamp in class ContextDependentBase
- Parameters:
cache - a cache entry to write the stampgs - the current graph state