From ded5c93b7fc6e92a23042edfad06e9067b7c870f Mon Sep 17 00:00:00 2001 From: Andrew Maclean <andrew.amaclean@gmail.com> Date: Sat, 17 Feb 2024 12:27:27 +1100 Subject: [PATCH] Putting in some extra "more clarifying" information --- src/PythonicAPIComments.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/src/PythonicAPIComments.md b/src/PythonicAPIComments.md index d9774079a6b..66a6878a663 100644 --- a/src/PythonicAPIComments.md +++ b/src/PythonicAPIComments.md @@ -2,7 +2,7 @@ ## Initializing a VTK Class -You can initialze the properties of a wrapped VTK class by specifying keyword arguments in the constructor. +You can initialize the properties of a wrapped VTK class by specifying keyword arguments in the constructor. | Example Name | Comments | Image | | -------------- | ---------------------- | ------- | @@ -38,7 +38,13 @@ In the case of `GetColor3d()` a `?vtkColor3d?` class is returned not a vector, t ## Multiple connections in a pipeline -A pipeline can have multiple connections: +A pipeline can have multiple connections. + +``` Python + (a, b, c) >> d >> e >> f >> g +``` + +E.g. ``` Python [vtk.?vtkSphereSource?(), vtk.?vtkSphereSource?()] >> vtk.?vtkAppendFilter?() @@ -69,16 +75,31 @@ Note: `None >> a` can also be used to clear any inputs on the filter `a`, whethe ## Multiple outputs from a pipeline -A pipeline can produce multiple outputs +A pipeline can produce multiple outputs. + +``` Python + pipeline_output = (a >> b >> c).update().output + p1 = vtkSomeClass(input_data=pipeline_output[0]) >> e >> f + p1 = vtkAnotherClass(input_data=pipeline_output[1]) >> g >> h +``` | Example Name | Comments | Image | | -------------- | ---------------------- | ------- | -[WarpCombustor](/PythonicAPI/Meshes/SolidClip) | The tuple `clipper` contains the clipped output as the first element and clipped away output is the second element. +[SolidClip](/PythonicAPI/Meshes/SolidClip) | The tuple `clipper` contains the clipped output as the first element and clipped away output is the second element. ## Updating part of a pipeline Sometimes we need to update part of a pipeline so that output can be used in other pipelines. +``` Python + a >> b >> c >> d + c.update() # At this point, a and b will also be updated. + # Use some data from c to build a new object, say v. + ... + # Then: + v >> w >> x +``` + | Example Name | Comments | Image | | -------------- | ---------------------- | ------- | [LineOnMesh](/PythonicAPI/DataManipulation/LineOnMesh) | One pipeline creates a smoothed dataset. However we need to update `smooth_loop` in the pipeline so that `?vtkCellLocator?` finds cells in order to create the spline. -- GitLab