[vtkusers] Destructor and vector

Charles Boivin Charles.Boivin at rwdiwest.com
Thu Sep 30 11:01:12 EDT 2004


Bonjour Jerome,

Although I have never done it with vtkPlaneSource specifically, I use
the STL with VTK objects... For example, you could have a vector of
pointers to vtkPlaneSource objects like so:

std::vector< vtkPlaneSource* > vecPlaneSources;

Just make sure to instantiate things properly with the
vtkPlaneSource::New() function before pushing them on the vector, and
also, remember to call vtkPlaneSource::Delete() for each item in the
vector before clearing it. 

I do just that with other VTK objects.. works fine for me. I'd be
interested to hear if there are any potential dangers associated with
this use of the STL from some of the VTK and C++ gurus on this mailing
list, however.

Hope that helps,

Charles Boivin

>>> Jérôme Lecoq <jerome.lecoq at espci.fr> 09/30/04 08:52am >>>
I guess I found myself the answear.
the vector are simply not implemented in vtk... But will be in the
future
releases.

http://public.kitware.com/cgi-bin/vtkfaq?req=show&file=faq06.011.htp 
:
"Further integration of STL and other important C++ constructs (like
templates)" in Roadmap: What changes are being considered for VTK

and in vtkPlaneSource.h
"
vtkPlaneSource(const vtkPlaneSource&);  // Not implemented.
  void operator=(const vtkPlaneSource&);  // Not implemented."

declaration which are needed to use vector, list, stack and so on...

I'll have to find another solution...
_______________________________________________
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