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
ConstructorDescriptionPolygonizationCache
(GraphState gs, int flags, float flatness, boolean shareLists) Constructs a new cache. -
Method Summary
Modifier and TypeMethodDescriptionprotected Cache.Entry
createEntry
(Object obj, boolean node, ContextDependent dep, Object strategy) get
(Object object, boolean asNode, Polygonizable p) Returns thePolygonArray
of aPolygonizable
in 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 topolygonize
flatness
- the flatness to pass topolygonize
shareLists
- shall the returnedPolygonArray
s share their lists (vertices
,normals
etc.)? This is useful where the returned data is copied into another representation and no longer needed
-
-
Method Details
-
get
Returns thePolygonArray
of aPolygonizable
in the given object context.- Parameters:
object
- the contextasNode
-true
ifobject
is a node,false
ifobject
is an edgep
- the polygonizable- Returns:
- a
PolygonArray
, computed byp
-
createEntry
- Specified by:
createEntry
in classCache
-