[vtk-developers] Python and the function GetParametricCoords()

Andrew Maclean andrew.amaclean at gmail.com
Mon Feb 19 02:53:31 EST 2018


David,

Thankyou so much for such a quick response!
Please see my comments on the MR. Only the first point is being returned,
maybe the VTK_SIZEHINT() has to be applied in all the subclasses? There is
a little Python script there that may be useful for testing since it is
never tested in CTest.

This is tested in Cxx but has never been tested using Python.

Regards
   Andrew

Andrew Maclean

On Mon, 19 Feb 2018, 10:53 David Gobbi <david.gobbi at gmail.com> wrote:

> Hi Andrew,
>
> It's missing a size hint for the wrappers, it should be declared like this:
>
> virtual double *GetParametricCoords() VTK_SIZEHINT(3);
>
> I've submitted an MR:
> https://gitlab.kitware.com/vtk/vtk/merge_requests/3944
> It's strange, it never had a hint in the old "hints" file, either.
>
>  - David
>
> On Sun, Feb 18, 2018 at 3:20 PM, Andrew Maclean <andrew.amaclean at gmail.com
> > wrote:
>
>> I was looking at converting Bill's excellent example:
>> https://lorensen.github.io/VTKExamples/site/Cxx/GeometricObjects/IsoparametricCellsDemo/
>> into Python but I have run into a problem with respect to
>>  GetParametricCoords()
>>
>> It seems to return a void pointer not an expected tuple even though the
>> example below is a primary cell.
>>
>> There are no tests in the Python tests for GetParametricCoords() yet it
>> is wrapped Ok as far as I can see. Does anyone have a solution?
>>
>> Here is some test code that illustrates the problem:
>>
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>>
>> import vtk
>>
>>
>> def main():
>>     xx = vtk.vtkQuadraticEdge()
>>     print('Is it a primary cell?', xx.IsPrimaryCell())
>>     # help(vtk.vtkQuadraticEdge.GetBounds)
>>     # help(vtk.vtkQuadraticEdge.GetParametricCoords)
>>     # print(dir(vtk.vtkQuadraticEdge))
>>     pcoords = xx.GetParametricCoords()
>>     #  Here we expect a tuple of nine floats.
>>     print('pcoords:', pcoords)
>>     # GetBounds() works.
>>     bounds = xx.GetBounds()
>>     print('bounds:', bounds)
>>
>>
>> if __name__ == '__main__':
>>     main()
>>
>>
>>
>>
>> --
>> ___________________________________________
>> Andrew J. P. Maclean
>>
>> ___________________________________________
>>
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Search the list archives at: http://markmail.org/search/?q=vtk-developers
>>
>> Follow this link to subscribe/unsubscribe:
>> https://vtk.org/mailman/listinfo/vtk-developers
>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtk-developers/attachments/20180219/dd06f1f6/attachment.html>


More information about the vtk-developers mailing list