Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Vincent Bourdier
Hi,

2008/12/12 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi Vincent,

  Sorry to make an update, but no one use osgManipulator ?


 I use osgManipulator extensively, but as Robert said we all have work to
 do. I'll test your code in a few minutes, but please keep in mind that some
 of us are in different time zones than you (+6 hours if you're in France,
 I'm in Canada eastern time) so you need to be more patient.


Did you test this code ? I know I have to spend some time to use it
correctly, but for now, this is a problem I totally not understand ... it
depends on a viewer run() call ...

Thanks for help.

Regards,

   Vincent.



 You can take a lesson from CPU architecture: one of the benefits of
 multi-tasking/pipelining is that if one of your tasks is blocked you can
 always context switch to another and still get work done. So it's one reason
 why I'm actually glad that my todo list is always pretty full. :-)

 I usually let at least a day pass to get an answer before I start wondering
 if my message got lost, especially since I'm 6 hours later than you (5 hours
 later than Robert and others) so a message I send in the afternoon is after
 the end of your work day. It's just the reality of a global community.

 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

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

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


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Vincent Bourdier
More info about the bug :

When setting the scene data, the commandManager built maps :
_draggerConstraintMap = [0]()
_draggerSelectionMap = [2]()   //ok, I set 2 draggers

While runing, when I click to dragg a dragger, the application crashes in
commandManager-addSelectionsToCommand
VS debugger give me theses informations about the commandManager content :
_draggerConstraintMap = [4277075694]() // !! this is the problem... map is
not valid.
_draggerSelectionMap = [0]()

The commandManager still the same (same adress) ... I don't know how/when
the maps can ha been destroyed ...

And still the same solution : call viewer-run() just after the
addEventHandler(new PickModeHandler()) make no crash ...

If you see any bug ... any idea...

Thanks a lot.

Regards,
Vincent.

