Re: [osg-users] multiple windows question

2012-02-16 Thread Wang Rui
Hi Alex,

The composite viewer can have multiple views of different scene graph on
different windows. Setup the Traits of each separated window and set it to
each view's camera, and setup your scenes with the View::setSceneData()
method.

Wang Rui


2012/2/17 Pecoraro, Alexander N 

> What is the best way to have multiple windows with different views of the
> same scene graph? I took a look at the composite viewer example, but it has
> different views of the same scene graph with a single window. So not quite
> what I want.
>
> ** **
>
> Thanks.
>
> ** **
>
> Alex
>
> ___
> 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] multiple windows question

2012-02-16 Thread Pecoraro, Alexander N
What is the best way to have multiple windows with different views of the same 
scene graph? I took a look at the composite viewer example, but it has 
different views of the same scene graph with a single window. So not quite what 
I want.

Thanks.

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


Re: [osg-users] Multiple Windows

2009-10-17 Thread Robert Osfield
Hi Russell,

Have you tried:

  viewer->done(true);

?

Robert.

On Mon, Oct 12, 2009 at 8:20 AM, Russell Morris  wrote:
> Hey all,
> I've been searching the forums this afternoon and can't seem to find the 
> answer to my question. I have a viewer setup with the following:
>
> rViewer = new osgViewer::Viewer();
>
> wm = new osgWidget::WindowManager(rViewer, width, height,
> MASK_2D, osgWidget::WindowManager::PD_NONE);
>        
> rViewer->setUpViewInWindow(width,height,wm->getWidth(),wm->getHeight());
> cam = wm->createParentOrthoCamera();
>
> osg::ClearNode *backdrop = new osg::ClearNode;
> backdrop->setClearColor(osg::Vec4(0.1,0.1,0.0,1.0));
> cam->addChild(backdrop);
>
> // add event handlers
> rViewer->addEventHandler(new osgWidget::MouseHandler(wm));
> rViewer->addEventHandler(new osgWidget::KeyboardHandler(wm));
>
> rViewer->realize();
> rViewer->setCameraWithFocus(cam);
> rViewer->setSceneData(cam);
>
> And I need to be able to close the window dynamically. I implemented this:
>
> osgViewer::Viewer::Windows windows;
> rViewer->getWindows(windows);
> osgViewer::GraphicsWindow *win = *windows.begin();
>    win->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_Escape);
>    win->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_Escape);
>
> but no joy. If anyone can point me in the right direction I'd be most 
> grateful. Thanks in advance!
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18198#18198
>
>
>
>
>
> ___
> 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 Windows

2009-10-13 Thread Russell Morris
Yeah I did try that and it didn't work either. However, for some strange reason 
if I call the closing routine once when the window is created, and then again 
when I want it closed it works fine. Weird, I'm still trying to wrap my brain 
around what is going on. Thanks for the response! Have a good one!

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





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


Re: [osg-users] Multiple Windows

2009-10-12 Thread Ümit Uzun
Hi Morris,

Did you try to close only viewer;

   rViewer->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_Escape);
   rViewer->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_Escape);

Regards.

Ümit Uzun


2009/10/12 Russell Morris 

> Hey all,
> I've been searching the forums this afternoon and can't seem to find the
> answer to my question. I have a viewer setup with the following:
>
> rViewer = new osgViewer::Viewer();
>
> wm = new osgWidget::WindowManager(rViewer, width, height,
> MASK_2D, osgWidget::WindowManager::PD_NONE);
>
>  rViewer->setUpViewInWindow(width,height,wm->getWidth(),wm->getHeight());
> cam = wm->createParentOrthoCamera();
>
> osg::ClearNode *backdrop = new osg::ClearNode;
> backdrop->setClearColor(osg::Vec4(0.1,0.1,0.0,1.0));
> cam->addChild(backdrop);
>
> // add event handlers
> rViewer->addEventHandler(new osgWidget::MouseHandler(wm));
> rViewer->addEventHandler(new osgWidget::KeyboardHandler(wm));
>
> rViewer->realize();
> rViewer->setCameraWithFocus(cam);
> rViewer->setSceneData(cam);
>
> And I need to be able to close the window dynamically. I implemented this:
>
> osgViewer::Viewer::Windows windows;
> rViewer->getWindows(windows);
> osgViewer::GraphicsWindow *win = *windows.begin();
>win->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_Escape);
>win->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_Escape);
>
> but no joy. If anyone can point me in the right direction I'd be most
> grateful. Thanks in advance!
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=18198#18198
>
>
>
>
>
> ___
> 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] Multiple Windows

2009-10-12 Thread Russell Morris
Hey all,
I've been searching the forums this afternoon and can't seem to find the answer 
to my question. I have a viewer setup with the following:

rViewer = new osgViewer::Viewer();

wm = new osgWidget::WindowManager(rViewer, width, height, 
MASK_2D, osgWidget::WindowManager::PD_NONE);
rViewer->setUpViewInWindow(width,height,wm->getWidth(),wm->getHeight());
cam = wm->createParentOrthoCamera();

osg::ClearNode *backdrop = new osg::ClearNode;
backdrop->setClearColor(osg::Vec4(0.1,0.1,0.0,1.0));
cam->addChild(backdrop);

// add event handlers
rViewer->addEventHandler(new osgWidget::MouseHandler(wm));
rViewer->addEventHandler(new osgWidget::KeyboardHandler(wm));

rViewer->realize();
rViewer->setCameraWithFocus(cam);
rViewer->setSceneData(cam);

And I need to be able to close the window dynamically. I implemented this:

osgViewer::Viewer::Windows windows;
rViewer->getWindows(windows);
osgViewer::GraphicsWindow *win = *windows.begin();
win->getEventQueue()->keyPress(osgGA::GUIEventAdapter::KEY_Escape);
win->getEventQueue()->keyRelease(osgGA::GUIEventAdapter::KEY_Escape);

but no joy. If anyone can point me in the right direction I'd be most grateful. 
Thanks in advance!

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





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


Re: [osg-users] Multiple Windows, Multiple Screens

2009-02-10 Thread Robert Osfield
Hi Julen,

It sounds like you have a single View but with two slave cameras, once
slave for each window.  This would mean two graphics context which
will mean a performance and memory overhead.  Sharing contexts would
help on the memory consumption front, but it'd only be safe to run the
view single threaded otherwise the OpenGL objects could get corrupted.

Robert.

On Tue, Feb 10, 2009 at 12:45 PM, Julen Garcia  wrote:
> Hi!
>
> I'm trying to setup a sceneario where in the first display I have a Qt
> window with diferent camera buttons and a 640x480 window for preview. The
> second screen is supposed to be the output where a fullscreen 1980x1080
> window is displayed.
>
>
> Do I need to use the composite view with two different graphic contexts?
>
> Does this drop the performance too much?
>
> Should I share the graphic context? How?
>
> Thanks in advance,
> ___
> 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] Multiple Windows, Multiple Screens

2009-02-10 Thread Julen Garcia
Hi!

I'm trying to setup a sceneario where in the first display I have a Qt
window with diferent camera buttons and a 640x480 window for preview. The
second screen is supposed to be the output where a fullscreen 1980x1080
window is displayed.


Do I need to use the composite view with two different graphic contexts?

Does this drop the performance too much?

Should I share the graphic context? How?

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


Re: [osg-users] multiple windows rendering bug

2008-05-23 Thread Serge Lages
It's driving me mad...

I tried deactivating things to isolate the problem, then I reactivated
everything to be sure to know where the problem comes from, and all is
working correctly with exactly the same code that was causing the problem,
my SVN repro can prove it. :)

On Fri, May 23, 2008 at 11:41 AM, Robert Osfield <[EMAIL PROTECTED]>
wrote:

> Hi Serge,
>
> The behaviour of the problem sounds a bit like contextID's aren't be
> managed correctly.  osgViewer/GraphicsContext should be managing the
> contextID automatically for you.  It would be worth double checking by
> looking each windows ContextID i.e.
>
>  gc->getState()->getContextID();
>
> You should 0 and 1 respectively for the two windows.
>
> The other possibility might be that your own custom graphics code does
> manage multiple graphics contexts properly so tries to reuse texture
> objects or display lists from the wrong graphics context.
>
> Robert.
>
> On Fri, May 23, 2008 at 10:34 AM, Serge Lages <[EMAIL PROTECTED]>
> wrote:
> > The patch suggested by Wojciech doesn't solve the issue for me... :/
> >
> > I've tested to disable display lists on my terrain and success, I don't
> have
> > any visual artefacts, but... on the first window I don't have textures
> > anymore (see attached image)...
> >
> > I'll try to make a little exemple application reproducing the bug to have
> it
> > tested on diffrent setups.
> >
> > On Fri, May 23, 2008 at 11:05 AM, Serge Lages <[EMAIL PROTECTED]>
> wrote:
> >>
> >> My setup is :
> >>
> >> WinXP, DualCore CPU, NVidia 8600 GTS, osgViewer SingleThreaded mode, one
> >> screen and two windows
> >>
> >> I'll try the patch suggested into this thread to see if it resolves my
> >> problem.
> >>
> >> On Fri, May 23, 2008 at 10:58 AM, J.P. Delport <[EMAIL PROTECTED]>
> >> wrote:
> >>>
> >>> Hi,
> >>>
> >>> Have you tried forcing single threaded?
> >>>
> >>> maybe see this thread.
> >>>
> >>> "Complete garbage in OSG / XP / multi monitor / multi   threaded /
> >>> NVidia"
> >>>
> >>> Don't know your setup, so I'm guessing.
> >>>
> >>> jp
> >>>
> >>> Serge Lages wrote:
> 
>  Hi all,
> 
>  I am currently using a osgViewer::viewer with slaves cameras (just
> like
>  the osgwindows example), and I am getting some visual artifacts on the
>  second window (see the attached image).
> 
>  Does it rings a bell to anyone ? Something not setted correctly ?
> 
>  Thanks in advance !
> 
>  PS : here is my viewer init :
> 
> osgViewer::Viewer viewer;
> 
> // upper window + upper slave camera
> {
> osg::ref_ptr traits = new
>  osg::GraphicsContext::Traits;
> traits->x = 300;
> traits->y = 40;
> traits->width = 600;
> traits->height = 200;
> traits->windowDecoration = true;
> traits->doubleBuffer = true;
> traits->sharedContext = 0;
> 
> osg::ref_ptr gc =
>  osg::GraphicsContext::createGraphicsContext(traits.get());
> 
> osg::ref_ptr camera = new osg::Camera;
> camera->setGraphicsContext(gc.get());
> camera->setViewport(new osg::Viewport(0,0, traits->width,
>  traits->height));
> GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
> camera->setDrawBuffer(buffer);
> camera->setReadBuffer(buffer);
> 
> // add this slave camera to the viewer
> viewer.addSlave(camera.get());
> }
> 
> // lower window + lower slave camera
> {
> osg::ref_ptr traits = new
>  osg::GraphicsContext::Traits;
> traits->x = 300;
> traits->y = 275;
> traits->width = 600;
> traits->height = 480;
> traits->windowDecoration = true;
> traits->doubleBuffer = true;
> traits->sharedContext = 0;
> 
> osg::ref_ptr gc =
>  osg::GraphicsContext::createGraphicsContext(traits.get());
> 
> osg::ref_ptr camera = new osg::Camera;
> camera->setGraphicsContext(gc.get());
> camera->setViewport(new osg::Viewport(0,0, traits->width,
>  traits->height));
> GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
> camera->setDrawBuffer(buffer);
> camera->setReadBuffer(buffer);
> 
> // add this slave camera to the viewer, with a shift right of
> the
>  projection matrix
> viewer.addSlave(camera.get());
> }
> 
>  --
>  Serge Lages
>  http://www.tharsis-software.com
> 
> 
> 
> 
> 
> 
> 
>  ___
>  osg-users mailing list
>  osg-users@lists.openscenegraph.org
> 
> 
> http://lists.

Re: [osg-users] multiple windows rendering bug

2008-05-23 Thread Robert Osfield
Hi Serge,

The behaviour of the problem sounds a bit like contextID's aren't be
managed correctly.  osgViewer/GraphicsContext should be managing the
contextID automatically for you.  It would be worth double checking by
looking each windows ContextID i.e.

 gc->getState()->getContextID();

You should 0 and 1 respectively for the two windows.

The other possibility might be that your own custom graphics code does
manage multiple graphics contexts properly so tries to reuse texture
objects or display lists from the wrong graphics context.

Robert.

On Fri, May 23, 2008 at 10:34 AM, Serge Lages <[EMAIL PROTECTED]> wrote:
> The patch suggested by Wojciech doesn't solve the issue for me... :/
>
> I've tested to disable display lists on my terrain and success, I don't have
> any visual artefacts, but... on the first window I don't have textures
> anymore (see attached image)...
>
> I'll try to make a little exemple application reproducing the bug to have it
> tested on diffrent setups.
>
> On Fri, May 23, 2008 at 11:05 AM, Serge Lages <[EMAIL PROTECTED]> wrote:
>>
>> My setup is :
>>
>> WinXP, DualCore CPU, NVidia 8600 GTS, osgViewer SingleThreaded mode, one
>> screen and two windows
>>
>> I'll try the patch suggested into this thread to see if it resolves my
>> problem.
>>
>> On Fri, May 23, 2008 at 10:58 AM, J.P. Delport <[EMAIL PROTECTED]>
>> wrote:
>>>
>>> Hi,
>>>
>>> Have you tried forcing single threaded?
>>>
>>> maybe see this thread.
>>>
>>> "Complete garbage in OSG / XP / multi monitor / multi   threaded /
>>> NVidia"
>>>
>>> Don't know your setup, so I'm guessing.
>>>
>>> jp
>>>
>>> Serge Lages wrote:

 Hi all,

 I am currently using a osgViewer::viewer with slaves cameras (just like
 the osgwindows example), and I am getting some visual artifacts on the
 second window (see the attached image).

 Does it rings a bell to anyone ? Something not setted correctly ?

 Thanks in advance !

 PS : here is my viewer init :

