Skip to content
Snippets Groups Projects
Forked from VTK / VTK
36113 commits behind the upstream repository.
David Gobbi's avatar
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
History

VTK - The Visualization Toolkit

Introduction

VTK is an open-source software system for image processing, 3D graphics, volume rendering and visualization. VTK includes many advanced algorithms (e.g., surface reconstruction, implicit modelling, decimation) and rendering techniques (e.g., hardware-accelerated volume rendering, LOD control).

VTK is used by academicians for teaching and research; by government research institutions such as Los Alamos National Lab in the US or CINECA in Italy; and by many commercial firms who use VTK to build or extend products.

The origin of VTK is with the textbook "The Visualization Toolkit, an Object-Oriented Approach to 3D Graphics" originally published by Prentice Hall and now published by Kitware, Inc. (Third Edition ISBN 1-930934-07-6). VTK has grown (since its initial release in 1994) to a world-wide user base in the commercial, academic, and research communities.

Learning Resources

Reporting Bugs

If you have found a bug:

  1. If you have a patch, please read the CONTRIBUTING.md document.

  2. Otherwise, please join the one of the VTK Mailing Lists and ask about the expected and observed behaviors to determine if it is really a bug.

  3. Finally, if the issue is not resolved by the above steps, open an entry in the VTK Issue Tracker.

Contributing

See CONTRIBUTING.md for instructions to contribute.

License

VTK is distributed under the OSI-approved BSD 3-clause License. See Copyright.txt for details.