Re: [osg-users] osgViewer + Fox Toolkit example

72 views
Skip to first unread message

Robert Osfield

unread,
Jul 24, 2007, 9:45:47 AM7/24/07
to osg users
HI Alexandre,

Thanks, the osgviewerFOX is now checked in. I've added provisional
CMake support for it, but had to wire it to fox-1.6. It looks like
we'll need to explicitly handled other versions of fox virtue of the
way CMake manages it search paths.

BTW, the example runs fine under Linux, but on segfaults. Do others
see this issue?

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

Markus Hein

unread,
Jul 24, 2007, 7:06:00 PM7/24/07
to osg-...@lists.openscenegraph.org
Robert Osfield schrieb:

Hi Robert & Alexandre,


BTW, the example runs fine under Linux, but on segfaults.  Do others
see this issue?
did you link against FOX-1.4 or FOX-1.6 ?

today I tested the code on Win32, MSVS8  with FOX-1.7 and Release OSG-2.0. 
The cow is running. :-) On Linux it works without differences.


Some small issues:

In my local copy of the code, I inserted  in  FOX_OSG_MDIView::~FOX_OSG_MDIView   destructor implementation :

getApp()->removeChore(this,ID_CHORE);


 for proper closedown of the MDI -Window containing the osgViewer, else it would stop in debug-mode (Linux & Win32).


Also tested rendering multiple viewer windows of the same scene. It works with some small hacks.


regards, Markus


amalric alexandre

unread,
Jul 25, 2007, 6:46:56 AM7/25/07
to osg-...@lists.openscenegraph.org
Hi all,
 
 
When I made this little example I did link with Fox Toolkit 1.6.26 exactly ;-), I didn't try with Fox 1.7 but I'm happy to see that it works according to Markus.
 
regards, Alexandre

 
2007/7/25, Markus Hein <mah...@frisurf.no>:

Markus Hein

unread,
Aug 19, 2007, 11:19:06 AM8/19/07
to rob...@openscenegraph.com, osg-...@lists.openscenegraph.org
Robert Osfield schrieb:

> BTW, the example runs fine under Linux, but on segfaults. Do others
> see this issue?

Hi all,

why I'm forced to run the Viewer SingleThreaded with current OSG from SVN ?

when I tested the FOX-Viewer code for the first time, I used the OSG-2.0
Release code. There was no problems.
The last days I updated the system , using the current OSG-SVN code
(Core2Dual,Win32, Nvidia Driver 162.18) , but this time I was forced to
set the Viewer Mode to SingleThreaded. Else it would crash in a
threading issue, difficult for me to track down.

I have no multicore CPU running Linux here, so I need to ask other users
if they have seen the same Problems in the last time on Linux too ?

Thanks, Markus

Robert Osfield

unread,
Aug 19, 2007, 2:14:04 PM8/19/07
to Markus Hein, rob...@openscenegraph.com, osg-...@lists.openscenegraph.org
Hi Markus,

On 8/19/07, Markus Hein <mah...@frisurf.no> wrote:
> Robert Osfield schrieb:


> why I'm forced to run the Viewer SingleThreaded with current OSG from SVN ?

Which viewer are we talking about here? What do you mean by forced to
run the Viewer SingleThreaded?

> when I tested the FOX-Viewer code for the first time, I used the OSG-2.0
> Release code. There was no problems.
> The last days I updated the system , using the current OSG-SVN code
> (Core2Dual,Win32, Nvidia Driver 162.18) , but this time I was forced to
> set the Viewer Mode to SingleThreaded. Else it would crash in a
> threading issue, difficult for me to track down.

I don't know if the FOX viewer was ever thread safe. It runs just
fine on my machine, running SingleThreaded, but still hangs on exit.

I don't know how you the threading model to something other than
SingleThreaded, as there is threading model event handler registered.

Robert.

Markus Hein

unread,
Aug 20, 2007, 2:57:24 PM8/20/07
to osg-...@lists.openscenegraph.org
Hi Robert,


> I don't know how you the threading model to something other than
> SingleThreaded, as there is threading model event handler registered.

The default osgViewer::Viewer settings should work fine.