osgViewer::Viewer viewer;

// upper window + upper slave camera
{
osg::ref_ptr traits = new
 osg::GraphicsContext::Traits;
traits->x = 300;
traits->y = 40;
traits->width = 600;
traits->height = 200;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr gc =
 osg::GraphicsContext::createGraphicsContext(traits.get());

osg::ref_ptr camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width,
 traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer
viewer.addSlave(camera.get());
}

// lower window + lower slave camera
{
osg::ref_ptr traits = new
 osg::GraphicsContext::Traits;
traits->x = 300;
traits->y = 275;
traits->width = 600;
traits->height = 480;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr gc =
 osg::GraphicsContext::createGraphicsContext(traits.get());

osg::ref_ptr camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width,
 traits->height));
GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer, with a shift right of the
 projection matrix
viewer.addSlave(camera.get());
}

 --
 Serge Lages
 http://www.tharsis-software.com
 


 

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org

 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>>
>>> --
>>> This message is subject to the CSIR's copyright terms and conditions,
>>> e-mail legal notice, and implemented Open Document Format (ODF) standard.
>>> The full disclaimer details can be found at
>>> http://www.csir.co.za/disclaimer.html.
>>>
>>> This message has been scanned for viruses and dangerous content by
>>> MailScanner, and is believed to be clean.  MailScanner thanks Transtec
>>> Computers for their support.
>>>
>>> ___
>>> osg-users mailing list
>>> osg-users@lists.openscenegraph.org
>>> http://list

Re: [osg-users] multiple windows rendering bug

2008-05-23 Thread Serge Lages
My setup is :

WinXP, DualCore CPU, NVidia 8600 GTS, osgViewer SingleThreaded mode, one
screen and two windows

I'll try the patch suggested into this thread to see if it resolves my
problem.

On Fri, May 23, 2008 at 10:58 AM, J.P. Delport <[EMAIL PROTECTED]> wrote:

> Hi,
>
> Have you tried forcing single threaded?
>
> maybe see this thread.
>
> "Complete garbage in OSG / XP / multi monitor / multi   threaded / NVidia"
>
> Don't know your setup, so I'm guessing.
>
> jp
>
> Serge Lages wrote:
>
>> Hi all,
>>
>> I am currently using a osgViewer::viewer with slaves cameras (just like
>> the osgwindows example), and I am getting some visual artifacts on the
>> second window (see the attached image).
>>
>> Does it rings a bell to anyone ? Something not setted correctly ?
>>
>> Thanks in advance !
>>
>> PS : here is my viewer init :
>>
>>osgViewer::Viewer viewer;
>>
>>// upper window + upper slave camera
>>{
>>osg::ref_ptr traits = new
>> osg::GraphicsContext::Traits;
>>traits->x = 300;
>>traits->y = 40;
>>traits->width = 600;
>>traits->height = 200;
>>traits->windowDecoration = true;
>>traits->doubleBuffer = true;
>>traits->sharedContext = 0;
>>
>>osg::ref_ptr gc =
>> osg::GraphicsContext::createGraphicsContext(traits.get());
>>
>>osg::ref_ptr camera = new osg::Camera;
>>camera->setGraphicsContext(gc.get());
>>camera->setViewport(new osg::Viewport(0,0, traits->width,
>> traits->height));
>>GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
>>camera->setDrawBuffer(buffer);
>>camera->setReadBuffer(buffer);
>>
>>// add this slave camera to the viewer
>>viewer.addSlave(camera.get());
>>}
>>
>>// lower window + lower slave camera
>>{
>>osg::ref_ptr traits = new
>> osg::GraphicsContext::Traits;
>>traits->x = 300;
>>traits->y = 275;
>>traits->width = 600;
>>traits->height = 480;
>>traits->windowDecoration = true;
>>traits->doubleBuffer = true;
>>traits->sharedContext = 0;
>>
>>osg::ref_ptr gc =
>> osg::GraphicsContext::createGraphicsContext(traits.get());
>>
>>osg::ref_ptr camera = new osg::Camera;
>>camera->setGraphicsContext(gc.get());
>>camera->setViewport(new osg::Viewport(0,0, traits->width,
>> traits->height));
>>GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
>>camera->setDrawBuffer(buffer);
>>camera->setReadBuffer(buffer);
>>
>>// add this slave camera to the viewer, with a shift right of the
>> projection matrix
>>viewer.addSlave(camera.get());
>>}
>>
>> --
>> Serge Lages
>> http://www.tharsis-software.com
>> 
>>
>>
>> 
>>
>> ___
>> osg-users mailing list
>> osg-users@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
> --
> This message is subject to the CSIR's copyright terms and conditions,
> e-mail legal notice, and implemented Open Document Format (ODF) standard.
> The full disclaimer details can be found at
> http://www.csir.co.za/disclaimer.html.
>
> This message has been scanned for viruses and dangerous content by
> MailScanner, and is believed to be clean.  MailScanner thanks Transtec
> Computers for their support.
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Serge Lages
http://www.tharsis-software.com
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple windows rendering bug

2008-05-23 Thread J.P. Delport

Hi,

Have you tried forcing single threaded?

maybe see this thread.

"Complete garbage in OSG / XP / multi monitor / multi  threaded / NVidia"

Don't know your setup, so I'm guessing.

jp

Serge Lages wrote:

Hi all,

I am currently using a osgViewer::viewer with slaves cameras (just like 
the osgwindows example), and I am getting some visual artifacts on the 
second window (see the attached image).


Does it rings a bell to anyone ? Something not setted correctly ?

Thanks in advance !

PS : here is my viewer init :

osgViewer::Viewer viewer;

// upper window + upper slave camera
{
osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;

traits->x = 300;
traits->y = 40;
traits->width = 600;
traits->height = 200;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());


osg::ref_ptr camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width, 
traits->height));

GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer
viewer.addSlave(camera.get());
}

// lower window + lower slave camera
{
osg::ref_ptr traits = new 
osg::GraphicsContext::Traits;

traits->x = 300;
traits->y = 275;
traits->width = 600;
traits->height = 480;
traits->windowDecoration = true;
traits->doubleBuffer = true;
traits->sharedContext = 0;

osg::ref_ptr gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());


osg::ref_ptr camera = new osg::Camera;
camera->setGraphicsContext(gc.get());
camera->setViewport(new osg::Viewport(0,0, traits->width, 
traits->height));

GLenum buffer = traits->doubleBuffer ? GL_BACK : GL_FRONT;
camera->setDrawBuffer(buffer);
camera->setReadBuffer(buffer);

// add this slave camera to the viewer, with a shift right of 
the projection matrix

viewer.addSlave(camera.get());
}

--
Serge Lages
http://www.tharsis-software.com





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


--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.


This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


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


Re: [osg-users] multiple windows rendering bug

2008-05-23 Thread Alberto Luaces
Could be this

http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/2008-May/011011.html

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


Re: [osg-users] multiple windows

2007-10-29 Thread Emmanuel Roche
Hi !

thanks for testing Thibault, if it's working on your side, it's already a
good thing...
I compiled everything in multithreaded DLL, this should be ok... So, as you
suggest, maybe it's a good time to try VS 2005... :-)

Manu.

2007/10/29, Thibault Genessay <[EMAIL PROTECTED]>:
>
> Hi Emmanuel
>
> I've just compiled your mod, and got the sample running.
>
> > Has someone already noticed that, if you remove the "start page" [you
> then
> > create the _auiNotebook the first time it is requested] and for example
> add
> > a Menu with an "Open..." command to load osg models, then each time you
> do
> > this sequence:
> >
> > 1) Open an osg file,
> > 2) Close the only tab created
> > 3) Try to open an other file
> >
> > ... the application crashes...
>
> I can't reproduce this crash on my machine (VS 2005 SP1), everything
> seems to work smoothly.
>
> > Or maybe it's a known issue and that's the very reason why you added the
> > "Start page" and prevented its detruction ?
>
> No, the only reason I did this in the first place is because we would
> have no way to spawn the startup page if we closed it - thus we would
> not be able to add anymore tabs.
> Also, it was a good way to check that we could add any window type as
> a tab - not only osg canvas.
>
> >
> > I can't say if the problem comes from OSG or wxWidgets: sometimes I have
> a
> > crash on osgViewer::View constructor but the debug version doesn't
> display
> > anything useful, and sometines I have the bug in other dlls like ntdll
> for
> > example... if it comes from wxWidgets, maybe that's the reason why you
> are
> > using version 2.9 (I built the application with the version 2.8.4, and
> in
> > non-unicode... so if you when to test this you may have to make small
> > changed in the code I added [every thing is in MainFrame.cpp in fact])
> >
>
> I'd bet the problem is a CRT issue. The bugs in wxAUI I had in the
> past were always triggered inside wxWidgets when you would remove a
> tab, it does not seem to be the case here.
> Have you made sure you used the multithreaded DLL everywhere ? (osg
> does this by default, wxWidgets needs to be compiled in DLL [Unicode]
> mode), and your app must use the multithreaded DLL.
> Also make sure you use the correct preprocessor macros (WXUSINGDLL and
> such).
>
> Bugs that occur at various places are hard to track. One thing you can
> do is regularly check the heap to see if a corruption occurs at some
> point by using the _heapchk() function. If something goes wrong you
> can be notified before the crash occurs (at a random place because the
> memory layout changes from execution to execution).
>
> Finally, try to switch to VS 2005 as the compiler (and the C++
> runtime) contains much less bugs than VS 7.x series.
>
> Cheers
>
> Thibault
>
>
> > regards,
> > Manu.
> >
> >
> > 2007/10/29, Thibault Genessay <[EMAIL PROTECTED]>:
> > > Hi Mario
> > >
> > >
> > > On 10/26/07, Mario Valle <[EMAIL PROTECTED]> wrote:
> > > > I had to make some addition to have it compiling under VS 7.1 (and
> my wx
> > and osg
> > > > libraries). But beside this, I noticed a strange thing:
> > > > load spaceship.osg (or fountain.osg) and you notice the motor plumes
> > does not animate. If
> > > > you make the model rotate, they start animate again.
> > >
> > > That is quite expected. The update traversal is not normally
> > > triggered, so no updatecallback-based animations can work if the view
> > > is not being updated. If you throw the model, the manipulator calls
> > > requestContinuousUpdate(true) so animations are updated.
> > > If you want to override this behavior, you can call
> > > Canvas::setUpdateWhenIdleOverride(true). You'll get the
> > "normal",
> > > real-time OSG loop.
> > >
> > > The rationale is that GUI based applications more often display static
> > > scenes (e.g. in a 3D modeler, the update is not continuous).
> > >
> > > > It is something related to your OnIdle optimization. If you comment
> the
> > if line, then
> > > > everything animates as usual.
> > > > Hope it helps.
> > >
> > > Glad to see if compiles under 7.1
> > > Thanks for testing
> > >
> > > Thibault
> > >
> > > > Ciao!
> > > > mario
> > > >
> > > >
> > > > Thibault Genessay wrote:
> > > > > Hi Emmanuel
> > > > >
> > > > > I have made a sample that demonstrate the integration of the OSG
> in
> > > > > wxWidgets. It is a simple frame with a wxAUINotebook containing
> OSG
> > > > > views. You can download source and binaries at
> > > > > http://ips-dil.unil.ch/osg
> > > > >
> > > > > Could you have a look at these and see if this suits your needs ?
> > > > >
> > > > > I am planning to release it as an "official" sample to
> OSG+wxWidgets,
> > > > > so I'll need to test it on more systems (not tested on Linux as of
> > > > > today) and more threading models.
> > > > >
> > > > > It uses a modified version of the osgCompositeViewer::Viewer that
> > > > > skips rendering if makeCurrent() returns false. Currently, the
> > > > > composite viewer

Re: [osg-users] multiple windows

2007-10-29 Thread Thibault Genessay
Hi Emmanuel

I've just compiled your mod, and got the sample running.

> Has someone already noticed that, if you remove the "start page" [you then
> create the _auiNotebook the first time it is requested] and for example add
> a Menu with an "Open..." command to load osg models, then each time you do
> this sequence:
>
> 1) Open an osg file,
> 2) Close the only tab created
> 3) Try to open an other file
>
> ... the application crashes...

I can't reproduce this crash on my machine (VS 2005 SP1), everything
seems to work smoothly.

> Or maybe it's a known issue and that's the very reason why you added the
> "Start page" and prevented its detruction ?

No, the only reason I did this in the first place is because we would
have no way to spawn the startup page if we closed it - thus we would
not be able to add anymore tabs.
Also, it was a good way to check that we could add any window type as
a tab - not only osg canvas.

