Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-25 Thread Mathias Fröhlich

Hi Robert,

On Friday, June 24, 2011 21:01:02 Robert Osfield wrote:
 I'm afraid I've got too much to think about with the release to start
 ponder on other topics so I'm going to bow out gracefully. After 3.0
 I'll start thinking about what might go into 3.2, so this would then
 be a natural time to bring up topics like how we evolve
 Nodes/Drawables/Visitors etc.
Fine.
I just was slowly digging out what I had at some time. And it looked like you 
just already had a clear idea ...

Have a nice Weekend
Mathias
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-24 Thread Mathias Fröhlich

Hi Robert,

On Wednesday, June 22, 2011 17:17:26 Robert Osfield wrote:
  At first it would probably help when the NodeVisitor is able to visit
  Drawables using the usual accept mehtods or something like that. Then we
  could probably just use the Geodes traverse method to walk the drawables.
  One dfficulty in this approach is the Bilboard implementation that does
  little more then just a traversal of all Drawables.
 
 I don't see any problems with handling subclasses from Geode, it'd be
 bit like how
 LOD subclasses from Group - it add a per child property that the the
 traverse method
 handles in a special way.  A NodeCallback that overrides the traverse
 then would have
 to handle the special functionality of a Billboard.  In the case of a
 Billboard we'd
 probably want to have a special handling of cases when chidlren are
 Drawable rather
 than Node's, as Drawables you can just manage the modelview matrix
 directly and don't
 need to worry about the view frustum transformation, while normal Nodes you
 have to push/pop the view frustum as we do right now for the normal
 Transform nodes.

Hmm, I am not exactly sure I already see what you are thinking:

I have started playing with this approach at some time. Attached is the patch 
I had so far. The NodeVisitor is just extended by the Drawable. May be the 
other drawable derived classes could be put there too. The patch just factors 
out the loop body of the geode in the cull visitor and puts that into a new 
CullVisitor::apply(Drawable) method.

That patch does not work for any billboard geode. This is just meant as a 
miminmal sketch implementation.

Now, If the billboard loop is implemented like the LOD nodes traversal method, 
we need virtual access to the modelview matrix in the NodeVisitor base class 
from the Billboard::traverse() method. Currently this is not available.

So, may be {push,pop}ModelViewMatrix as a virtual method in the NodeVisitor? 
Or do you already have a better idea to do that?

Greetings

Mathias
Index: include/osgUtil/CullVisitor
===
--- include/osgUtil/CullVisitor	(revision 12643)
+++ include/osgUtil/CullVisitor	(working copy)
@@ -105,6 +105,8 @@
 virtual void apply(osg::OccluderNode node);
 virtual void apply(osg::OcclusionQueryNode node);
 
+virtual void apply(osg::Drawable drawable);
+
 /** Push state set on the current state group.
   * If the state exists in a child state group of the current
   * state group then move the current state group to that child.
Index: include/osg/NodeVisitor
===
--- include/osg/NodeVisitor	(revision 12643)
+++ include/osg/NodeVisitor	(working copy)
@@ -271,6 +271,7 @@
 virtual void apply(OccluderNode node);
 virtual void apply(OcclusionQueryNode node);
 
+virtual void apply(Drawable drawable);
 
 /** Callback for managing database paging, such as generated by PagedLOD nodes.*/
 class DatabaseRequestHandler : public osg::Referenced
Index: include/osg/Geode
===
--- include/osg/Geode	(revision 12643)
+++ include/osg/Geode	(working copy)
@@ -41,6 +41,9 @@
 virtual Geode* asGeode() { return this; }
 virtual const Geode* asGeode() const { return this; }
 
+/** Traverse downwards : calls children's accept method with NodeVisitor.*/
+virtual void traverse(NodeVisitor nv);
+
 /** Add a \c Drawable to the \c Geode.
   * If \c drawable is not \c NULL and is not contained in the \c Geode
   * then increment its reference count, add it to the drawables list and
Index: include/osg/Drawable
===
--- include/osg/Drawable	(revision 12643)
+++ include/osg/Drawable	(working copy)
@@ -574,6 +574,10 @@
 virtual void accept(PrimitiveIndexFunctor) const {}
 
 
+/** Visitor Pattern : calls the apply method of a NodeVisitor with this node's type.*/
+virtual void accept(NodeVisitor nv) { nv.apply(*this); }
+
+
 /** Extensions class which encapsulates the querying of extensions and
 * associated function pointers, and provide convenience wrappers to
 * check for the extensions or use the associated functions.*/
