[vtkusers] vtkImageViewer2 do not fit my needs

Raúl Ferriz raul at torresyvalero.com
Tue May 18 12:05:17 EDT 2010


El 18/05/2010 16:48, Jothy escribió:
> You should set the Interactorstyle to InteractorstyleToImage, inorder 
> not to allow it to rotate in any direction.

> On Tue, May 18, 2010 at 3:43 PM, Raúl Ferriz <raul at torresyvalero.com 
> <mailto:raul at torresyvalero.com>> wrote:
>
>     Hello!
>
>
>     I'm trying to find a good image viewer class for an image. My only
>     needs is: image should fill renderwindow, do NOT allowed to rotate
>     on any axis. Could be cool, but not a need, to make zoom in and
>     out. Allowed to click on image and return point coord on original
>     non zoomed in or out image.
>
>     Is there any class or example that achieves that? Any advice in
>     other case?
>


Hello again!

I have created next class only for testing porpouses:

// Define interaction style
class myInteractorStyle2d : public vtkInteractorStyleImage
{
public:
     static myInteractorStyle2d* New();
     vtkTypeRevisionMacro(myInteractorStyle2d, vtkInteractorStyleImage);

public:
     virtual void OnLeftButtonDown()
     {
         // Do nothing!

         // forward events
         //vtkInteractorStyleImage::OnLeftButtonDown();
     }
public:
     virtual void OnRightButtonDown()
     {
         // Do nothing
        return;
     }
};
vtkCxxRevisionMacro(myInteractorStyle2d, "$Revision: 1.1 $");
vtkStandardNewMacro(myInteractorStyle2d);


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?

Many thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100518/57c548ec/attachment.htm>


More information about the vtkusers mailing list