>
> I can't say if the problem comes from OSG or wxWidgets: sometimes I have a
> crash on osgViewer::View constructor but the debug version doesn't display
> anything useful, and sometines I have the bug in other dlls like ntdll for
> example... if it comes from wxWidgets, maybe that's the reason why you are
> using version 2.9 (I built the application with the version 2.8.4, and in
> non-unicode... so if you when to test this you may have to make small
> changed in the code I added [every thing is in MainFrame.cpp in fact])
>

I'd bet the problem is a CRT issue. The bugs in wxAUI I had in the
past were always triggered inside wxWidgets when you would remove a
tab, it does not seem to be the case here.
Have you made sure you used the multithreaded DLL everywhere ? (osg
does this by default, wxWidgets needs to be compiled in DLL [Unicode]
mode), and your app must use the multithreaded DLL.
Also make sure you use the correct preprocessor macros (WXUSINGDLL and such).

Bugs that occur at various places are hard to track. One thing you can
do is regularly check the heap to see if a corruption occurs at some
point by using the _heapchk() function. If something goes wrong you
can be notified before the crash occurs (at a random place because the
memory layout changes from execution to execution).

Finally, try to switch to VS 2005 as the compiler (and the C++
runtime) contains much less bugs than VS 7.x series.

Cheers

Thibault


> regards,
> Manu.
>
>
> 2007/10/29, Thibault Genessay <[EMAIL PROTECTED]>:
> > Hi Mario
> >
> >
> > On 10/26/07, Mario Valle <[EMAIL PROTECTED]> wrote:
> > > I had to make some addition to have it compiling under VS 7.1 (and my wx
> and osg
> > > libraries). But beside this, I noticed a strange thing:
> > > load spaceship.osg (or fountain.osg) and you notice the motor plumes
> does not animate. If
> > > you make the model rotate, they start animate again.
> >
> > That is quite expected. The update traversal is not normally
> > triggered, so no updatecallback-based animations can work if the view
> > is not being updated. If you throw the model, the manipulator calls
> > requestContinuousUpdate(true) so animations are updated.
> > If you want to override this behavior, you can call
> > Canvas::setUpdateWhenIdleOverride(true). You'll get the
> "normal",
> > real-time OSG loop.
> >
> > The rationale is that GUI based applications more often display static
> > scenes (e.g. in a 3D modeler, the update is not continuous).
> >
> > > It is something related to your OnIdle optimization. If you comment the
> if line, then
> > > everything animates as usual.
> > > Hope it helps.
> >
> > Glad to see if compiles under 7.1
> > Thanks for testing
> >
> > Thibault
> >
> > > Ciao!
> > > mario
> > >
> > >
> > > Thibault Genessay wrote:
> > > > Hi Emmanuel
> > > >
> > > > I have made a sample that demonstrate the integration of the OSG in
> > > > wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> > > > views. You can download source and binaries at
> > > > http://ips-dil.unil.ch/osg
> > > >
> > > > Could you have a look at these and see if this suits your needs ?
> > > >
> > > > I am planning to release it as an "official" sample to OSG+wxWidgets,
> > > > so I'll need to test it on more systems (not tested on Linux as of
> > > > today) and more threading models.
> > > >
> > > > It uses a modified version of the osgCompositeViewer::Viewer that
> > > > skips rendering if makeCurrent() returns false. Currently, the
> > > > composite viewer ignores the return value of makeCurrent(). We'll need
> > > > to address this issue with Robert as it is precisely the problem you
> > > > and him are discussing in the thread "camera switching in composite
> > > > viewer".
> > > >
> > > > Cheers
> > > >
> > > > Thibault
> > > >
> > > >
> > > > On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > >> Okay, with this version joined, we have two tabs (not added
> dynamically,
> > > >> sure, but it's a beginning...) with animation rendered correctly...
> > > >>
> > > >> The o

Re: [osg-users] multiple windows

2007-10-29 Thread Emmanuel Roche
Hi again,

I check again the crash: in fact it comes from osgDB::readNodeFile(...) when
it's called the second time (so after a first View is created, added to the
main composite viewer, rendered correctly a few seconds, and then removed
from the composite viewer and destroyed...) : Would you have any clue on
this Robert ?

Manu.


2007/10/29, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> By the way, guys, I've noticed a small bug in this wxOSG_tab application
> (at least in the version I compiled...):
>
> Has someone already noticed that, if you remove the "start page" [you then
> create the _auiNotebook the first time it is requested] and for example add
> a Menu with an "Open..." command to load osg models, then each time you do
> this sequence:
>
> 1) Open an osg file,
> 2) Close the only tab created
> 3) Try to open an other file
>
> ... the application crashes...
>
> I put a zip file of the modified sources on my website: if someone wants
> to check this... http://utopianworld.ath.cx/web/osg/wxOSG_tab_modified.zip
> Or maybe it's a known issue and that's the very reason why you added the
> "Start page" and prevented its detruction ?
>
> I can't say if the problem comes from OSG or wxWidgets: sometimes I have a
> crash on osgViewer::View constructor but the debug version doesn't display
> anything useful, and sometines I have the bug in other dlls like ntdll for
> example... if it comes from wxWidgets, maybe that's the reason why you are
> using version 2.9 (I built the application with the version 2.8.4, and in
> non-unicode... so if you when to test this you may have to make small
> changed in the code I added [every thing is in MainFrame.cpp in fact])
>
> regards,
> Manu.
>
>
> 2007/10/29, Thibault Genessay <[EMAIL PROTECTED]>:
> >
> > Hi Mario
> >
> >
> > On 10/26/07, Mario Valle <[EMAIL PROTECTED]> wrote:
> > > I had to make some addition to have it compiling under VS 7.1 (and my
> > wx and osg
> > > libraries). But beside this, I noticed a strange thing:
> > > load spaceship.osg (or fountain.osg) and you notice the motor plumes
> > does not animate. If
> > > you make the model rotate, they start animate again.
> >
> > That is quite expected. The update traversal is not normally
> > triggered, so no updatecallback-based animations can work if the view
> > is not being updated. If you throw the model, the manipulator calls
> > requestContinuousUpdate(true) so animations are updated.
> > If you want to override this behavior, you can call
> > Canvas::setUpdateWhenIdleOverride(true). You'll get the "normal",
> > real-time OSG loop.
> >
> > The rationale is that GUI based applications more often display static
> > scenes (e.g. in a 3D modeler, the update is not continuous).
> >
> > > It is something related to your OnIdle optimization. If you comment
> > the if line, then
> > > everything animates as usual.
> > > Hope it helps.
> >
> > Glad to see if compiles under 7.1
> > Thanks for testing
> >
> > Thibault
> >
> > > Ciao!
> > > mario
> > >
> > >
> > > Thibault Genessay wrote:
> > > > Hi Emmanuel
> > > >
> > > > I have made a sample that demonstrate the integration of the OSG in
> > > > wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> > > > views. You can download source and binaries at
> > > > http://ips-dil.unil.ch/osg
> > > >
> > > > Could you have a look at these and see if this suits your needs ?
> > > >
> > > > I am planning to release it as an "official" sample to
> > OSG+wxWidgets,
> > > > so I'll need to test it on more systems (not tested on Linux as of
> > > > today) and more threading models.
> > > >
> > > > It uses a modified version of the osgCompositeViewer::Viewer that
> > > > skips rendering if makeCurrent() returns false. Currently, the
> > > > composite viewer ignores the return value of makeCurrent(). We'll
> > need
> > > > to address this issue with Robert as it is precisely the problem you
> > > > and him are discussing in the thread "camera switching in composite
> > > > viewer".
> > > >
> > > > Cheers
> > > >
> > > > Thibault
> > > >
> > > >
> > > > On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > >> Okay, with this version joined, we have two tabs (not added
> > dynamically,
> > > >> sure, but it's a beginning...) with animation rendered correctly...
> > > >>
> > > >> The only issue left is the mouse handling problem:
> > > >> I added a trackballmanipulator on the view1 on each tab, assigned
> > an
> > > >> handling function to the corresponding wxGLCanvas each time, and
> > this
> > > >> function is indeed called when I drag on the view1 BUT nothing
> > moves...
> > > >> :-(...
> > > >>
> > > >> I'm using view->getEventQueue()... could it be somehow
> > "disconnected" ?
> > > >> nothing happens either if I use the corresponding
> > > >> graphicswindow->getEventQueue()... so what's left ??
> > > >>
> > > >> Manu.
> > > >>
> > > >>
> > > >> 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
> > > >>> Indeed, we are in a situation where the Comp

Re: [osg-users] multiple windows

2007-10-29 Thread Emmanuel Roche
By the way, guys, I've noticed a small bug in this wxOSG_tab application (at
least in the version I compiled...):

Has someone already noticed that, if you remove the "start page" [you then
create the _auiNotebook the first time it is requested] and for example add
a Menu with an "Open..." command to load osg models, then each time you do
this sequence:

1) Open an osg file,
2) Close the only tab created
3) Try to open an other file

... the application crashes...

I put a zip file of the modified sources on my website: if someone wants to
check this... http://utopianworld.ath.cx/web/osg/wxOSG_tab_modified.zip
Or maybe it's a known issue and that's the very reason why you added the
"Start page" and prevented its detruction ?

I can't say if the problem comes from OSG or wxWidgets: sometimes I have a
crash on osgViewer::View constructor but the debug version doesn't display
anything useful, and sometines I have the bug in other dlls like ntdll for
example... if it comes from wxWidgets, maybe that's the reason why you are
using version 2.9 (I built the application with the version 2.8.4, and in
non-unicode... so if you when to test this you may have to make small
changed in the code I added [every thing is in MainFrame.cpp in fact])

regards,
Manu.