Index: src/osgUtil/CullVisitor.cpp
===
--- src/osgUtil/CullVisitor.cpp	(revision 12643)
+++ src/osgUtil/CullVisitor.cpp	(working copy)
@@ -876,81 +876,6 @@
 // traverse any call callbacks and traverse any children.
 handle_cull_callbacks_and_traverse(node);
 
-RefMatrix matrix = *getModelViewMatrix();
-for(unsigned int i=0;inode.getNumDrawables();++i)
-{
-Drawable* drawable = node.getDrawable(i);
-const BoundingBox bb =drawable-getBound();
-
-if( 

Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-24 Thread Robert Osfield
Hi Mathias,

I'm afraid I've got too much to think about with the release to start
ponder on other topics so I'm going to bow out gracefully. After 3.0
I'll start thinking about what might go into 3.2, so this would then
be a natural time to bring up topics like how we evolve
Nodes/Drawables/Visitors etc.

Cheers,
Robert.

2011/6/24 Mathias Fröhlich mathias.froehl...@gmx.net:

 Hi Robert,

 On Wednesday, June 22, 2011 17:17:26 Robert Osfield wrote:
  At first it would probably help when the NodeVisitor is able to visit
  Drawables using the usual accept mehtods or something like that. Then we
  could probably just use the Geodes traverse method to walk the drawables.
  One dfficulty in this approach is the Bilboard implementation that does
  little more then just a traversal of all Drawables.

 I don't see any problems with handling subclasses from Geode, it'd be
 bit like how
 LOD subclasses from Group - it add a per child property that the the
 traverse method
 handles in a special way.  A NodeCallback that overrides the traverse
 then would have
 to handle the special functionality of a Billboard.  In the case of a
 Billboard we'd
 probably want to have a special handling of cases when chidlren are
 Drawable rather
 than Node's, as Drawables you can just manage the modelview matrix
 directly and don't
 need to worry about the view frustum transformation, while normal Nodes you
 have to push/pop the view frustum as we do right now for the normal
 Transform nodes.

 Hmm, I am not exactly sure I already see what you are thinking:

 I have started playing with this approach at some time. Attached is the patch
 I had so far. The NodeVisitor is just extended by the Drawable. May be the
 other drawable derived classes could be put there too. The patch just factors
 out the loop body of the geode in the cull visitor and puts that into a new
 CullVisitor::apply(Drawable) method.

 That patch does not work for any billboard geode. This is just meant as a
 miminmal sketch implementation.

 Now, If the billboard loop is implemented like the LOD nodes traversal method,
 we need virtual access to the modelview matrix in the NodeVisitor base class
 from the Billboard::traverse() method. Currently this is not available.

 So, may be {push,pop}ModelViewMatrix as a virtual method in the NodeVisitor?
 Or do you already have a better idea to do that?

 Greetings

 Mathias

 ___
 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] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-22 Thread Mathias Fröhlich

Hi Robert,

Ok, I have yesterday tested fvwm with the viewer changes. This works so far.

On Tuesday 21 June 2011, Robert Osfield wrote:
 When users attempt to do things is awkward ways, especially when grampling
 with lower level facilities, it's a warning sign to me that the OSG is make
 the problem more difficult and probably needs refactoring.   Sometimes it's
 just the users overcomplicating things for little reason, but often there
 will be an underlying design issue that they are trying to workaround.

 It's doesn't always mean I can see a straight forward solution... but
 occassionally
 a small tweak to the OSG can make a big diffrence.
Yes.

  The problem is with the cull callback in a Geode during the cull stage.
 
  The cull callback in a geode cannot do much. It just calls an empty
  traverse method in a geode. Then past that all drawables are
  *unconditionally* - from the point of the geodes cull visitor - put into
  the render graph.

 This lies with Geode's having Drawable children that aren't Nodes so the
 usual traversal rules don't apply.

 One modification to the OSG that I have considered for a while is to
 make a Drawable
 a Node.  This has a number of knock on effects though so something
 I'll need to consider
 rather carefully.
Hmm, That would reduce the Geode to just being a Group.

At first it would probably help when the NodeVisitor is able to visit 
Drawables using the usual accept mehtods or something like that. Then we 
could probably just use the Geodes traverse method to walk the drawables.
One dfficulty in this approach is the Bilboard implementation that does little 
more then just a traversal of all Drawables.

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-22 Thread Robert Osfield
Hi Mathias,

2011/6/22 Mathias Fröhlich m.froehl...@science-computing.de:
 Ok, I have yesterday tested fvwm with the viewer changes. This works so far.

Thanks for the testing.  Looks like the viewer changes for fullscreen
toggling are good to go.

 One modification to the OSG that I have considered for a while is to
 make a Drawable
 a Node.  This has a number of knock on effects though so something
 I'll need to consider
 rather carefully.
 Hmm, That would reduce the Geode to just being a Group.

Probably/possibly.  One of the challenge with making a Drawable a Node is
that retraining backwards compatibility so to achieve this we'd still
have to carry
around classes that aren't that neccessary anyone.   I'm not sure how
far we'd be
able to retain compatibility or how much this compatibility might compromise
the cleanness of the design.  It's one of those tasks that one really
has to roll
ones sleves up and do the changes and see what happens.

 At first it would probably help when the NodeVisitor is able to visit
 Drawables using the usual accept mehtods or something like that. Then we
 could probably just use the Geodes traverse method to walk the drawables.
 One dfficulty in this approach is the Bilboard implementation that does little
 more then just a traversal of all Drawables.

I don't see any problems with handling subclasses from Geode, it'd be
bit like how
LOD subclasses from Group - it add a per child property that the the
traverse method
handles in a special way.  A NodeCallback that overrides the traverse
then would have
to handle the special functionality of a Billboard.  In the case of a
Billboard we'd
probably want to have a special handling of cases when chidlren are
Drawable rather
than Node's, as Drawables you can just manage the modelview matrix
directly and don't
need to worry about the view frustum transformation, while normal Nodes you have
to push/pop the view frustum as we do right now for the normal Transform nodes.

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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-21 Thread Mathias Fröhlich

Hi Robert,

On Monday 20 June 2011, Robert Osfield wrote:
 It's over a decade since I used an IRIX system so apart from fond memories
 of a bigone era I don't think we need to worry about IRIX.  I do suspect if
 one did resurrect an IRIX it wouldn't too difficult to get the OSG working
 on it.
So, may be we should discuss this in an other thread with a more apropriate 
subject ...

  So recent compile tests were only run on HP and Sun.
 
  I have compile tested these two remaining machines today. But I expect
  this to be the last time I will care for these machines...
 
  Solaris works more or less.
  Even if the fullscreen stuff does no longer remove the window borders on
  CDE. I do not know if this worked before. But to say that, I don't care
  for the osgViewer fullscreen feature.
 
  HPUX still compiles.
  But I expect CDE on HPUX to have the same problems like solaris for the
  fullscreen stuff.

 Does CDE not respond to the _MOTIF_WM_HINTS traditionally used for
 window decoration under X11?  This window decoration code I've changed
 a little to fix a bug in it, but it's basically still the same.

 The  _NET_WM_STATE functionality used for telling the window manager
 that a window is full screen is a recent development so I wouldn't
 know if this has an support under CDE, if this functionality isn't
 there then these calls will just be ignored so, but the OSG's window
 size and window decoration code should still be able to toggle
 fullscreen on/off by itself.
I do not know the exact atoms that play a role here. So, I cant' comment on 
that.
But anyway, don't spend too much time on that.

 When you say the fullscreen stuff doesn't work under HPUX and Solaris
 could you explain what happens when you run osgviewer cow.osg and
 then press 'f' and couple of times to toggle the full scrren on/off.
Initially I get a full screen window *with* decorations.
Pressing f gives a small window as expected.
Press f again gives the previous huge window including decorations as before.

 Could you aslso try running osgviewer cow.osg --window 100 100 640
 480 and trying the 'f' toggling.
The same as above with the exception that the given initial size is the 
initial size of the small window. Toggling full screen behaves as above.

But as I told, I have kept that compiling and running osg in its major 
functionality. This detail of the viewer is not really used and not worth a 
huge effort.

 If the full screen toggling behaviour under Solaris and HPUX hasn't
 changed between 3.0.0-rc1 and the changes I checked in this morning
 then I'd be happy to leave this as is, and merge the changes with the
 OSG-3.0 in knowledge that it does improve things under the main X11
 platform use.   This morning I've tested Gnome, KDE and a failsafe
 xterm with no window manager and with a small fix for the later
 everything works OK.  FYI, The failsafe xterm (Provided by Gnome under
 Ubuntu) doesn't have an window decoration, but I guess this is to be
 expected so I don't see this issue.
From my point of view, this is fine.
The only WM I can think of behaving different is may be twm or fvwm which both 
should be easy to test with. I can test fvwm at home easily since the primary 
flightgear machine runs fvwm.

 On a slightly different note, this afternoon I've been addressing some
 warnings generated by cppcheck and there is a chance that these might
 introduce some portability issues if the namespace support is a bit
 incosinstitent on Solaris and HPUX.  Could you please update to
 svn/trunk and let me know if things still compile fine.
From today morning, it compiled on HP and solaris.

 Does FlightGear not use the OSG's full screen?
Yes it does. But not on HP :)

