Hi Robert,
On 6/18/2013 10:58 AM, Robert Osfield wrote:
Hi Judson,
On 18 June 2013 15:21, Judson Weissert <[email protected]> wrote:
What is the difference between containsDeprecatedData() and
checkForDeprecatedData()? I see that containsDeprecatedData() just checks
the flag, what does the latter do? Forgive me if this is obvious, the names
suggest the same operation to me.
checkForDeprecatedData() actively goes through the arrays looking for
an IndexArray attached via their UserData and any Array::Binding set
to BIND_PER_PRIMITIVE, if it finds any it sets the internal member
variable _containsDeprecatedData;
containsDeprecatedData() just returns the _containsDeprecatedData values.
Both return true if their is deprecated data attached.
I looked at the implementations now (the Geometry.cpp changes were not
included in the online diff). Correct me if I am wrong, outside of the
optimizer, there is no code path that will call
checkForDeprecatedData(). Therefore, it is quite likely that
drawImplementation() and other functions will be called before
checkForDeprecatedData() is called. Thus, I am wondering if the
_containsDeprecatedData flag should be taken out entirely.
Perhaps the member functions could be replaced with two free functions:
bool
CheckForDeprecatedData (const osg::Geometry *geometry);
and
void
FixDeprecatedData (osg::Geometry *geometry);
and they would be part of the osg::Geometry API, but they would not be
as tightly coupled to the same source files. i.e., you could move them
wherever you want. That is, assuming they do not require access to the
non-Public osg::Geometry API.
I realize it is expensive to call CheckForDeprecatedData(), but in
theory, FixDeprecatedData() is going to be called afterwards anyhow, so
you end up with the same end result (at least from what I have observed
so far).
I am basing this logic on the fact that the _containsDeprecatedData flag
is already not guaranteed to be correct in the places where it is being
used as a guard.
Regards,
Judson
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org