1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273
|
Usage
vtkAlgorithm is the superclass for all sources, filters, and
sinks in VTK. It defines a generalized interface for
executing data processing algorithms. Pipeline connections
are associated with input and output ports that are
independent of the type of data passing through the
connections.
Instances may be used independently or within pipelines with
a variety of architectures and update mechanisms. Pipelines
are controlled by instances of vtkExecutive. Every
vtkAlgorithm instance has an associated vtkExecutive when it
is used in a pipeline. The executive is responsible for data
flow.
To create an instance of class vtkAlgorithm, simply invoke
its constructor as follows
obj = vtkAlgorithm
Methods
The class vtkAlgorithm has several methods that can be used.
They are listed below. Note that the documentation is
translated automatically from the VTK sources, and may not
be completely intelligible. When in doubt, consult the VTK
website. In the methods listed below, obj is an instance of
the vtkAlgorithm class.
* string = obj.GetClassName ()
* int = obj.IsA (string name)
* vtkAlgorithm = obj.NewInstance ()
* vtkAlgorithm = obj.SafeDownCast (vtkObject o)
* int = obj.HasExecutive () - Check whether this algorithm
has an assigned executive. This will NOT create a default
executive.
* vtkExecutive = obj.GetExecutive () - Get this algorithm's
executive. If it has none, a default executive will be
created.
* obj.SetExecutive (vtkExecutive executive) - Set this
algorithm's executive. This algorithm is removed from any
executive to which it has previously been assigned and
then assigned to the given executive.
* int = obj.ModifyRequest (vtkInformation request, int when)
- This method gives the algorithm a chance to modify the
contents of a request before or after (specified in the
when argument) it is forwarded. The default implementation
is empty. Returns 1 on success, 0 on failure. When can be
either vtkExecutive::BeforeForward or vtkExecutive::
AfterForward.
* vtkInformation = obj.GetInputPortInformation (int port) -
Get the information object associated with an input port.
There is one input port per kind of input to the
algorithm. Each input port tells executives what kind of
data and downstream requests this algorithm can handle for
that input.
* vtkInformation = obj.GetOutputPortInformation (int port) -
Get the information object associated with an output port.
There is one output port per output from the algorithm.
Each output port tells executives what kind of upstream
requests this algorithm can handle for that output.
* vtkInformation = obj.GetInformation () - Set/Get the
information object associated with this algorithm.
* obj.SetInformation (vtkInformation ) - Set/Get the
information object associated with this algorithm.
* int = obj.GetNumberOfInputPorts () - Get the number of
input ports used by the algorithm.
* int = obj.GetNumberOfOutputPorts () - Get the number of
output ports provided by the algorithm.
* obj.Register (vtkObjectBase o) - Participate in garbage
collection.
* obj.UnRegister (vtkObjectBase o) - Participate in garbage
collection.
* obj.SetAbortExecute (int ) - Set/Get the AbortExecute flag
for the process object. Process objects may handle
premature termination of execution in different ways.
* int = obj.GetAbortExecute () - Set/Get the AbortExecute
flag for the process object. Process objects may handle
premature termination of execution in different ways.
* obj.AbortExecuteOn () - Set/Get the AbortExecute flag for
the process object. Process objects may handle premature
termination of execution in different ways.
* obj.AbortExecuteOff () - Set/Get the AbortExecute flag for
the process object. Process objects may handle premature
termination of execution in different ways.
* obj.SetProgress (double ) - Set/Get the execution progress
of a process object.
* double = obj.GetProgressMinValue () - Set/Get the
execution progress of a process object.
* double = obj.GetProgressMaxValue () - Set/Get the
execution progress of a process object.
* double = obj.GetProgress () - Set/Get the execution
progress of a process object.
* obj.UpdateProgress (double amount) - Update the progress
of the process object. If a ProgressMethod exists,
executes it. Then set the Progress ivar to amount. The
parameter amount should range between (0,1).
* obj.SetProgressText (string ptext) - Set the current text
message associated with the progress state. This may be
used by a calling process/GUI. Note: Because
SetProgressText() is called from inside RequestData() it
does not modify the algorithm object. Algorithms are not
allowed to modify themselves from inside RequestData().
* string = obj.GetProgressText () - Set the current text
message associated with the progress state. This may be
used by a calling process/GUI. Note: Because
SetProgressText() is called from inside RequestData() it
does not modify the algorithm object. Algorithms are not
allowed to modify themselves from inside RequestData().
* long = obj.GetErrorCode () - The error code contains a
possible error that occured while reading or writing the
file.
* obj.SetInputArrayToProcess (int idx, int port, int
connection, int fieldAssociation, string name) - Set the
input data arrays that this algorithm will process.
Specifically the idx array that this algorithm will
process (starting from 0) is the array on port, connection
with the specified association and name or attribute type
(such as SCALARS). The fieldAssociation refers to which
field in the data object the array is stored. See
vtkDataObject::FieldAssociations for detail.
* obj.SetInputArrayToProcess (int idx, int port, int
connection, int fieldAssociation, int fieldAttributeType)
- Set the input data arrays that this algorithm will
process. Specifically the idx array that this algorithm
will process (starting from 0) is the array on port,
connection with the specified association and name or
attribute type (such as SCALARS). The fieldAssociation
refers to which field in the data object the array is
stored. See vtkDataObject::FieldAssociations for detail.
* obj.SetInputArrayToProcess (int idx, vtkInformation info)
- Set the input data arrays that this algorithm will
process. Specifically the idx array that this algorithm
will process (starting from 0) is the array on port,
connection with the specified association and name or
attribute type (such as SCALARS). The fieldAssociation
refers to which field in the data object the array is
stored. See vtkDataObject::FieldAssociations for detail.
* obj.SetInputArrayToProcess (int idx, int port, int
connection, string fieldAssociation, string
attributeTypeorName) - String based versions of
SetInputArrayToProcess(). Because fieldAssociation and
fieldAttributeType are enums, they cannot be easily
accessed from scripting language. These methods provides
an easy and safe way of passing association and attribute
type information. Field association is one of the
following:
vtkDataObject::FIELD_ASSOCIATION_POINTS
vtkDataObject::FIELD_ASSOCIATION_CELLS
vtkDataObject::FIELD_ASSOCIATION_NONE
vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS
Attribute type is one of the following:
vtkDataSetAttributes::SCALARS
vtkDataSetAttributes::VECTORS
vtkDataSetAttributes::NORMALS
vtkDataSetAttributes::TCOORDS
vtkDataSetAttributes::TENSORS
If the last argument is not an attribute type, it is
assumed to be an array name.
* vtkInformation = obj.GetInputArrayInformation (int idx) -
Get the info object for the specified input array to this
algorithm
* obj.RemoveAllInputs () - Remove all the input data.
* vtkDataObject = obj.GetOutputDataObject (int port) - Get
the data object that will contain the algorithm output for
the given port.
* vtkDataObject = obj.GetInputDataObject (int port, int
connection) - Get the data object that will contain the
algorithm input for the given port and given connection.
* obj.SetInputConnection (int port, vtkAlgorithmOutput
input) - Set the connection for the given input port
index. Each input port of a filter has a specific purpose.
A port may have zero or more connections and the required
number is specified by each filter. Setting the connection
with this method removes all other connections from the
port. To add more than one connection use
AddInputConnection().
The input for the connection is the output port of another
filter, which is obtained with GetOutputPort(). Typical
usage is
filter2->SetInputConnection(0, filter1->GetOutputPort(0)).
* obj.SetInputConnection (vtkAlgorithmOutput input) - Set
the connection for the given input port index. Each input
port of a filter has a specific purpose. A port may have
zero or more connections and the required number is
specified by each filter. Setting the connection with this
method removes all other connections from the port. To add
more than one connection use AddInputConnection().
The input for the connection is the output port of another
filter, which is obtained with GetOutputPort(). Typical
usage is
filter2->SetInputConnection(0, filter1->GetOutputPort(0)).
* obj.AddInputConnection (int port, vtkAlgorithmOutput
input) - Add a connection to the given input port index.
See SetInputConnection() for details on input connections.
This method is the complement to RemoveInputConnection()
in that it adds only the connection specified without
affecting other connections. Typical usage is
filter2->AddInputConnection(0, filter1->GetOutputPort(0)).
* obj.AddInputConnection (vtkAlgorithmOutput input) - Add a
connection to the given input port index. See
SetInputConnection() for details on input connections.
This method is the complement to RemoveInputConnection()
in that it adds only the connection specified without
affecting other connections. Typical usage is
filter2->AddInputConnection(0, filter1->GetOutputPort(0)).
* obj.RemoveInputConnection (int port, vtkAlgorithmOutput
input) - Remove a connection from the given input port
index. See SetInputConnection() for details on input
connection. This method is the complement to
AddInputConnection() in that it removes only the
connection specified without affecting other connections.
Typical usage is
filter2->RemoveInputConnection(0, filter1->GetOutputPort
(0)).
* vtkAlgorithmOutput = obj.GetOutputPort (int index) - Get a
proxy object corresponding to the given output port of
this algorithm. The proxy object can be passed to another
algorithm's SetInputConnection(), AddInputConnection(),
and RemoveInputConnection() methods to modify pipeline
connectivity.
* vtkAlgorithmOutput = obj.GetOutputPort () - Get the number
of inputs currently connected to a port.
* int = obj.GetNumberOfInputConnections (int port) - Get the
number of inputs currently connected to a port.
* int = obj.GetTotalNumberOfInputConnections () - Get the
total number of inputs for this algorithm
* vtkAlgorithmOutput = obj.GetInputConnection (int port, int
index) - Get the algorithm output port connected to an
input port.
* obj.Update () - Bring this algorithm's outputs up-to-date.
* obj.UpdateInformation () - Backward compatibility method
to invoke UpdateInformation on executive.
* obj.UpdateWholeExtent () - Bring this algorithm's outputs
up-to-date.
* obj.SetReleaseDataFlag (int ) - Turn release data flag on
or off for all output ports.
* int = obj.GetReleaseDataFlag () - Turn release data flag
on or off for all output ports.
* obj.ReleaseDataFlagOn () - Turn release data flag on or
off for all output ports.
* obj.ReleaseDataFlagOff () - Turn release data flag on or
off for all output ports.
* int = obj.UpdateExtentIsEmpty (vtkDataObject output) -
This detects when the UpdateExtent will generate no data
This condition is satisfied when the UpdateExtent has zero
volume (0,-1,...) or the UpdateNumberOfPieces is 0. The
source uses this call to determine whether to call
Execute.
* int = obj.UpdateExtentIsEmpty (vtkInformation pinfo, int
extentType) - This detects when the UpdateExtent will
generate no data This condition is satisfied when the
UpdateExtent has zero volume (0,-1,...) or the
UpdateNumberOfPieces is 0. The source uses this call to
determine whether to call Execute.
* double = obj.ComputePriority () - Returns the priority of
the piece described by the current update extent. The
priority is a number between 0.0 and 1.0 with 0 meaning
skippable (REQUEST_DATA not needed) and 1.0 meaning
important.
* FreeMat_Documentation
* Visualization_Toolkit_Filtering_Classes
* Generated on Thu Jul 25 2013 17:18:30 for FreeMat by
doxygen_ 1.8.1.1
|