2007/10/29, Thibault Genessay <[EMAIL PROTECTED]>:
>
> Hi Mario
>
>
> On 10/26/07, Mario Valle <[EMAIL PROTECTED]> wrote:
> > I had to make some addition to have it compiling under VS 7.1 (and my wx
> and osg
> > libraries). But beside this, I noticed a strange thing:
> > load spaceship.osg (or fountain.osg) and you notice the motor plumes
> does not animate. If
> > you make the model rotate, they start animate again.
>
> That is quite expected. The update traversal is not normally
> triggered, so no updatecallback-based animations can work if the view
> is not being updated. If you throw the model, the manipulator calls
> requestContinuousUpdate(true) so animations are updated.
> If you want to override this behavior, you can call
> Canvas::setUpdateWhenIdleOverride(true). You'll get the "normal",
> real-time OSG loop.
>
> The rationale is that GUI based applications more often display static
> scenes (e.g. in a 3D modeler, the update is not continuous).
>
> > It is something related to your OnIdle optimization. If you comment the
> if line, then
> > everything animates as usual.
> > Hope it helps.
>
> Glad to see if compiles under 7.1
> Thanks for testing
>
> Thibault
>
> > Ciao!
> > mario
> >
> >
> > Thibault Genessay wrote:
> > > Hi Emmanuel
> > >
> > > I have made a sample that demonstrate the integration of the OSG in
> > > wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> > > views. You can download source and binaries at
> > > http://ips-dil.unil.ch/osg
> > >
> > > Could you have a look at these and see if this suits your needs ?
> > >
> > > I am planning to release it as an "official" sample to OSG+wxWidgets,
> > > so I'll need to test it on more systems (not tested on Linux as of
> > > today) and more threading models.
> > >
> > > It uses a modified version of the osgCompositeViewer::Viewer that
> > > skips rendering if makeCurrent() returns false. Currently, the
> > > composite viewer ignores the return value of makeCurrent(). We'll need
> > > to address this issue with Robert as it is precisely the problem you
> > > and him are discussing in the thread "camera switching in composite
> > > viewer".
> > >
> > > Cheers
> > >
> > > Thibault
> > >
> > >
> > > On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > >> Okay, with this version joined, we have two tabs (not added
> dynamically,
> > >> sure, but it's a beginning...) with animation rendered correctly...
> > >>
> > >> The only issue left is the mouse handling problem:
> > >> I added a trackballmanipulator on the view1 on each tab, assigned an
> > >> handling function to the corresponding wxGLCanvas each time, and this
> > >> function is indeed called when I drag on the view1 BUT nothing
> moves...
> > >> :-(...
> > >>
> > >> I'm using view->getEventQueue()... could it be somehow "disconnected"
> ?
> > >> nothing happens either if I use the corresponding
> > >> graphicswindow->getEventQueue()... so what's left ??
> > >>
> > >> Manu.
> > >>
> > >>
> > >> 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
> > >>> Indeed, we are in a situation where the CompositeViewers don't share
> the
> > >> GraphicsWindows and everything happen in the same thread... yet, it's
> > >> currently not working for me:
> > >>> as soon as I had a second tab only the last compositeviewer gets
> updated
> > >> and drawn, the others are frozen... :-(...
> > >>> I keep investigating...
> > >>>
> > >>> Manu.
> > >>>
> > >>>
> > >>> 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
> > >>>
> >  On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > > If I recall correctly, you can have as many CompositeViewers as
> you
> > >> like/need.
> >  If the different viewers don't share any G

Re: [osg-users] multiple windows

2007-10-28 Thread Thibault Genessay
Hi Mario


On 10/26/07, Mario Valle <[EMAIL PROTECTED]> wrote:
> I had to make some addition to have it compiling under VS 7.1 (and my wx and 
> osg
> libraries). But beside this, I noticed a strange thing:
> load spaceship.osg (or fountain.osg) and you notice the motor plumes does not 
> animate. If
> you make the model rotate, they start animate again.

That is quite expected. The update traversal is not normally
triggered, so no updatecallback-based animations can work if the view
is not being updated. If you throw the model, the manipulator calls
requestContinuousUpdate(true) so animations are updated.
If you want to override this behavior, you can call
Canvas::setUpdateWhenIdleOverride(true). You'll get the "normal",
real-time OSG loop.

The rationale is that GUI based applications more often display static
scenes (e.g. in a 3D modeler, the update is not continuous).

> It is something related to your OnIdle optimization. If you comment the if 
> line, then
> everything animates as usual.
> Hope it helps.

Glad to see if compiles under 7.1
Thanks for testing

Thibault

> Ciao!
> mario
>
>
> Thibault Genessay wrote:
> > Hi Emmanuel
> >
> > I have made a sample that demonstrate the integration of the OSG in
> > wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> > views. You can download source and binaries at
> > http://ips-dil.unil.ch/osg
> >
> > Could you have a look at these and see if this suits your needs ?
> >
> > I am planning to release it as an "official" sample to OSG+wxWidgets,
> > so I'll need to test it on more systems (not tested on Linux as of
> > today) and more threading models.
> >
> > It uses a modified version of the osgCompositeViewer::Viewer that
> > skips rendering if makeCurrent() returns false. Currently, the
> > composite viewer ignores the return value of makeCurrent(). We'll need
> > to address this issue with Robert as it is precisely the problem you
> > and him are discussing in the thread "camera switching in composite
> > viewer".
> >
> > Cheers
> >
> > Thibault
> >
> >
> > On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> >> Okay, with this version joined, we have two tabs (not added dynamically,
> >> sure, but it's a beginning...) with animation rendered correctly...
> >>
> >> The only issue left is the mouse handling problem:
> >> I added a trackballmanipulator on the view1 on each tab, assigned an
> >> handling function to the corresponding wxGLCanvas each time, and this
> >> function is indeed called when I drag on the view1 BUT nothing moves...
> >> :-(...
> >>
> >> I'm using view->getEventQueue()... could it be somehow "disconnected" ?
> >> nothing happens either if I use the corresponding
> >> graphicswindow->getEventQueue()... so what's left ??
> >>
> >> Manu.
> >>
> >>
> >> 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
> >>> Indeed, we are in a situation where the CompositeViewers don't share the
> >> GraphicsWindows and everything happen in the same thread... yet, it's
> >> currently not working for me:
> >>> as soon as I had a second tab only the last compositeviewer gets updated
> >> and drawn, the others are frozen... :-(...
> >>> I keep investigating...
> >>>
> >>> Manu.
> >>>
> >>>
> >>> 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
> >>>
>  On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > If I recall correctly, you can have as many CompositeViewers as you
> >> like/need.
>  If the different viewers don't share any GaphicsWindows then it should
>  be fine to have multiple Viewer/CompositeViewers.
> 
>  However, If all the viewers run in different threads then sharing a
>  single scene graph between them would be problematic.  Such usage
>  would lead to one viewers update running in parallel with another
>  viewer's cull/draw.
> 
>  Robert.
>  ___
>  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
> >
>
> --
> Ing. Mario Valle
> Visualization Group  | http://www.cscs.ch/~mvalle
> Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
> v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
___
osg-use

Re: [osg-users] multiple windows

2007-10-26 Thread Mario Valle
Nice example, thanks!
I had to make some addition to have it compiling under VS 7.1 (and my wx and osg
libraries). But beside this, I noticed a strange thing:
load spaceship.osg (or fountain.osg) and you notice the motor plumes does not 
animate. If
you make the model rotate, they start animate again.
It is something related to your OnIdle optimization. If you comment the if 
line, then
everything animates as usual.
Hope it helps.
Ciao!
mario


Thibault Genessay wrote:
> Hi Emmanuel
> 
> I have made a sample that demonstrate the integration of the OSG in
> wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> views. You can download source and binaries at
> http://ips-dil.unil.ch/osg
> 
> Could you have a look at these and see if this suits your needs ?
> 
> I am planning to release it as an "official" sample to OSG+wxWidgets,
> so I'll need to test it on more systems (not tested on Linux as of
> today) and more threading models.
> 
> It uses a modified version of the osgCompositeViewer::Viewer that
> skips rendering if makeCurrent() returns false. Currently, the
> composite viewer ignores the return value of makeCurrent(). We'll need
> to address this issue with Robert as it is precisely the problem you
> and him are discussing in the thread "camera switching in composite
> viewer".
> 
> Cheers
> 
> Thibault
> 
> 
> On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
>> Okay, with this version joined, we have two tabs (not added dynamically,
>> sure, but it's a beginning...) with animation rendered correctly...
>>
>> The only issue left is the mouse handling problem:
>> I added a trackballmanipulator on the view1 on each tab, assigned an
>> handling function to the corresponding wxGLCanvas each time, and this
>> function is indeed called when I drag on the view1 BUT nothing moves...
>> :-(...
>>
>> I'm using view->getEventQueue()... could it be somehow "disconnected" ?
>> nothing happens either if I use the corresponding
>> graphicswindow->getEventQueue()... so what's left ??
>>
>> Manu.
>>
>>
>> 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
>>> Indeed, we are in a situation where the CompositeViewers don't share the
>> GraphicsWindows and everything happen in the same thread... yet, it's
>> currently not working for me:
>>> as soon as I had a second tab only the last compositeviewer gets updated
>> and drawn, the others are frozen... :-(...
>>> I keep investigating...
>>>
>>> Manu.
>>>
>>>
>>> 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
>>>
 On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> If I recall correctly, you can have as many CompositeViewers as you
>> like/need.
 If the different viewers don't share any GaphicsWindows then it should
 be fine to have multiple Viewer/CompositeViewers.

 However, If all the viewers run in different threads then sharing a
 single scene graph between them would be problematic.  Such usage
 would lead to one viewers update running in parallel with another
 viewer's cull/draw.

 Robert.
 ___
 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
> 

-- 
Ing. Mario Valle
Visualization Group  | http://www.cscs.ch/~mvalle
Swiss National Supercomputing Centre (CSCS)  | Tel:  +41 (91) 610.82.60
v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91) 610.82.82
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] multiple windows

2007-10-26 Thread Emmanuel Roche
Okay :-) this seems fair enough :-)

2007/10/26, Robert Osfield <[EMAIL PROTECTED]>:
>
> On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > just a small point : you're binary distribution is not working : at
> least
> > osg24-osgUtil.dll is missing for me :-)
> >
> > I have osg25-*** on my computer Could someone tell me what this
> means by
> > the way ? why this prefix on the dll files ?
>
> Versioning of the dlls is now done by default for the OSG, this is to
> prevent you from mixing the wrong version of the OSG at compile time
> and runtime.
>
> Robert.
> ___
> 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 windows

2007-10-26 Thread Robert Osfield
On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> just a small point : you're binary distribution is not working : at least
> osg24-osgUtil.dll is missing for me :-)
>
> I have osg25-*** on my computer Could someone tell me what this means by
> the way ? why this prefix on the dll files ?

Versioning of the dlls is now done by default for the OSG, this is to
prevent you from mixing the wrong version of the OSG at compile time
and runtime.

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


Re: [osg-users] multiple windows

2007-10-26 Thread Emmanuel Roche
Whaooo !

Thanks ! thanks ! thanks !...
That's exactly what I was looking for... it's really great ! :-)

just a small point : you're binary distribution is not working : at least
osg24-osgUtil.dll is missing for me :-)

I have osg25-*** on my computer Could someone tell me what this means by
the way ? why this prefix on the dll files ?

But I successfully rebuild your application from the sources with OSG
2.2and wxWidgets
2.8.4 on winXP (with Visual Studio .NET 2003)...
Sorry I don't have a valid linux dev station for the moment.

thanks again... Now I finally have a working example :-)

Manu.


