de.grogra.imp3d
Class LineSegmentizationCache

java.lang.Object
  extended by de.grogra.graph.Cache
      extended by de.grogra.imp3d.LineSegmentizationCache

public class LineSegmentizationCache
extends Cache

This class can be used to cache the result of segmentization of LineSegmentizable shapes.

Author:
Ole Kniemeyer

Nested Class Summary
 
Nested classes/interfaces inherited from class de.grogra.graph.Cache
Cache.Entry
 
Field Summary
 
Fields inherited from class de.grogra.graph.Cache
gs
 
Constructor Summary
LineSegmentizationCache(GraphState gs, float flatness)
          Constructs a new cache.
 
Method Summary
protected  Cache.Entry createEntry(java.lang.Object obj, boolean node, ContextDependent dep, java.lang.Object strategy)
           
 LineArray get(java.lang.Object object, boolean asNode, LineSegmentizable ls)
          Returns the LineArray of a LineSegmentizable in the given object context.
 
Methods inherited from class de.grogra.graph.Cache
clear, clearUnused, getGraphState, getValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineSegmentizationCache

public LineSegmentizationCache(GraphState gs,
                               float flatness)
Constructs a new cache. The parameters will be passed to LineSegmentizable.segmentize(ContextDependent, GraphState, LineArray, float) when a cache entry is to be computed.

Parameters:
gs - the graph state within which the cache will be used
flatness - the flatness to pass to segmentize
Method Detail

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 LineArray get(java.lang.Object object,
                     boolean asNode,
                     LineSegmentizable ls)
Returns the LineArray of a LineSegmentizable in the given object context.

Parameters:
object - the context
asNode - true if object is a node, false if object is an edge
ls - the segmentizable
Returns:
a LineArray, computed by ls