[OpenWalnut-Dev] OpenWalnut-Dev Digest, Vol 36, Issue 2

Sebastian Eichelbaum eichelbaum at informatik.uni-leipzig.de
Mon Nov 5 17:19:37 CET 2012


Hi

1. issue:

Ok. One last test :-) ... please enable "Slider Min/Max editing" in the Settings-menu. If you modify the max constraint of your property, what happens with the max slider?

2. issue:

Believe me it is a larger hassle to get the Pick handler convinced of handling modifiers and similar. Writing an own EventHandler is nearly trivial. Just derive from the osgGA::GUIEventHandler and implement a handle function which checks for click events. everything else can be ignored. Have a look in our code. We use these handlers in several modules, like clusterDisplay.

Bye
Sebastian


On Mon, 05 Nov 2012, David Moreno-Dominguez wrote:

> Hi, I just pulled and updated walnut to the current version and recompiled and the max restriction issue still persists. ( although I also made sure I had it up to date at the time I originally reported the problem ).
> It seems as "m_propSample->removeConstraint( PC_MAX );" does not remove the constraint set by "m_propSample->setMax( a );"
> 
> Regarding the "pick" event, I dont think id like to go through the hassle of correctly implementing my own handler, but then: is it possible of it to detect if a modifier key was pressed at the same time as the right click button? (say shift ot ctrl? )
> 
> I tried checking the value of "pickInfo.getModifierKey()" but it seems to be always set to "WPickInfo::NONE" no matter what key is pressed on the keyboard at the time of the click
> 
> Regards
> 
> 
> 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
> 
> ----- Original Message -----
> From: openwalnut-dev-request at lists.informatik.uni-leipzig.de
> To: openwalnut-dev at lists.informatik.uni-leipzig.de
> Sent: Monday, November 5, 2012 12:00:01 PM
> Subject: OpenWalnut-Dev Digest, Vol 36, Issue 2
> 
> Send OpenWalnut-Dev mailing list submissions to
> 	openwalnut-dev at lists.informatik.uni-leipzig.de
> 
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> 
> or, via email, send a message with subject or body 'help' to
> 	openwalnut-dev-request at lists.informatik.uni-leipzig.de
> 
> You can reach the person managing the list at
> 	openwalnut-dev-owner at lists.informatik.uni-leipzig.de
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of OpenWalnut-Dev digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: removing max xonstraint and detecting left	click
>       (Sebastian Eichelbaum)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 5 Nov 2012 10:32:15 +0100
> From: Sebastian Eichelbaum <eichelbaum at informatik.uni-leipzig.de>
> To: OpenWalnut Developers
> 	<openwalnut-dev at lists.informatik.uni-leipzig.de>
> Subject: Re: [OpenWalnut-Dev] removing max xonstraint and detecting
> 	left	click
> Message-ID: <20121105093215.GA12519 at cardano.informatik.uni-leipzig.de>
> Content-Type: text/plain; charset=iso-8859-1
> 
> 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
> 
> 
> ------------------------------
> 
> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> 
> 
> End of OpenWalnut-Dev Digest, Vol 36, Issue 2
> *********************************************
> _______________________________________________
> 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