> 
> Hi Robert,
> 
> On Tue, Dec 8, 2009 at 2:25 PM, Robert Milharcic
> <[email protected]> wrote:
> > Anyway, I agree that at this point it is best not to include this
> feature into core. Thanks for your suggestions and time spend...
> 
> For clarity, I don't think a readPixels callback is appropriate now,
> or anytime in the future.  I believe it's in appropriate to utilize
> callbacks for such low level operations - if we started doing this for
> overriding basic methods where do you stop?  Every single method in
> every single class to have it's own callback?  I try use the "minimal
> and complete" approach classes API's, for me the readPixels falls well
> short of this requirement as you can already override the required
> function with higher level callbacks that are already more general
> purpose and sufficient.
> 

OK, point taken.

> There is also one far less intrusive and verbose approach to enable
> user customization in C++, and that's to make methods virtual.  This
> would require one to subclass from osg::Image but this is no more
> effort than subclassing from a Callback class.  One does need to
> consider how often a method is called before one takes the step to
> declare a function virtual, and in this case readPixels() is called
> very rarely on each frame so the overhead would be negligible.  With
> this in mind I've made a number of osg::Image methods virtual, to
> allow for greater customization.  The following methods are now
> virtual, and svn update will get these changes.

This is great, thank you! To be honest, my suggestion was inspired by the 
GraphicsContext::ResizedCallback and that is why I choose to propose callback 
over making osg::Image methods polymorphic. I thought callbacks are osg way to 
solve such problems... BTW, I was also playing with more involved solutions, 
like camera ability to attach custom object, but such approach would probably 
never be accepted. Anyway, I'm happy with the decision you made. Thanks again.

Robert M.

<<attachment: Robert Milharcic.vcf>>

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to