1. 06 Jul, 2016 1 commit
    • David Gobbi's avatar
      BUG 16054: Reduce chance of mistaken swig pointer string. · 66c211a7
      David Gobbi authored
      In the Python wrappers, the vtkDataArray::SetVoidArray() method can take
      two kinds of arguments:
      
      1) a string formatted as a swig pointer "_addr_type" where "addr" is
      the hexadecimal address and "type" is the type, e.g. "p_void".
      
      2) a Python buffer object (any Python object with buffer protocol)
      
      A Python string (in Python 2) is also a buffer object, therefore there
      is some ambiguity.  The use of swig pointers with VTK is exceedingly
      rare, so this fix requires that the string exactly matches the format
      "_addr_p_void" to be interpreted as a swig pointer.
      
      Note that in Python 3, the ambiguity disappears because a string in Py3K
      does not have the buffer protocol.
      66c211a7
  2. 10 Aug, 2015 1 commit
    • David Gobbi's avatar
      Fix typo PYTHON_VERSION_HEX to PY_VERSION_HEX · d6f7466d
      David Gobbi authored
      A typo in vtkPythonArgs.cxx resulted in the use of a "char *" from a
      deleted Python object.  I've fixed the typo and have completely
      removed the code that can give rise to the invalid pointer.
      
      This commit also changes a BuildBytes to actually build a Bytes object
      on Python 3 (it was building a string).
      
      Under Python 3.2, the default locale encoding will be used for 8-bit
      strings rather than utf8 (similar to Python 2).  It wasn't until 3.3
      that unicode objects kept a cached copy of the utf8 string.
      d6f7466d
  3. 06 Aug, 2015 2 commits
    • David Gobbi's avatar
      Python API compatibility for py3k. · d3eb4043
      David Gobbi authored
      This is a large change that adds conditional compilation to support
      both python 2 and python 3.  The header vtkPythonCompatibility.h
      does a lot of the necessary work:
      1) PyInt is redefined to PyLong for py3k
      2) PyString is redefied to PyUnicode for py3k
      3) PyBytes is redefined to PyString for python 2
      d3eb4043
    • David Gobbi's avatar
      Add the new py3k buffer interface. · 16bb32d4
      David Gobbi authored
      Python 3 introduced a multi-dimensional buffer interface, which was
      backported to Python 2.6 and Python 2.7.
      16bb32d4
  4. 28 Jul, 2015 1 commit
  5. 26 Jul, 2015 1 commit
    • David Gobbi's avatar
      Make python enum type objects static. · 41c65801
      David Gobbi authored
      This was the last generated type object that was exported.  Now that
      it is static, the wrapper-specific import/export macros are no longer
      needed.
      41c65801
  6. 23 Jul, 2015 5 commits
  7. 01 Dec, 2014 1 commit
    • David Gobbi's avatar
      Add an enum type to the python wrappers. · ba693ade
      David Gobbi authored
      Any enum types that are encountered will automatically be wrapped
      as integral types.  This is true for enum types defined in the global
      namespace, and enum types defined within a wrapped class.  Other
      namespaces are not yet supported, because the python wrappers do not
      yet wrap C++ namespaces.
      
      When a class method has an enum parameter, and if the enum is a member
      of the class, then that method will perform type checking on the enum.
      Class methods that require enums that are not members of the class will
      not be wrapped (in future versions of the wrappers, they might).
      
      Change-Id: If38391de8a1a66eb255ddf83a72916af6d81dc78
      ba693ade
  8. 03 Oct, 2014 1 commit
    • David Gobbi's avatar
      12098: Mangle void_p like other swig pointers. · e12eb1f4
      David Gobbi authored
      When vtk-python returns a "void *", it passes it as a swig-style
      pointer string _0acd876f_void_p which was valid for swig 1.0, but
      modern swig requires _0acd876f_p_void instead.
      
      Change-Id: Ic58e66581b7bc56c04e91ec0060b63a8c8e4e445
      e12eb1f4
  9. 08 Sep, 2014 1 commit
    • David Gobbi's avatar
      Replace python mutable with its value in GetValue(). · ab5b27f9
      David Gobbi authored
      The "vtk.mutable" object is used to pass a python object to a C++
      method that requires a reference argument.  Essentially, vtk.mutable
      is a simple container for numeric types and strings, so that the C++
      method can modify the contents and hence return an argument by
      reference.  Somewhere during the wrapper update that occurred a few
      years ago, the code that extracted the value from the vtk.mutable was
      lost from the wrappers.  The vtk.mutable object still worked when it
      was a container for numeric values (since it supports the number
      protocol), but at that time it stopped working for strings.
      
      Change-Id: I781a3ada1120143c9159968733997bf811fb6d90
      ab5b27f9
  10. 04 Jun, 2014 1 commit
  11. 20 Nov, 2013 1 commit
  12. 12 Nov, 2013 1 commit
    • David Gobbi's avatar
      Consolidate the new python pointer-wrapping code. · fa15dcde
      David Gobbi authored
      Use the python array parameter wrapping code to handle POD pointer
      parameters, rather than using code that is POD-pointer specific.
      This makes wrapped pointers behave exactly the same as wrapped arrays,
      except the way that the size is set for pointers.  This patch also
      adds a test for the wrapped pointers.
      
      Change-Id: I5b69606a95d94e03b53530f059c1d1e6b0921ce1
      fa15dcde
  13. 18 Oct, 2013 1 commit
    • Ben Boeckel's avatar
      Wrap methods with POD pointer arguments in Python · cce489ec
      Ben Boeckel authored
      Support wrapping parameters in Python which are pointers to POD types.
      These parameters are passed using memory managed by a vector of the base
      POD type (except bool since its memory layout is not compatible with
      bool* semantics) so that no memory is leaked. The size is obtained from
      the passed-in argument, not any size argument which the C++ code may
      use, so Python code must be careful to match where necessary.
      
      Change-Id: I8c85baf76374ecaa5a65348c998db8f56941dc86
      cce489ec
  14. 12 Sep, 2013 1 commit
  15. 22 Mar, 2013 1 commit
    • Marcus D. Hanwell's avatar
      Move the Python wrapping to the end · 34903fe1
      Marcus D. Hanwell authored
      This moves the Python wrapping to the end of the build process, using
      the information exported by the module files.
      
      Change-Id: I711382f79fc1fdb15cd80c87f55dd2f97a2c5cd8
      34903fe1
  16. 31 Oct, 2012 1 commit
    • David Gobbi's avatar
      Change python arg float-to-int conversion to python 2.7 style. · 7b53f28e
      David Gobbi authored
      In Python 2.3 through 2.6, if a method that expected an integer
      parameter was given a float, then a DeprecationWarning was printed.
      In Python 2.7, a ValueError exception occurs instead.  This patch
      causes the vtk python wrappers to follow the python 2.7 behavior:
      If a VTK method expects an int but is given a float, an exception
      will occur.
      
      The rationale for this change was that it is very difficult to find
      out what python code is causing the "deprecation warning", because
      it does not print the method or line number.  If an exception is
      generated, the the user sees a stack trace and can therefore easily
      fix the python code.
      
      Change-Id: I11f0efb506884fc4eedae84bb251b10102daae48
      7b53f28e
  17. 14 Jun, 2012 1 commit
  18. 09 Apr, 2012 1 commit
    • VTK Developers's avatar
      Modularize VTK tree layout · cdd4d6fd
      VTK Developers authored and Brad King's avatar Brad King committed
      Move source files from their former monolithic VTK location to their new
      location in modular VTK without modification.  This preserves enough
      information for "git blame -M" and "git log --follow" to connect
      modularized VTK files to their original location and history.
      
      Co-Author: Marcus D. Hanwell <marcus.hanwell@kitware.com>
      Co-Author: Chris Harris <chris.harris@kitware.com>
      Co-Author: Brad King <brad.king@kitware.com>
      Co-Author: Nikhil Shetty <nikhil.shetty@kitware.com>
      cdd4d6fd
  19. 16 Nov, 2011 1 commit
  20. 14 Sep, 2011 1 commit
  21. 25 Jul, 2011 1 commit
  22. 18 Jul, 2011 1 commit
  23. 30 May, 2011 1 commit
    • David Gobbi's avatar
      ENH: Wrap templated types in python. · 7cf3539a
      David Gobbi authored
      This patch wraps vtkVector, vtkRect, and vtkColor, vtkDenseArray,
      and vtkSparseArray and makes them usable from python.  These objects
      can be instantiated by including the template args in square brackets,
      e.g. vtkVector['float32',3](), or by using the specializations that
      have already been provided in C++ such as vtkVector3f.
      
      Change-Id: I5304da8409de67bd104bf75d52b9af7462705099
      7cf3539a
  24. 18 May, 2011 1 commit
  25. 07 May, 2011 1 commit
  26. 22 Apr, 2011 1 commit
  27. 06 Oct, 2010 1 commit
  28. 05 Oct, 2010 2 commits
  29. 04 Oct, 2010 2 commits
  30. 02 Oct, 2010 3 commits
  31. 01 Oct, 2010 1 commit