Permalink
Browse files

Fixed inputs and outputs

In the plugins XML file, the InputProperty element's name
attribute *must* be named "Input". If not, the filter will
not appear correctly as the child of its input in the
pipeline browser. For two-input filters, the name can be
anything, so I named the first two FirstInput and SecondInput.

Also, used a DeepCopy() for the output rather than a ShallowCopy()
because the original data must be garbage collected within
GenerateData().
  • Loading branch information...
1 parent b5e2620 commit 94b89d3632aae899e3b635f7db1d1e4b882e77c0 Cory Quammen committed Apr 4, 2012
Showing with 18 additions and 3 deletions.
  1. +18 −3 Generators/ParaView3/ParaView3PluginGenerator.cxx
View
21 Generators/ParaView3/ParaView3PluginGenerator.cxx
@@ -89,7 +89,23 @@ ::GenerateXML()
for (int i = 0; i < this->GetNumberOfInputs(); ++i)
{
os << " <InputProperty\n";
- os << " name=\"Input" << i+1 << "\"\n";
+
+ if ( i == 0 )
+ {
+ if ( this->GetNumberOfInputs() == 1 )
+ {
+ os << " name=\"Input\"\n";
+ }
+ else
+ {
+ os << " name=\"First Input\"\n";
+ }
+ }
+ else
+ {
+ os << " name=\"Second Input\"\n";
+ }
+
os << " port_index=\"" << i << "\"\n";
os << " command=\"SetInputConnection\">\n";
@@ -684,7 +700,6 @@ ::GenerateCXXCode()
}
}
- os << "\n";
os << " try\n";
os << " {\n";
os << " filter->Update();\n";
@@ -700,7 +715,7 @@ ::GenerateCXXCode()
os << " itkToVTKConnector->SetInput( filter->GetOutput() );\n";
os << " itkToVTKConnector->Update();\n\n";
- os << " output->ShallowCopy( itkToVTKConnector->GetOutput() );\n\n";
+ os << " output->DeepCopy( itkToVTKConnector->GetOutput() );\n\n";
// End the Run method
os << "}\n\n";

0 comments on commit 94b89d3

Please sign in to comment.