Currently flightgear does not render well on current osg trunk.
Over the time we gained a highly adapted cull stage with even an own cull 
visitor and a home grown depth partitioning scheme. I am not yet sure, but I 
expect that there might be some interference with changes that have broken 
flightgear.

Thanks and greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-21 Thread Robert Osfield
Hi Mathias,

2011/6/21 Mathias Fröhlich m.froehl...@science-computing.de:
 Initially I get a full screen window *with* decorations.
 Pressing f gives a small window as expected.
 Press f again gives the previous huge window including decorations as before

Thanks for the explanation.  It sounds like the _MOTIF_WM_HINTS hasn't
been implemented with CDE.

 But as I told, I have kept that compiling and running osg in its major
 functionality. This detail of the viewer is not really used and not worth a
 huge effort.

I'll just let this issue pass for 3.0 then, I suspect the of window decoration
not toggling off has been with all the way through the 2.x series and probably
back to the 1.x days as well as they all rely upon _MOTIF_WM_HINTS for
controlling the window decoation.


 From my point of view, this is fine.
 The only WM I can think of behaving different is may be twm or fvwm which both
 should be easy to test with. I can test fvwm at home easily since the primary
 flightgear machine runs fvwm.

Thanks.

 From today morning, it compiled on HP and solaris.

