java.lang.Object
de.grogra.graph.Cache
de.grogra.imp3d.PolygonizationCache
This class can be used to cache the result of polygonization
of
Polygonizable shapes.- Author:
- Ole Kniemeyer
-
Nested Class Summary
Nested classes/interfaces inherited from class de.grogra.graph.Cache
Cache.Entry -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionPolygonizationCache(GraphState gs, int flags, float flatness, boolean shareLists) Constructs a new cache. -
Method Summary
Modifier and TypeMethodDescriptionprotected Cache.EntrycreateEntry(Object obj, boolean node, ContextDependent dep, Object strategy) get(Object object, boolean asNode, Polygonizable p) Returns thePolygonArrayof aPolygonizablein the given object context.Methods inherited from class de.grogra.graph.Cache
clear, clearUnused, getGraphState, getValue
-
Constructor Details
-
PolygonizationCache
Constructs a new cache. The parameters will be passed toPolygonization.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 topolygonizeflatness- the flatness to pass topolygonizeshareLists- shall the returnedPolygonArrays share their lists (vertices,normalsetc.)? This is useful where the returned data is copied into another representation and no longer needed
-
-
Method Details
-
get
Returns thePolygonArrayof aPolygonizablein the given object context.- Parameters:
object- the contextasNode-trueifobjectis a node,falseifobjectis an edgep- the polygonizable- Returns:
- a
PolygonArray, computed byp
-
createEntry
- Specified by:
createEntryin classCache
-