2008/12/15 Vincent Bourdier vincent.bourd...@gmail.com

 Hi,

 2008/12/12 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi Vincent,

  Sorry to make an update, but no one use osgManipulator ?


 I use osgManipulator extensively, but as Robert said we all have work to
 do. I'll test your code in a few minutes, but please keep in mind that some
 of us are in different time zones than you (+6 hours if you're in France,
 I'm in Canada eastern time) so you need to be more patient.


 Did you test this code ? I know I have to spend some time to use it
 correctly, but for now, this is a problem I totally not understand ... it
 depends on a viewer run() call ...

 Thanks for help.

 Regards,

Vincent.



 You can take a lesson from CPU architecture: one of the benefits of
 multi-tasking/pipelining is that if one of your tasks is blocked you can
 always context switch to another and still get work done. So it's one reason
 why I'm actually glad that my todo list is always pretty full. :-)

 I usually let at least a day pass to get an answer before I start
 wondering if my message got lost, especially since I'm 6 hours later than
 you (5 hours later than Robert and others) so a message I send in the
 afternoon is after the end of your work day. It's just the reality of a
 global community.

 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

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



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


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Robert Osfield
Hi Vincent,

I'm afraid I'd not yet have an ideas what might be amiss.  What you do
is to set the viewer threading to SingleThreaded just to see if this
might be threading issue.

Robert.

On Mon, Dec 15, 2008 at 9:55 AM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
 More info about the bug :

 When setting the scene data, the commandManager built maps :
 _draggerConstraintMap = [0]()
 _draggerSelectionMap = [2]()   //ok, I set 2 draggers

 While runing, when I click to dragg a dragger, the application crashes in
 commandManager-addSelectionsToCommand
 VS debugger give me theses informations about the commandManager content :
 _draggerConstraintMap = [4277075694]() // !! this is the problem... map is
 not valid.
 _draggerSelectionMap = [0]()

 The commandManager still the same (same adress) ... I don't know how/when
 the maps can ha been destroyed ...

 And still the same solution : call viewer-run() just after the
 addEventHandler(new PickModeHandler()) make no crash ...

 If you see any bug ... any idea...

 Thanks a lot.

 Regards,
 Vincent.

 2008/12/15 Vincent Bourdier vincent.bourd...@gmail.com

 Hi,

 2008/12/12 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi Vincent,

 Sorry to make an update, but no one use osgManipulator ?

 I use osgManipulator extensively, but as Robert said we all have work to
 do. I'll test your code in a few minutes, but please keep in mind that some
 of us are in different time zones than you (+6 hours if you're in France,
 I'm in Canada eastern time) so you need to be more patient.

 Did you test this code ? I know I have to spend some time to use it
 correctly, but for now, this is a problem I totally not understand ... it
 depends on a viewer run() call ...

 Thanks for help.

 Regards,

Vincent.


 You can take a lesson from CPU architecture: one of the benefits of
 multi-tasking/pipelining is that if one of your tasks is blocked you can
 always context switch to another and still get work done. So it's one reason
 why I'm actually glad that my todo list is always pretty full. :-)

 I usually let at least a day pass to get an answer before I start
 wondering if my message got lost, especially since I'm 6 hours later than
 you (5 hours later than Robert and others) so a message I send in the
 afternoon is after the end of your work day. It's just the reality of a
 global community.

 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



 ___
 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] Bug in osgManipulator with viewer.

2008-12-15 Thread Vincent Bourdier
Hi Robert,

I get it I think!

To solve the problem, I set my CommandManager ref_ptr as a private member in
my class which launch the frame loop.
That is to say the dragger-setCommandManager(...) method is not
sufficient... and the commandManager instance is lost when leaving the block
where is was created...

In Dragger(.h), command Manager is set as a CommandManager* and not a
ref_ptr !! This do not seems normal, isn't it ? in my code, a ref_ptr store
the instance, and that's why, leaving the cration block, the ref_ptr delete
the instance, because the dragger's command manager pointer do not increment
reference count. (Don't know if I am understanable, but it looks a good
explanation of the problem.)

So now the last question is : is it normal the dragger do not store the
commandManager in a ref_ptr ?

Thanks,
Regards.
   Vincent.

2008/12/15 Robert Osfield robert.osfi...@gmail.com

 Hi Vincent,

 I'm afraid I'd not yet have an ideas what might be amiss.  What you do
 is to set the viewer threading to SingleThreaded just to see if this
 might be threading issue.

 Robert.

 On Mon, Dec 15, 2008 at 9:55 AM, Vincent Bourdier
 vincent.bourd...@gmail.com wrote:
  More info about the bug :
 
  When setting the scene data, the commandManager built maps :
  _draggerConstraintMap = [0]()
  _draggerSelectionMap = [2]()   //ok, I set 2 draggers
 
  While runing, when I click to dragg a dragger, the application crashes in
  commandManager-addSelectionsToCommand
  VS debugger give me theses informations about the commandManager content
 :
  _draggerConstraintMap = [4277075694]() // !! this is the problem... map
 is
  not valid.
  _draggerSelectionMap = [0]()
 
  The commandManager still the same (same adress) ... I don't know how/when
  the maps can ha been destroyed ...
 
  And still the same solution : call viewer-run() just after the
  addEventHandler(new PickModeHandler()) make no crash ...
 
  If you see any bug ... any idea...
 
  Thanks a lot.
 
  Regards,
  Vincent.
 
  2008/12/15 Vincent Bourdier vincent.bourd...@gmail.com
 
  Hi,
 
  2008/12/12 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com
 
  Hi Vincent,
 
  Sorry to make an update, but no one use osgManipulator ?
 
  I use osgManipulator extensively, but as Robert said we all have work
 to
  do. I'll test your code in a few minutes, but please keep in mind that
 some
  of us are in different time zones than you (+6 hours if you're in
 France,
  I'm in Canada eastern time) so you need to be more patient.
 
  Did you test this code ? I know I have to spend some time to use it
  correctly, but for now, this is a problem I totally not understand ...
 it
  depends on a viewer run() call ...
 
  Thanks for help.
 
  Regards,
 
 Vincent.
 
 
  You can take a lesson from CPU architecture: one of the benefits of
  multi-tasking/pipelining is that if one of your tasks is blocked you
 can
  always context switch to another and still get work done. So it's one
 reason
  why I'm actually glad that my todo list is always pretty full. :-)
 
  I usually let at least a day pass to get an answer before I start
  wondering if my message got lost, especially since I'm 6 hours later
 than
  you (5 hours later than Robert and others) so a message I send in the
  afternoon is after the end of your work day. It's just the reality of a
  global community.
 
  J-S
  --
  __
  Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
http://www.cm-labs.com/
 http://whitestar02.webhop.org/
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 
  ___
  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] Bug in osgManipulator with viewer.

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

Hi Vincent,

Sorry I could not try out your example code before you found the 
solution yourself... I was totally swamped. I'm glad you found the 
solution though!


To solve the problem, I set my CommandManager ref_ptr as a private 
member in my class which launch the frame loop.


...

So now the last question is : is it normal the dragger do not store the 
commandManager in a ref_ptr ?


As I understand it, the Command Manager is an application-level object 
which is used to reduce coupling between the Dragger and the Selection. 
So it's really up to the application to keep it alive, which is what you 
now do.


As to why it isn't stored as a ref_ptr, I'm not sure, I don't think 
there would be a performance problem there...


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Vincent Bourdier
Hi,

2008/12/15 Jean-Sébastien Guay jean-sebastien.g...@cm-labs.com

 Hi Vincent,

 Sorry I could not try out your example code before you found the solution
 yourself... I was totally swamped. I'm glad you found the solution though!

  To solve the problem, I set my CommandManager ref_ptr as a private member
 in my class which launch the frame loop.


 ...

  So now the last question is : is it normal the dragger do not store the
 commandManager in a ref_ptr ?


 As I understand it, the Command Manager is an application-level object
 which is used to reduce coupling between the Dragger and the Selection. So
 it's really up to the application to keep it alive, which is what you now
 do.

 As to why it isn't stored as a ref_ptr, I'm not sure, I don't think there
 would be a performance problem there...

The disturbing thing, is that the Dragger set the commandManager in a
pointer (dragger-setcommandManager ) so we can assume that the command
manager is well stored in memory... but no !
Without the source and a good debuguer, I would not understand that..
Vincent.



 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

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


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Robert Osfield
Hi Vincent,

On Mon, Dec 15, 2008 at 8:31 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:
 The disturbing thing, is that the Dragger set the commandManager in a
 pointer (dragger-setcommandManager ) so we can assume that the command
 manager is well stored in memory... but no !
 Without the source and a good debuguer, I would not understand that..
 Vincent.

I'm rather busy with other tasks still so haven't looked into the
details of this problem yet.  Added a ref_ptr into Dragger would be
OK as long as CommandManger doesn't keep references to the Draggers
otherwise a circular dependency would be created.

I really need to sit down with the design and see what would be the
best thing, this might mean refactoring things inside osgManipulator
so that there is no CommandManager, or it has a different role.
osgWidget itself could become something that osgManipulator is based
on, but this itself has some issues with application level objects
needing to be constructed that perhaps could be avoided with some
careful scene graph management.

Unfortunately all this takes some quieten time of reflection to sort
out improvements design, something I don't have the luxury of right
now.  After 2.8 hopefully there will be a slot where I can sit back a
spend a few days on this stuff.  For 2.8 we'll just need to spot short
term fixes like introducing a ref_ptr to avoid CommandManager going
out of scope while still being used.

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


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-15 Thread Vincent Bourdier
Hi Robert,

2008/12/15 Robert Osfield robert.osfi...@gmail.com

 Hi Vincent,

 On Mon, Dec 15, 2008 at 8:31 PM, Vincent Bourdier
 vincent.bourd...@gmail.com wrote:
  The disturbing thing, is that the Dragger set the commandManager in a
  pointer (dragger-setcommandManager ) so we can assume that the command
  manager is well stored in memory... but no !
  Without the source and a good debuguer, I would not understand that..
  Vincent.

 I'm rather busy with other tasks still so haven't looked into the
 details of this problem yet.  Added a ref_ptr into Dragger would be
 OK as long as CommandManger doesn't keep references to the Draggers
 otherwise a circular dependency would be created.

Yes, I was trying to solve the bug adding a ref_ptr this morning, but the
circular dependency
make the compilator crying ...
And I don't have time before christmas too to have a look on it... so for
the moment I just
continue my project knowing this problem...
Thanks,
Regards,
   Vincent.


 I really need to sit down with the design and see what would be the
 best thing, this might mean refactoring things inside osgManipulator
 so that there is no CommandManager, or it has a different role.
 osgWidget itself could become something that osgManipulator is based
 on, but this itself has some issues with application level objects
 needing to be constructed that perhaps could be avoided with some
 careful scene graph management.

Unfortunately all this takes some quieten time of reflection to sort
 out improvements design, something I don't have the luxury of right
 now.  After 2.8 hopefully there will be a slot where I can sit back a
 spend a few days on this stuff.  For 2.8 we'll just need to spot short
 term fixes like introducing a ref_ptr to avoid CommandManager going
 out of scope while still being used.

 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] Bug in osgManipulator with viewer.

