| 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 | { |
no test coverage detected