Re: [osg-users] Composite viewer resize

2008-07-01 Thread Robert Osfield
Hi Fabien,

Does osgcomposite resize correctly for you? i.e.

   osgcompositeviewer cow.osg

I have just tried resizing and it all three views adjust their aspect
ratio correctly.  This relies upon the Camera's projection matrices
being resized by the GraphicsContext itself, your own code shouldn't
need to handle the resize, unless of course you actually want to
implement some custom resize.  You can control the resize behaviour of
the projection matrix via the Camera::setProjectionResizePolicy(..)
options are:

enum ProjectionResizePolicy
{
FIXED, /** Keep the projection matrix fixed, despite
window resizes.*/
HORIZONTAL, /** Adjust the HORIZOTNAL field of view on
window resizes.*/
VERTICAL /** Adjust the VERTICAL field of view on window resizes.*/
};


Robert.


On Tue, Jul 1, 2008 at 10:59 AM, fabien rioli
[EMAIL PROTECTED] wrote:
 Hi All,

 I'm currently having problems with the resize event redistribution with
 multiple views (in a composite viewer).
 It seems that only one of the viewers receives the resize event.
 See the attached example (.cpp) witch illustrate the problem (two viewers
 with a resize handler).
 In the resise handlers I change the projection matrix in order to show witch
 view gets the event.
 The following sreenshots shows different steps of the test.

 1.jpg : no event
 2.jpg : a first resize event ( the window have been moved)
 3.jpg : a second resize event ( resise from the bottom right corner)

 From what I have understood from osgViewer/CompositeViewer.cpp (in the
 eventTraversal) the viewer witch receives the event is the one who have the
 focus.
 I think that because every viewer in the same window is affected by the
 resizing, the may have to receive the event each other.
 Is this an intended behaviour ?

 Thank you in advance,

 Fabien

 --
 Fabien Rioli
 www.tharsis-software.com
 ___
 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] Composite viewer resize

2008-07-01 Thread fabien rioli
On Tue, Jul 1, 2008 at 12:23 PM, Robert Osfield [EMAIL PROTECTED]
wrote:

 Hi Fabien,

 Does osgcomposite resize correctly for you? i.e.

   osgcompositeviewer cow.osg


Thanks for your answer Robert.

Yes, the composite viewer does work fine for the aspect ratio. The
projection matrices changes in my example were only here to show that the
resize event wasn't send to the two viewers.

I work on an application with multiple viewers that needs to shows a grid of
objects of a setted number of collums and lines.
I also need to display objects of the same ratio, so I change horizontal and
vertical space between the objects to have the same number of objecst
*and*keep their aspect. Sometimes the viewer with the grid gets the
resize event,
sometimes it's an other one, but never both of them.

Fabien.



 I have just tried resizing and it all three views adjust their aspect
 ratio correctly.  This relies upon the Camera's projection matrices
 being resized by the GraphicsContext itself, your own code shouldn't
 need to handle the resize, unless of course you actually want to
 implement some custom resize.  You can control the resize behaviour of
 the projection matrix via the Camera::setProjectionResizePolicy(..)
 options are:

enum ProjectionResizePolicy
{
FIXED, /** Keep the projection matrix fixed, despite
 window resizes.*/
HORIZONTAL, /** Adjust the HORIZOTNAL field of view on
 window resizes.*/
VERTICAL /** Adjust the VERTICAL field of view on window
 resizes.*/
};


 Robert.


 On Tue, Jul 1, 2008 at 10:59 AM, fabien rioli
 [EMAIL PROTECTED] wrote:
  Hi All,
 
  I'm currently having problems with the resize event redistribution with
  multiple views (in a composite viewer).
  It seems that only one of the viewers receives the resize event.
  See the attached example (.cpp) witch illustrate the problem (two viewers
  with a resize handler).
  In the resise handlers I change the projection matrix in order to show
 witch
  view gets the event.
  The following sreenshots shows different steps of the test.
 
  1.jpg : no event
  2.jpg : a first resize event ( the window have been moved)
  3.jpg : a second resize event ( resise from the bottom right corner)
 
  From what I have understood from osgViewer/CompositeViewer.cpp (in the
  eventTraversal) the viewer witch receives the event is the one who have
 the
  focus.
  I think that because every viewer in the same window is affected by the
  resizing, the may have to receive the event each other.
  Is this an intended behaviour ?
 
  Thank you in advance,
 
  Fabien
 
  --
  Fabien Rioli
  www.tharsis-software.com
  ___
  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




