Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document object identity behavior matching VTK #351

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions docs/source/tvtk/README.txt
Expand Up @@ -198,6 +198,27 @@ Note that the complete state of the underlying C++ object is
impossible to represent in the Python world since this usually
involves various pointers to other C++ objects.

It is also important to consider that the identity of objects
is preserved according to the VTK behavior. For example, in the
following code, the default object created by the VTK implementation of
`GetLines()` is the same for any vtkPolyData::

>>> data1 = vtk.vtkPolyData()
>>> data2 = vtk.vtkPolyData()
>>> data1.GetLines()
(vtkCellArray)0x103b52e30
>>> data2.GetLines()
(vtkCellArray)0x103b52e30

The equivalent tvtk code behaves in the same way::

>>> data1 = tvtk.PolyData()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops ignore my comment

>>> data2 = tvtk.PolyData()
>>> data1.lines
<tvtk.tvtk_classes.cell_array.CellArray at 0xe11e570>
>>> data2.lines
<tvtk.tvtk_classes.cell_array.CellArray at 0xe11e570>


The wrapped VTK object
-----------------------
Expand Down