I think that problems arised for me mostly because I played with
osgFoxViewer & multiple Viewer Windows (context's) rendering the same
scene, instead of the Single Viewer Window in (the original
osgFoxViewer example) .

It was mostly to compare different strategies of rendering multiple
views inside a FoxGui-Application. Something has changed since osg-2.0
or it is because I changed the NVidia Driver version to the latest release.

> I don't know if the FOX viewer was ever thread safe. It runs just
> fine on my machine, running SingleThreaded, but still hangs on exit.

based on osg-2.0 I saw no output in the console (under Linux) onExit.
Since I updated to a OSG-SVN Version, yes I also got reported some
problems onExit (linking FOX-1.7. I'm not working on this machine now).

Even with :

getApp()->removeChore(this,ID_CHORE);

in FOX_OSG_MDIView::~FOX_OSG_MDIView destructor. I think this was
important to stop execution of the onChore Event when the MDI Viewer
Window already is closed by the user.


thanks for reply, Markus

Robert Osfield

unread,
Aug 21, 2007, 4:56:34 AM8/21/07
to osg-...@lists.openscenegraph.org
Hi Markus,

I'm really not familiar with FOX at all, so can't really comment on
how to fix things. I'd welcome bug fixes though :-)

Robert.

Mario Valle

unread,
Aug 22, 2007, 3:40:01 AM8/22/07
to osg-...@lists.openscenegraph.org
Your proposed change solved one of the problems I had at osgviewerFOX exit.
The change was in FOX_OSG_MDIView.cpp line 60
FOX_OSG_MDIView::~FOX_OSG_MDIView()
{
getApp()->removeChore(this,ID_CHORE); // added
}
Could it be added to SVN?

Now I have a hang in the same example try to exit with ESC when stats are active. But I
start another thread on this.

Thanks!
mario

--
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

Robert Osfield

unread,
Aug 22, 2007, 4:50:27 AM8/22/07
to osg-...@lists.openscenegraph.org
Hi Mario,

On 8/22/07, Mario Valle <mva...@cscs.ch> wrote:
> Your proposed change solved one of the problems I had at osgviewerFOX exit.
> The change was in FOX_OSG_MDIView.cpp line 60
> FOX_OSG_MDIView::~FOX_OSG_MDIView()
> {
> getApp()->removeChore(this,ID_CHORE); // added
> }
> Could it be added to SVN?

Please post the complete changed file to osg-submissions, this way we
can be sure not to loose it or make mistakes in review/merge.

> Now I have a hang in the same example try to exit with ESC when stats are active. But I
> start another thread on this.

A quick solution to this might be just to deactivate the escape sets
done on the viewer. The proper solution is for the Fox code to pick
up on the done flag and close the associated window/viewer.

// to disable the escape sets done just set the key to 0.
viewer.setKeyEventSetsDone(0);

Robert.

Tomas Hnilica

unread,
Sep 6, 2007, 11:13:48 AM9/6/07
to osg-...@lists.openscenegraph.org
Hello Marcus,

could you please describe your test of multiple viewer windows?
When I add another FOX_OSG_MDIView to the MDICllient, both scenes are
drawn to the newly created window and the first one is not actualised,
mouse actions are token from both windows correctly. (I think this would
be the same also for one scene)
I am wondering why this happens, each FOX_OSG_MDIView has it's own
osgViewer::Viewer and others (FXGLVisual, manipulator). Could it be
because of some mixing of ID_CHORE messages?

Do you share one FXGLVisual, with all MDIChild?

Many thanks,
Tomas


Markus Hein wrote:
> Also tested rendering multiple viewer windows of the same scene. It
> works with some small hacks.
>
>
> regards, Markus

Markus Hein

unread,
Sep 6, 2007, 2:54:44 PM9/6/07
to Public OpenSceneGraph Users discussion list.
Hi Tomas,
Markus Hein wrote:
  
Also tested rendering multiple viewer windows of the same scene. It 
works with some small hacks.


regards, Markus
    


Tomas Hnilica schrieb:

could you please describe your test of multiple viewer windows?
When I add another FOX_OSG_MDIView to the MDICllient, both scenes are 
drawn to the newly created window and the first one is not actualised, 
mouse actions are token from both windows correctly. (I think this would 
be the same also for one scene)


just change the following code in FOX_OSG_MDIView::OnIdle() implementation like this:

if( m_gwFox->makeCurrentImplementation() )
{
        m_osgViewer->frame();  // org. line from osgviewerfox - example
        m_gwFox->releaseContext()
}

then your Problem is solved.



Could it be 
because of some mixing of ID_CHORE messages?

No, I don't think so.


I would like to suggest all osg-fox coders to study the following fox examples

"glviewer" example, "datatarget" example and "adie" application.

Helped me a lot to understand how to build Fox-App's. The same thing as with the osg examples: lot's of useful code-blocks :-) 

greetings, Markus




Reply all
Reply to author
Forward
0 new messages