This is an old revision of the document!
Instantiation
Instantiations are additional transient “sub-graphs” that can be resolved by a visitor. The most common example of instantiation is the additional 3D shapes added to a Node when it is represented in the 3D scene. The objects created in the instantiation are linked to the Node who have declare that instantiation. (For instance, the raytracing consider all shapes from a Node instantiation to be the Node - thus the node get absorbed light include the shapes).
Instantiations are not connected to the data graph. Thus, they are not included in queries.
A module can declare an instantiation which will be used by default for its 3D representation. The syntax for the instantiation declaration is :
module A ==> PRODUCTION ; // instantiation declaration
The module instantiation is considered as part of the module. Thus, operations that are applied to the instantiation are applied on the module. (E.g. light absorbed).
import de.grogra.rgg.model.Instantiation; module A ==> Box; // is equivalent to : class A extends Node implements de.grogra.xl.modules.Instantiator { // ... constructor & pattern // instantiation public de.grogra.graph.Instantiator getInstantiator(){ return Instantiation.INSTANTIATOR; } public void instantiate (Object p) { Instantiation producer = (Instantiation) p; producer.producer$begin(); producer.instantiate(new Box()); producer.producer$end(); } }
