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

Method RequestData

Filters/Geometry/vtkDataSetRegionSurfaceFilter.cxx:96–147  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

94
95//------------------------------------------------------------------------------
96int vtkDataSetRegionSurfaceFilter::RequestData(
97 vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector)
98{
99 vtkUnstructuredGrid* input = vtkUnstructuredGrid::GetData(inputVector[0], 0);
100
101 if (!input)
102 {
103 vtkErrorMacro("Input not specified!");
104 return 0;
105 }
106
107 if (this->RegionArrayName)
108 {
109 this->RegionArray =
110 vtkIntArray::SafeDownCast(input->GetCellData()->GetArray(this->RegionArrayName));
111 }
112
113 // assume all tets, and that the tets are small relative to the size of the
114 // regions (absolute max number of faces in output would be
115 // input->GetNumberOfCells() * 4)
116 this->OrigCellIds->Reset();
117 this->OrigCellIds->Allocate(input->GetNumberOfCells());
118 this->CellFaceIds->Reset();
119 this->CellFaceIds->Allocate(input->GetNumberOfCells());
120
121 this->Superclass::RequestData(request, inputVector, outputVector);
122
123 // if any tets, then we'll have CellFaceIds... assume all tets and that we
124 // want to addthe cell data
125 if (this->CellFaceIds->GetNumberOfTuples() > 0)
126 {
127 vtkPolyData* output = vtkPolyData::GetData(outputVector, 0);
128 if (output->GetNumberOfCells() != this->CellFaceIds->GetNumberOfTuples())
129 {
130 vtkErrorMacro("Unable to add CellData because wrong # of values!");
131 }
132 else
133 {
134 output->GetCellData()->AddArray(this->OrigCellIds);
135 output->GetCellData()->AddArray(this->CellFaceIds);
136 }
137 }
138 else
139 { // get rid of point mapping information
140 vtkPolyData* output = vtkPolyData::GetData(outputVector, 0);
141 output->GetPointData()->RemoveArray("vtkOriginalPointIds");
142 }
143
144 this->CheckAbort();
145
146 return 1;
147}
148
149//------------------------------------------------------------------------------
150int vtkDataSetRegionSurfaceFilter::UnstructuredGridExecute(

Callers

nothing calls this directly

Calls 11

CheckAbortMethod · 0.80
GetDataFunction · 0.50
GetArrayMethod · 0.45
GetCellDataMethod · 0.45
ResetMethod · 0.45
AllocateMethod · 0.45
GetNumberOfCellsMethod · 0.45
GetNumberOfTuplesMethod · 0.45
AddArrayMethod · 0.45
RemoveArrayMethod · 0.45
GetPointDataMethod · 0.45

Tested by

no test coverage detected