Class SoCache

    • 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)
        Assuming isValid() 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)
        Assuming isValid() 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.