[vtk-developers] Factory issue for new VBO and VertexArray painters

Xabi Riobe xabivtk at gmail.com
Thu Mar 13 10:31:53 EDT 2014


Hi,
I have a set of painter classes using VBO (adapted from VTKEdge) and
VertexArrays that i'm willing to share via gerrit, but there is an issue i
would like to resolve before, in order to add the test class.

Currently i use them with vtk 5.10.1, and i have a rendering factory to
instantiate them instead of vtkPolygonsPainter, vtkLinesPainter
and vtkTStripsPainter.

but with vtk 6.1, the factory mechanism has changed and i can not manage to
make it work properly. So i first try to localy test my classes with the
new version by incorporating them directly in
vtkRenderingOpenGLObjectFactory, adding these lines in
Rendering\OpenGL\CMakeLists.txt :

list(APPEND vtk_module_overrides "vtkPolygonsPainter")
set(vtk_module_vtkPolygonsPainter_override
"vtkOpenGLVertexArrayPolygonsPainter")

Runing my test in debug, i can see that the class is added in the factory,
but when the vtkChooserPainter creates the vtkPolygonsPainter, my own class
is not instantiated, nor it is if i directly call vtkPolygonsPainter::New()
in the test.

Is there something else i am missing to use my class in a factory with vtk
6.1?

Thanks


extract from my own factory code:

class vtkRenderingVertexArrayFactory
   : public vtkObjectFactory
{
public:
   static vtkRenderingVertexArrayFactory* New();
   vtkTypeMacro(vtkRenderingVertexArrayFactory, vtkObjectFactory);
   static void RegisterFactory();
protected:
   vtkRenderingVertexArrayFactory();
private:
   vtkRenderingVertexArrayFactory(const vtkRenderingVertexArrayFactory&);
// Not implemented.
   void operator=(const vtkRenderingVertexArrayFactory&); // Not
implemented.
};

vtkStandardNewMacro(vtkRenderingVertexArrayFactory);

VTK_FACTORY_INTERFACE_IMPLEMENT(vtkRenderingVertexArrayFactory);

VTK_CREATE_CREATE_FUNCTION(vtkOpenGLVertexArrayPolygonsPainter);

vtkRenderingVertexArrayFactory::vtkRenderingVertexArrayFactory()
{
   this->RegisterOverride("vtkPolygonsPainter",
                          "vtkOpenGLVertexArrayPolygonsPainter",
                          "Override for vtkRenderingOpenGL module",
                          1,

vtkObjectFactoryCreatevtkOpenGLVertexArrayPolygonsPainter);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20140313/22b6861c/attachment-0001.html>


More information about the vtk-developers mailing list