[vtkusers] syntax question

A J lost_bits1110 at hotmail.com
Tue Jun 8 14:38:40 EDT 2004


Yes thanks tom , I've already inherited these from vtkObject,

but now this means that instead of doing

Bclass *stuff = new Bclass[ number ]

I now have to do something like

vtkBclass **stuff = vtkBclass::New() [number]

or...???

I just want a pointer to an array of vtkBclass's, not just one which would 
obviously just be
vtkBclass *stuff = vtkBclass::New();




>AJ, use Bclass' New() member function.
>
>You should derive Bclass (and Aclass, for that matter) from a
>vtkObject and it will then automagically obtain the vtkObject::New()
>member function.
>
>Also, you should make sure your vtk* objects have their constructors
>and destructors declared as protected, and additionally that the
>destructors are declared virtual.
>
>HTH,
>
>-tom
>
>  <BAY99-F504GCjNNsqlt0003748a at hotmail.com>"A J" writes:
> >Hi,
> >
> >Say I have my own classes called Aclass and Bclass
> >
> >and say I have now wrapped these to VTK classes so they are now known as
> >vtkAclass and vtkBclass
> >
> >Originally, I had:
> >
> >class Aclass
> >{
> >
> >public:
> >Bclass *stuff = new Bclass[ number ]
> >  ....
> >}
> >
> >
> >So now that Aclass has become vtkAclass and same for vtkBclass.. what is 
>the
> >syntax to do this with the New() operator that I now have to use..?  I 
>had
> >tried a few things but nothign works so far.. it must be something very
> >basic..! =S
> >
> >Thanks!!
> >
> >_________________________________________________________________
> >Watch the online reality show Mixed Messages with a friend and enter to 
>win
> >a trip to NY
> >http://www.msnmessenger-download.click-url.com/go/onm00200497ave/direct/01/
> >
> >_______________________________________________
> >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

_________________________________________________________________
Is your PC infected? Get a FREE online computer virus scan from McAfee® 
Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963




More information about the vtkusers mailing list