Re: [osg-users] multiple views on separate Qt widgets

2009-03-03 Thread Robert Osfield
Hi Richard,

My best guess would be that you haven't attached the Camera's to the
appropriate graphics context properly, there isn't any difference in
the way that 2.6 and 2.8 handle window inheritance so I'm surprised
you see a difference, perhaps something else in the mix has changed.
I'm not a QT expert so I have to defer to others for the specifics.

Robert.

On Mon, Mar 2, 2009 at 11:45 PM, Richard Baron Penman
 wrote:
> hi,
>
> the 2.6 screenshot shows the expected functionality (the right panel is a
> top down view).
> The problem is in 2.8 my composite views are rendered on the desktop instead
> of within the window. Can you think of a reason for this?
> I suspected the problem is how I create the view in the SceneOSG::addView()
> function.
>
> Richard
>
>
> On Mon, Mar 2, 2009 at 8:41 PM, Robert Osfield 
> wrote:
>>
>> HI Richard,
>>
>> The right window looks odd, is this correct?  Is this way one should
>> expect if everything is working or is this an example of the problem?
>>
>> Robert.
>>
>> On Sun, Mar 1, 2009 at 11:54 PM, Richard Baron Penman 
>> wrote:
>> > Sure, here is a screenshot with 2.6 where the composite views are
>> > contained within the window.
>> > Richard
>> >
>> > --
>> > Read this topic online here:
>> > http://forum.openscenegraph.org/viewtopic.php?p=7715#7715
>> >
>> >
>> >
>> >
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-03-02 Thread Richard Baron Penman
hi,

the 2.6 screenshot shows the expected functionality (the right panel is a
top down view).
The problem is in 2.8 my composite views are rendered on the desktop instead
of within the window. Can you think of a reason for this?
I suspected the problem is how I create the view in the SceneOSG::addView()
function.

Richard


On Mon, Mar 2, 2009 at 8:41 PM, Robert Osfield wrote:

> HI Richard,
>
> The right window looks odd, is this correct?  Is this way one should
> expect if everything is working or is this an example of the problem?
>
> Robert.
>
> On Sun, Mar 1, 2009 at 11:54 PM, Richard Baron Penman 
> wrote:
> > Sure, here is a screenshot with 2.6 where the composite views are
> contained within the window.
> > Richard
> >
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=7715#7715
> >
> >
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-03-02 Thread Robert Osfield
HI Richard,

The right window looks odd, is this correct?  Is this way one should
expect if everything is working or is this an example of the problem?

Robert.

On Sun, Mar 1, 2009 at 11:54 PM, Richard Baron Penman  wrote:
> Sure, here is a screenshot with 2.6 where the composite views are contained 
> within the window.
> Richard
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=7715#7715
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-03-01 Thread Richard Baron Penman
Sure, here is a screenshot with 2.6 where the composite views are contained 
within the window.
Richard

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7715#7715



<>___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-02-27 Thread Robert Osfield
Hi Richard,

Could you explain what we should be expecting.  For instance a
screenshot of what it originally looked like would be useful.

Robert.

On Fri, Feb 27, 2009 at 1:58 AM, Richard Baron Penman  wrote:
> hello,
>
> When I upgraded from 2.4 to 2.6 the CompositeViewer example in my previous 
> post broke so that the model rendered outside the window on the desktop.
> A screenshot and the original code are attached.
>
> I suspect I was doing something illegal in the SceneOSG::addView() method but 
> got away with it in the previous version. If you are experienced with the 
> Viewer class could you take a look?
>
> thanks,
> Richard
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=7565#7565
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2009-02-26 Thread Richard Baron Penman
whoops, got the versions wrong - I upgraded from 2.6 to 2.8.

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=7570#7570





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Jean-Sébastien Guay

Hello Richard,

I am trying to provide multiple views of an OpenSceneGraph scene within 
a Qt window.


[...]

But I am still not clear how to render each view. The examples use 
composite_viewer->frame() in the paint event but for me this only 
renders a single view and leaves the rest blank.

Is there an alternative way to render multiple views at the same time?


I've seen you're considering having separate viewers, but I would 
suggest you use a single CompositeViewer. That will make sure you get 
the benefits of OSG's threading of update, cull and draw traversals.


Just add views to your viewer, and have each view's camera have a 
GraphicsWindow whose inheritedWindowData is:


traits->inheritedWindowData = new WindowData(winId());

(using the definition of WindowData at the top of QOSGWidget.cpp)

I personally realize() the graphics contexts at creation, because the 
CompositeViewer has a few early-exit conditions where it will not 
execute some branch if *one* of its views' contexts is realized, so I 
just want to make sure the all are.


