[vtkusers] How to subclass vtkInteractorStyle?

Malcolm Drummond malcolm at geovision.co.za
Sun Feb 8 16:20:13 EST 2004


Hi Arnold

myInteractorStyle::New() is not defined so vtkInteractorStyle::New() would
be invoked - returning vtkInteractorStyle*, hence the invalid conversion
error. Look at the source code for one of the derived interactors (eg
vtkInteractorStyleFlight) to see how to subclass an interactor and how to
use the vtk macros.

HTH
Malcolm

----- Original Message -----
From: <a.meijster at rc.rug.nl>
To: <vtkusers at vtk.org>
Sent: Sunday, February 08, 2004 8:51 PM
Subject: [vtkusers] How to subclass vtkInteractorStyle?




Hi,

I want to make a subclass of vtkInteractorStyle in
order to build my own interactor.

I tried:

class myInteractorStyle : public vtkInteractorStyle {
// for the time being this is empty
};

The compiler (g++) accepts this, but when I try to make
an object with

  myInteractorStyle *style = myInteractorStyle::New();

the compiler generates the following error:
  invalid conversion from `vtkInteractorStyle*' to
   myInteractorStyle*'

What am I doing wrong? Can anybody give me an example
how to make subclasses of vtkInteractorStyle? Just a
simple example which only prints to the terminal
that a mouse button was clicked would be perfect.
>From that point on I think I'll manage myself.

Regards,

  Arnold


========================================================
Arnold Meijster
Centre for High Performance Computing & Visualisation,
Nettelbosje 1,
9747 AJ Groningen, Netherlands

e-mail: a.meijster at rc.rug.nl
tel:    +31 50 363 9246
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers




More information about the vtkusers mailing list