Пример #1
0
 public void vec2FieldMagnitude(Field field, AffineTransform ftoi) {
   AffineTransform itof = null;
   try {
     itof = ftoi.createInverse();
   } catch (NoninvertibleTransformException niv) {
     TDebug.println(0, "NoninvertibleTransformException: " + niv);
   }
   Vector3d v = new Vector3d();
   Point2D.Double p = new Point2D.Double();
   for (int j = 0, k = 0; j < height; ++j)
     for (int i = 0; i < width; ++i, ++k) {
       p.x = i;
       p.y = j;
       itof.transform(p, p);
       v = field.get(p.x, p.y, 0.0);
       f[k] = (float) Math.sqrt(v.x * v.x + v.y * v.y);
     }
 }
Пример #2
0
 public void vec2FieldZero(Field field, AffineTransform ftoi) {
   AffineTransform itof = null;
   try {
     itof = ftoi.createInverse();
   } catch (NoninvertibleTransformException niv) {
     TDebug.println(0, "NoninvertibleTransformException: " + niv);
   }
   Vector3d v = new Vector3d();
   Point2D.Double p = new Point2D.Double();
   for (int j = 0, k = 0; j < height; ++j)
     for (int i = 0; i < width; ++i, ++k) {
       p.x = i;
       p.y = j;
       itof.transform(p, p);
       v = field.get(p.x, p.y, 0.0);
       if ((v.x == 0.0) && (v.y == 0.0)) f[k] = 1.0f;
       else f[k] = 0.0f;
     }
 }
Пример #3
0
 protected Object zzb(Field field) {
   String s = field.zzos();
   if (field.zzou() != null) {
     boolean flag;
     if (zzck(field.zzos()) == null) {
       flag = true;
     } else {
       flag = false;
     }
     zzu.zza(flag, "Concrete field shouldn't be value object: %s", new Object[] {field.zzos()});
     if (field.zzor()) {
       field = zzoo();
     } else {
       field = zzon();
     }
     if (field != null) {
       return field.get(s);
     }
     try {
       field =
           (new StringBuilder())
               .append("get")
               .append(Character.toUpperCase(s.charAt(0)))
               .append(s.substring(1))
               .toString();
       field = ((Field) (getClass().getMethod(field, new Class[0]).invoke(this, new Object[0])));
     }
     // Misplaced declaration of an exception variable
     catch (Field field) {
       throw new RuntimeException(field);
     }
     return field;
   } else {
     return zzck(field.zzos());
   }
 }
Пример #4
0
 @Override
 public T get(ByteBuffer buffer) {
   return field.get(buffer);
 }