[vtkusers] Why can we still instantiate vtkRenderWindow though it is abstract class?
wayne5ning
wayne5ning at gmail.com
Fri Apr 22 03:57:56 EDT 2011
Usually, we instantiate our window in the following way:
vtkSmartPointer<vtkRenderWindow> renderWnd = vtkRenderWindow::New();
But when I look into the declaration of vtkRenderWindow, I find that it's an
abstract class as it has pure abstract member functions like
virtual void Start() = 0;
So I'm confused because I've learned that abstract classes cannot be
instantiated, but here the instantiation succeeds.
Then when I examine the class reference of its subclass
http://www.vtk.org/doc/nightly/html/classvtkOpenGLRenderWindow.html
vtkOpenGLRenderWindow , I find this:
vtkOpenGLRenderWindow is a concrete implementation of the abstract class
vtkRenderWindow. vtkOpenGLRenderer interfaces to the OpenGL graphics
library. Application programmers should normally use vtkRenderWindow instead
of the OpenGL specific version.
The suggestion "Application programmers should normally use vtkRenderWindow
instead of the OpenGL specific version." makes me more confused.
--
View this message in context: http://vtk.1045678.n5.nabble.com/Why-can-we-still-instantiate-vtkRenderWindow-though-it-is-abstract-class-tp4332513p4332513.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list