On 1/25/2011 4:34 AM, Sam Warns wrote:
Hi Robert,

I am aware of the possibility to define my own methods in the visitor but the 
point I was trying to explain is, that if I apply a visitor on a scene I would 
except that this visitor has finished its work after calling the 
node->accept(myVisitor)

If I have a RemoveXVisitor and I as the user and not the writer of it use this 
visitor as I am used to use them by


Code:

RemoveXVisitor v;
node->accept(v);




I would expect that the Visitor has done it's work, which it actually didn't since there 
is no "finalize" method I would need to write:

Code:

RemoveXVisitor v;
node->accept(v);
v.doTheJobActually();




So there is a discrepancy between what I would except from a visitor after it 
was passed to accept and what a visitor is able to do in it's apply method

If your RemoveXVisitor doesn't actually remove anything, but instead collects references to X (that you might remove later with a separate operation), then perhaps you should consider changing the name of the visitor to CollectXVisitor to more accurately describe its purpose, so that other developers don't get confused about what it does (as you are describing above).
   -Paul
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to