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

Method CalculateHTs

IO/XML/vtkXMLHyperTreeGridReader.cxx:120–143  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

118
119//------------------------------------------------------------------------------
120void vtkXMLHyperTreeGridReader::CalculateHTs(const vtkHyperTreeGrid* grid)
121{
122 assert("pre: already_done" && !this->FixedHTs);
123 if (this->SelectedHTs == COORDINATES_BOUNDING_BOX)
124 {
125 this->SelectedHTs = INDICES_BOUNDING_BOX;
126 // if coord_min{x,y,z} < HTG->coord_min{x,y,z} then ht_idx{x,y,z} = 0
127 double htg_bbox[6];
128 const_cast<vtkHyperTreeGrid*>(grid)->GetGridBounds(htg_bbox);
129 this->IndicesBoundingBox[0] = this->CoordinatesBoundingBox[0] <= htg_bbox[0]
130 ? 0
131 : grid->FindDichotomicX(this->CoordinatesBoundingBox[0]);
132 this->IndicesBoundingBox[1] = grid->FindDichotomicX(this->CoordinatesBoundingBox[1]);
133 this->IndicesBoundingBox[2] = this->CoordinatesBoundingBox[2] <= htg_bbox[2]
134 ? 0
135 : grid->FindDichotomicY(this->CoordinatesBoundingBox[2]);
136 this->IndicesBoundingBox[3] = grid->FindDichotomicY(this->CoordinatesBoundingBox[3]);
137 this->IndicesBoundingBox[4] = this->CoordinatesBoundingBox[4] <= htg_bbox[4]
138 ? 0
139 : grid->FindDichotomicZ(this->CoordinatesBoundingBox[4]);
140 this->IndicesBoundingBox[5] = grid->FindDichotomicZ(this->CoordinatesBoundingBox[5]);
141 }
142 this->FixedHTs = true;
143}
144
145//------------------------------------------------------------------------------
146bool vtkXMLHyperTreeGridReader::IsSelectedHT(const vtkHyperTreeGrid* grid, vtkIdType treeIndx) const

Callers 1

ReadXMLDataMethod · 0.95

Calls 5

FindDichotomicXMethod · 0.80
FindDichotomicYMethod · 0.80
FindDichotomicZMethod · 0.80
assertFunction · 0.50
GetGridBoundsMethod · 0.45

Tested by

no test coverage detected