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

Method StructuredPointsContour

Filters/General/vtkMarchingContourFilter.cxx:143–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void vtkMarchingContourFilter::StructuredPointsContour(
144 int dim, vtkDataSet* input, vtkPolyData* thisOutput)
145{
146 vtkPolyData* output;
147 vtkIdType numContours = this->ContourValues->GetNumberOfContours();
148 double* values = this->ContourValues->GetValues();
149
150 if (dim == 2) // marching squares
151 {
152 vtkMarchingSquares* msquares;
153 int i;
154
155 msquares = vtkMarchingSquares::New();
156 msquares->SetInputData((vtkImageData*)input);
157 msquares->SetDebug(this->Debug);
158 msquares->SetNumberOfContours(numContours);
159 for (i = 0; i < numContours; i++)
160 {
161 msquares->SetValue(i, values[i]);
162 }
163
164 msquares->SetContainerAlgorithm(this);
165 msquares->Update();
166 output = msquares->GetOutput();
167 output->Register(this);
168 msquares->Delete();
169 }
170
171 else // marching cubes
172 {
173 vtkMarchingCubes* mcubes;
174 int i;
175
176 mcubes = vtkMarchingCubes::New();
177 mcubes->SetInputData((vtkImageData*)input);
178 mcubes->SetComputeNormals(this->ComputeNormals);
179 mcubes->SetComputeGradients(this->ComputeGradients);
180 mcubes->SetComputeScalars(this->ComputeScalars);
181 mcubes->SetDebug(this->Debug);
182 mcubes->SetNumberOfContours(numContours);
183 for (i = 0; i < numContours; i++)
184 {
185 mcubes->SetValue(i, values[i]);
186 }
187
188 mcubes->SetContainerAlgorithm(this);
189 mcubes->Update();
190 output = mcubes->GetOutput();
191 output->Register(this);
192 mcubes->Delete();
193 }
194
195 thisOutput->CopyStructure(output);
196 thisOutput->GetPointData()->ShallowCopy(output->GetPointData());
197 output->UnRegister(this);
198}
199
200void vtkMarchingContourFilter::DataSetContour(vtkDataSet* input, vtkPolyData* output)

Callers 1

RequestDataMethod · 0.95

Calls 15

DeleteMethod · 0.65
NewFunction · 0.50
GetNumberOfContoursMethod · 0.45
GetValuesMethod · 0.45
SetInputDataMethod · 0.45
SetDebugMethod · 0.45
SetNumberOfContoursMethod · 0.45
SetValueMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45
RegisterMethod · 0.45
CopyStructureMethod · 0.45

Tested by

no test coverage detected