2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> Great !!
> Indeed using the return value of makeCurrent() is exactly what I was
> looking for :-D...
> I'm testing your application right now !
>
> cheers,
> Emmanuel.
>
> 2007/10/26, Thibault Genessay < [EMAIL PROTECTED]>:
> >
> > Hi Emmanuel
> >
> > I have made a sample that demonstrate the integration of the OSG in
> > wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> > views. You can download source and binaries at
> > http://ips-dil.unil.ch/osg
> >
> > Could you have a look at these and see if this suits your needs ?
> >
> > I am planning to release it as an "official" sample to OSG+wxWidgets,
> > so I'll need to test it on more systems (not tested on Linux as of
> > today) and more threading models.
> >
> > It uses a modified version of the osgCompositeViewer::Viewer that
> > skips rendering if makeCurrent() returns false. Currently, the
> > composite viewer ignores the return value of makeCurrent(). We'll need
> > to address this issue with Robert as it is precisely the problem you
> > and him are discussing in the thread "camera switching in composite
> > viewer".
> >
> > Cheers
> >
> > Thibault
> >
> >
> > On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > Okay, with this version joined, we have two tabs (not added
> > dynamically,
> > > sure, but it's a beginning...) with animation rendered correctly...
> > >
> > > The only issue left is the mouse handling problem:
> > > I added a trackballmanipulator on the view1 on each tab, assigned an
> > > handling function to the corresponding wxGLCanvas each time, and this
> > > function is indeed called when I drag on the view1 BUT nothing
> > moves...
> > > :-(...
> > >
> > > I'm using view->getEventQueue()... could it be somehow "disconnected"
> > ?
> > > nothing happens either if I use the corresponding
> > > graphicswindow->getEventQueue()... so what's left ??
> > >
> > > Manu.
> > >
> > >
> > > 2007/10/26, Emmanuel Roche < [EMAIL PROTECTED]>:
> > > > Indeed, we are in a situation where the CompositeViewers don't share
> > the
> > > GraphicsWindows and everything happen in the same thread... yet, it's
> > > currently not working for me:
> > > >
> > > > as soon as I had a second tab only the last compositeviewer gets
> > updated
> > > and drawn, the others are frozen... :-(...
> > > >
> > > > I keep investigating...
> > > >
> > > > Manu.
> > > >
> > > >
> > > > 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
> > > >
> > > > > On 10/26/07, Alberto Luaces < [EMAIL PROTECTED]> wrote:
> > > > > > If I recall correctly, you can have as many CompositeViewers as
> > you
> > > like/need.
> > > > >
> > > > > If the different viewers don't share any GaphicsWindows then it
> > should
> > > > > be fine to have multiple Viewer/CompositeViewers.
> > > > >
> > > > > However, If all the viewers run in different threads then sharing
> > a
> > > > > single scene graph between them would be problematic.  Such usage
> > > > > would lead to one viewers update running in parallel with another
> > > > > viewer's cull/draw.
> > > > >
> > > > > Robert.
> > > > > ___
> > > > > 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 windows

2007-10-26 Thread Emmanuel Roche
Great !!
Indeed using the return value of makeCurrent() is exactly what I was looking
for :-D...
I'm testing your application right now !

cheers,
Emmanuel.

2007/10/26, Thibault Genessay <[EMAIL PROTECTED]>:
>
> Hi Emmanuel
>
> I have made a sample that demonstrate the integration of the OSG in
> wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
> views. You can download source and binaries at
> http://ips-dil.unil.ch/osg
>
> Could you have a look at these and see if this suits your needs ?
>
> I am planning to release it as an "official" sample to OSG+wxWidgets,
> so I'll need to test it on more systems (not tested on Linux as of
> today) and more threading models.
>
> It uses a modified version of the osgCompositeViewer::Viewer that
> skips rendering if makeCurrent() returns false. Currently, the
> composite viewer ignores the return value of makeCurrent(). We'll need
> to address this issue with Robert as it is precisely the problem you
> and him are discussing in the thread "camera switching in composite
> viewer".
>
> Cheers
>
> Thibault
>
>
> On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > Okay, with this version joined, we have two tabs (not added dynamically,
> > sure, but it's a beginning...) with animation rendered correctly...
> >
> > The only issue left is the mouse handling problem:
> > I added a trackballmanipulator on the view1 on each tab, assigned an
> > handling function to the corresponding wxGLCanvas each time, and this
> > function is indeed called when I drag on the view1 BUT nothing moves...
> > :-(...
> >
> > I'm using view->getEventQueue()... could it be somehow "disconnected" ?
> > nothing happens either if I use the corresponding
> > graphicswindow->getEventQueue()... so what's left ??
> >
> > Manu.
> >
> >
> > 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
> > > Indeed, we are in a situation where the CompositeViewers don't share
> the
> > GraphicsWindows and everything happen in the same thread... yet, it's
> > currently not working for me:
> > >
> > > as soon as I had a second tab only the last compositeviewer gets
> updated
> > and drawn, the others are frozen... :-(...
> > >
> > > I keep investigating...
> > >
> > > Manu.
> > >
> > >
> > > 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
> > >
> > > > On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > > > > If I recall correctly, you can have as many CompositeViewers as
> you
> > like/need.
> > > >
> > > > If the different viewers don't share any GaphicsWindows then it
> should
> > > > be fine to have multiple Viewer/CompositeViewers.
> > > >
> > > > However, If all the viewers run in different threads then sharing a
> > > > single scene graph between them would be problematic.  Such usage
> > > > would lead to one viewers update running in parallel with another
> > > > viewer's cull/draw.
> > > >
> > > > Robert.
> > > > ___
> > > > 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 windows

2007-10-26 Thread Thibault Genessay
Hi Emmanuel

I have made a sample that demonstrate the integration of the OSG in
wxWidgets. It is a simple frame with a wxAUINotebook containing OSG
views. You can download source and binaries at
http://ips-dil.unil.ch/osg

Could you have a look at these and see if this suits your needs ?

I am planning to release it as an "official" sample to OSG+wxWidgets,
so I'll need to test it on more systems (not tested on Linux as of
today) and more threading models.

It uses a modified version of the osgCompositeViewer::Viewer that
skips rendering if makeCurrent() returns false. Currently, the
composite viewer ignores the return value of makeCurrent(). We'll need
to address this issue with Robert as it is precisely the problem you
and him are discussing in the thread "camera switching in composite
viewer".

Cheers

Thibault


On 10/26/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> Okay, with this version joined, we have two tabs (not added dynamically,
> sure, but it's a beginning...) with animation rendered correctly...
>
> The only issue left is the mouse handling problem:
> I added a trackballmanipulator on the view1 on each tab, assigned an
> handling function to the corresponding wxGLCanvas each time, and this
> function is indeed called when I drag on the view1 BUT nothing moves...
> :-(...
>
> I'm using view->getEventQueue()... could it be somehow "disconnected" ?
> nothing happens either if I use the corresponding
> graphicswindow->getEventQueue()... so what's left ??
>
> Manu.
>
>
> 2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
> > Indeed, we are in a situation where the CompositeViewers don't share the
> GraphicsWindows and everything happen in the same thread... yet, it's
> currently not working for me:
> >
> > as soon as I had a second tab only the last compositeviewer gets updated
> and drawn, the others are frozen... :-(...
> >
> > I keep investigating...
> >
> > Manu.
> >
> >
> > 2007/10/26, Robert Osfield < [EMAIL PROTECTED]>:
> >
> > > On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > > > If I recall correctly, you can have as many CompositeViewers as you
> like/need.
> > >
> > > If the different viewers don't share any GaphicsWindows then it should
> > > be fine to have multiple Viewer/CompositeViewers.
> > >
> > > However, If all the viewers run in different threads then sharing a
> > > single scene graph between them would be problematic.  Such usage
> > > would lead to one viewers update running in parallel with another
> > > viewer's cull/draw.
> > >
> > > Robert.
> > > ___
> > > 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 windows

2007-10-26 Thread Emmanuel Roche
Okay, with this version joined, we have two tabs (not added dynamically,
sure, but it's a beginning...) with animation rendered correctly...

The only issue left is the mouse handling problem:
I added a trackballmanipulator on the view1 on each tab, assigned an
handling function to the corresponding wxGLCanvas each time, and this
function is indeed called when I drag on the view1 BUT nothing moves...
:-(...

I'm using view->getEventQueue()... could it be somehow "disconnected" ?
nothing happens either if I use the corresponding
graphicswindow->getEventQueue()... so what's left ??

Manu.


2007/10/26, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> Indeed, we are in a situation where the CompositeViewers don't share the
> GraphicsWindows and everything happen in the same thread... yet, it's
> currently not working for me:
>
> as soon as I had a second tab only the last compositeviewer gets updated
> and drawn, the others are frozen... :-(...
>
> I keep investigating...
>
> Manu.
>
> 2007/10/26, Robert Osfield <[EMAIL PROTECTED]>:
> >
> > On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > > If I recall correctly, you can have as many CompositeViewers as you
> > like/need.
> >
> > If the different viewers don't share any GaphicsWindows then it should
> > be fine to have multiple Viewer/CompositeViewers.
> >
> > However, If all the viewers run in different threads then sharing a
> > single scene graph between them would be problematic.  Such usage
> > would lead to one viewers update running in parallel with another
> > viewer's cull/draw.
> >
> > Robert.
> > ___
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
>
>
#include "wx/wx.h"
#include "wx/glcanvas.h"
#include "wx/notebook.h"

#include "osg/ref_ptr"
#include "osg/Vec3"
#include "osg/GraphicsContext"
#include "osgViewer/GraphicsWindow"
#include "osgViewer/CompositeViewer"
#include "osgViewer/Viewer"
#include "osgViewer/View"
#include "osgDB/ReadFile"
#include "osgGA/TrackballManipulator"

#include 

osg::State *st2;
osg::State *st1;

//osgViewer::CompositeViewer* currentViewer;

class programa: public wxApp
{
public:
bool OnInit();
};

DECLARE_APP( programa)
IMPLEMENT_APP( programa)

class ventanaOSGWX: public osgViewer::GraphicsWindow
{
public:
ventanaOSGWX( wxGLCanvas *wx): wxGL( wx)
{
}
bool makeCurrentImplementation()
{
if(!wxGL->GetParent()->IsShown())
return false;

wxGL->SetCurrent();
return true;
}
void swapBuffersImplementation()
{
wxGL->SwapBuffers();
}
bool realizeImplementation()
{
return true;
}
bool valid() const
{
return true;
}
bool isRealizedImplementation() const
{
return true;
}
void closeImplementation()
{
}
bool releaseContextImplementation()
{
return true;
}
void grabFocus()
{
wxGL->SetFocus();
}
void grabFocusIfPointerInWindow()
{
wxGL->SetFocus();
}
private:
wxGLCanvas *wxGL;
};

class ventana: public wxPanel
{
public:
ventana( wxWindow *p, const std::string &objeto);

void OnPaint( wxPaintEvent &e);

osgViewer::CompositeViewer* getViewer() { return cViewer; }
private:
osg::ref_ptr v1, v2;
osgViewer::CompositeViewer *cViewer;
osgViewer::View *view1, *view2;
DECLARE_EVENT_TABLE()
};

BEGIN_EVENT_TABLE( ventana, wxPanel)
EVT_PAINT( ventana::OnPaint)

END_EVENT_TABLE()

class MouseHandler : public wxEvtHandler
{
private:
DECLARE_EVENT_TABLE();
osgViewer::View* view;
ventanaOSGWX* gw;

public:
MouseHandler(osgViewer::View* v, ventanaOSGWX* graphicswindow) : 
view(v), gw(graphicswindow) {};

void OnMouse(wxMouseEvent& event);
};

BEGIN_EVENT_TABLE(MouseHandler,wxEvtHandler)
EVT_MOUSE_EVENTS(MouseHandler::OnMouse)
END_EVENT_TABLE()

bool programa::OnInit()
{
//currentViewer = NULL;
wxFrame *v = new wxFrame(0, wxID_ANY, wxT("Dos vistas con OSG"), 
wxDefaultPosition, wxSize( 540,305)); /* No vale con el ctor por defecto */
wxNotebook *nb = new wxNotebook(v,wxID_ANY);
ventana *panel1

Re: [osg-users] multiple windows

2007-10-26 Thread Emmanuel Roche
Indeed, we are in a situation where the CompositeViewers don't share the
GraphicsWindows and everything happen in the same thread... yet, it's
currently not working for me:

as soon as I had a second tab only the last compositeviewer gets updated and
drawn, the others are frozen... :-(...

I keep investigating...

Manu.

2007/10/26, Robert Osfield <[EMAIL PROTECTED]>:
>
> On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> > If I recall correctly, you can have as many CompositeViewers as you
> like/need.
>
> If the different viewers don't share any GaphicsWindows then it should
> be fine to have multiple Viewer/CompositeViewers.
>
> However, If all the viewers run in different threads then sharing a
> single scene graph between them would be problematic.  Such usage
> would lead to one viewers update running in parallel with another
> viewer's cull/draw.
>
> Robert.
> ___
> 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 windows

2007-10-26 Thread Robert Osfield
On 10/26/07, Alberto Luaces <[EMAIL PROTECTED]> wrote:
> If I recall correctly, you can have as many CompositeViewers as you like/need.

If the different viewers don't share any GaphicsWindows then it should
be fine to have multiple Viewer/CompositeViewers.

However, If all the viewers run in different threads then sharing a
single scene graph between them would be problematic.  Such usage
would lead to one viewers update running in parallel with another
viewer's cull/draw.

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


Re: [osg-users] multiple windows

2007-10-26 Thread Emmanuel Roche
Yes Alberto, you're right, and I noticed this also, that's why my
GraphicsWindowWX class inherits from both wxGLCanvas and
osgViewer::GraphicsWindow as you can see in the files I joined... [this
solution comes from the osgviewerWX example].

And in addition to this you will notice  that I'm not using OnPaint to draw
the GL canvas : because this function is called only when Wx thinks it is
"needed"... I had to use an Idle function instead to handle the
viewer->frame() call often enough.

Concerning the TrackballManipulator issue I noticed that things work well if
I use "view->getEventQueue()" instead of the corresponding
GraphicsWindow->getEventQueue()...

Manu.

PS: ... Writing this, I have an other idea... the very problem comes from
the fact that I'm using an Idle function... but why am I not keeping using
OnPaint and just adding a call o Refresh() at the end !!! ??? :-) I'm
testing this right now...


2007/10/26, Alberto Luaces <[EMAIL PROTECTED]>:
>
> Hi Manu,
>
> I have been investigating a bit the event issue an I found some
> interesting
> things:
>
> The mouse event is only proccessed when the mouse pointer is over a part
> of
> the wxPanel not owned by a wxGLCanvas, that is, mouse events on the
> wxGLCanvas aren't sent to its parents. According to the Wx documentation,
> only events that are derived from wxCommandEvent are passed to the
> parents.
> The rest (and here the documentation mentions wxMouseEvent explicitly)
> aren't. So we should have to subclass from wxGLCanvas to handle those
> events
> after all.
>
> I'll post further progress.
>
> Alberto
>
> El Thursday 25 October 2007 17:23:52 Emmanuel Roche escribió:
> > Hi again guys !
> >
> > I've just tested your solution Alberto, and indeed it's working and I
> can
> > see both pages with two View on each page :-)...
> >
> > Yet I think there is still something I'm missing about the
> CompositeViewer
> > behavior : indeed, I set a trackballmanipulator for the view1 [
> > view1->setCameraManipulator(new osgGA::TrackballManipulator); ] and
> created
> > a Mouse handling function:
> >
> > void ventana::OnMouse(wxMouseEvent& event)
> > {
> > if (event.ButtonDown()) {
> > int button = event.GetButton();
> > v1->getEventQueue()->mouseButtonPress(event.GetX(), event.GetY
> (),
> > button);
> > }
> > else if (event.ButtonUp()) {
> > int button = event.GetButton();
> > v1->getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY
> (),
> > button);
> > }
> > else if (event.Dragging()) {
> > v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY());
> > }
> > }
> >
> > ... here "v1" is the first GraphicsWindow on the tab, and, when I
> activate
> > this function by dragging the mouse on the tab nothing moves :-(...
> I
> > trying replacing "v1" by "cViewer" and calling
> > cViewer->setEventQueue(v1->getEventQueue()) in the initilialization
> process
> > [ because the eventQueue seems to be NULL otherwise...] but this doesn't
> > work either... Any clue about this ???
> >
> >
> > regards,
> > Manu.
> >
> > 2007/10/25, Robert Osfield <[EMAIL PROTECTED]>:
> > > Hi Guys,
> > >
> > > I don't have any recommendations, or time right now to dive into this
> > > topic.  I'd certainly like to see osgViewer be able to cope with this
> > > type of usage, and its not one that its been coded for up to this
> > > point.  Might I suggest getting a tabbed WxWidget example together
> > > than could be included with the OSG distribution that illustrates the
> > > this issue and can be used as a test bed for a final recommend
> > > solution.
> > >
> > > Robert.
> > >
> > > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > > Thanks a lot Alberto I guess I could not get anything more usefull
> :-)
> > > > !
> > > >
> > > > I'm checking this right now
> > > >
> > > > Regards,
> > > > Manu.
> > > >
> > > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > > > Hi Manu,
> > > > >
> > > > > I'm doing the very same thing, but with two views of a same scene
> on
> > >
> > > every
> > >
> > > > > tab. Currently it works well, but I suspect there are duplicated
> > > >
> > > > resources, so
> > > >
> > > > > I have to say that my code is not in its final version.
> > > > >
> > > > > I'm attaching it, it works for me on Linux and wx 2.6.3unmodified.
> > > > >
> > > > > Feel free to compare it with yours so we can learn together :)
> > > > >
> > > > > HTH,
> > > > >
> > > > > Alberto
> > > > >
> > > > > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > > > > Hello everyone!
> > > > > >
> > > > > > I've got a simple question, but I can't find any practical
> > > > > > solution:
> > > > > >
> > > > > > In my application, I have to display a notebook with a 3D window
> on
> > >
> > > each
> > >
> > > > > > tab... and I want to be able to add/remove tabs dynamically...
> so,
> > >
> > > what
> > >
> > > > can
> > > >
> > > > > > I use to achieve this result ?
> > > > > >
> > > 

Re: [osg-users] multiple windows

2007-10-26 Thread Alberto Luaces
If I recall correctly, you can have as many CompositeViewers as you like/need.

Alberto

El Friday 26 October 2007 00:19:25 Emmanuel Roche escribió:
> Still on the issue of multi-windows, I guess it's totally unsafe to use
> multiple CompositeViewer at the same time, isn't it ?
>
> For exemple doing something like:
>
> CompositeViewer* v1 = (...)
>
> CompositeViewer* v2 = ()
>
>
> while(true) {
>   v1->frame();
>   v2->frame();
> }
>
>
> ???
>
> 2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
> > Whoups my zip file was blocked...:-( thus I'm joining the files one
> > by one
> >
> > regards,
> > Manu.
> >
> > 2007/10/25, Emmanuel Roche < [EMAIL PROTECTED]>:
> > > whoups... forgot the file of course;..
> > >
> > > 2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
> > > > For those who would have some time to give a look at this, I'm
> > > > joining the code of a simple application designed to open a View in
> > > > multiple tabs:
> > > >
> > > > the user select an osg or ive file to open an then a new tab is
> > > > created using this file as scene Data.
> > > >
> > > > There is a single CompositeViewer managed by the main frame, an 1
> > > > View object per tab...
> > > >
> > > > This sample is NOT working properly: if you add one tab, every thing
> > > > is okay, but when you had other tabs, as before, only the last one is
> > > > displayed :-( the others become empty [only the default blue
> > > > background :-( ] and this last tab doesn't handle the mouse inputs
> > > > correctly [instead, it seems that the mouse input for the first tab
> > > > are used for this last View !!!...
> > > >
> > > > Yet the code is very clear: each tab has its GraphicsWindowWX, (so
> > > > its wxGLCanvas too), its OSGPanel (so its own processing of mouse
> > > > inputs, and its View).. so what does this mean ? is the global
> > > > CompositeViewer appropriating itself the eventQueue of the first View
> > > > added and then using this one for the other Views ?
> > > >
> > > > As always , any clue would be really welcomed, I feel a bit lost with
> > > > this...
> > > >
> > > > regards,
> > > > Manu.
> > > >
> > > > 2007/10/25, Emmanuel Roche < [EMAIL PROTECTED]>:
> > > > > Hi again guys !
> > > > >
> > > > > I've just tested your solution Alberto, and indeed it's working and
> > > > > I can see both pages with two View on each page :-)...
> > > > >
> > > > > Yet I think there is still something I'm missing about the
> > > > > CompositeViewer behavior : indeed, I set a trackballmanipulator for
> > > > > the view1 [ view1->setCameraManipulator(new
> > > > > osgGA::TrackballManipulator); ] and created a Mouse handling
> > > > > function:
> > > > >
> > > > > void ventana::OnMouse(wxMouseEvent& event)
> > > > > {
> > > > > if (event.ButtonDown()) {
> > > > > int button = event.GetButton();
> > > > > v1->getEventQueue()->mouseButtonPress(event.GetX(),
> > > > > event.GetY(), button);
> > > > > }
> > > > > else if (event.ButtonUp()) {
> > > > > int button = event.GetButton();
> > > > > v1->getEventQueue()->mouseButtonRelease(event.GetX(),
> > > > > event.GetY(), button);
> > > > > }
> > > > > else if (event.Dragging ()) {
> > > > > v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY
> > > > > ());
> > > > > }
> > > > > }
> > > > >
> > > > > ... here "v1" is the first GraphicsWindow on the tab, and, when I
> > > > > activate this function by dragging the mouse on the tab nothing
> > > > > moves
> > > > >
> > > > > :-(... I trying replacing "v1" by "cViewer" and calling
> > > > >
> > > > > cViewer->setEventQueue(v1->getEventQueue()) in the initilialization
> > > > > process [ because the eventQueue seems to be NULL otherwise...] but
> > > > > this doesn't work either... Any clue about this ???
> > > > >
> > > > >
> > > > > regards,
> > > > > Manu.
> > > > >
> > > > > 2007/10/25, Robert Osfield <[EMAIL PROTECTED] >:
> > > > > > Hi Guys,
> > > > > >
> > > > > > I don't have any recommendations, or time right now to dive into
> > > > > > this
> > > > > > topic.  I'd certainly like to see osgViewer be able to cope with
> > > > > > this
> > > > > > type of usage, and its not one that its been coded for up to this
> > > > > > point.  Might I suggest getting a tabbed WxWidget example
> > > > > > together than could be included with the OSG distribution that
> > > > > > illustrates the
> > > > > > this issue and can be used as a test bed for a final recommend
> > > > > > solution.
> > > > > >
> > > > > > Robert.
> > > > > >
> > > > > > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > > > > > Thanks a lot Alberto I guess I could not get anything more
> > > > > >
> > > > > > usefull :-) !
> > > > > >
> > > > > > > I'm checking this right now
> > > > > > >
> > > > > > > Regards,
> > > > > > > Manu.
> > > > > > >
> > > > > > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > > > > > > Hi Manu,
> > > > > > > >
> > > > > > > > I'm doing the v

Re: [osg-users] multiple windows

2007-10-26 Thread Alberto Luaces
Hi Manu,

I have been investigating a bit the event issue an I found some interesting 
things:

The mouse event is only proccessed when the mouse pointer is over a part of 
the wxPanel not owned by a wxGLCanvas, that is, mouse events on the 
wxGLCanvas aren't sent to its parents. According to the Wx documentation, 
only events that are derived from wxCommandEvent are passed to the parents. 
The rest (and here the documentation mentions wxMouseEvent explicitly) 
aren't. So we should have to subclass from wxGLCanvas to handle those events 
after all.

I'll post further progress.

Alberto

El Thursday 25 October 2007 17:23:52 Emmanuel Roche escribió:
> Hi again guys !
>
> I've just tested your solution Alberto, and indeed it's working and I can
> see both pages with two View on each page :-)...
>
> Yet I think there is still something I'm missing about the CompositeViewer
> behavior : indeed, I set a trackballmanipulator for the view1 [
> view1->setCameraManipulator(new osgGA::TrackballManipulator); ] and created
> a Mouse handling function:
>
> void ventana::OnMouse(wxMouseEvent& event)
> {
> if (event.ButtonDown()) {
> int button = event.GetButton();
> v1->getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(),
> button);
> }
> else if (event.ButtonUp()) {
> int button = event.GetButton();
> v1->getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY(),
> button);
> }
> else if (event.Dragging()) {
> v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY());
> }
> }
>
> ... here "v1" is the first GraphicsWindow on the tab, and, when I activate
> this function by dragging the mouse on the tab nothing moves :-(... I
> trying replacing "v1" by "cViewer" and calling
> cViewer->setEventQueue(v1->getEventQueue()) in the initilialization process
> [ because the eventQueue seems to be NULL otherwise...] but this doesn't
> work either... Any clue about this ???
>
>
> regards,
> Manu.
>
> 2007/10/25, Robert Osfield <[EMAIL PROTECTED]>:
> > Hi Guys,
> >
> > I don't have any recommendations, or time right now to dive into this
> > topic.  I'd certainly like to see osgViewer be able to cope with this
> > type of usage, and its not one that its been coded for up to this
> > point.  Might I suggest getting a tabbed WxWidget example together
> > than could be included with the OSG distribution that illustrates the
> > this issue and can be used as a test bed for a final recommend
> > solution.
> >
> > Robert.
> >
> > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > Thanks a lot Alberto I guess I could not get anything more usefull :-)
> > > !
> > >
> > > I'm checking this right now
> > >
> > > Regards,
> > > Manu.
> > >
> > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > > Hi Manu,
> > > >
> > > > I'm doing the very same thing, but with two views of a same scene on
> >
> > every
> >
> > > > tab. Currently it works well, but I suspect there are duplicated
> > >
> > > resources, so
> > >
> > > > I have to say that my code is not in its final version.
> > > >
> > > > I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.
> > > >
> > > > Feel free to compare it with yours so we can learn together :)
> > > >
> > > > HTH,
> > > >
> > > > Alberto
> > > >
> > > > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > > > Hello everyone!
> > > > >
> > > > > I've got a simple question, but I can't find any practical
> > > > > solution:
> > > > >
> > > > > In my application, I have to display a notebook with a 3D window on
> >
> > each
> >
> > > > > tab... and I want to be able to add/remove tabs dynamically... so,
> >
> > what
> >
> > > can
> > >
> > > > > I use to achieve this result ?
> > > > >
> > > > > I'm usig wxWidgets + OSG 2.2.0
> > > > > I'm on Win XP
> > > > >
> > > > > I tried with a CompositeViewer :
> > > > > - creating the conpositeViewer when requested (so everything should
> >
> > be
> >
> > > in
> > >
> > > > > the wx event handling thread...)
> > > > > - building my graphicswindowWX
> > > > > - creating a view
> > > > > - adding this view to the compositeview
> > > > > - relying on an Idle function to call viewer->frame()...
> > > > >
> > > > > ... this works as long as there is a single tab...  but when I had
> > >
> > > others,
> > >
> > > > > then only the last tab added display something : the others only
> >
> > display
> >
> > > > > the blue background with no model anymore... ? why that ??
> > > > >
> > > > > by the way I had to make a small change in the
> > > > > GraphicsWindowWx::makeCurrentImplementation() :
> > > > >
> > > > > bool GraphicsWindowWX::makeCurrentImplementation() {
> > > > >   // Bouml preserved body begin 0001FE83
> > > > > if(!GetParent()->IsShown())
> > > > > return false;
> > > > >
> > > > > SetCurrent();
> > > > > return true;
> > > > >   // Bouml preserved body end 0001FE83
> > > > > }
> > > > >
> > > > > --> So the hidden tabs shoul

Re: [osg-users] multiple windows

2007-10-25 Thread Emmanuel Roche
Still on the issue of multi-windows, I guess it's totally unsafe to use
multiple CompositeViewer at the same time, isn't it ?

For exemple doing something like:

CompositeViewer* v1 = (...)

CompositeViewer* v2 = ()


while(true) {
  v1->frame();
  v2->frame();
}


???


2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> Whoups my zip file was blocked...:-( thus I'm joining the files one by
> one
>
> regards,
> Manu.
>
> 2007/10/25, Emmanuel Roche < [EMAIL PROTECTED]>:
> >
> > whoups... forgot the file of course;..
> >
> >
> > 2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
> > >
> > > For those who would have some time to give a look at this, I'm joining
> > > the code of a simple application designed to open a View in multiple tabs:
> > >
> > > the user select an osg or ive file to open an then a new tab is
> > > created using this file as scene Data.
> > >
> > > There is a single CompositeViewer managed by the main frame, an 1 View
> > > object per tab...
> > >
> > > This sample is NOT working properly: if you add one tab, every thing
> > > is okay, but when you had other tabs, as before, only the last one is
> > > displayed :-( the others become empty [only the default blue background 
> > > :-(
> > > ] and this last tab doesn't handle the mouse inputs correctly [instead, it
> > > seems that the mouse input for the first tab are used for this last View
> > > !!!...
> > >
> > > Yet the code is very clear: each tab has its GraphicsWindowWX, (so its
> > > wxGLCanvas too), its OSGPanel (so its own processing of mouse inputs, and
> > > its View).. so what does this mean ? is the global CompositeViewer
> > > appropriating itself the eventQueue of the first View added and then using
> > > this one for the other Views ?
> > >
> > > As always , any clue would be really welcomed, I feel a bit lost with
> > > this...
> > >
> > > regards,
> > > Manu.
> > >
> > >
> > > 2007/10/25, Emmanuel Roche < [EMAIL PROTECTED]>:
> > > >
> > > > Hi again guys !
> > > >
> > > > I've just tested your solution Alberto, and indeed it's working and
> > > > I can see both pages with two View on each page :-)...
> > > >
> > > > Yet I think there is still something I'm missing about the
> > > > CompositeViewer behavior : indeed, I set a trackballmanipulator for the
> > > > view1 [ view1->setCameraManipulator(new osgGA::TrackballManipulator); ] 
> > > > and
> > > > created a Mouse handling function:
> > > >
> > > > void ventana::OnMouse(wxMouseEvent& event)
> > > > {
> > > > if (event.ButtonDown()) {
> > > > int button = event.GetButton();
> > > > v1->getEventQueue()->mouseButtonPress(event.GetX(),
> > > > event.GetY(), button);
> > > > }
> > > > else if (event.ButtonUp()) {
> > > > int button = event.GetButton();
> > > > v1->getEventQueue()->mouseButtonRelease(event.GetX(),
> > > > event.GetY(), button);
> > > > }
> > > > else if (event.Dragging ()) {
> > > > v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY
> > > > ());
> > > > }
> > > > }
> > > >
> > > > ... here "v1" is the first GraphicsWindow on the tab, and, when I
> > > > activate this function by dragging the mouse on the tab nothing 
> > > > moves
> > > > :-(... I trying replacing "v1" by "cViewer" and calling
> > > > cViewer->setEventQueue(v1->getEventQueue()) in the initilialization 
> > > > process
> > > > [ because the eventQueue seems to be NULL otherwise...] but this doesn't
> > > > work either... Any clue about this ???
> > > >
> > > >
> > > > regards,
> > > > Manu.
> > > >
> > > >
> > > > 2007/10/25, Robert Osfield <[EMAIL PROTECTED] >:
> > > > >
> > > > > Hi Guys,
> > > > >
> > > > > I don't have any recommendations, or time right now to dive into
> > > > > this
> > > > > topic.  I'd certainly like to see osgViewer be able to cope with
> > > > > this
> > > > > type of usage, and its not one that its been coded for up to this
> > > > > point.  Might I suggest getting a tabbed WxWidget example together
> > > > > than could be included with the OSG distribution that illustrates
> > > > > the
> > > > > this issue and can be used as a test bed for a final recommend
> > > > > solution.
> > > > >
> > > > > Robert.
> > > > >
> > > > > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > > > > Thanks a lot Alberto I guess I could not get anything more
> > > > > usefull :-) !
> > > > > >
> > > > > > I'm checking this right now
> > > > > >
> > > > > > Regards,
> > > > > > Manu.
> > > > > >
> > > > > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > > > > >
> > > > > > > Hi Manu,
> > > > > > >
> > > > > > > I'm doing the very same thing, but with two views of a same
> > > > > scene on every
> > > > > > > tab. Currently it works well, but I suspect there are
> > > > > duplicated
> > > > > > resources, so
> > > > > > > I have to say that my code is not in its final version.
> > > > > > >
> > > > > > > I'm attaching it, it works for me on Linux and wx 2.6.3unmodified.
> > 

Re: [osg-users] multiple windows

2007-10-25 Thread Emmanuel Roche
Whoups my zip file was blocked...:-( thus I'm joining the files one by
one

regards,
Manu.

2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> whoups... forgot the file of course;..
>
>
> 2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
> >
> > For those who would have some time to give a look at this, I'm joining
> > the code of a simple application designed to open a View in multiple tabs:
> >
> > the user select an osg or ive file to open an then a new tab is created
> > using this file as scene Data.
> >
> > There is a single CompositeViewer managed by the main frame, an 1 View
> > object per tab...
> >
> > This sample is NOT working properly: if you add one tab, every thing is
> > okay, but when you had other tabs, as before, only the last one is displayed
> > :-( the others become empty [only the default blue background :-( ] and this
> > last tab doesn't handle the mouse inputs correctly [instead, it seems that
> > the mouse input for the first tab are used for this last View !!!...
> >
> > Yet the code is very clear: each tab has its GraphicsWindowWX, (so its
> > wxGLCanvas too), its OSGPanel (so its own processing of mouse inputs, and
> > its View).. so what does this mean ? is the global CompositeViewer
> > appropriating itself the eventQueue of the first View added and then using
> > this one for the other Views ?
> >
> > As always , any clue would be really welcomed, I feel a bit lost with
> > this...
> >
> > regards,
> > Manu.
> >
> >
> > 2007/10/25, Emmanuel Roche < [EMAIL PROTECTED]>:
> > >
> > > Hi again guys !
> > >
> > > I've just tested your solution Alberto, and indeed it's working and I
> > > can see both pages with two View on each page :-)...
> > >
> > > Yet I think there is still something I'm missing about the
> > > CompositeViewer behavior : indeed, I set a trackballmanipulator for the
> > > view1 [ view1->setCameraManipulator(new osgGA::TrackballManipulator); ] 
> > > and
> > > created a Mouse handling function:
> > >
> > > void ventana::OnMouse(wxMouseEvent& event)
> > > {
> > > if (event.ButtonDown()) {
> > > int button = event.GetButton();
> > > v1->getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(),
> > > button);
> > > }
> > > else if (event.ButtonUp()) {
> > > int button = event.GetButton();
> > > v1->getEventQueue()->mouseButtonRelease(event.GetX(),
> > > event.GetY(), button);
> > > }
> > > else if (event.Dragging ()) {
> > > v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY());
> > > }
> > > }
> > >
> > > ... here "v1" is the first GraphicsWindow on the tab, and, when I
> > > activate this function by dragging the mouse on the tab nothing moves
> > > :-(... I trying replacing "v1" by "cViewer" and calling
> > > cViewer->setEventQueue(v1->getEventQueue()) in the initilialization 
> > > process
> > > [ because the eventQueue seems to be NULL otherwise...] but this doesn't
> > > work either... Any clue about this ???
> > >
> > >
> > > regards,
> > > Manu.
> > >
> > >
> > > 2007/10/25, Robert Osfield <[EMAIL PROTECTED] >:
> > > >
> > > > Hi Guys,
> > > >
> > > > I don't have any recommendations, or time right now to dive into
> > > > this
> > > > topic.  I'd certainly like to see osgViewer be able to cope with
> > > > this
> > > > type of usage, and its not one that its been coded for up to this
> > > > point.  Might I suggest getting a tabbed WxWidget example together
> > > > than could be included with the OSG distribution that illustrates
> > > > the
> > > > this issue and can be used as a test bed for a final recommend
> > > > solution.
> > > >
> > > > Robert.
> > > >
> > > > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > > > Thanks a lot Alberto I guess I could not get anything more usefull
> > > > :-) !
> > > > >
> > > > > I'm checking this right now
> > > > >
> > > > > Regards,
> > > > > Manu.
> > > > >
> > > > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > > > >
> > > > > > Hi Manu,
> > > > > >
> > > > > > I'm doing the very same thing, but with two views of a same
> > > > scene on every
> > > > > > tab. Currently it works well, but I suspect there are duplicated
> > > > > resources, so
> > > > > > I have to say that my code is not in its final version.
> > > > > >
> > > > > > I'm attaching it, it works for me on Linux and wx 2.6.3unmodified.
> > > > > >
> > > > > > Feel free to compare it with yours so we can learn together :)
> > > > > >
> > > > > > HTH,
> > > > > >
> > > > > > Alberto
> > > > > >
> > > > > > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > > > > > Hello everyone!
> > > > > > >
> > > > > > > I've got a simple question, but I can't find any practical
> > > > solution:
> > > > > > >
> > > > > > > In my application, I have to display a notebook with a 3D
> > > > window on each
> > > > > > > tab... and I want to be able to add/remove tabs dynamically...
> > > > so, what
> > > > > can
> > > > > > > I use to ach

Re: [osg-users] multiple windows

2007-10-25 Thread Emmanuel Roche
For those who would have some time to give a look at this, I'm joining the
code of a simple application designed to open a View in multiple tabs:

the user select an osg or ive file to open an then a new tab is created
using this file as scene Data.

There is a single CompositeViewer managed by the main frame, an 1 View
object per tab...

This sample is NOT working properly: if you add one tab, every thing is
okay, but when you had other tabs, as before, only the last one is displayed
:-( the others become empty [only the default blue background :-( ] and this
last tab doesn't handle the mouse inputs correctly [instead, it seems that
the mouse input for the first tab are used for this last View !!!...

Yet the code is very clear: each tab has its GraphicsWindowWX, (so its
wxGLCanvas too), its OSGPanel (so its own processing of mouse inputs, and
its View).. so what does this mean ? is the global CompositeViewer
appropriating itself the eventQueue of the first View added and then using
this one for the other Views ?

As always , any clue would be really welcomed, I feel a bit lost with
this...

regards,
Manu.


2007/10/25, Emmanuel Roche <[EMAIL PROTECTED]>:
>
> Hi again guys !
>
> I've just tested your solution Alberto, and indeed it's working and I can
> see both pages with two View on each page :-)...
>
> Yet I think there is still something I'm missing about the CompositeViewer
> behavior : indeed, I set a trackballmanipulator for the view1 [
> view1->setCameraManipulator(new osgGA::TrackballManipulator); ] and created
> a Mouse handling function:
>
> void ventana::OnMouse(wxMouseEvent& event)
> {
> if (event.ButtonDown()) {
> int button = event.GetButton();
> v1->getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(),
> button);
> }
> else if (event.ButtonUp()) {
> int button = event.GetButton();
> v1->getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY(),
> button);
> }
> else if (event.Dragging ()) {
> v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY());
> }
> }
>
> ... here "v1" is the first GraphicsWindow on the tab, and, when I activate
> this function by dragging the mouse on the tab nothing moves :-(... I
> trying replacing "v1" by "cViewer" and calling
> cViewer->setEventQueue(v1->getEventQueue()) in the initilialization process
> [ because the eventQueue seems to be NULL otherwise...] but this doesn't
> work either... Any clue about this ???
>
>
> regards,
> Manu.
>
>
> 2007/10/25, Robert Osfield <[EMAIL PROTECTED]>:
> >
> > Hi Guys,
> >
> > I don't have any recommendations, or time right now to dive into this
> > topic.  I'd certainly like to see osgViewer be able to cope with this
> > type of usage, and its not one that its been coded for up to this
> > point.  Might I suggest getting a tabbed WxWidget example together
> > than could be included with the OSG distribution that illustrates the
> > this issue and can be used as a test bed for a final recommend
> > solution.
> >
> > Robert.
> >
> > On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > > Thanks a lot Alberto I guess I could not get anything more usefull :-)
> > !
> > >
> > > I'm checking this right now
> > >
> > > Regards,
> > > Manu.
> > >
> > > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > > >
> > > > Hi Manu,
> > > >
> > > > I'm doing the very same thing, but with two views of a same scene on
> > every
> > > > tab. Currently it works well, but I suspect there are duplicated
> > > resources, so
> > > > I have to say that my code is not in its final version.
> > > >
> > > > I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.
> > > >
> > > > Feel free to compare it with yours so we can learn together :)
> > > >
> > > > HTH,
> > > >
> > > > Alberto
> > > >
> > > > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > > > Hello everyone!
> > > > >
> > > > > I've got a simple question, but I can't find any practical
> > solution:
> > > > >
> > > > > In my application, I have to display a notebook with a 3D window
> > on each
> > > > > tab... and I want to be able to add/remove tabs dynamically... so,
> > what
> > > can
> > > > > I use to achieve this result ?
> > > > >
> > > > > I'm usig wxWidgets + OSG 2.2.0
> > > > > I'm on Win XP
> > > > >
> > > > > I tried with a CompositeViewer :
> > > > > - creating the conpositeViewer when requested (so everything
> > should be
> > > in
> > > > > the wx event handling thread...)
> > > > > - building my graphicswindowWX
> > > > > - creating a view
> > > > > - adding this view to the compositeview
> > > > > - relying on an Idle function to call viewer->frame()...
> > > > >
> > > > > ... this works as long as there is a single tab...  but when I had
> > > others,
> > > > > then only the last tab added display something : the others only
> > display
> > > > > the blue background with no model anymore... ? why that ??
> > > > >
> > > > > by the way I had to m

Re: [osg-users] multiple windows

2007-10-25 Thread Emmanuel Roche
Hi again guys !

I've just tested your solution Alberto, and indeed it's working and I can
see both pages with two View on each page :-)...