Excellent news.  I did make quite a few changes yesterday to address
the cppheck reported issues so was a bit concerned but the older
compilers used on these platforms.  I'm not expecting any further
widespread code changes so we should be in a good place for 3.0.

 Currently flightgear does not render well on current osg trunk.
 Over the time we gained a highly adapted cull stage with even an own cull
 visitor and a home grown depth partitioning scheme. I am not yet sure, but I
 expect that there might be some interference with changes that have broken
 flightgear.

Ouch, sorry to hear that things aren't working well for FlightGear.  The basics
of the scene graphi and viewer are the same between 2.8.x and 3.0 so I'm
surprised to hear of problems.  Is there an online record of these problems
and what might be the root cause of them?

I do wonder if the custom cull faciltiies might be solvable in other ways - for
instance osgViewer::View now has some support for depth partitioning.

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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-21 Thread Robert Osfield
Hi Mathias,

2011/6/21 Mathias Fröhlich m.froehl...@science-computing.de:
 Yes, I was erasing my initial comment on that some minutes ago :).
 From my personal point of view, I think that our code touches too much
 internals of osg.
 So, I think we need to change that in some way to make that more robust.

 For the CullVisitor that is subclassed - which is one of the potential
 problems I fear for compatibility - there might be room for improovements in
 osg.

When users attempt to do things is awkward ways, especially when grampling
with lower level facilities, it's a warning sign to me that the OSG is make the
problem more difficult and probably needs refactoring.   Sometimes it's just
the users overcomplicating things for little reason, but often there will be
an underlying design issue that they are trying to workaround.

It's doesn't always mean I can see a straight forward solution... but
occassionally
a small tweak to the OSG can make a big diffrence.

 The problem is with the cull callback in a Geode during the cull stage.

 The cull callback in a geode cannot do much. It just calls an empty traverse
 method in a geode. Then past that all drawables are *unconditionally* - from
 the point of the geodes cull visitor - put into the render graph.

This lies with Geode's having Drawable children that aren't Nodes so the usual
traversal rules don't apply.

One modification to the OSG that I have considered for a while is to
make a Drawable
a Node.  This has a number of knock on effects though so something
I'll need to consider
rather carefully.

 Anyway, now this is too late for 3.0. But may be we could think about that
 past 3.0.

