[vtkusers] vtkPlaybackWidget not working in Activiz.NET

David Cole DLRdave at aol.com
Wed Aug 31 12:43:52 EDT 2016


In ActiViz .NET, you cannot derive a new class from a VTK wrapper
class. You would have to write the class in C++ and then wrap it to
generate the class on the managed/.NET side.

You can intercept events fired from the VTK objects: there should be
decent examples of how to do that in ActiViz .NET, but no deriving
classes in the wrapper layer without having a corresponding class on
the unwrapped side.


Hope this helps,
David C.



On Wed, Aug 31, 2016 at 4:12 AM, Sunil Mathew via vtkusers
<vtkusers at vtk.org> wrote:
> Hi,
>
> I'm clicking on the playback buttons but they do not trigger the overridden
> method. I tried making the call explicitly and it does work. I also tried
> some enable flags, but did not seem to work. Any help is appreciated. I got
> here by trying out an
> example->https://itk.org/Wiki/VTK/Examples/Cxx/Broken/Widgets/PlaybackWidget
>
> public class PlaybackRepresentation: vtkPlaybackRepresentation
> {
>     public new static PlaybackRepresentation New()
>     {
>         return new PlaybackRepresentation();
>     }
>
>     public PlaybackRepresentation()
>     {
>     }
>
>     public override void Play()
>     {
>         Log("Play pressed.");
>     }
> }
>
> PlaybackRepresentation   pbRep    = PlaybackRepresentation.New();
> vtkPlaybackWidget        pbWidget = vtkPlaybackWidget.New();
>
> public void AddPlaybackWidget()
> {
>     pbRep.SetShowBorderToOff();
>     pbRep.SetPosition( 0.43, 0.05);
>     pbRep.SetPosition2(0.14, 0.07);
>
>     pbWidget.SetInteractor(_style.GetInteractor());
>     pbWidget.SetRepresentation(pbRep);
>     pbWidget.On();
>
>     pbRep.Play(); // This does work, but clicking
>                   // on the button does not trigger the method call
> }
>
>
> _______________________________________________
> 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:
> http://public.kitware.com/mailman/listinfo/vtkusers
>


More information about the vtkusers mailing list