Yet I think there is still something I'm missing about the CompositeViewer
behavior : indeed, I set a trackballmanipulator for the view1 [
view1->setCameraManipulator(new osgGA::TrackballManipulator); ] and created
a Mouse handling function:

void ventana::OnMouse(wxMouseEvent& event)
{
if (event.ButtonDown()) {
int button = event.GetButton();
v1->getEventQueue()->mouseButtonPress(event.GetX(), event.GetY(),
button);
}
else if (event.ButtonUp()) {
int button = event.GetButton();
v1->getEventQueue()->mouseButtonRelease(event.GetX(), event.GetY(),
button);
}
else if (event.Dragging()) {
v1->getEventQueue()->mouseMotion(event.GetX(), event.GetY());
}
}

... here "v1" is the first GraphicsWindow on the tab, and, when I activate
this function by dragging the mouse on the tab nothing moves :-(... I
trying replacing "v1" by "cViewer" and calling
cViewer->setEventQueue(v1->getEventQueue()) in the initilialization process
[ because the eventQueue seems to be NULL otherwise...] but this doesn't
work either... Any clue about this ???


regards,
Manu.


2007/10/25, Robert Osfield <[EMAIL PROTECTED]>:
>
> Hi Guys,
>
> I don't have any recommendations, or time right now to dive into this
> topic.  I'd certainly like to see osgViewer be able to cope with this
> type of usage, and its not one that its been coded for up to this
> point.  Might I suggest getting a tabbed WxWidget example together
> than could be included with the OSG distribution that illustrates the
> this issue and can be used as a test bed for a final recommend
> solution.
>
> Robert.
>
> On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> > Thanks a lot Alberto I guess I could not get anything more usefull :-) !
> >
> > I'm checking this right now
> >
> > Regards,
> > Manu.
> >
> > 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> > >
> > > Hi Manu,
> > >
> > > I'm doing the very same thing, but with two views of a same scene on
> every
> > > tab. Currently it works well, but I suspect there are duplicated
> > resources, so
> > > I have to say that my code is not in its final version.
> > >
> > > I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.
> > >
> > > Feel free to compare it with yours so we can learn together :)
> > >
> > > HTH,
> > >
> > > Alberto
> > >
> > > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > > Hello everyone!
> > > >
> > > > I've got a simple question, but I can't find any practical solution:
> > > >
> > > > In my application, I have to display a notebook with a 3D window on
> each
> > > > tab... and I want to be able to add/remove tabs dynamically... so,
> what
> > can
> > > > I use to achieve this result ?
> > > >
> > > > I'm usig wxWidgets + OSG 2.2.0
> > > > I'm on Win XP
> > > >
> > > > I tried with a CompositeViewer :
> > > > - creating the conpositeViewer when requested (so everything should
> be
> > in
> > > > the wx event handling thread...)
> > > > - building my graphicswindowWX
> > > > - creating a view
> > > > - adding this view to the compositeview
> > > > - relying on an Idle function to call viewer->frame()...
> > > >
> > > > ... this works as long as there is a single tab...  but when I had
> > others,
> > > > then only the last tab added display something : the others only
> display
> > > > the blue background with no model anymore... ? why that ??
> > > >
> > > > by the way I had to make a small change in the
> > > > GraphicsWindowWx::makeCurrentImplementation() :
> > > >
> > > > bool GraphicsWindowWX::makeCurrentImplementation() {
> > > >   // Bouml preserved body begin 0001FE83
> > > > if(!GetParent()->IsShown())
> > > > return false;
> > > >
> > > > SetCurrent();
> > > > return true;
> > > >   // Bouml preserved body end 0001FE83
> > > > }
> > > >
> > > > --> So the hidden tabs should return false here... could this be the
> > source
> > > > of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when
> the
> > > > corresponding tab is not visible... :-S )
> > > >
> > > > regards !
> > > >
> > > > Thanks for your help !
> > > > Manu.
> > >
> > >
> > > ___
> > > 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 

