[vtkusers] vtkImageViewer2 do not fit my needs
Raúl Ferriz
raul at torresyvalero.com
Wed May 19 04:46:06 EDT 2010
El 19/05/2010 10:32, Karthik Krishnan escribió:
> On Tue, May 18, 2010 at 9:35 PM, Raúl Ferriz <raul at torresyvalero.com
> <mailto:raul at torresyvalero.com>> wrote:
>
>
> Hello again!
>
> I have created next class only for testing porpouses:
>
>
> Later on my code I have something like:
>
> myInteractorStyle2d* style = myInteractorStyle2d::New();
> m_Interactor->SetInteractorStyle(style);
> m_ImageViewer2->SetupInteactor(m_Interactor);
>
>
>
> But this doesn't seem to work. Before I had StyleTrallbackActor,
> and when I changed to ImageStyle, I can see the diferences. But
> seems like my overrides do not want to work, it act just like I
> was using vtkInteractorStyleImage... What am I doing wrong?
>
>
>
> Your line "m_Interactor->SetInteractorStyle(style)" no effect here,
> since the ImageViewer overrides this with its own interactor style
> (vtkInteractorStyleImage) in the very next line. Specifically the line
> m_ImageViewer2->SetupInteractor(..), invokes
>
> vtkImageViewer2::InstallPipeline()
>
> where the connections are made..
>
> Move that line after setting up the pipeline :
>
>
> myInteractorStyle2d* style = myInteractorStyle2d::New();
> m_ImageViewer2->SetupInteactor(m_Interactor);
> m_Interactor->SetInteractorStyle(style);
>
>
> Please dig a bit deeper by looking at the source code.
>
>
Ouch, did not thought that order can be crucial!
That worked!
Now myInteractorStyle2d is finally used. I was currently looking at
sourcecode and try to find what logic was used, but I currently did not
find that piece of code. Next time I will find deeper before asking.
Many thanks to all interested.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100519/faefdee5/attachment.htm>
More information about the vtkusers
mailing list