Make sure you assign the scene data to your new view, and make sure your 
camera's projection matrix is sane. We had a problem where the window 
was first created by QT with a 0 width, so the initial projection matrix 
was not valid, and then any attempt to change the projection matrix (in 
the resizeEvent) would still use the invalid matrix as its starting 
point, so we would not see anything in the view.


Also, another caveat, often when reparenting a QT widget, its HWND (on 
Windows) changes. At that point of course, we need to recreate the 
graphics context, since it's tied to the widget's HWND, otherwise it 
would try to draw to an invalid HWND and fail.


Other than that, you might have to experiment with threading (when to 
create the context, when to stopThreading and startThreading, etc.). We 
still don't have an optimal solution, as you can see in the thread 
"CompositeViewer addView threading issue on Windows?".


Hope this helps,

J-S
--
__
Jean-Sebastien Guay[EMAIL PROTECTED]
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
HI Richard,

On Mon, Dec 1, 2008 at 11:48 AM, Richard Baron Penman
<[EMAIL PROTECTED]> wrote:
> The examples I've seen put frame() in their paint event and don't render
> without it there. Is there an example available that implements the
> architecture you describe?

Well all the examples except the ones like osgviewerQT have a main
loop that drives the rendering.  These are frame driven rather than
event driven.  Almost all vis-sim/games application should be frame
driven rather than event driven.  Only interactive applications should
use event driven, but even then frame driven can still be used and may
be preferred.

>> Or use multiple viewers.
> that would be the simplest way. Can viewers share the same node group
> memory?

You can do it, but you need take care of the sync'ing the FrameStamp
between each traversal as otherwise the state of the scene graph can
get thrashed between different times.

You are getting well beyond what I have personally experimented with
though so I can't really help you along this journey.

Robert.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Richard Baron Penman
The examples I've seen put frame() in their paint event and don't render
without it there. Is there an example available that implements the
architecture you describe?

> Or use multiple viewers.
that would be the simplest way. Can viewers share the same node group
memory?

Richard


On Mon, Dec 1, 2008 at 10:23 PM, Robert Osfield <[EMAIL PROTECTED]>wrote:

> Hi Richard,
>
> The osgViewer:::CompositeViewer/Viewer architecture is designed to
> support one frame loop driving all the windows associated with that
> viewer, not multiple places trying to dispatch frame().   So you use a
> single timer.  Or use multiple viewers.
>
> Robert.
>
> On Mon, Dec 1, 2008 at 11:16 AM, Richard Baron Penman
> <[EMAIL PROTECTED] <[EMAIL PROTECTED]>> wrote:
> > hi Robert,
> >
> > I've tried both methods used in the example and got both working for a
> > single view, but not for multiple.
> > The problem seems to be with having separate timeout loops calling
> > composite_viewer->frame(). Is there an alternative way to render a view?
> >
> > Richard
> >
> >
> > On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield <
> [EMAIL PROTECTED]>
> > wrote:
> >>
> >> Hi Richard,
> >>
> >> You don't mention how you are actually implementing the link between
> >> OSG and QT, are you using GraphicsWindowEmbedded or using the window
> >> inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
> >> restricted as it's simplicity hides all the
> >> makeCurrent/releaseContext/swapBuffer functionality that a fully
> >> threaded/multi-context viewer requires.
> >>
> >> Robert.
> >>
> >> On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
> >> <[EMAIL PROTECTED] <[EMAIL PROTECTED]>> wrote:
> >> > hello,
> >> >
> >> > I am trying to provide multiple views of an OpenSceneGraph scene
> within
> >> > a Qt
> >> > window.
> >> > I can get this working for a single view, or multiple views in the
> same
> >> > widget like in the osgviewerQT composite example. But I'm struggling
> to
> >> > get
> >> > multiple views on separate widgets working.
> >> >
> >> > I know many variations of this question have been asked:
> >> >
> >> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
> >> >
> >> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
> >> >
> >> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
> >> >
> >> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
> >> > etc
> >> >
> >> > But I am still not clear how to render each view. The examples use
> >> > composite_viewer->frame() in the paint event but for me this only
> >> > renders a
> >> > single view and leaves the rest blank.
> >> > Is there an alternative way to render multiple views at the same time?
> >> >
> >> > Richard
> >> >
> >> > ___
> >> > osg-users mailing list
> >> > osg-users@lists.openscenegraph.org
> >> >
> >> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >> >
> >> >
> >> ___
> >> osg-users mailing list
> >> osg-users@lists.openscenegraph.org
> >>
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
Hi Richard,

