Hi Harash,
You need to subclass suggest to me that we possible need to push these
changes back into the main CompositeViewer class, while we need to be
careful about how much functionality we try to push back into a class
like this, we also need to balance ease of use, this case I think it'd
be appropriate to add it into the base class.
Robert.
On 5/11/07, Harash Sharma <[EMAIL PROTECTED]> wrote:
Hi Robert,
Thanks a lot for your help and support. Overwhelmingly, I was able to
achieve dynamic windo insertion / deletion using the suggested Idea. What I
have done is that I have added a new class NewCompositeViewer derived from
CompositeViewer. I have overridden the addView member function in which I
first stop the running threads, add a new view, re-initialize and re-realize
the viewer and re-start the threads.
The Sample is working fine. If you suggestI can post this sample program.
It is not a very jazzy one but only an MFC MDI Application where windows can
be opened and closed dynamically and all the windows share the same
document.
Once again, thanks a lot. I will be troubling you every now and then
whenever I am in trouble ;-).
Regards
Harash.
Robert Osfield <[EMAIL PROTECTED]> wrote:
Hi Harash,
Once the view is running its threads it isn't appropriate to
dynamically add a new View, so what you need to do is call
viewer.stopThreading(), add the view then call startThreading().
There is one proviso though, I haven't actually tried this with
CompositeViewer yet, is still a pretty new class. If it doesn't work
we'll need to modify the osgmultiplecameras example to do dynamic
addition/removal of Views, then I can pick up the case at my end and
tweak things so they work, be it modifications to the example or
perhaps to the CompositeViewer implementation itself.
Robert.
On 5/10/07, Harash Sharma wrote:
>
>
>
>
>
> Hi Robert,
>
> Moving on the lines you had suggested, I have now been able to get a
> working MFC MDI Application with osgViewer::CompositeViewer. But there is
an
> observation on this issue. The application I am developing requires a
window
> to be dynamically opened / closed. The CompositeViewer class is expecting
> all the Views to be added before a call to frame() is made. If I make a
call
> to osgViewer::CompositeViewer::frame(), then add a view
> using osgViewer::CompositeViewer::addView(), and again
call
> frame(), the program hangs. Debugging, I found that this happens in
>
> osgViewer::renderingTraversal()
> ....
>
> if ( _startRenderingBarrier.valid())
> _startRenderingBarrier->block();
>
> The debugger gives the message: "This process seems to be deadlocked".
> I don't know if it is a bug or if the class is not supposed to be used
> in this manner. Please Help.
>
> Thanks in Advance.
>
> Regards
>
> Harash.
>
> Robert Osfield wrote:
>
> Hi Harash,
>
> On 5/8/07, Harash Sharma wrote:
>
> As you had suggested, I tried creating the osgViewer::CompositeViewer
> object and to it attached the osgViewer::View. Further, as shown in
> osgMultipleCameras example, the traits structure was filled accordingly.
The
> problem I am now facing is how to attach the MFC Window to the
> GraphicsContext / osgViewer. OSGMFC achieved this by passing the window
> handle using GetSafeHwnd() to Producer::RenderSurface. But I could not
> locate a mechanism of passing any such information to the osgViewer::View
or
> CompositeViewer or Viewer. One Win32WindowingSystemInterface class I could
> locate, but there too I could not find a way out.
>
> I don't have the code to hand, but if your browse through the osg-users
> email archives for the last week you'll see how to use the
> osg::GraphicsContext::Traits::inheritedWindowData set to
> osgViewer::GraphicsWindowWin32::WindowData(hwnd) to tell
> the viewer to realize a window adopting the passed in window. The approach
> is roughly the same as done in Producer::RenderSurface previous, only the
> architecture is a bit different in osgViewer.
>
> Robert.
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
> ________________________________
>
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
> ________________________________
> Ahhh...imagining that irresistible "new car" smell?
> Check out new cars at Yahoo! Autos.
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
> ________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail
> Beta._______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
>
> ________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/