From: Maik J. <mj...@gm...> - 2009-03-20 19:51:58
|
Hi, Stuart Buchanan schrieb am 20.03.2009 16:22: > My immediate thought is that one could write some fairly straightforward > code to interpret a given property node with 3 child values as a Vec3. Could > we subvert the property attributes to indicate that a given nodes contains > a Vect3. That way internal code could interpret it as a Vec3, while external > interfaces would be preserved. > Or we do it vice versa. We store the vec3 directly in the property tree, e.g.. surface/color, but you can access any components over the property tree in the approved way. (surface/color/red, curface/color/blue, ...). From telnet, MP, property-browser, etc. everything keep unchanged, but from c++ you can directly access the vec3. We even can allow to store any (?) class directly in the property tree. The class must present functions to map it's components to the property tree in the common way. The nodes and actual basic datatypes would be just classes as any other class in the property tree. We even can take care, that a cast from and to the basic datatypes must be present. By mapping of all class members to the property tree in the approved way, we are able to ex- and import the property tree via xml. Best regards, Maik |