User Tools

Site Tools


01_user_documentation:07_rgg_xl:02_xl:08_object:01_module:05_instantiation

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.

Modules implicitly declare the instantiator and instantiation producer required to create an instantiation by using the syntax:

 module A 
   ==> PRODUCTION ; // instantiation declaration
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();
	}
 
}
01_user_documentation/07_rgg_xl/02_xl/08_object/01_module/05_instantiation.txt · Last modified: 2025/09/05 13:15 by gaetan