de.grogra.imp3d.objects
public class GRSMesh extends ContextDependentBase implements Polygons
GRSMesh looks for GRSVertex
nodes in its object context (see Polygons),
interprets them as a
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.
| Modifier and Type | Class and Description |
|---|---|
static class |
GRSMesh.Type |
| Modifier and Type | Field and Description |
|---|---|
static GRSMesh.Type |
$TYPE |
COMPUTE_NORMALS, COMPUTE_UV| Constructor and Description |
|---|
GRSMesh() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
dependsOnContext()
Determines whether this object actually depends on context.
|
ManageableType |
getManageableType() |
void |
polygonize(ContextDependent source,
GraphState gs,
PolygonArray out,
int flags,
float flatness)
Performs the polygonization of the source into polygons.
|
void |
writeStamp(Cache.Entry cache,
GraphState gs)
Writes a stamp of the context into
cache. |
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReferencepublic static final GRSMesh.Type $TYPE
public boolean dependsOnContext()
ContextDependentdependsOnContext in interface ContextDependenttrue iff this object depends on contextpublic ManageableType getManageableType()
getManageableType in interface Manageablepublic void polygonize(ContextDependent source, GraphState gs, PolygonArray out, int flags, float flatness)
Polygonizationout.userObject is not modified.polygonize in interface Polygonizationsource - 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 1public void writeStamp(Cache.Entry cache, GraphState gs)
ContextDependentcache. Based on
this stamp, a cache detects whether the context of this
object has changed or not.writeStamp in interface ContextDependentwriteStamp in class ContextDependentBasecache - a cache entry to write the stampgs - the current graph state