The osgViewer:::CompositeViewer/Viewer architecture is designed to
support one frame loop driving all the windows associated with that
viewer, not multiple places trying to dispatch frame().   So you use a
single timer.  Or use multiple viewers.

Robert.

On Mon, Dec 1, 2008 at 11:16 AM, Richard Baron Penman
<[EMAIL PROTECTED]> wrote:
> hi Robert,
>
> I've tried both methods used in the example and got both working for a
> single view, but not for multiple.
> The problem seems to be with having separate timeout loops calling
> composite_viewer->frame(). Is there an alternative way to render a view?
>
> Richard
>
>
> On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi Richard,
>>
>> You don't mention how you are actually implementing the link between
>> OSG and QT, are you using GraphicsWindowEmbedded or using the window
>> inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
>> restricted as it's simplicity hides all the
>> makeCurrent/releaseContext/swapBuffer functionality that a fully
>> threaded/multi-context viewer requires.
>>
>> Robert.
>>
>> On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
>> <[EMAIL PROTECTED]> wrote:
>> > hello,
>> >
>> > I am trying to provide multiple views of an OpenSceneGraph scene within
>> > a Qt
>> > window.
>> > I can get this working for a single view, or multiple views in the same
>> > widget like in the osgviewerQT composite example. But I'm struggling to
>> > get
>> > multiple views on separate widgets working.
>> >
>> > I know many variations of this question have been asked:
>> >
>> > http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
>> >
>> > http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
>> >
>> > http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
>> >
>> > http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
>> > etc
>> >
>> > But I am still not clear how to render each view. The examples use
>> > composite_viewer->frame() in the paint event but for me this only
>> > renders a
>> > single view and leaves the rest blank.
>> > Is there an alternative way to render multiple views at the same time?
>> >
>> > Richard
>> >
>> > ___
>> > osg-users mailing list
>> > osg-users@lists.openscenegraph.org
>> >
>> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> >
>> >
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Richard Baron Penman
hi Robert,

I've tried both methods used in the example and got both working for a
single view, but not for multiple.
The problem seems to be with having separate timeout loops calling
composite_viewer->frame(). Is there an alternative way to render a view?

Richard


On Mon, Dec 1, 2008 at 10:00 PM, Robert Osfield <[EMAIL PROTECTED]>wrote:

> Hi Richard,
>
> You don't mention how you are actually implementing the link between
> OSG and QT, are you using GraphicsWindowEmbedded or using the window
> inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
> restricted as it's simplicity hides all the
> makeCurrent/releaseContext/swapBuffer functionality that a fully
> threaded/multi-context viewer requires.
>
> Robert.
>
> On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
> <[EMAIL PROTECTED] <[EMAIL PROTECTED]>> wrote:
> > hello,
> >
> > I am trying to provide multiple views of an OpenSceneGraph scene within a
> Qt
> > window.
> > I can get this working for a single view, or multiple views in the same
> > widget like in the osgviewerQT composite example. But I'm struggling to
> get
> > multiple views on separate widgets working.
> >
> > I know many variations of this question have been asked:
> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
> >
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
> > etc
> >
> > But I am still not clear how to render each view. The examples use
> > composite_viewer->frame() in the paint event but for me this only renders
> a
> > single view and leaves the rest blank.
> > Is there an alternative way to render multiple views at the same time?
> >
> > Richard
> >
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple views on separate Qt widgets

2008-12-01 Thread Robert Osfield
Hi Richard,

You don't mention how you are actually implementing the link between
OSG and QT, are you using GraphicsWindowEmbedded or using the window
inheritance of osgViewer.  The GraphicsWindowEmbedded route is very
restricted as it's simplicity hides all the
makeCurrent/releaseContext/swapBuffer functionality that a fully
threaded/multi-context viewer requires.

Robert.

On Mon, Dec 1, 2008 at 1:09 AM, Richard Baron Penman
<[EMAIL PROTECTED]> wrote:
> hello,
>
> I am trying to provide multiple views of an OpenSceneGraph scene within a Qt
> window.
> I can get this working for a single view, or multiple views in the same
> widget like in the osgviewerQT composite example. But I'm struggling to get
> multiple views on separate widgets working.
>
> I know many variations of this question have been asked:
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg08512.html
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg04883.html
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg05487.html
> http://www.mail-archive.com/osg-users@lists.openscenegraph.org/msg16623.html
> etc
>
> But I am still not clear how to render each view. The examples use
> composite_viewer->frame() in the paint event but for me this only renders a
> single view and leaves the rest blank.
> Is there an alternative way to render multiple views at the same time?
>
> Richard
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org