[vtkusers] Subclassing vtkActor broken?

stoptv stoptv at gmail.com
Tue Apr 18 12:53:23 EDT 2006


On 4/18/06, Marc Cotran <marc at cotran.ca> wrote:
>
>
> I'm pretty sure you can't subclass vtkObjects like that. You need to
> include some vtk implementation details like:
>
>     vtkTypeRevisionMacro(MyActor,  vtkActor);
>
> Put the above line in your public section. Then in the implementation
> file put:
>
> vtkCxxRevisionMacro(MyActor, "1");
> vtkStandardNewMacro(MyActor);
>
> just after your headers. You may need to include vtkObjectFactory as well.
>
> I think this will solve your problem.
>
> Marc


Hmmm.. I'd be flippin' burgers if it weren't for you Marc =-)

anyway.. still no luck. I did realize I have no idea what I'm doing so I
went and read some sources,
and I've made my subclass as similar as vtkFollower (which is a working
subclass of vtkActor), but I'm
getting the same effect.

The object is there but is invisible.. it does not get rendered. I've
searched vtkuser-archives but have
found nothing new.

VTK is really very, very nice, but a bit steep I must say.
I really appreciate all the help I'm getting here!


/***  vtkPigment.h ***/

#ifndef __vtkPigment_h
#define __vtkPigment_h
#include "vtkActor.h"

class VTK_RENDERING_EXPORT vtkPigment : public vtkActor
{
public:
   vtkTypeRevisionMacro(vtkPigment,vtkActor);
   static vtkPigment *New();
protected:
   vtkPigment(){}
   ~vtkPigment(){}
};

#endif

/*** vtkPigment.cpp ***/

#include "vtkPigment.h"
#include "vtkObjectFactory.h"

vtkCxxRevisionMacro(vtkPigment, "$Revision: 1.45 $");
vtkStandardNewMacro(vtkPigment);

/*************************/


Cheers!!
--
stoptv at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060418/3b61b180/attachment.htm>


More information about the vtkusers mailing list