Too later for 3.0 for sure.  3.2 a possibility though.

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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-20 Thread Mathias Fröhlich

Hi Robert,

On Monday 20 June 2011, Robert Osfield wrote:
 I will install Gnome on one of my systems today to check it works.  I
 can't test older X11 system though - such as IRIX, Solaris, HP-Ux,
 FreeBSD etc.  Could members of the community check out OSG svn/trunk
 and let me know how things work out.

Ok, our last IRIX machine is dead since one or two years.
So recent compile tests were only run on HP and Sun.

I have compile tested these two remaining machines today. But I expect this to 
be the last time I will care for these machines...

Solaris works more or less.
Even if the fullscreen stuff does no longer remove the window borders on CDE. 
I do not know if this worked before. But to say that, I don't care for the 
osgViewer fullscreen feature.

HPUX still compiles.
But I expect CDE on HPUX to have the same problems like solaris for the 
fullscreen stuff.

Greetings

Mathias

-- 
Dr. Mathias Fröhlich, science + computing ag, Software Solutions
Hagellocher Weg 71-75, D-72070 Tuebingen, Germany
Phone: +49 7071 9457-268, Fax: +49 7071 9457-511
-- 
Vorstand/Board of Management:
Dr. Bernd Finkbeiner, Dr. Roland Niemeier, 
Dr. Arno Steitz, Dr. Ingrid Zech
Vorsitzender des Aufsichtsrats/
Chairman of the Supervisory Board:
Philippe Miltin
Sitz/Registered Office: Tuebingen
Registergericht/Registration Court: Stuttgart
Registernummer/Commercial Register No.: HRB 382196 


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


Re: [osg-users] Testing a workaround for fullscreen toggling issues under modern X11 window managers

2011-06-20 Thread Robert Osfield
Hi Mathias,

2011/6/20 Mathias Fröhlich m.froehl...@science-computing.de:
 Ok, our last IRIX machine is dead since one or two years.

It's over a decade since I used an IRIX system so apart from fond memories of
a bigone era I don't think we need to worry about IRIX.  I do suspect if one did
resurrect an IRIX it wouldn't too difficult to get the OSG working on it.

 So recent compile tests were only run on HP and Sun.

 I have compile tested these two remaining machines today. But I expect this to
 be the last time I will care for these machines...

 Solaris works more or less.
 Even if the fullscreen stuff does no longer remove the window borders on CDE.
 I do not know if this worked before. But to say that, I don't care for the
 osgViewer fullscreen feature.

 HPUX still compiles.
 But I expect CDE on HPUX to have the same problems like solaris for the
 fullscreen stuff.

Does CDE not respond to the _MOTIF_WM_HINTS traditionally used for
window decoration under X11?  This window decoration code I've changed
a little to fix a bug in it, but it's basically still the same.

The  _NET_WM_STATE functionality used for telling the window manager
that a window is full screen is a recent development so I wouldn't
know if this has an support under CDE, if this functionality isn't
there then these calls will just be ignored so, but the OSG's window
size and window decoration code should still be able to toggle
fullscreen on/off by itself.

When you say the fullscreen stuff doesn't work under HPUX and Solaris
could you explain what happens when you run osgviewer cow.osg and
then press 'f' and couple of times to toggle the full scrren on/off.
Could you aslso try running osgviewer cow.osg --window 100 100 640
480 and trying the 'f' toggling.

If the full screen toggling behaviour under Solaris and HPUX hasn't
changed between 3.0.0-rc1 and the changes I checked in this morning
then I'd be happy to leave this as is, and merge the changes with the
OSG-3.0 in knowledge that it does improve things under the main X11
platform use.   This morning I've tested Gnome, KDE and a failsafe
xterm with no window manager and with a small fix for the later
everything works OK.  FYI, The failsafe xterm (Provided by Gnome under
Ubuntu) doesn't have an window decoration, but I guess this is to be
expected so I don't see this issue.

On a slightly different note, this afternoon I've been addressing some
warnings generated by cppcheck and there is a chance that these might
introduce some portability issues if the namespace support is a bit
incosinstitent on Solaris and HPUX.  Could you please update to
svn/trunk and let me know if things still compile fine.

Thanks,
Robert.



Does FlightGear not use the OSG's full screen?
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org