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

Method Clip

Common/DataModel/vtkTriangleStrip.cxx:275–317  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

273
274//------------------------------------------------------------------------------
275void vtkTriangleStrip::Clip(double value, vtkDataArray* cellScalars,
276 vtkIncrementalPointLocator* locator, vtkCellArray* tris, vtkPointData* inPd, vtkPointData* outPd,
277 vtkCellData* inCd, vtkIdType cellId, vtkCellData* outCd, int insideOut)
278{
279 int i, numTris = this->Points->GetNumberOfPoints() - 2;
280 int id1, id2, id3;
281 vtkDataArray* triScalars = cellScalars->NewInstance();
282 triScalars->SetNumberOfComponents(cellScalars->GetNumberOfComponents());
283 triScalars->SetNumberOfTuples(3);
284
285 for (i = 0; i < numTris; i++)
286 {
287 if (i % 2)
288 {
289 id1 = i + 2;
290 id2 = i + 1;
291 id3 = i;
292 }
293 else
294 {
295 id1 = i;
296 id2 = i + 1;
297 id3 = i + 2;
298 }
299
300 this->Triangle->Points->SetPoint(0, this->Points->GetPoint(id1));
301 this->Triangle->Points->SetPoint(1, this->Points->GetPoint(id2));
302 this->Triangle->Points->SetPoint(2, this->Points->GetPoint(id3));
303
304 this->Triangle->PointIds->SetId(0, this->PointIds->GetId(id1));
305 this->Triangle->PointIds->SetId(1, this->PointIds->GetId(id2));
306 this->Triangle->PointIds->SetId(2, this->PointIds->GetId(id3));
307
308 triScalars->SetTuple(0, cellScalars->GetTuple(id1));
309 triScalars->SetTuple(1, cellScalars->GetTuple(id2));
310 triScalars->SetTuple(2, cellScalars->GetTuple(id3));
311
312 this->Triangle->Clip(
313 value, triScalars, locator, tris, inPd, outPd, inCd, cellId, outCd, insideOut);
314 }
315
316 triScalars->Delete();
317}
318
319//------------------------------------------------------------------------------
320// Return the center of the point cloud in parametric coordinates.

Callers

nothing calls this directly

Calls 12

DeleteMethod · 0.65
GetNumberOfPointsMethod · 0.45
NewInstanceMethod · 0.45
SetNumberOfComponentsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
SetPointMethod · 0.45
GetPointMethod · 0.45
SetIdMethod · 0.45
GetIdMethod · 0.45
SetTupleMethod · 0.45
GetTupleMethod · 0.45

Tested by

no test coverage detected