2008-12-12 Thread Vincent Bourdier
Sorry to make an update, but no one use osgManipulator ?

Regards,
Vincent.

2008/12/12 Vincent Bourdier vincent.bourd...@gmail.com

 Hi all,

 Having a bug with the osgManipulator, I succeed to reproduce it on an osg
 example I modified. See in attached file.
 The interesting code is at the end of the file, the bug is line 386.

 Problem : if the viewer-run() is not called is the same block where it was
 created, the application crashes when I manipulate a node with the handlers.

 I have tried to modify osgManipulator sources but nothing succeed...

 I you can have a look and help me...
 Thanks a lot.

 Regards,
Vincent.


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


Re: [osg-users] Bug in osgManipulator with viewer.

2008-12-12 Thread Robert Osfield
Hi Vincent,

Other people do use osgManipulator but not with the same problems as
you've seen.

I have I've been busy so haven't had a chance to try out your example,
no doubt others are also rushed off their feet, so you just need to be
patient.

I must admit from your explanation it does sounds it may well be a
usage problem, i.e. a bug in your code, rather than osgManipulator.
Why not post a stack trace, and an explanation of where the crash
occurs.  People might not have the time to try out your code but might
have time to review what you post in terms of trace trace etc.

Robert.

On Fri, Dec 12, 2008 at 2:48 PM, Vincent Bourdier
vincent.bourd...@gmail.com wrote:

 Sorry to make an update, but no one use osgManipulator ?

 Regards,
 Vincent.

 2008/12/12 Vincent Bourdier vincent.bourd...@gmail.com

 Hi all,

 Having a bug with the osgManipulator, I succeed to reproduce it on an osg
 example I modified. See in attached file.
 The interesting code is at the end of the file, the bug is line 386.

 Problem : if the viewer-run() is not called is the same block where it
 was created, the application crashes when I manipulate a node with the
 handlers.

 I have tried to modify osgManipulator sources but nothing succeed...

 I you can have a look and help me...
 Thanks a lot.

 Regards,
Vincent.



 ___
 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] Bug in osgManipulator with viewer.

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

Hi Vincent,


Sorry to make an update, but no one use osgManipulator ?


I use osgManipulator extensively, but as Robert said we all have work to 
do. I'll test your code in a few minutes, but please keep in mind that 
some of us are in different time zones than you (+6 hours if you're in 
France, I'm in Canada eastern time) so you need to be more patient.


You can take a lesson from CPU architecture: one of the benefits of 
multi-tasking/pipelining is that if one of your tasks is blocked you can 
always context switch to another and still get work done. So it's one 
reason why I'm actually glad that my todo list is always pretty full. :-)


I usually let at least a day pass to get an answer before I start 
wondering if my message got lost, especially since I'm 6 hours later 
than you (5 hours later than Robert and others) so a message I send in 
the afternoon is after the end of your work day. It's just the reality 
of a global community.


J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org