[vtkusers] Superclass not being set correctly?

Francois Bertel francois.bertel at kitware.com
Wed Dec 2 16:54:42 EST 2009


You wrote:
 vtkTypeRevisionMacro(vtkImageCamera,vtkObject);

instead of:
 vtkTypeRevisionMacro(vtkImageCamera,vtkPhysicalCamera);


On Wed, Dec 2, 2009 at 4:50 PM, David Doria <daviddoria+vtk at gmail.com> wrote:
> I have 2 classes, vtkImageCamera that inherits from vtkPhysicalCamera -
>
> class vtkImageCamera : public vtkPhysicalCamera
>
> The PrintSelf function of the derived class is:
>
> void vtkImageCamera::PrintSelf(ostream& os, vtkIndent indent)
> {
>  this->Superclass::PrintSelf(os,indent);
>  os << "new info here.";
> }
>
> When I output the derived class, I'd expect it to first call PrintSelf
> of vtkPhysicalCamera. However, the vtkImageCamera::PrintSelf thinks
> the Superclass is vtkObject and it never calls
> vtkPhysicalCamera::PrintSelf.
>
> The output of:
> vtkstd::cout << "ImageCamera Superclass: " <<
> this->Superclass::GetClassName() << vtkstd::endl;
>
> is
> ImageCamera Superclass: vtkImageCamera
>
> Is there something that needs to be done manually to set the
> SuperClass variable to vtkPhysicalCamera?
> The vtkObject::PrintSelf function is called, but it skips the
> vtkPhysicalCamera::PrintSelf.
>
> Here is an extracted example of the problem:
> http://www.rpi.edu/~doriad/VTK_List/SuperClass/
>
> Thanks,
>
> David
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>



-- 
François Bertel, PhD  | Kitware Inc. Suite 204
1 (518) 371 3971 x113 | 28 Corporate Drive
                      | Clifton Park NY 12065, USA



More information about the vtkusers mailing list