File: vtkfiltering_vtkalgorithm.html

package info (click to toggle)
freemat 4.2%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 141,800 kB
  • ctags: 14,082
  • sloc: ansic: 126,788; cpp: 62,046; python: 2,080; perl: 1,255; sh: 1,146; yacc: 1,019; lex: 239; makefile: 100
file content (214 lines) | stat: -rw-r--r-- 16,837 bytes parent folder | download | duplicates (2)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>FreeMat: vtkAlgorithm</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">FreeMat
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('vtkfiltering_vtkalgorithm.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">vtkAlgorithm </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Section: <a class="el" href="sec_vtkfiltering.html">Visualization Toolkit Filtering Classes</a> </p>
<h1><a class="anchor" id="Usage"></a>
Usage</h1>
<p>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.</p>
<p>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.</p>
<p>To create an instance of class vtkAlgorithm, simply invoke its constructor as follows </p>
<pre class="fragment">  obj = vtkAlgorithm
</pre> <h1><a class="anchor" id="Methods"></a>
Methods</h1>
<p>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, <code>obj</code> is an instance of the vtkAlgorithm class. </p>
<ul>
<li>
<code>string = obj.GetClassName ()</code>  </li>
<li>
<code>int = obj.IsA (string name)</code>  </li>
<li>
<code>vtkAlgorithm = obj.NewInstance ()</code>  </li>
<li>
<code>vtkAlgorithm = obj.SafeDownCast (vtkObject o)</code>  </li>
<li>
<code>int = obj.HasExecutive ()</code> - Check whether this algorithm has an assigned executive. This will NOT create a default executive.  </li>
<li>
<code>vtkExecutive = obj.GetExecutive ()</code> - Get this algorithm's executive. If it has none, a default executive will be created.  </li>
<li>
<code>obj.SetExecutive (vtkExecutive executive)</code> - 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.  </li>
<li>
<code>int = obj.ModifyRequest (vtkInformation request, int when)</code> - 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.  </li>
<li>
<code>vtkInformation = obj.GetInputPortInformation (int port)</code> - 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.  </li>
<li>
<code>vtkInformation = obj.GetOutputPortInformation (int port)</code> - 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.  </li>
<li>
<code>vtkInformation = obj.GetInformation ()</code> - Set/Get the information object associated with this algorithm.  </li>
<li>
<code>obj.SetInformation (vtkInformation )</code> - Set/Get the information object associated with this algorithm.  </li>
<li>
<code>int = obj.GetNumberOfInputPorts ()</code> - Get the number of input ports used by the algorithm.  </li>
<li>
<code>int = obj.GetNumberOfOutputPorts ()</code> - Get the number of output ports provided by the algorithm.  </li>
<li>
<code>obj.Register (vtkObjectBase o)</code> - Participate in garbage collection.  </li>
<li>
<code>obj.UnRegister (vtkObjectBase o)</code> - Participate in garbage collection.  </li>
<li>
<code>obj.SetAbortExecute (int )</code> - Set/Get the AbortExecute flag for the process object. Process objects may handle premature termination of execution in different ways.  </li>
<li>
<code>int = obj.GetAbortExecute ()</code> - Set/Get the AbortExecute flag for the process object. Process objects may handle premature termination of execution in different ways.  </li>
<li>
<code>obj.AbortExecuteOn ()</code> - Set/Get the AbortExecute flag for the process object. Process objects may handle premature termination of execution in different ways.  </li>
<li>
<code>obj.AbortExecuteOff ()</code> - Set/Get the AbortExecute flag for the process object. Process objects may handle premature termination of execution in different ways.  </li>
<li>
<code>obj.SetProgress (double )</code> - Set/Get the execution progress of a process object.  </li>
<li>
<code>double = obj.GetProgressMinValue ()</code> - Set/Get the execution progress of a process object.  </li>
<li>
<code>double = obj.GetProgressMaxValue ()</code> - Set/Get the execution progress of a process object.  </li>
<li>
<code>double = obj.GetProgress ()</code> - Set/Get the execution progress of a process object.  </li>
<li>
<code>obj.UpdateProgress (double amount)</code> - 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).  </li>
<li>
<code>obj.SetProgressText (string ptext)</code> - 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().  </li>
<li>
<code>string = obj.GetProgressText ()</code> - 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().  </li>
<li>
<code>long = obj.GetErrorCode ()</code> - The error code contains a possible error that occured while reading or writing the file.  </li>
<li>
<code>obj.SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, string name)</code> - 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.  </li>
<li>
<code>obj.SetInputArrayToProcess (int idx, int port, int connection, int fieldAssociation, int fieldAttributeType)</code> - 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.  </li>
<li>
<code>obj.SetInputArrayToProcess (int idx, vtkInformation info)</code> - 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.  </li>
<li>
<code>obj.SetInputArrayToProcess (int idx, int port, int connection, string fieldAssociation, string attributeTypeorName)</code> - 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: <pre class="fragment"> vtkDataObject::FIELD_ASSOCIATION_POINTS
 vtkDataObject::FIELD_ASSOCIATION_CELLS
 vtkDataObject::FIELD_ASSOCIATION_NONE
 vtkDataObject::FIELD_ASSOCIATION_POINTS_THEN_CELLS</pre> Attribute type is one of the following: <pre class="fragment"> vtkDataSetAttributes::SCALARS
 vtkDataSetAttributes::VECTORS
 vtkDataSetAttributes::NORMALS
 vtkDataSetAttributes::TCOORDS
 vtkDataSetAttributes::TENSORS</pre> If the last argument is not an attribute type, it is assumed to be an array name.  </li>
