<br><div class="gmail_quote">On Sun, Nov 1, 2009 at 11:35 AM, David Doria <span dir="ltr"><<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
1) At the beginning of a RequestData function for a filter, this is typically the first thing:<br><br>  // get the info object<br>  vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);<br><br>  // get the input<br>

  vtkPolyData *input = vtkPolyData::SafeDownCast(<br>                                                 inInfo->Get(vtkDataObject::DATA_OBJECT()));<br><br>If there are multiple inputs, do I need to do:<br>  vtkInformation *inInfo = inputVector[0]->GetInformationObject(1); //1 instead of 0 here? Or should it be inputVector[1]?<br>


<br>
  // get the second input input<br>
  vtkPolyData *input1 = vtkPolyData::SafeDownCast(<br>
                                                 inInfo->Get(vtkDataObject::DATA_OBJECT()));<br>
<br>to get the second input? Is there a way to access the inputs by a name instead of depending on the order? That is, instead of saying first input, second input, etc, can you say MyBigInput, MyOtherInput so the order does not matter?<br>
</blockquote><div><br></div><div>They must always be accessed by index, there is no way to "name" the port. Several classes have convenience methods for setting the input externally (or input connection) such as</div>
<div><br></div><div>void SetGlyphInput(vtkPolyData* input);</div><div>void SetGlyphInputConnection(vtkAlgorithmOutput* connection);</div><div><br></div><div>These just call SetInput/Connection with the appropriate index. You can always add even more syntactic sugar to help yourself out, like an enum in the class:</div>
<div><br></div><div>enum {</div><div>  BIG_INPUT = 0,</div><div>  OTHER_INPUT = 1</div><div>};</div><div><br></div><div>so that your code looks a bit cleaner when you are referring to input indices.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>2) In my FillInputPortInformation function, I have been doing: (for a filter with 4 inputs)<br><br>  if (!this->Superclass::FillInputPortInformation(port, info))<br>    {<br>    return 0;<br>    }<br>  if ( port >= 0 && port <=3 )<br>

    {<br>    info->Set( vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData" );<br>    return 1;<br>    }<br><br>It seems that 'port' is never used anywhere - is this the correct way to tell the pipeline the type of the 4 inputs? Is the correct 'info' object automatically passed when the FillInputPortInformation function is called with the corresponding port number?<br>
</blockquote><div><br></div><div>What you have looks fine. Yes, it is called with a different vtkInformation for each port, so that's all you need to do.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<br>3) When making a Paraview plugin for a vtk filter, in the XML I will do something like <br>      <InputProperty<br>         name="Source"<br><br>to tell Paraivew to make an input connection. Since these inputs are not named in the vtk filter, is paraview associating the first InputProperty that appears in the xml with input 0 of the filter, etc?<br>
<br></blockquote><div><br></div><div>I'd go to the paraview list for this one.</div><div><br></div><div>Jeff</div><div><br></div></div>