------------------------------------------------------------------------------ Specify a source object at a specified table location.
| 263 | //------------------------------------------------------------------------------ |
| 264 | // Specify a source object at a specified table location. |
| 265 | void vtkGlyph3DMapper::SetSourceData(int idx, vtkPolyData* pd) |
| 266 | { |
| 267 | int numConnections = this->GetNumberOfInputConnections(1); |
| 268 | |
| 269 | if (idx < 0 || idx > numConnections) |
| 270 | { |
| 271 | vtkErrorMacro("Bad index " << idx << " for source."); |
| 272 | return; |
| 273 | } |
| 274 | |
| 275 | vtkTrivialProducer* tp = nullptr; |
| 276 | if (pd) |
| 277 | { |
| 278 | tp = vtkTrivialProducer::New(); |
| 279 | tp->SetOutput(pd); |
| 280 | } |
| 281 | |
| 282 | if (idx < numConnections) |
| 283 | { |
| 284 | if (tp) |
| 285 | { |
| 286 | this->SetNthInputConnection(1, idx, tp->GetOutputPort()); |
| 287 | } |
| 288 | else |
| 289 | { |
| 290 | this->SetNthInputConnection(1, idx, nullptr); |
| 291 | } |
| 292 | } |
| 293 | else if (idx == numConnections && tp) |
| 294 | { |
| 295 | this->AddInputConnection(1, tp->GetOutputPort()); |
| 296 | } |
| 297 | |
| 298 | if (tp) |
| 299 | { |
| 300 | tp->Delete(); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | //------------------------------------------------------------------------------ |
| 305 | void vtkGlyph3DMapper::SetSourceTableTree(vtkDataObjectTree* tree) |
no test coverage detected