Example #1
0
//======================================================================
// Function: bounding_box (PUBLIC)
// Description: return the bounding box of the edge
// Author: sjowen
// Date: 10/02
//======================================================================
CubitBox CubitFacetEdge::bounding_box( )
{
  CubitPoint *p1 = point (0);
  CubitPoint *p2 = point (1);

  CubitVector bbox_min, bbox_max;
  bbox_min.x(CUBIT_MIN(p1->x(),p2->x()));
  bbox_min.y(CUBIT_MIN(p1->y(),p2->y()));
  bbox_min.z(CUBIT_MIN(p1->z(),p2->z()));
  bbox_max.x(CUBIT_MAX(p1->x(),p2->x()));
  bbox_max.y(CUBIT_MAX(p1->y(),p2->y()));
  bbox_max.z(CUBIT_MAX(p1->z(),p2->z()));
  CubitBox edge_box(bbox_min,bbox_max);
  return edge_box;
}
Example #2
0
/*
 *************************************************************************
 *
 * Set up a EdgeOverlap oject using the given boxes and offset
 *
 *************************************************************************
 */
std::shared_ptr<hier::BoxOverlap>
OuteredgeGeometry::setUpOverlap(
   const hier::BoxContainer& boxes,
   const hier::Transformation& transformation) const
{
   const tbox::Dimension& dim(transformation.getOffset().getDim());
   std::vector<hier::BoxContainer> dst_boxes(dim.getValue());

   for (hier::BoxContainer::const_iterator b = boxes.begin();
        b != boxes.end(); ++b) {
      for (int d = 0; d < dim.getValue(); ++d) {
         hier::Box edge_box(EdgeGeometry::toEdgeBox(*b, d));
         dst_boxes[d].pushBack(edge_box);
      }
   }

   // Create the edge overlap data object using the boxes and transformation
   return std::make_shared<EdgeOverlap>(dst_boxes, transformation);

}