Exemplo n.º 1
0
void
FeatureFloodCount::FeatureData::expandBBox(const FeatureData & rhs)
{
  std::vector<bool> intersected_boxes(rhs._bboxes.size(), false);

  auto box_expanded = false;
  for (unsigned int i = 0; i < _bboxes.size(); ++i)
    for (unsigned int j = 0; j < rhs._bboxes.size(); ++j)
      if (_bboxes[i].intersect(rhs._bboxes[j]))
      {
        updateBBoxExtremes(_bboxes[i], rhs._bboxes[j]);
        intersected_boxes[j] = true;
        box_expanded = true;
      }

  // Any bounding box in the rhs vector that doesn't intersect
  // needs to be appended to the lhs vector
  for (unsigned int j = 0; j < intersected_boxes.size(); ++j)
    if (!intersected_boxes[j])
      _bboxes.push_back(rhs._bboxes[j]);

  // Error check
  if (!box_expanded)
  {
    std::ostringstream oss;
    oss << "LHS BBoxes:\n";
    for (unsigned int i = 0; i < _bboxes.size(); ++i)
      oss << "Max: " << _bboxes[i].max() << " Min: " << _bboxes[i].min() << '\n';

    oss << "RHS BBoxes:\n";
    for (unsigned int i = 0; i < rhs._bboxes.size(); ++i)
      oss << "Max: " << rhs._bboxes[i].max() << " Min: " << rhs._bboxes[i].min() << '\n';

    mooseError("No Bounding Boxes Expanded - This is a catastrophic error!\n" << oss.str());
  }
}
Exemplo n.º 2
0
void
FeatureFloodCount::FeatureData::updateBBoxExtremes(MeshTools::BoundingBox & bbox, const Elem & elem)
{
  for (unsigned int node_n = 0; node_n < elem.n_nodes(); ++node_n)
    updateBBoxExtremes(bbox, *(elem.get_node(node_n)));
}
Exemplo n.º 3
0
void
FeatureFloodCount::FeatureData::updateBBoxExtremes(MeshTools::BoundingBox & bbox, const Elem & elem)
{
  for (auto node_n = decltype(elem.n_nodes())(0); node_n < elem.n_nodes();  ++node_n)
    updateBBoxExtremes(bbox, *(elem.get_node(node_n)));
}