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

Xabi Riobe xabivtk at gmail.com
Tue Jun 10 04:52:37 EDT 2014


Hi,
if everyone else want to be a reviewer of this, feel free to take a look at
it:
http://review.source.kitware.com/#/t/4069/


2014-03-18 17:32 GMT+01:00 Xabi Riobe <xabivtk at gmail.com>:

> Great!
> Thank you David for your help.
>
>
> 2014-03-18 15:47 GMT+01:00 David E DeMarle <dave.demarle at kitware.com>:
>
> If the test doesn't do an image comparison, tell cmake about it like so:
>>
>> vtk_add_test_cxx(name.cxx [NO_DATA] [NO_VALID] [NO_OUTPUT])
>> NO_DATA indicates that this test doesn't require any input data files
>> --> NO_VALID indicates that this test doesn't compare results against
>> baseline images
>> NO_OUTPUT indicates that the test doesn't produce any output files
>>
>> (for more details see the vtk software process document)
>>
>> hth
>>
>> David E DeMarle
>> Kitware, Inc.
>> R&D Engineer
>> 21 Corporate Drive
>> Clifton Park, NY 12065-8662
>> Phone: 518-881-4909
>>
>>
>> On Tue, Mar 18, 2014 at 10:35 AM, Xabi Riobe <xabivtk at gmail.com> wrote:
>>
>>> Thanks David!
>>>
>>> Currently my test is only about rendering speed acceleration, and not
>>> for the resulting image.
>>> So I do not need vtkRegressionTestImage. But after reading your link, I
>>> assume I *have to* generate one?
>>>
>>> I will try to add it, but by curiosity is there another command
>>> than vtk_add_test_cxx to put in CMakeLists.txt to get rid of the regression
>>> test, or every OpenGL test must come with an image?
>>>
>>>
>>> 2014-03-18 14:11 GMT+01:00 David E DeMarle <dave.demarle at kitware.com>:
>>>
>>> This warning comes from the new way (starting in 6.1) in which
>>>> regression tests get their data.
>>>>
>>>> Move the regression test baseline image into:
>>>> C:/Dev/vtk-gerrit/VTK/Rendering/OpenGL/Testing/Data/Baseline/
>>>> TestVBOandVertexArray.png
>>>>
>>>> Run cmake, that will replace the above file with:
>>>> C:/Dev/vtk-gerrit/VTK/Rendering/OpenGL/Testing/Data/Baseline/
>>>> TestVBOandVertexArray.png.md5
>>>> And move the original into the bowels of git for safe keeping.
>>>>
>>>> Now when you push to gerrit the regression test image and the
>>>> corresponding source code get committed together.
>>>>
>>>> See http://www.vtk.org/Wiki/VTK/Git/Develop/Data
>>>> for more details.
>>>>
>>>>
>>>> David E DeMarle
>>>> Kitware, Inc.
>>>> R&D Engineer
>>>> 21 Corporate Drive
>>>> Clifton Park, NY 12065-8662
>>>> Phone: 518-881-4909
>>>>
>>>>
>>>> On Thu, Mar 13, 2014 at 10:45 AM, Xabi Riobe <xabivtk at gmail.com> wrote:
>>>>
>>>>> 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);
>>>>>> }
>>>>>>
>>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Powered by www.kitware.com
>>>>>
>>>>> Visit other Kitware open-source projects at
>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>
>>>>> Follow this link to subscribe/unsubscribe:
>>>>> http://www.vtk.org/mailman/listinfo/vtk-developers
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtk-developers/attachments/20140610/08254890/attachment-0001.html>


More information about the vtk-developers mailing list