MantisBT - VTK | |||||
| View Issue Details | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update |
| 0002187 | VTK | (No Category) | public | 2005-08-24 21:49 | 2012-12-12 12:13 |
| Reporter | Simon Warfield | ||||
| Assigned To | David Gobbi | ||||
| Priority | normal | Severity | major | Reproducibility | always |
| Status | closed | Resolution | fixed | ||
| Platform | OS | OS Version | |||
| Product Version | |||||
| Target Version | Fixed in Version | 5.6.0 | |||
| Project | |||||
| Type | |||||
| Summary | 0002187: vtkImageBlend sets input on port 1 instead of connection 1 | ||||
| Description | vtkImageAlgorithm has an AddInput method and a SetInput method which are intended to add or set the input at a particular index. These methods in turn call vtkAlgorithm AddInputConnection and SetInputConnection, but translate the index into a port. The upshot of this is that an attempt to set the second input at index 1 on port 0 instead sets index 0 on port 1. vtkImageBlend uses port 1 exclusively for vtkImageStencil data and the result is a runtime failure with a type mismatch. Basically the bug is that these are incompatible: void vtkImageAlgorithm::SetInput(int index, vtkDataObject* input) void vtkAlgorithm::SetInputConnection(int port, vtkAlgorithmOutput* input) Also, the workaround of calling SetInputConnection directly is difficult to discern as the pipeline documentation is not completely clear. Basically a sequence like the following is necessary: vtkImageData *input1; vtkImageData *input2; vtkImageData *input3; blend->SetStencil(stencil); blend->AddInputConnection(0, input1->GetProducerPort()); blend->AddInputConnection(0, input2->GetProducerPort()); // THERE IS NO REMOVEINPUT - WOULD BE GOOD TO HAVE IT blend->RemoveInput( input1->GetProducerPort()); // UNDESIRABLE blend->SetInput(0, 0); // Removes all inputs ???? blend->RemoveInputConnection(0,input2->GetProducerPort()); // seems to do the job.... // Not immediately obvious that calling GetProducerPort() generates a vtkAlgorithmOutput *. blend->AddInputConnection(0, input3->GetProducerPort()); | ||||
| Steps To Reproduce | |||||
| Additional Information | |||||
| Tags | No tags attached. | ||||
| Relationships | |||||
| Attached Files | |||||
| Issue History | |||||
| Date Modified | Username | Field | Change | ||
| 2008-02-06 10:17 | Jeff Baumes | Assigned To | => Berk Geveci | ||
| 2011-02-26 10:38 | David Gobbi | Assigned To | Berk Geveci => David Gobbi | ||
| 2011-04-15 17:31 | David Gobbi | Note Added: 0026189 | |||
| 2011-04-15 17:31 | David Gobbi | Status | tabled => @80@ | ||
| 2011-04-15 17:31 | David Gobbi | Resolution | open => fixed | ||
| 2011-06-16 13:11 | Zack Galbreath | Category | => (No Category) | ||
| 2012-12-12 12:13 | David Gobbi | Status | customer review => closed | ||
| 2012-12-12 12:13 | David Gobbi | Fixed in Version | => 5.6.0 | ||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||