faces.render.prt.parametricrendering.decorators
PersistentCaching
Companion object PersistentCaching
case class PersistentCaching[TParams <: TechniqueParameters, TData] extends TechniqueDecorator[TParams, TData] with Product with Serializable
This decorator forms a persistent caching layer above any given PRT technique. It handles the caching of precomputable data completely autonomously. It stores occlusion information, auxiliary data and transfer data. The resulting data files will be stored in "./prtcache/" by default. The caching path can be changed using the method withCachingPath().
The implementations maintains a correspondence between the cached data sets and the technique parameters that the cached data has been generated with. The system will only load a cached data set if it matches the specified technique parameters. If there is no data set that fulfills this property new data will be precomputed and stored with respect to the new parameters.
Occlusion, auxiliary and transfer data are cached individually and thus stored in separate files. Transfer and auxiliary data files are accompanied by a corresponding text file that summarizes the used parameters in a human-readable format.
The change detection system is based on the ParameterSummary class which provides a parameterSignature method that, in turn, makes use of the hash codes of the individual parameters. In other words, cached data is tied to a set of parameters via their combined hashes. Therefore parameters are required to provide a hashCode implementation that is stable over multiple program executions. Fortunately, this is the case for scala's case classes and case objects and the TriangleMesh3D class in particular. However, there are some parameters that allow values which might not have stable hashes in certain situations (e.g. when assigned a anonymous class or function). Although not recommended, these parameters can be excluded from the parameter signature hash using the allowAmbiguousCaching method. This way, the non-stable hashes will not affect the caching functionality and the user needs to trigger recalculation manually whenever one of the non-stable-hash parameters is altered.
Please note that auxiliary data caching is disabled by default. It can be enabled with the method cacheAuxiliaryData which requires a suitable implementation of the AuxiliaryDataIO interface.
- Alphabetic
- By Inheritance
- PersistentCaching
- Serializable
- Serializable
- Product
- Equals
- TechniqueDecorator
- ParametricPrtTechnique
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allowAmbiguousCaching: PersistentCaching[TParams, TData]
Recalculation will not be triggered when parameters with non-stable hashes are changed.
Recalculation will not be triggered when parameters with non-stable hashes are changed. Although not recommended, this option comes in handy when assigning non-stable hash values, i.e. anonymous types or functions, to parameters.
- val alwaysRecalculateAuxiliaryData: Boolean
- val alwaysRecalculateOcclusion: Boolean
- val alwaysRecalculateTransfer: Boolean
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
cacheAuxiliaryData(implicit dataIO: AuxiliaryDataIO[TParams, TData]): PersistentCaching[TParams, TData]
Enables full caching functionality for auxiliary data.
Enables full caching functionality for auxiliary data. (disabled by default) A suitable IO implementation is required.
- dataIO
A suitable implementation of AuxiliaryDataIO.
-
def
cacheOcclusion: PersistentCaching[TParams, TData]
Enables full caching functionality for occlusion information.
Enables full caching functionality for occlusion information. (enabled by default)
- val cachePath: Path
-
def
cacheTransfer: PersistentCaching[TParams, TData]
Enables full caching functionality for transfer data.
Enables full caching functionality for transfer data. (enabled by default)
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
disableLoggingToConsole: PersistentCaching[TParams, TData]
Logging to standard out will be disabled.
-
def
enableLoggingToConsole: PersistentCaching[TParams, TData]
Logs recalculation, loading and storing operations to standard out.
-
def
enforceUnambiguousCaching: PersistentCaching[TParams, TData]
Recalculation of cached data will be triggered whenever the hash of a parameter changes.
Recalculation of cached data will be triggered whenever the hash of a parameter changes. This includes the parameters for which hash stability cannot be guaranteed in certain situations.
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
final
def
getDefaultParameters(mesh: TriangleMesh3D): TParams
Returns the default parameters for this technique with respect to the mesh to render.
Returns the default parameters for this technique with respect to the mesh to render.
- Definition Classes
- TechniqueDecorator → ParametricPrtTechnique
-
final
def
getParametricShader(parameters: TParams, transfer: GreyOrRGB[Transfer], data: TData): ParametricPrtShader
- Definition Classes
- TechniqueDecorator → ParametricPrtTechnique
-
final
def
getRenderer(parameters: TParams): ParametricPrtImageRender
Returns a ParametricPrtImageRenderer for the set of PRT parameters.
Returns a ParametricPrtImageRenderer for the set of PRT parameters. Transfer, auxiliary data and occlusion information will be computed when this method is called.
- Definition Classes
- ParametricPrtTechnique
-
final
def
getRenderer(parameters: TParams, transfer: GreyOrRGB[Transfer]): ParametricPrtImageRender
Returns a ParametricPrtImageRenderer for the specified transfer and the set of PRT parameters.
Returns a ParametricPrtImageRenderer for the specified transfer and the set of PRT parameters. If necessary, auxiliary data will be computed when this method is called.
- Definition Classes
- ParametricPrtTechnique
-
final
def
getRenderer(parameters: TParams, transfer: GreyOrRGB[Transfer], data: TData): ParametricPrtImageRender
Returns a ParametricPrtImageRenderer for the specified transfer and auxiliary data as well as the set of PRT parameters.
Returns a ParametricPrtImageRenderer for the specified transfer and auxiliary data as well as the set of PRT parameters.
- Definition Classes
- ParametricPrtTechnique
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- val loggingEnabled: Boolean
-
final
def
name: String
The name of the implemented PRT rendering technique.
The name of the implemented PRT rendering technique.
- Definition Classes
- TechniqueDecorator → ParametricPrtTechnique
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- val optionalAuxDataIO: Option[AuxiliaryDataIO[_, _]]
-
def
precomputeAuxiliaryData(parameters: TParams): TData
Tries to load auxiliary data from the persistent cache.
Tries to load auxiliary data from the persistent cache. When a matching data set cannot be found, it will compute auxiliary information in the same way ParametricPrtTechnique.precomputeAuxiliaryData. The result will be stored persistently for later reuse.
- parameters
The parameters customizing the employed technique.
- Definition Classes
- PersistentCaching → TechniqueDecorator → ParametricPrtTechnique
-
def
precomputeOcclusion(parameters: TParams): OcclusionInformation
Tries to load occlusion data from the persistent cache.
Tries to load occlusion data from the persistent cache. When a matching data set cannot be found, it will compute occlusion information in the same way ParametricPrtTechnique.precomputeOcclusion. The result will be stored persistently for later reuse.
- parameters
The parameters specifying the mesh and the raycast directions.
- returns
An instance of OcclusionInformation.
- Definition Classes
- PersistentCaching → TechniqueDecorator → ParametricPrtTechnique
-
def
recalculateAuxiliaryData: PersistentCaching[TParams, TData]
Auxiliary data will always be recalculated.
Auxiliary data will always be recalculated. The results will be stored in the cache, if a suitable implementation of AuxiliaryDataIO has been provided via cacheAuxiliaryData.
Hence, in order to disable loading of auxiliary data while storing it after recalculation one needs to call cacheAuxiliaryData and recalculateAuxiliaryData on this decorator instance.
-
def
recalculateOcclusion: PersistentCaching[TParams, TData]
Occlusion information will always be recalculated.
Occlusion information will always be recalculated. The result will be stored in the cache, nevertheless.
-
def
recalculateTransfer: PersistentCaching[TParams, TData]
Transfer data will always be recalculated.
Transfer data will always be recalculated. The result will be stored in the cache, nevertheless.
-
def
simulateTransfer(parameters: TParams, occlusion: OcclusionInformation, data: TData): GreyOrRGB[Transfer]
Tries to load transfer data from the persistent cache.
Tries to load transfer data from the persistent cache. When a matching data set cannot be found, it will compute transfer information in the same way ParametricPrtTechnique.simulateTransfer. The result will be stored persistently for later reuse.
- parameters
The parameters customizing the employed technique.
- occlusion
The occlusion information for the mesh specified via the parameters.
- data
Auxiliary, precomputed data that is required by some parametric techniques.
- returns
Simulated light transfer (monochromatic or RGB, based on parameters).
- Definition Classes
- PersistentCaching → TechniqueDecorator → ParametricPrtTechnique
-
final
def
simulateTransfer(parameters: TParams, data: TData): GreyOrRGB[Transfer]
Simulates light transport with respect to the given parameters and precomputed auxiliary data.
Simulates light transport with respect to the given parameters and precomputed auxiliary data. Occlusion information will be computed on demand, that is, it will not be cached.
- Definition Classes
- ParametricPrtTechnique
-
final
def
simulateTransfer(parameters: TParams): GreyOrRGB[Transfer]
Simulates light transport with respect to the given parameters.
Simulates light transport with respect to the given parameters. Occlusion information will be computed on demand, that is, it will not be cached. This also applies to the optional, precomputable, auxiliary data.
- Definition Classes
- ParametricPrtTechnique
- val strict: Boolean
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
val
technique: ParametricPrtTechnique[TParams, TData]
- Definition Classes
- PersistentCaching → TechniqueDecorator
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
withCachingPath(path: String): PersistentCaching[TParams, TData]
Specifies the path where data files will be stored.
-
def
withDecorator[T <: TechniqueDecorator[TParams, TData]](wrapper: (PersistentCaching.this.type) ⇒ T): T
Wraps this technique in a TechniqueDecorator that adds advanced functionality that can be used in combination with any particular PRT technique.
Wraps this technique in a TechniqueDecorator that adds advanced functionality that can be used in combination with any particular PRT technique. (e.g. PersistentCaching)
- wrapper
A function that wraps this instance into a TechniqueDecorator. E.g. PersistentCaching(_)
- returns
A TechniqueDecorator of type T that is based on this instance of ParametricPrtTechnique.
- Definition Classes
- ParametricPrtTechnique