On Sat, Mar 21, 2009 at 12:06 PM, Tim Moore wrote:
> Melchior FRANZ wrote:
> > * Tim Moore -- Saturday 21 March 2009:
> >> Gene Buckle wrote:
> >>> What benefit does the compound property offer?
> >
> >> More concise syntax for aggregate values like colors, rotations, etc.
> >
> > Doesn't sound like a valid reason to me:
> >
> > SGVec3 vec = n->getVec3Value("/some/vector");
> >
> The syntax is actually:
> Vec3d vec = n->getValue<Vec3d>()
> > vs.
> >
> > SGVec3 vec = getVec3(n->getNode("/some/vector", true));
> That is not correct, because there is no explicit ordering of property node
> children.
> You need different functions, or some helper argument, for every property
> type that
> is vector-like -- colors, positions, normals, rotations, etc.
I may be misunderstanding your point, but there are multiple children of a
property node, all with the same name, then there is an explicit ordering
... you can provide the ordering yourself, i.e <value n="2"> in the xml
file, or "value[2]" when referencing the property name, or getChild("value",
2) when using the tree walking API. And if you don't specify any ordering,
the values are created in sequential order. If you have unique property
names, then I don't see a need for ordering since you just reference the
name of the thing you need.
But in any case, I'm not worried so much about concise syntax in C++; I'm
> talking
> about the syntax of the XML files that will use the new properties.
Again, I think that the syntax in the xml file is the least concern. Do
your expected usage cases involve 100's or 1000's of these entities where a
few bytes here or there could make a noticeable difference, or just a few
here or there where we are talking about fractions of a percentage of the
overall fiile size?
Curt.
--
Curtis Olson: http://baron.flightgear.org/~curt/
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel