Discussion:
[vtkusers] vtkButtonSource、vtkRectangularButtonSource 、vtkEllipticalButtonSource
louiskoo
2013-07-04 06:27:47 UTC
Permalink
any one can tell me some use of vtkButtonSource or vtkRectangularButtonSource
or vtkEllipticalButtonSource?
meanWhile, tell me about some click event information?



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752.html
Sent from the VTK - Users mailing list archive at Nabble.com.
Christopher Mullins
2013-07-04 06:32:41 UTC
Permalink
Under the "broken" section of the examples, but maybe this will help [1].
vtkButtonSource is itself an abstract class [2].

[1] http://www.vtk.org/Wiki/VTK/Examples/Broken/RectangularButtonSource
[2] http://www.vtk.org/doc/release/5.0/html/a01209.html
Post by louiskoo
any one can tell me some use of vtkButtonSource or
vtkRectangularButtonSource
or vtkEllipticalButtonSource?
meanWhile, tell me about some click event information?
--
http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Christopher Mullins
R&D Engineer
Kitware Inc.,
919.869.8871
louiskoo
2013-07-04 06:50:55 UTC
Permalink
Thanks for your help.

How can I add click event? And below is my code:
button.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(button_LeftButtonPressEvt) ;
However,it dosen't work.



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721754.html
Sent from the VTK - Users mailing list archive at Nabble.com.
mirko heuegger
2013-07-04 09:23:40 UTC
Permalink
Hello!

I guess you are using C# and ActiViz.NET, if so, the 'vtkObject' should be
a type of a vtkRenderWindowInteractor, then you example should work.

hth

mirko
Post by louiskoo
Thanks for your help.
button.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(button_LeftButtonPressEvt) ;
However,it dosen't work.
--
http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721754.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Real programmers don't document; if it was
hard to write, it should be hard to understand.
louiskoo
2013-07-04 09:36:29 UTC
Permalink
Yes,you are right.I am using C# and ActiViz.NET .
I have change it as follows.

button.LeftButtonPressEvt += new
vtkRenderWindowInteractor.vtkObjectEventHandler(button_LeftButtonPressEvt);

But it doesn't work either.



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721758.html
Sent from the VTK - Users mailing list archive at Nabble.com.
mirko heuegger
2013-07-04 11:01:04 UTC
Permalink
Hello!

You heave to get the RenderWindowInteractor from the currently used
RenderWindowControl.

I posted here a while ago a C# example (subject: '[vtkusers] Change default
mouse buttons') <http://markmail.org/message/loemzhq2pbldhptg> how to do
that.


hth

mirko
Post by louiskoo
Yes,you are right.I am using C# and ActiViz.NET .
I have change it as follows.
button.LeftButtonPressEvt += new
vtkRenderWindowInteractor.vtkObjectEventHandler(button_LeftButtonPressEvt);
But it doesn't work either.
--
http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721758.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Real programmers don't document; if it was
hard to write, it should be hard to understand.
louiskoo
2013-07-04 12:20:56 UTC
Permalink
Thanks,I have read what you have written.
However,I just wanna find how to add clicking event to vtkButtonWidget or
vtkEllipticalButtonSource.Can you give me some idea?



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721763.html
Sent from the VTK - Users mailing list archive at Nabble.com.
mirko heuegger
2013-07-04 12:54:21 UTC
Permalink
Hello!

I never used a vtkButtonWidget.
But have you tried to set you Interactor to the widget (over vtk
ButtonWidget.SetInteractor(..))?


hth

mirko
Post by louiskoo
Thanks,I have read what you have written.
However,I just wanna find how to add clicking event to vtkButtonWidget or
vtkEllipticalButtonSource.Can you give me some idea?
--
http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721763.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Real programmers don't document; if it was
hard to write, it should be hard to understand.
louiskoo
2013-07-04 13:28:47 UTC
Permalink
Yes,I have taken your suggstion.

vtkButtonWidget buttonWidget = vtkButtonWidget.New();
vtkRenderWindowInteractor renderInteractor =
renderWindowControl1.RenderWindow.GetInteractor();
renderInteractor.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(renderInteractor_LeftButtonPressEvt);
buttonWidget.SetInteractor(renderInteractor);
buttonWidget.SetRepresentation(rep);
//buttonWidget.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(buttonWidget_LeftButtonPressEvt);
buttonWidget.On();

But the result is that the buttonWidget has no effect when I click the
buttonWidget .



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721767.html
Sent from the VTK - Users mailing list archive at Nabble.com.
mirko heuegger
2013-07-04 14:19:07 UTC
Permalink
Hello!

If I extend my mentioned example ('Form1.cs') by:
this.buttonWidget = vtkButtonWidget.New();
iren.LeftButtonPressEvt += new vtkObject.vtkObjectEventHandler(dummyEvnt);
this.buttonWidget.SetInteractor(this.RendWinInteractor);
this.buttonWidget.On();
and the event will fired, so I guess your snippet is working and the error
is located elsewhere.


regards

mirko
Post by louiskoo
Yes,I have taken your suggstion.
vtkButtonWidget buttonWidget = vtkButtonWidget.New();
vtkRenderWindowInteractor renderInteractor =
renderWindowControl1.RenderWindow.GetInteractor();
renderInteractor.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(renderInteractor_LeftButtonPressEvt);
buttonWidget.SetInteractor(renderInteractor);
buttonWidget.SetRepresentation(rep);
//buttonWidget.LeftButtonPressEvt += new
vtkObject.vtkObjectEventHandler(buttonWidget_LeftButtonPressEvt);
buttonWidget.On();
But the result is that the buttonWidget has no effect when I click the
buttonWidget .
--
http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721767.html
Sent from the VTK - Users mailing list archive at Nabble.com.
_______________________________________________
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
http://www.vtk.org/Wiki/VTK_FAQ
http://www.vtk.org/mailman/listinfo/vtkusers
--
Real programmers don't document; if it was
hard to write, it should be hard to understand.
louiskoo
2013-07-05 01:48:02 UTC
Permalink
Yes , the RendWinInteractor will fire exactly.

I just wanna konw if the event will fired when you click the buttonWidget?



--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkButtonSource-vtkRectangularButtonSource-vtkEllipticalButtonSource-tp5721752p5721786.html
Sent from the VTK - Users mailing list archive at Nabble.com.
jesper1266
2018-11-07 14:15:19 UTC
Permalink
Did you figure out how to fire the event?



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

Loading...