Пример #1
0
 public Vector3 getSize(ReferenceFrame asSeenBy, HowMuch howMuch, boolean ignoreHidden) {
   Box box = getBoundingBox(asSeenBy, howMuch, ignoreHidden);
   if (box != null) {
     return new Vector3(box.getWidth(), box.getHeight(), box.getDepth());
   } else {
     return new Vector3(0, 0, 0);
   }
 }
Пример #2
0
 public double getSizeAlongDimension(
     Dimension dimension, ReferenceFrame asSeenBy, HowMuch howMuch, boolean ignoreHidden) {
   Box box = getBoundingBox(asSeenBy, howMuch, ignoreHidden);
   if (box != null) {
     if (dimension == Dimension.LEFT_TO_RIGHT) {
       return box.getWidth();
     } else if (dimension == Dimension.TOP_TO_BOTTOM) {
       return box.getHeight();
     } else if (dimension == Dimension.FRONT_TO_BACK) {
       return box.getDepth();
     } else {
       throw new IllegalArgumentException(
           dimension + " is expected to be in [LEFT_TO_RIGHT, TOP_TO_BOTTOM, FRONT_TO_BACK].");
     }
   } else {
     // todo: Double.NaN?
     return 0;
   }
 }