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

Xabi Riobe xabivtk at gmail.com
Thu Mar 13 10:45:49 EDT 2014


As a side question,
I got this message during the Configure step in CMake 2.8.12.2 when adding
my test in Rendering\OpenGL\Testing\Cxx:


Data file referenced by argument

DATA{C:/Dev/vtk-gerrit/VTK/Rendering/OpenGL/Testing/Data/Baseline/TestVBOandVertexArray.png,:}

corresponds to source tree path

Rendering/OpenGL/Testing/Data/Baseline/TestVBOandVertexArray.png

that does not exist as a file (with or without an extension)!


What produces it?
I added this line in the CMakeLists.txt file:

# For tests that actually use a vtkRenderWindow
vtk_add_test_cxx(
...
TestVBOandVertexArray.cxx          <=== line added
)

and the test is correctly inserted to vtkRenderingOpenGLCxxTests.exe



2014-03-13 15:31 GMT+01:00 Xabi Riobe <xabivtk at gmail.com>:

> 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://public.kitware.com/pipermail/vtk-developers/attachments/20140313/9bccc24c/attachment-0002.html>


More information about the vtk-developers mailing list