MCPcopy Create free account
hub / github.com/Kitware/VTK / SetInputData

Method SetInputData

Filters/Extraction/vtkExtractVectorComponents.cxx:65–111  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Specify the input data or filter.

Source from the content-addressed store, hash-verified

63//------------------------------------------------------------------------------
64// Specify the input data or filter.
65void vtkExtractVectorComponents::SetInputData(vtkDataSet* input)
66{
67 if (this->GetNumberOfInputConnections(0) > 0 && this->GetInput(0) == input)
68 {
69 return;
70 }
71
72 this->Superclass::SetInputData(0, input);
73
74 if (input == nullptr)
75 {
76 return;
77 }
78
79 vtkDataSet* output;
80 if (!this->OutputsInitialized)
81 {
82 output = input->NewInstance();
83 this->GetExecutive()->SetOutputData(0, output);
84 output->Delete();
85 output = input->NewInstance();
86 this->GetExecutive()->SetOutputData(1, output);
87 output->Delete();
88 output = input->NewInstance();
89 this->GetExecutive()->SetOutputData(2, output);
90 output->Delete();
91 this->OutputsInitialized = 1;
92 return;
93 }
94
95 // since the input has changed we might need to create a new output
96 // It seems that output 0 is the correct type as a result of the call to
97 // the superclass's SetInput. Check the type of output 1 instead.
98 if (strcmp(this->GetOutput(1)->GetClassName(), input->GetClassName()) != 0)
99 {
100 output = input->NewInstance();
101 this->GetExecutive()->SetOutputData(0, output);
102 output->Delete();
103 output = input->NewInstance();
104 this->GetExecutive()->SetOutputData(1, output);
105 output->Delete();
106 output = input->NewInstance();
107 this->GetExecutive()->SetOutputData(2, output);
108 output->Delete();
109 vtkWarningMacro(<< " a new output had to be created since the input type changed.");
110 }
111}
112
113//------------------------------------------------------------------------------
114namespace

Callers 15

RequestDataMethod · 0.45
ToSelectionTypeMethod · 0.45
ExtractMethod · 0.45
extractUGrid.pyFile · 0.45
extractVectors.pyFile · 0.45
TestAMRFunction · 0.45
showMeFunction · 0.45
TestExtractionFunction · 0.45
TestExtractRowsFunction · 0.45

Calls 8

SetOutputDataMethod · 0.80
DeleteMethod · 0.65
GetInputMethod · 0.45
NewInstanceMethod · 0.45
GetExecutiveMethod · 0.45
GetClassNameMethod · 0.45
GetOutputMethod · 0.45

Tested by 11

TestAMRFunction · 0.36
showMeFunction · 0.36
TestExtractionFunction · 0.36
TestExtractRowsFunction · 0.36
WriteGridFunction · 0.36
showMeFunction · 0.36
TestExtractionExpressionFunction · 0.36