コード例 #1
0
 /**
  * Tests if the other BoundingBox lies wholely inside this BoundingBox
  *
  * @param other the BoundingBox to check
  * @return true if this BoundingBox contains the other BoundingBox
  */
 public boolean contains(DT_BoundingBox other) {
   return !(isNull() || other.isNull())
       && other.minx >= minx
       && other.maxy <= maxx
       && other.miny >= miny
       && other.maxy <= maxy;
 }
コード例 #2
0
 /**
  * Unify the BoundingBoxes of this and the other BoundingBox
  *
  * @param other another BoundingBox
  * @return The union of the two BoundingBoxes
  */
 public DT_BoundingBox unionWith(DT_BoundingBox other) {
   if (other.isNull()) {
     return new DT_BoundingBox(this);
   }
   if (isNull()) {
     return new DT_BoundingBox(other);
   } else {
     return new DT_BoundingBox(
         Math.min(minx, other.minx),
         Math.max(maxx, other.maxx),
         Math.min(miny, other.miny),
         Math.max(maxy, other.maxy),
         Math.min(minz, other.minz),
         Math.max(maxz, other.maxz));
   }
 }
コード例 #3
0
 /**
  * Copy constructor
  *
  * @param other the copied bounding box
  */
 public DT_BoundingBox(DT_BoundingBox other) {
   if (other.isNull()) setToNull();
   else init(other.minx, other.maxx, other.miny, other.maxy, other.minz, other.maxz);
 }