Re: [osg-users] multiple windows

2007-10-25 Thread Robert Osfield
Hi Guys,

I don't have any recommendations, or time right now to dive into this
topic.  I'd certainly like to see osgViewer be able to cope with this
type of usage, and its not one that its been coded for up to this
point.  Might I suggest getting a tabbed WxWidget example together
than could be included with the OSG distribution that illustrates the
this issue and can be used as a test bed for a final recommend
solution.

Robert.

On 10/25/07, Emmanuel Roche <[EMAIL PROTECTED]> wrote:
> Thanks a lot Alberto I guess I could not get anything more usefull :-) !
>
> I'm checking this right now
>
> Regards,
> Manu.
>
> 2007/10/25, Alberto Luaces < [EMAIL PROTECTED]>:
> >
> > Hi Manu,
> >
> > I'm doing the very same thing, but with two views of a same scene on every
> > tab. Currently it works well, but I suspect there are duplicated
> resources, so
> > I have to say that my code is not in its final version.
> >
> > I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.
> >
> > Feel free to compare it with yours so we can learn together :)
> >
> > HTH,
> >
> > Alberto
> >
> > El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > > Hello everyone!
> > >
> > > I've got a simple question, but I can't find any practical solution:
> > >
> > > In my application, I have to display a notebook with a 3D window on each
> > > tab... and I want to be able to add/remove tabs dynamically... so, what
> can
> > > I use to achieve this result ?
> > >
> > > I'm usig wxWidgets + OSG 2.2.0
> > > I'm on Win XP
> > >
> > > I tried with a CompositeViewer :
> > > - creating the conpositeViewer when requested (so everything should be
> in
> > > the wx event handling thread...)
> > > - building my graphicswindowWX
> > > - creating a view
> > > - adding this view to the compositeview
> > > - relying on an Idle function to call viewer->frame()...
> > >
> > > ... this works as long as there is a single tab...  but when I had
> others,
> > > then only the last tab added display something : the others only display
> > > the blue background with no model anymore... ? why that ??
> > >
> > > by the way I had to make a small change in the
> > > GraphicsWindowWx::makeCurrentImplementation() :
> > >
> > > bool GraphicsWindowWX::makeCurrentImplementation() {
> > >   // Bouml preserved body begin 0001FE83
> > > if(!GetParent()->IsShown())
> > > return false;
> > >
> > > SetCurrent();
> > > return true;
> > >   // Bouml preserved body end 0001FE83
> > > }
> > >
> > > --> So the hidden tabs should return false here... could this be the
> source
> > > of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when the
> > > corresponding tab is not visible... :-S )
> > >
> > > regards !
> > >
> > > Thanks for your help !
> > > Manu.
> >
> >
> > ___
> > 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 windows

