Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2010-01-28 Thread Tobias Bellmann
Hi,

I know this thread is a little bit old, but I've got the same symptoms in my QT 
Embedded CompositeViewer. The EventQueue of a view seems to never contain any 
osgGA::GUIEventAdapter::MOVE Events, but osgGA::GUIEventAdapter::PRESSED are 
generated. 

My CompositeViewer class definiton:

class CompositeViewerQt: public osgViewer::CompositeViewer, public AdapterWidget



 ive fixed my problem.
 
 the reason was glut
 ive forgotten to declare a passiveMouse Callback


could anyone explain this solution in a little more detail, and how to perform 
this with osg?

Thank you!

Cheers,
Tobias

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





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


Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2010-01-28 Thread Nishant Singh
Turn on the mouse tracking in your constructor. it is off by default in
QGLWidget.

setMouseTracking(true);

On Thu, Jan 28, 2010 at 7:25 PM, Tobias Bellmann tobias.bellm...@dlr.dewrote:

 Hi,

 I know this thread is a little bit old, but I've got the same symptoms in
 my QT Embedded CompositeViewer. The EventQueue of a view seems to never
 contain any osgGA::GUIEventAdapter::MOVE Events, but
 osgGA::GUIEventAdapter::PRESSED are generated.

 My CompositeViewer class definiton:

 class CompositeViewerQt: public osgViewer::CompositeViewer, public
 AdapterWidget



  ive fixed my problem.
 
  the reason was glut
  ive forgotten to declare a passiveMouse Callback


 could anyone explain this solution in a little more detail, and how to
 perform this with osg?

 Thank you!

 Cheers,
 Tobias

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





 ___
 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] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-06-01 Thread Matthias Asselborn
iam holding the mouse button not down.

i want a pick each time i move my mouse! 
i thought its implemented with : MOVE ...
but its not working 

... 

Thank you!

Cheers,
Matthias

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





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


Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-06-01 Thread Robert Osfield
Hi Mathias,

I have just modified the osgpick example to check for MOVE events and
it works perfectly.

switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::MOVE):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view) pick(view,ea);
return false;
}

I don't know what you've done wrong, but perhaps you can look at the
attached osgpick.cpp for reference.

Robert.


On Mon, Jun 1, 2009 at 1:30 PM, Matthias Asselborn
matthias.asselb...@gmx.de wrote:
 iam holding the mouse button not down.

 i want a pick each time i move my mouse!
 i thought its implemented with : MOVE ...
 but its not working

 ...

 Thank you!

 Cheers,
 Matthias

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





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

/* OpenSceneGraph example, osgpick.
*
*  Permission is hereby granted, free of charge, to any person obtaining a copy
*  of this software and associated documentation files (the Software), to deal
*  in the Software without restriction, including without limitation the rights
*  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
*  copies of the Software, and to permit persons to whom the Software is
*  furnished to do so, subject to the following conditions:
*
*  THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
*  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
*  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
*  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
*  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
*  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
*  THE SOFTWARE.
*/

/* osgpick sample
* demonstrate use of osgUtil/PickVisitor for picking in a HUD or
* in a 3d scene,
*/

#include osgUtil/Optimizer
#include osgDB/ReadFile
#include osgViewer/Viewer
#include osgViewer/CompositeViewer

#include osgGA/TerrainManipulator
#include osgGA/StateSetManipulator
#include osgGA/AnimationPathManipulator
#include osgGA/TrackballManipulator
#include osgGA/FlightManipulator
#include osgGA/DriveManipulator
#include osgGA/KeySwitchMatrixManipulator
#include osgGA/StateSetManipulator
#include osgGA/AnimationPathManipulator
#include osgGA/TerrainManipulator

#include osg/Material
#include osg/Geode
#include osg/BlendFunc
#include osg/Depth
#include osg/Projection
#include osg/MatrixTransform
#include osg/Camera
#include osg/io_utils
#include osg/ShapeDrawable

#include osgText/Text

#include sstream

// class to handle events with a pick
class PickHandler : public osgGA::GUIEventHandler {
public: 

PickHandler(osgText::Text* updateText):
_updateText(updateText) {}

~PickHandler() {}

bool handle(const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter aa);

virtual void pick(osgViewer::View* view, const osgGA::GUIEventAdapter ea);

void setLabel(const std::string name)
{
if (_updateText.get()) _updateText-setText(name);
}

protected:

osg::ref_ptrosgText::Text  _updateText;
};

bool PickHandler::handle(const osgGA::GUIEventAdapter ea,osgGA::GUIActionAdapter aa)
{
switch(ea.getEventType())
{
case(osgGA::GUIEventAdapter::MOVE):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view) pick(view,ea);
return false;
}
case(osgGA::GUIEventAdapter::PUSH):
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
if (view) pick(view,ea);
return false;
}
case(osgGA::GUIEventAdapter::KEYDOWN):
{
if (ea.getKey()=='c')
{
osgViewer::View* view = dynamic_castosgViewer::View*(aa);
osg::ref_ptrosgGA::GUIEventAdapter event = new osgGA::GUIEventAdapter(ea);
event-setX((ea.getXmin()+ea.getXmax())*0.5);
event-setY((ea.getYmin()+ea.getYmax())*0.5);
if (view) pick(view,*event);
}
return false;
}
default:
return false;
}
}

void PickHandler::pick(osgViewer::View* view, const osgGA::GUIEventAdapter ea)
{
osgUtil::LineSegmentIntersector::Intersections intersections;

std::string gdlist=;
float x = ea.getX();
float y = ea.getY();
#if 0
osg::ref_ptr osgUtil::LineSegmentIntersector  picker = new osgUtil::LineSegmentIntersector(osgUtil::Intersector::WINDOW, x, y);
osgUtil::IntersectionVisitor iv(picker.get());
view-getCamera()-accept(iv);
if (picker-containsIntersections())
{
intersections = picker-getIntersections();
#else
if 

Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-06-01 Thread Matthias Asselborn
Thank you Robert

your example works perfect 
this is exactly what i need 
what osg version did you use?
did you change only code in the swith case section?

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





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


Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-06-01 Thread Robert Osfield
On Mon, Jun 1, 2009 at 2:17 PM, Matthias Asselborn
matthias.asselb...@gmx.de wrote:
 Thank you Robert

 your example works perfect
 this is exactly what i need
 what osg version did you use?
 did you change only code in the swith case section?

svn/trunk, but it's something that has worked forever.
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-06-01 Thread Matthias Asselborn
ive fied this problem.

the reason was glut 
ive forgotten to declare a passiveMouse Callback 

sorry ... ;-) 

now it works perfect ;-)

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





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


Re: [osg-users] osgGA::GUIEventAdapter::MOVE: doesnt work

2009-05-31 Thread Paul Martz
Are you holding the mouse button down? If so, you'll get a DRAG event,
right? (Is this not universal UI terminology?)

Paul Martz
Skew Matrix Software LLC
http://www.skew-matrix.com
+1 303 859 9466

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