de.grogra.imp3d
Class PolygonizationCache
java.lang.Object
de.grogra.graph.Cache
de.grogra.imp3d.PolygonizationCache
public class PolygonizationCache
- extends Cache
This class can be used to cache the result of polygonization
of Polygonizable
shapes.
- Author:
- Ole Kniemeyer
Nested classes/interfaces inherited from class de.grogra.graph.Cache |
Cache.Entry |
Fields inherited from class de.grogra.graph.Cache |
gs |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PolygonizationCache
public PolygonizationCache(GraphState gs,
int flags,
float flatness,
boolean shareLists)
- Constructs a new cache. The parameters will be passed
to
Polygonization.polygonize(de.grogra.graph.ContextDependent, de.grogra.graph.GraphState, de.grogra.imp3d.PolygonArray, int, float)
when a cache entry is to be computed.
- Parameters:
gs
- the graph state within which the cache will be usedflags
- the flags to pass to polygonize
flatness
- the flatness to pass to polygonize
shareLists
- shall the returned PolygonArray
s share their lists
(vertices
, normals
etc.)? This is useful where the
returned data is copied into another representation and no longer needed
createEntry
protected Cache.Entry createEntry(java.lang.Object obj,
boolean node,
ContextDependent dep,
java.lang.Object strategy)
- Specified by:
createEntry
in class Cache
get
public PolygonArray get(java.lang.Object object,
boolean asNode,
Polygonizable p)
- Returns the
PolygonArray
of a Polygonizable
in the given object context.
- Parameters:
object
- the contextasNode
- true
if object
is a node,
false
if object
is an edgep
- the polygonizable
- Returns:
- a
PolygonArray
, computed by p