fabric-engine/JSSceneGraph — Issue #80: SceneGraph node UI generation.
Author: phtaylor
Created: 2011-11-28 20:04:21+00:00
State: open

we need a demo that shows automatic UI generation.

Make sure this is on a separate branch. (not the beta branches we integrate onto, but a separate one for this feature. )

Take the 'Selection' demo.
Add a random collection of boxes, toruses, cones ect.. (copy 'Primitives.html')
Create a new ui box panel called object parameters.
When an object is selected, generate a user interface for that object.

// pseudo code.

```
selectionManager.addEventListener('selectionChanged', function(evt){
if(evt.selection.length != 1){
// clear the ui
return;
}
var instance = evt.selection[0];
// Add object params
var obj = instance.getGeometryNode().
for( var i in obj){
if(i.subString(0, 3) == 'get'){
// display a ui widget for i
// e.g. for a Scalar, Integer, Vec3 ...
}
}
});
```

Generate a UI box for the geometry, transform, and the material.

This code must eventually be separated from the demo code so that we can use it in other demos.