------------------------------------------------------------------------------
| 534 | |
| 535 | //------------------------------------------------------------------------------ |
| 536 | void vtkBiDimensionalRepresentation2D::BuildRepresentation() |
| 537 | { |
| 538 | if (this->GetMTime() > this->BuildTime || |
| 539 | this->Point1Representation->GetMTime() > this->BuildTime || |
| 540 | this->Point2Representation->GetMTime() > this->BuildTime || |
| 541 | this->Point3Representation->GetMTime() > this->BuildTime || |
| 542 | this->Point4Representation->GetMTime() > this->BuildTime || |
| 543 | (this->Renderer && this->Renderer->GetVTKWindow() && |
| 544 | this->Renderer->GetVTKWindow()->GetMTime() > this->BuildTime)) |
| 545 | { |
| 546 | // Make sure that tolerance is consistent between handles and this representation |
| 547 | this->Point1Representation->SetTolerance(this->Tolerance); |
| 548 | this->Point2Representation->SetTolerance(this->Tolerance); |
| 549 | this->Point3Representation->SetTolerance(this->Tolerance); |
| 550 | this->Point4Representation->SetTolerance(this->Tolerance); |
| 551 | |
| 552 | // Now bring the lines up to date |
| 553 | if (!this->Line1Visibility) |
| 554 | { |
| 555 | return; |
| 556 | } |
| 557 | |
| 558 | double p1[3], p2[3], p3[3], p4[3]; |
| 559 | this->GetPoint1DisplayPosition(p1); |
| 560 | this->GetPoint2DisplayPosition(p2); |
| 561 | this->GetPoint3DisplayPosition(p3); |
| 562 | this->GetPoint4DisplayPosition(p4); |
| 563 | |
| 564 | double wp1[3], wp2[3], wp3[3], wp4[3]; |
| 565 | this->GetPoint1WorldPosition(wp1); |
| 566 | this->GetPoint2WorldPosition(wp2); |
| 567 | this->GetPoint3WorldPosition(wp3); |
| 568 | this->GetPoint4WorldPosition(wp4); |
| 569 | |
| 570 | this->LinePoints->SetPoint(0, p1); |
| 571 | this->LinePoints->SetPoint(1, p2); |
| 572 | this->LinePoints->SetPoint(2, p3); |
| 573 | this->LinePoints->SetPoint(3, p4); |
| 574 | this->LinePoints->Modified(); |
| 575 | |
| 576 | this->LineCells->Reset(); |
| 577 | this->LineCells->InsertNextCell(2); |
| 578 | this->LineCells->InsertCellPoint(0); |
| 579 | this->LineCells->InsertCellPoint(1); |
| 580 | |
| 581 | if (this->Line2Visibility) |
| 582 | { |
| 583 | this->LineCells->InsertNextCell(2); |
| 584 | this->LineCells->InsertCellPoint(2); |
| 585 | this->LineCells->InsertCellPoint(3); |
| 586 | } |
| 587 | |
| 588 | double line1Dist = sqrt(vtkMath::Distance2BetweenPoints(wp1, wp2)); |
| 589 | double line2Dist = 0; |
| 590 | if (this->Line2Visibility) |
| 591 | { |
| 592 | line2Dist = sqrt(vtkMath::Distance2BetweenPoints(wp3, wp4)); |
| 593 | } |
no test coverage detected