2007-10-25 Thread Emmanuel Roche
Thanks a lot Alberto I guess I could not get anything more usefull :-) !

I'm checking this right now

Regards,
Manu.

2007/10/25, Alberto Luaces <[EMAIL PROTECTED]>:
>
> Hi Manu,
>
> I'm doing the very same thing, but with two views of a same scene on every
> tab. Currently it works well, but I suspect there are duplicated
> resources, so
> I have to say that my code is not in its final version.
>
> I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.
>
> Feel free to compare it with yours so we can learn together :)
>
> HTH,
>
> Alberto
>
> El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> > Hello everyone!
> >
> > I've got a simple question, but I can't find any practical solution:
> >
> > In my application, I have to display a notebook with a 3D window on each
> > tab... and I want to be able to add/remove tabs dynamically... so, what
> can
> > I use to achieve this result ?
> >
> > I'm usig wxWidgets + OSG 2.2.0
> > I'm on Win XP
> >
> > I tried with a CompositeViewer :
> > - creating the conpositeViewer when requested (so everything should be
> in
> > the wx event handling thread...)
> > - building my graphicswindowWX
> > - creating a view
> > - adding this view to the compositeview
> > - relying on an Idle function to call viewer->frame()...
> >
> > ... this works as long as there is a single tab...  but when I had
> others,
> > then only the last tab added display something : the others only display
> > the blue background with no model anymore... ? why that ??
> >
> > by the way I had to make a small change in the
> > GraphicsWindowWx::makeCurrentImplementation() :
> >
> > bool GraphicsWindowWX::makeCurrentImplementation() {
> >   // Bouml preserved body begin 0001FE83
> > if(!GetParent()->IsShown())
> > return false;
> >
> > SetCurrent();
> > return true;
> >   // Bouml preserved body end 0001FE83
> > }
> >
> > --> So the hidden tabs should return false here... could this be the
> source
> > of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when the
> > corresponding tab is not visible... :-S )
> >
> > regards !
> >
> > Thanks for your help !
> > Manu.
>
>
> ___
> 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 windows

2007-10-25 Thread Emmanuel Roche
I'm not supposed to control this SetCurrent function : it is called by the
graphicsWindow when it wants to draw a frame()

But indeed, if i were to use multiple osgViewer::Viewer for example instead
of a single CompositeViewer I could process this event to update the
"Current Viewer"... Yet I think I heard somewhere it's not a good idea to
use multiple asynchronous Viewer object in a single application am I
wrong ?

regards.



2007/10/25, Andreas Goebel <[EMAIL PROTECTED]>:
>
> Hi,
>
> why don´t you just call SetCurrent when the corresponding tab is shown?
>
> You could process the *EVT_NOTEBOOK_PAGE_CHANGED event and then make the
> corresponding wxGLCanvas that lies in the notebook current.
>
> Regards,
>
> Andreas
> *
> ___
> 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 windows

2007-10-25 Thread Alberto Luaces
Hi Manu,

I'm doing the very same thing, but with two views of a same scene on every 
tab. Currently it works well, but I suspect there are duplicated resources, so 
I have to say that my code is not in its final version.

I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.

Feel free to compare it with yours so we can learn together :)

HTH,

Alberto

El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> Hello everyone!
>
> I've got a simple question, but I can't find any practical solution:
>
> In my application, I have to display a notebook with a 3D window on each
> tab... and I want to be able to add/remove tabs dynamically... so, what can
> I use to achieve this result ?
>
> I'm usig wxWidgets + OSG 2.2.0
> I'm on Win XP
>
> I tried with a CompositeViewer :
> - creating the conpositeViewer when requested (so everything should be in
> the wx event handling thread...)
> - building my graphicswindowWX
> - creating a view
> - adding this view to the compositeview
> - relying on an Idle function to call viewer->frame()...
>
> ... this works as long as there is a single tab...  but when I had others,
> then only the last tab added display something : the others only display
> the blue background with no model anymore... ? why that ??
>
> by the way I had to make a small change in the
> GraphicsWindowWx::makeCurrentImplementation() :
>
> bool GraphicsWindowWX::makeCurrentImplementation() {
>   // Bouml preserved body begin 0001FE83
> if(!GetParent()->IsShown())
> return false;
>
> SetCurrent();
> return true;
>   // Bouml preserved body end 0001FE83
> }
>
> --> So the hidden tabs should return false here... could this be the source
> of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when the
> corresponding tab is not visible... :-S )
>
> regards !
>
> Thanks for your help !
> Manu.

#include "wx/wx.h"
#include "wx/glcanvas.h"

#include "osg/ref_ptr"
#include "osg/Vec3"
#include "osg/GraphicsContext"
#include "osgViewer/GraphicsWindow"
#include "osgViewer/CompositeViewer"
#include "osgViewer/Viewer"
#include "osgViewer/View"
#include "osgDB/ReadFile"
#include "osgGA/TrackballManipulator"

#include 

osg::State *st2;
osg::State *st1;

class programa: public wxApp
{
	public:
		bool OnInit();
};

DECLARE_APP( programa)
IMPLEMENT_APP( programa)

class ventanaOSGWX: public osgViewer::GraphicsWindow
{
	public:
		ventanaOSGWX( wxGLCanvas *wx): wxGL( wx)
		{
		}
		bool makeCurrentImplementation()
		{
			wxGL->SetCurrent();
			return true;
		}
		void swapBuffersImplementation()
		{
			wxGL->SwapBuffers();
		}
		bool realizeImplementation()
		{
			return true;
		}
		bool valid() const
		{
			return true;
		}
		bool isRealizedImplementation() const
		{
			return true;
		}
		void closeImplementation()
		{
		}
		bool releaseContextImplementation()
		{
			return true;
		}
		void grabFocus()
		{
			wxGL->SetFocus();
		}
		void grabFocusIfPointerInWindow()
		{
			wxGL->SetFocus();
		}
	private:
		wxGLCanvas *wxGL;
};

class ventana: public wxPanel
{
	public:
		ventana( wxWindow *p, const std::string &objeto);

		void OnPaint( wxPaintEvent &e);
	private:
		osg::ref_ptr v1, v2;
		osgViewer::CompositeViewer *cViewer;
		DECLARE_EVENT_TABLE()
};

BEGIN_EVENT_TABLE( ventana, wxPanel)
	EVT_PAINT( ventana::OnPaint)
END_EVENT_TABLE()



bool programa::OnInit()
{
	wxFrame *v = new wxFrame(0, wxID_ANY, wxT("Dos vistas con OSG"), wxDefaultPosition, wxSize( 540,305)); /* No vale con el ctor por defecto */
	wxNotebook *nb = new wxNotebook( v, wxID_ANY);
	ventana *panel1 = new ventana( nb, "cubo_flechas.obj");
	ventana *panel2 = new ventana( nb, "prototipo.ive");
	nb->AddPage( panel1, wxT("Primero"), true);
	nb->AddPage( panel2, wxT("Segundo"), false);
	v->Show();
	return true;
}

ventana::ventana( wxWindow *p, const std::string &objeto): wxPanel( p)
{
	wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL);
	SetSizer( sizer);
	wxGLCanvas *w1, *w2;
	wxGLContext *wxglc;
	
	w1 = new wxGLCanvas( this, 1, wxDefaultPosition, wxSize(256,256));
	Show(); /* Para que se cree de manera efectiva el contexto de OpenGL */
	
	/* Genera una advertencia de GTK acerca de un widget todavía no constuído, posiblemente porque */
	/* se ordena mostrar el "wxFrame" cuando todavía no se ha salido de su constructor. Una solución */
	/* posiblemente más limpia sería crear la segunda ventana en el primer evento de redibujado, */
	/* mediante un bool que indique si ya estaba creado o no. */
	
	wxglc = w1->GetContext();

	w2 = new wxGLCanvas( this, wxglc, 2, wxDefaultPosition, wxSize(256,256));
	
	sizer->Add( w1, 0, wxALL, 5);
	sizer->Add( w2, 0, wxALL, 5);
	
	sizer->Fit( this);

	v1 = new ventanaOSGWX( w1);
	v2 = new ventanaOSGWX( w2);

	cViewer = new osgViewer::CompositeViewer;
	osgViewer::View *view1, *view2;
	
	view1 = new osgViewer::View;
	view2 = new osgViewer::View;
	
	st1 = new osg::State;
	st2 = new osg::State;
	
	st1->setContextID( osg::GraphicsContext::createNewContextID());
// 	Si st2 usa el mismo ID

Re: [osg-users] multiple windows

2007-10-25 Thread Andreas Goebel
Hi,

why don´t you just call SetCurrent when the corresponding tab is shown?

You could process the *EVT_NOTEBOOK_PAGE_CHANGED event and then make the 
corresponding wxGLCanvas that lies in the notebook current.

Regards,

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


[osg-users] multiple windows

2007-10-25 Thread Emmanuel Roche
Hello everyone!

I've got a simple question, but I can't find any practical solution:

In my application, I have to display a notebook with a 3D window on each
tab... and I want to be able to add/remove tabs dynamically... so, what can
I use to achieve this result ?

I'm usig wxWidgets + OSG 2.2.0
I'm on Win XP

I tried with a CompositeViewer :
- creating the conpositeViewer when requested (so everything should be in
the wx event handling thread...)
- building my graphicswindowWX
- creating a view
- adding this view to the compositeview
- relying on an Idle function to call viewer->frame()...

... this works as long as there is a single tab...  but when I had others,
then only the last tab added display something : the others only display the
blue background with no model anymore... ? why that ??

by the way I had to make a small change in the
GraphicsWindowWx::makeCurrentImplementation() :

bool GraphicsWindowWX::makeCurrentImplementation() {
  // Bouml preserved body begin 0001FE83
if(!GetParent()->IsShown())
return false;

SetCurrent();
return true;
  // Bouml preserved body end 0001FE83
}

--> So the hidden tabs should return false here... could this be the source
of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when the
corresponding tab is not visible... :-S )

regards !

Thanks for your help !
Manu.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org