- All Implemented Interfaces:
ContextDependent
,Polygons
,Polygonization
,Manageable
,Shareable
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.
- Author:
- Ole Kniemeyer
-
Nested Class Summary
-
Field Summary
Fields inherited from interface de.grogra.imp3d.Polygonization
COMPUTE_NORMALS, COMPUTE_UV
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determines whether this object actually depends on context.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 intocache
.Methods inherited from class de.grogra.persistence.ShareableBase
addReference, appendReferencesTo, fieldModified, getProvider, getStamp, initProvider, manageableReadResolve, manageableWriteReplace, removeReference
-
Field Details
-
$TYPE
-
-
Constructor Details
-
GRSMesh
public GRSMesh()
-
-
Method Details
-
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 fieldout.userObject
is not modified.- Specified by:
polygonize
in interfacePolygonization
- Parameters:
source
- the data source as reported by a previous invocation ofPolygonizable.getPolygonizableSource(GraphState)
with the samegs
gs
- the current graph stateout
- the polygons are written toout
flags
- combination of bit masksflatness
- a parameter for the degree of flatness, a typical value is 1
-
dependsOnContext
public boolean dependsOnContext()Description copied from interface:ContextDependent
Determines whether this object actually depends on context.- Specified by:
dependsOnContext
in interfaceContextDependent
- Returns:
true
iff this object depends on context
-
writeStamp
Description copied from interface:ContextDependent
Writes a stamp of the context intocache
. Based on this stamp, a cache detects whether the context of this object has changed or not.- Specified by:
writeStamp
in interfaceContextDependent
- Overrides:
writeStamp
in classContextDependentBase
- Parameters:
cache
- a cache entry to write the stampgs
- the current graph state
-
getManageableType
- Specified by:
getManageableType
in interfaceManageable
-