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

Method FindGrid

Common/DataModel/vtkOverlappingAMRMetaData.cxx:1155–1193  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1153
1154//------------------------------------------------------------------------------
1155bool vtkOverlappingAMRMetaData::FindGrid(double q[3], unsigned int& level, unsigned int& gridId)
1156{
1157 if (!this->HasChildrenInformation())
1158 {
1159 this->GenerateParentChildInformation();
1160 }
1161
1162 if (!this->FindGrid(q, 0, gridId))
1163 {
1164 return false;
1165 }
1166
1167 unsigned int maxLevels = this->GetNumberOfLevels();
1168 for (level = 0; level < maxLevels; level++)
1169 {
1170 unsigned int n;
1171 unsigned int* children = this->GetChildren(level, gridId, n);
1172 if (children == nullptr)
1173 {
1174 break;
1175 }
1176 unsigned int i;
1177 for (i = 0; i < n; i++)
1178 {
1179 double bb[6];
1180 this->GetBounds(level + 1, children[i], bb);
1181 if (::Inside(q, bb))
1182 {
1183 gridId = children[i];
1184 break;
1185 }
1186 }
1187 if (i >= n)
1188 {
1189 break;
1190 }
1191 }
1192 return true;
1193}
1194
1195//------------------------------------------------------------------------------
1196bool vtkOverlappingAMRMetaData::FindGrid(double q[3], int level, unsigned int& gridId)

Callers

nothing calls this directly

Calls 7

GetChildrenMethod · 0.95
GetBoundsMethod · 0.95
InsideFunction · 0.70
GetNumberOfLevelsMethod · 0.45
GetNumberOfBlocksMethod · 0.45

Tested by

no test coverage detected