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

Method SampleEdge

Filters/Modeling/vtkPolyDataPointSampler.cxx:438–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436 }
437
438 void SampleEdge(vtkIdType p0, vtkIdType p1) override
439 {
440 double x0[3], x1[3];
441 this->InPts->GetPoint(p0, x0);
442 this->InPts->GetPoint(p1, x1);
443 double len = vtkMath::Distance2BetweenPoints(x0, x1);
444 if (len > this->Distance2)
445 {
446 len = sqrt(len);
447 vtkIdType npts = std::ceil(len / this->Distance);
448 vtkIdType pId;
449 double t, x[3];
450 for (auto i = 0; i < npts; ++i)
451 {
452 t = this->RandomSeq->GetValue();
453 this->RandomSeq->Next();
454 x[0] = x0[0] + t * (x1[0] - x0[0]);
455 x[1] = x0[1] + t * (x1[1] - x0[1]);
456 x[2] = x0[2] + t * (x1[2] - x0[2]);
457 pId = this->OutPts->InsertNextPoint(x);
458 if (this->InPD)
459 {
460 this->OutPD->InterpolateEdge(this->InPD, pId, p0, p1, t);
461 }
462 }
463 }
464 }
465
466 void SampleTriangle(const vtkIdType* pts) override
467 {

Callers 2

SamplePolygonMethod · 0.95
operator()Method · 0.45

Calls 7

sqrtFunction · 0.50
ceilFunction · 0.50
GetPointMethod · 0.45
GetValueMethod · 0.45
NextMethod · 0.45
InsertNextPointMethod · 0.45
InterpolateEdgeMethod · 0.45

Tested by

no test coverage detected