Package com.openinventor.inventor.caches
Class SoCache
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.caches.SoBaseContextCache
-
- com.openinventor.inventor.caches.SoCache
-
- All Implemented Interfaces:
SafeDisposable
- Direct Known Subclasses:
SoBoundingBoxCache
,SoNormalCache
,SoPrimitiveCountCache
,SoTangentCache
public class SoCache extends SoBaseContextCache
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCacheDependency(SoState state, SoCache cache)
Adds a dependency of this instance on another cache instance.void
addElement(SoElement elt)
Adds an element to elements-used list if not already there.SoElement
getCachedInvalidElement(SoState state)
AssumingisValid()
returns false, this will return the first cached element that is invalid (auto-caching uses this in its heuristic).SoElement
getInvalidElement(SoState state)
AssumingisValid()
returns false, this will return the first state element that is invalid (auto-caching uses this in its heuristic).void
invalidate()
Make this cache invalid.boolean
isValid(SoState state)
Returns true if cache is valid with respect to the given state.boolean
isValid(SoState state, SoElement elf)
Return is the given element is valid True if the element is not monitored.-
Methods inherited from class com.openinventor.inventor.caches.SoBaseContextCache
dispose, isContextDependent, isDisposable, release, setContextDependent, setContextDependent
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Constructor Detail
-
SoCache
public SoCache(SoState state)
Constructor. Takes the state in effect when the cache is used; it is assumed that the state is pushed before the cache is created.
-
-
Method Detail
-
addCacheDependency
public void addCacheDependency(SoState state, SoCache cache)
Adds a dependency of this instance on another cache instance. The default method takes care of adding dependencies from the child cache.
-
addElement
public void addElement(SoElement elt)
Adds an element to elements-used list if not already there.
-
isValid
public boolean isValid(SoState state, SoElement elf)
Return is the given element is valid True if the element is not monitored.
-
invalidate
public void invalidate()
Make this cache invalid.
-
getInvalidElement
public SoElement getInvalidElement(SoState state)
AssumingisValid()
returns false, this will return the first state element that is invalid (auto-caching uses this in its heuristic). Returns NULL if the cache is not invalid because of an element or if the cache is valid.
-
isValid
public boolean isValid(SoState state)
Returns true if cache is valid with respect to the given state.
-
getCachedInvalidElement
public SoElement getCachedInvalidElement(SoState state)
AssumingisValid()
returns false, this will return the first cached element that is invalid (auto-caching uses this in its heuristic). Returns NULL if the cache is not invalid because of an element or if the cache is valid.
-
-