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

Method IntersectsRegion

Common/DataModel/vtkKdNode.cxx:670–711  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

668
669//------------------------------------------------------------------------------
670int vtkKdNode::IntersectsRegion(vtkPlanesIntersection* pi, int useDataBounds)
671{
672 double x0, x1, y0, y1, z0, z1;
673 vtkPoints* box = vtkPoints::New();
674
675 box->SetNumberOfPoints(8);
676
677 double *min, *max;
678
679 if (useDataBounds)
680 {
681 min = this->MinVal;
682 max = this->MaxVal;
683 }
684 else
685 {
686 min = this->Min;
687 max = this->Max;
688 }
689
690 x0 = min[0];
691 x1 = max[0];
692 y0 = min[1];
693 y1 = max[1];
694 z0 = min[2];
695 z1 = max[2];
696
697 box->SetPoint(0, x1, y0, z1);
698 box->SetPoint(1, x1, y0, z0);
699 box->SetPoint(2, x1, y1, z0);
700 box->SetPoint(3, x1, y1, z1);
701 box->SetPoint(4, x0, y0, z1);
702 box->SetPoint(5, x0, y0, z0);
703 box->SetPoint(6, x0, y1, z0);
704 box->SetPoint(7, x0, y1, z1);
705
706 int intersects = pi->IntersectsRegion(box);
707
708 box->Delete();
709
710 return intersects;
711}
712
713//------------------------------------------------------------------------------
714int vtkKdNode::IntersectsCell(vtkCell* cell, int useDataBounds, int cellRegion, double* bounds)

Callers 2

IntersectsCellMethod · 0.95

Calls 4

DeleteMethod · 0.65
NewFunction · 0.50
SetNumberOfPointsMethod · 0.45
SetPointMethod · 0.45

Tested by 1