[OpenWalnut-Dev] removing max xonstraint and detecting left click

Sebastian Eichelbaum eichelbaum at informatik.uni-leipzig.de
Mon Nov 5 10:32:15 CET 2012


Hi David

Sorry for the late reply. 

The min/max issue:
------------------

Alexander Wiebel commited a patch wich fixes an issue with out min/max constraints. Please try the up-to-date version of OpenWalnut and report back if the issue still exists.

The Click-handling issue:
-------------------------

The signal you are using is the so called "pick" event. Picking is done with a right mouse click. If you really need to handle left-clicks and other events, you'll need to write
your own event handler for the view you are using. If you are using the main 3D view, you need to take care of several things in your event handler:

* only handle clicks
* do not accept other events like dragging, moving and similar or the 3d scene interaction will not work anymore.

How to implement your own event handler:

1. use WKernel::getRunningKernel()->getGraphicsEngine()->getViewer()->getView() to get the osgViewer::View instance 
2. use this view instance's "addEventHandler". (http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a01050.html#99c233a07c8870101074c2750725d5b7)
3. implement an osgGA::GUIEventHandler http://www.openscenegraph.org/documentation/OpenSceneGraphReferenceDocs/a00294.html


I hope this helps somewhat. But once again, the GUIEventHandler::handle function returns true ONLY if you handle the click. Everything else should be returned as "false" in your handler.

Bye
Sebastian



On Thu, 01 Nov 2012, David Moreno-Dominguez wrote:

> Hello, I am working on a walnut module and I have a couple of questions you might be able to solve.
> 
> Firstly it is about the setting and resetting maximum/minimum constraints for int properties
> Basically I find myself unable to override a previously max already set before.
> I have tried using 
> 
>     m_propSample->setMax( a );
>     m_propSample->removeConstraint( PC_MAX );
>     m_propSample->setMax( b );
> 
> but it still keeps the a limit, unless b is even more restrictive.
> Is there anyway around this?
> I would like to be able to change dynamically the maximum value allowed for my property.
> 
> 
> My second question refers to capturing the signal of a mouse click.
> I am using the following piece of code written by a colleague
> 
> boost::signals2::connection con = WKernel::getRunningKernel()->getGraphicsEngine()->getViewer()->getPickHandler()->getPickSignal()->
>             connect( boost::bind( &WMHierchClustDisplay::dendrogramClick, this, _1 ) );
> 
> 
> However, it seems this only calls to the "dendrogramClick" function when a right mouse button is pressed, and I do not know the reason why.
> Any way to also capture the left click?
> 
> Thanks in advance for your help
> 
> David Moreno-Dominguez
> PhD Student
> Research group "Cortical Networks and Cognitive Functions"
> Max Planck Institute for Human Cognitive and Brain Sciences
> Stephanstraße 1A, 04103 Leipzig, Germany
> Phone: +49 341 9940-2625
> Email: moreno at cbs.mpg.de
> http://www.cbs.mpg.de/~moreno
> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> 
> Archive: http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/
> 

-- 
Dipl.-Inf. Sebastian Eichelbaum
Universität Leipzig
Institut für Informatik
Abteilung Bild- und Signalverarbeitung
PF 100920
D-04009 Leipzig


More information about the OpenWalnut-Dev mailing list