-- 
Fabien Rioli - Directeur Commercial Tharsis-software
Portable: 06 76 96 59 98
Paris innovation 5 rue d'Uzès 75002 Paris Fixe: 01 40 13 53 49
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] Composite viewer resize

2008-07-01 Thread Robert Osfield
Hi Fabian,

osgViewer::CompositeViewer directs events to camera with focus.  If
you want different behavior you can always override the
CompositeViewer::eventTravesals() method.

Robert.

On Tue, Jul 1, 2008 at 1:31 PM, fabien rioli
[EMAIL PROTECTED] wrote:


 On Tue, Jul 1, 2008 at 12:23 PM, Robert Osfield [EMAIL PROTECTED]
 wrote:

 Hi Fabien,

 Does osgcomposite resize correctly for you? i.e.

   osgcompositeviewer cow.osg

 Thanks for your answer Robert.

 Yes, the composite viewer does work fine for the aspect ratio. The
 projection matrices changes in my example were only here to show that the
 resize event wasn't send to the two viewers.

 I work on an application with multiple viewers that needs to shows a grid of
 objects of a setted number of collums and lines.
 I also need to display objects of the same ratio, so I change horizontal and
 vertical space between the objects to have the same number of objecst and
 keep their aspect. Sometimes the viewer with the grid gets the resize event,
 sometimes it's an other one, but never both of them.

 Fabien.


 I have just tried resizing and it all three views adjust their aspect
 ratio correctly.  This relies upon the Camera's projection matrices
 being resized by the GraphicsContext itself, your own code shouldn't
 need to handle the resize, unless of course you actually want to
 implement some custom resize.  You can control the resize behaviour of
 the projection matrix via the Camera::setProjectionResizePolicy(..)
 options are:

enum ProjectionResizePolicy
{
FIXED, /** Keep the projection matrix fixed, despite
 window resizes.*/
HORIZONTAL, /** Adjust the HORIZOTNAL field of view on
 window resizes.*/
VERTICAL /** Adjust the VERTICAL field of view on window
 resizes.*/
};


 Robert.


 On Tue, Jul 1, 2008 at 10:59 AM, fabien rioli
 [EMAIL PROTECTED] wrote:
  Hi All,
 
  I'm currently having problems with the resize event redistribution with
  multiple views (in a composite viewer).
  It seems that only one of the viewers receives the resize event.
  See the attached example (.cpp) witch illustrate the problem (two
  viewers
  with a resize handler).
  In the resise handlers I change the projection matrix in order to show
  witch
  view gets the event.
  The following sreenshots shows different steps of the test.
 
  1.jpg : no event
  2.jpg : a first resize event ( the window have been moved)
  3.jpg : a second resize event ( resise from the bottom right corner)
 
  From what I have understood from osgViewer/CompositeViewer.cpp (in the
  eventTraversal) the viewer witch receives the event is the one who have
  the
  focus.
  I think that because every viewer in the same window is affected by the
  resizing, the may have to receive the event each other.
  Is this an intended behaviour ?
 
  Thank you in advance,
 
  Fabien
 
  --
  Fabien Rioli
  www.tharsis-software.com
  ___
  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



 --
 Fabien Rioli - Directeur Commercial Tharsis-software
 Portable: 06 76 96 59 98
 Paris innovation 5 rue d'Uzès 75002 Paris Fixe: 01 40 13 53 49
 www.tharsis-software.com
 ___
 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