<li>
<code>vtkInformation = obj.GetInputArrayInformation (int idx)</code> - Get the info object for the specified input array to this algorithm  </li>
<li>
<code>obj.RemoveAllInputs ()</code> - Remove all the input data.  </li>
<li>
<code>vtkDataObject = obj.GetOutputDataObject (int port)</code> - Get the data object that will contain the algorithm output for the given port.  </li>
<li>
<code>vtkDataObject = obj.GetInputDataObject (int port, int connection)</code> - Get the data object that will contain the algorithm input for the given port and given connection.  </li>
<li>
<p class="startli"><code>obj.SetInputConnection (int port, vtkAlgorithmOutput input)</code> - 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().</p>
<p>The input for the connection is the output port of another filter, which is obtained with GetOutputPort(). Typical usage is</p>
<p class="endli">filter2-&gt;SetInputConnection(0, filter1-&gt;GetOutputPort(0)).  </p>
</li>
<li>
<p class="startli"><code>obj.SetInputConnection (vtkAlgorithmOutput input)</code> - 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().</p>
<p>The input for the connection is the output port of another filter, which is obtained with GetOutputPort(). Typical usage is</p>
<p class="endli">filter2-&gt;SetInputConnection(0, filter1-&gt;GetOutputPort(0)).  </p>
</li>
<li>
<p class="startli"><code>obj.AddInputConnection (int port, vtkAlgorithmOutput input)</code> - 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</p>
<p class="endli">filter2-&gt;AddInputConnection(0, filter1-&gt;GetOutputPort(0)).  </p>
</li>
<li>
<p class="startli"><code>obj.AddInputConnection (vtkAlgorithmOutput input)</code> - 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</p>
<p class="endli">filter2-&gt;AddInputConnection(0, filter1-&gt;GetOutputPort(0)).  </p>
</li>
<li>
<p class="startli"><code>obj.RemoveInputConnection (int port, vtkAlgorithmOutput input)</code> - 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</p>
<p class="endli">filter2-&gt;RemoveInputConnection(0, filter1-&gt;GetOutputPort(0)).  </p>
</li>
<li>
<code>vtkAlgorithmOutput = obj.GetOutputPort (int index)</code> - 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.  </li>
<li>
<code>vtkAlgorithmOutput = obj.GetOutputPort ()</code> - Get the number of inputs currently connected to a port.  </li>
<li>
<code>int = obj.GetNumberOfInputConnections (int port)</code> - Get the number of inputs currently connected to a port.  </li>
<li>
<code>int = obj.GetTotalNumberOfInputConnections ()</code> - Get the total number of inputs for this algorithm  </li>
<li>
<code>vtkAlgorithmOutput = obj.GetInputConnection (int port, int index)</code> - Get the algorithm output port connected to an input port.  </li>
<li>
<code>obj.Update ()</code> - Bring this algorithm's outputs up-to-date.  </li>
<li>
<code>obj.UpdateInformation ()</code> - Backward compatibility method to invoke UpdateInformation on executive.  </li>
<li>
<code>obj.UpdateWholeExtent ()</code> - Bring this algorithm's outputs up-to-date.  </li>
<li>
<code>obj.SetReleaseDataFlag (int )</code> - Turn release data flag on or off for all output ports.  </li>
<li>
<code>int = obj.GetReleaseDataFlag ()</code> - Turn release data flag on or off for all output ports.  </li>
<li>
<code>obj.ReleaseDataFlagOn ()</code> - Turn release data flag on or off for all output ports.  </li>
<li>
<code>obj.ReleaseDataFlagOff ()</code> - Turn release data flag on or off for all output ports.  </li>
<li>
<code>int = obj.UpdateExtentIsEmpty (vtkDataObject output)</code> - 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.  </li>
<li>
<code>int = obj.UpdateExtentIsEmpty (vtkInformation pinfo, int extentType)</code> - 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.  </li>
<li>
<code>double = obj.ComputePriority ()</code> - 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.  </li>
</ul>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="index.html">FreeMat Documentation</a></li><li class="navelem"><a class="el" href="sec_vtkfiltering.html">Visualization Toolkit Filtering Classes</a></li>
    <li class="footer">Generated on Thu Jul 25 2013 17:18:30 for FreeMat by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
  </ul>
</div>
</body>
</html>