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

Method SamplePoints

Filters/Modeling/vtkPolyDataPointSampler.cxx:419–436  ·  view source on GitHub ↗

Internal methods for sampling edges, triangles, and polygons

Source from the content-addressed store, hash-verified

417
418 // Internal methods for sampling edges, triangles, and polygons
419 void SamplePoints() override
420 {
421 // First the vertex points
422 double ranVal, frac = (this->Distance / std::pow(this->Length, 0.3333));
423 for (auto i = 0; i < this->NumPts; ++i)
424 {
425 ranVal = this->RandomSeq->GetValue();
426 this->RandomSeq->Next();
427 if (ranVal <= frac)
428 { // insert point
429 this->OutPts->InsertNextPoint(this->InPts->GetPoint(i));
430 if (this->InPD)
431 {
432 this->OutPD->CopyData(this->InPD, i, i);
433 }
434 }
435 }
436 }
437
438 void SampleEdge(vtkIdType p0, vtkIdType p1) override
439 {

Callers 1

operator()Method · 0.45

Calls 6

powFunction · 0.50
GetValueMethod · 0.45
NextMethod · 0.45
InsertNextPointMethod · 0.45
GetPointMethod · 0.45
CopyDataMethod · 0.45

Tested by

no test coverage detected