1. 17 Feb, 2016 1 commit
    • David Gobbi's avatar
      15995: Implement C++ templates as Python modules. · 67eb4fc5
      David Gobbi authored
      The help() function was not working on wrapped class templates, so the
      PyVTKTemplate type has been re-imagined as a module that contains the
      instantiations of the template, since the help() function works with
      module docstrings. PyVTKTemplate still supports the mapping protocol
      as before, which allows lookup of the instantiated templates via the
      template arguments.
      67eb4fc5
  2. 11 Feb, 2016 1 commit
  3. 09 Feb, 2016 1 commit
  4. 31 Jan, 2016 1 commit
  5. 28 Jan, 2016 1 commit
    • David Gobbi's avatar
      Fix wrapping pointer parameters with default value 0. · fcd2ac5a
      David Gobbi authored
      When the python wrappers were wrapping a pointer parameter with a default
      value of null, e.g. func(int *x=0), then if no parameter was passed then
      the underlying C++ function would receive an uninitialized array rather
      a null pointer.
      
      In addition, the SaveArray() and ArrayHasChanged() methods that the python
      wrappers use when wrapping non-const pointers and arrays would overflow
      when the array size was zero.
      fcd2ac5a
  6. 25 Jan, 2016 1 commit
    • David Gobbi's avatar
      Add a vtkImagePointIterator class. · f7fb4c66
      David Gobbi authored
      Given an image, the vtkImagePointIterator will iterate through the
      image point-by-point and efficiently provide the current position in
      both (x,y,z) data coordinates and (i,j,k) structured coordinates. If
      a stencil is provided, then it is possible to check whether the current
      point is in the stencil.
      
      The superclass, vtkImagePointDataIterator, iterates through the data
      span-by-span for efficiency.  For each span, it provides the point id
      for the beginning of the span, and the length of the span.  This makes
      it useful for iterating through the point attributes when the actual
      point coordinates are not important.
      f7fb4c66
  7. 22 Jan, 2016 1 commit
  8. 14 Jan, 2016 1 commit
    • David Gobbi's avatar
      Make wrappers guess type of NULL as nullptr_t. · 2941cb4c
      David Gobbi authored
      When the wrappers encounter NULL in a header file, specifically in the case
      of "#define something NULL", it now treated as a value of type nullptr_t,
      similar to nullptr itself.  This ensures that NULL will not be wrapped as
      int, even if it is defined to be 0.
      2941cb4c
  9. 04 Jan, 2016 1 commit
    • Sean McBride's avatar
      Fixed a bunch of clang-tidy misc-macro-parentheses warnings · a595ab8e
      Sean McBride authored
      This tool warns where macros should be using parens.
      Fixed many issues it pointed out by either:
       - adding parens (which it can do automatically)
       - removed unused (or rarely used) macros
       - replacing macros with functions, notably vtkMath stuff
      a595ab8e
  10. 21 Dec, 2015 3 commits
    • David Gobbi's avatar
      Remove some doxygen commands when formatting comments. · 1064b4ee
      David Gobbi authored
      The @brief doxygen command is out of place in the python docstrings, and
      can be removed.  Several other commands, like @param, are left in because
      they are informative and the purpose of the comment is lost if they are
      removed.
      1064b4ee
    • David Gobbi's avatar
      Apply doxygen class docs to python wrapping. · 9df72c1f
      David Gobbi authored
      Previously, the class docstrings were generated from the .SECTION commands
      in the file documentation.  Now, the doxygen class documentation will be
      used if they are present and the .SECTION commands are absent.
      9df72c1f
    • David Gobbi's avatar
      Read all doxygen comments from headers. · 53a763d4
      David Gobbi authored
      With this change, all doxygen comments are read from the headers, including
      trailing comments (//!<) and comments that do not appear immediately before
      the item they apply too (e.g. comments with \class).  Comment groups are not
      not handled.
      53a763d4
  11. 20 Dec, 2015 1 commit
    • David Gobbi's avatar
      Add preliminary doxygen comment handling for wrappers. · 0b77535e
      David Gobbi authored
      This change allows the wrappers to recognize and use some doxygen comments,
      in the same way that they can recognize VTK's "// Description:" comments.
      Currently, doxygen comments are only passed through to python docstrings for
      methods, not for classes.
      0b77535e
  12. 18 Dec, 2015 1 commit
  13. 14 Dec, 2015 1 commit
  14. 08 Dec, 2015 2 commits
    • Brad King's avatar
      Drop support for compilers without `long long` · 3b89e771
      Brad King authored
      VTK no longer supports any compilers that do not provide this type.
      Therefore all code conditional on VTK_TYPE_USE_LONG_LONG can be made
      unconditional.  Leave the macro defined to tell dependent projects that
      APIs using the type are available in case they still support versions of
      VTK that make it conditional.
      3b89e771
    • Brad King's avatar
      Drop support for compilers with `__int64` as the only 64-bit int · 36bb09a7
      Brad King authored
      VTK no longer supports any compilers that have `__int64` but not a
      `long` or `long long` that is 64-bit.  Therefore all code that is
      conditional on VTK_TYPE_USE___INT64 is never used and can be dropped.
      36bb09a7
  15. 01 Dec, 2015 1 commit
    • David Gobbi's avatar
      Fix bug for parsing backslash in string literal. · db20eb75
      David Gobbi authored
      The string and char literals had a mistake that caused a mis-parse if
      a backslash appeared before the terminating quote.  The new patterns
      fix the bug, and also allow for multi-line string literals.
      db20eb75
  16. 10 Nov, 2015 1 commit
  17. 05 Nov, 2015 3 commits
  18. 28 Oct, 2015 2 commits
  19. 21 Oct, 2015 1 commit
  20. 18 Oct, 2015 3 commits
    • David Gobbi's avatar
      Add C++14 header support to wrappers. · ae0a8037
      David Gobbi authored
      This patch adds support for parsing headers that have various features
      that were introduced in the C++14 standard:
      1) binary literals
      2) digit separators in numeric literals
      3) variable templates
      4) "typename" instead of "class" in templated template parameters
      
      It also introduces a proposed C++17 feature:
      5) the u8 prefix for character literals
      ae0a8037
    • David Gobbi's avatar
      Add evaluation of unicode char literals. · 987d98dd
      David Gobbi authored
      The wrapper's char literal evaluator did not recognize the 'u' and U'
      escape codes or evaluate utf-8 encoded char constants.  Also, the
      CPRE_IDGIT character type has been split into CPRE_XID (which allows
      non-ASCII chars) and CPRE_XDIGIT (which is restricted to ASCII).
      987d98dd
    • David Gobbi's avatar
      Fix evaluation of char literals with escape codes. · 2318e520
      David Gobbi authored
      The char pointer was not being advanced, leading to incorrect evaluation
      and a false syntax error.  Also, octal and hexadecimal escape codes were
      not evaluated with the correct signedness.
      2318e520
  21. 12 Oct, 2015 1 commit
  22. 10 Oct, 2015 1 commit
    • David Gobbi's avatar
      Ignore more typedefs for anonymous structs. · 6cb06ace
      David Gobbi authored
      This is for code where the typedef modifier does not come first, e.g.
          struct { ... } typedef mytype;
      It causes such typefs to be ignored because vtkParse.y is currently
      unable to properly deal with anonymous structs.  Note that the more
      common "typedef struct { ... } mytype;" is already treated the same.
      6cb06ace
  23. 26 Sep, 2015 1 commit
  24. 22 Sep, 2015 3 commits
    • David Gobbi's avatar
      Wrap many more classes with python. · e6f75b9a
      David Gobbi authored
      This makes the python wrappers ignore WRAP_EXCLUDE, and instead use
      the new property WRAP_EXCLUDE_PYTHON that excludes fewer classes.
      The WRAP_SPECIAL flag, which used to act as a whitelist for python,
      has been removed.
      
      Because this change causes classes to be wrapped in python by default,
      some third-party VTK packages might break until they modify their own
      CMakeLists.txt files to add WRAP_EXCLUDE_PYTHON where necessary.
      e6f75b9a
    • David Gobbi's avatar
      Ensure that entries in hierarchy file are unique. · 77f7a0dd
      David Gobbi authored
      Previously, it only checked whether the entire line in the file was
      unique.  Instead, it should verify that the entry itself is unique.
      This became an issue in some C headers that had declarations of the
      form "typedef struct X {} X;", causing X to appear both as a typedef
      and as a class type.
      77f7a0dd
    • David Gobbi's avatar
      Ensure that stream operator parameter is const. · 21224324
      David Gobbi authored
      The python wrappers cannot successfully wrap a C++ stream operator
      if the second parameter (i.e. the object to be printed) is a non-const
      reference.
      21224324
  25. 24 Aug, 2015 1 commit
  26. 20 Aug, 2015 1 commit
    • Brad King's avatar
      ENH: Remove use of include <vtksys/ios/*> and vtksys_ios::* · 3ae7dd3a
      Brad King authored
      We no longer need this compatibility layer for the compilers we support.
      Use the following commands to switch to standard header and namespace:
      
       git grep -l vtksys/ios/ | xargs sed -i 's|vtksys/ios/||'
       git grep -l vtksys_ios | xargs sed -i 's|vtksys_ios|std|g'
      3ae7dd3a
  27. 10 Aug, 2015 1 commit
    • David Gobbi's avatar
      Add a python function to check buffer equivalence. · 8320da24
      David Gobbi authored
      The python "buffer" and "memoryview" objects do not expose the pointer
      to the underlying memory, they only expose the contents of the memory.
      Likewise, if you check (buffer1 == buffer2) within python, then python
      will iterate through both buffers to see if they have the same contents!
      After all, for python, that's how equality is defined for sequence types.
      
      This commit adds a method called buffer_shared(ob1, ob2) that checks to
      see if two objects (e.g. arrays) expose the same block of memory via
      their buffer interface.  It assumes that the "buf" pointer is the lowest
      address of the buffer (i.e. the strides must be non-negative).
      
      It also adds two changes to dataset_adapter.py:
      1) The adapter now uses buffer_shared() instead of using "==" to compare
      buffers, because as stated above "==" does the wrong thing.
      2) It repairs an infinite recursion where __getattr__ called hasattr().
      The infinite recursion was caught silently by hasattr() itself in python2,
      but is exposed as a RuntimeError in python3.
      8320da24
  28. 06 Aug, 2015 3 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
    • David Gobbi's avatar
      Provide py3k module initialization. · f2aebb86
      David Gobbi authored
      This changes the return value of the "real_init" function from void
      to PyObject *, in accordance with the new PyInit method.
      f2aebb86