001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004// Code generated by protocol buffer compiler. Do not edit!
005package edu.wpi.first.math.proto;
006
007import java.io.IOException;
008import us.hebi.quickbuf.Descriptors;
009import us.hebi.quickbuf.FieldName;
010import us.hebi.quickbuf.InvalidProtocolBufferException;
011import us.hebi.quickbuf.JsonSink;
012import us.hebi.quickbuf.JsonSource;
013import us.hebi.quickbuf.MessageFactory;
014import us.hebi.quickbuf.ProtoMessage;
015import us.hebi.quickbuf.ProtoSink;
016import us.hebi.quickbuf.ProtoSource;
017import us.hebi.quickbuf.ProtoUtil;
018import us.hebi.quickbuf.RepeatedByte;
019
020public final class Geometry3D {
021  private static final RepeatedByte descriptorData = ProtoUtil.decodeBase64(1875,
022    "ChBnZW9tZXRyeTNkLnByb3RvEgl3cGkucHJvdG8iQQoVUHJvdG9idWZUcmFuc2xhdGlvbjNkEgwKAXgY" + 
023    "ASABKAFSAXgSDAoBeRgCIAEoAVIBeRIMCgF6GAMgASgBUgF6IkwKElByb3RvYnVmUXVhdGVybmlvbhIM" + 
024    "CgF3GAEgASgBUgF3EgwKAXgYAiABKAFSAXgSDAoBeRgDIAEoAVIBeRIMCgF6GAQgASgBUgF6IkEKElBy" + 
025    "b3RvYnVmUm90YXRpb24zZBIrCgFxGAEgASgLMh0ud3BpLnByb3RvLlByb3RvYnVmUXVhdGVybmlvblIB" + 
026    "cSKPAQoOUHJvdG9idWZQb3NlM2QSQgoLdHJhbnNsYXRpb24YASABKAsyIC53cGkucHJvdG8uUHJvdG9i" + 
027    "dWZUcmFuc2xhdGlvbjNkUgt0cmFuc2xhdGlvbhI5Cghyb3RhdGlvbhgCIAEoCzIdLndwaS5wcm90by5Q" + 
028    "cm90b2J1ZlJvdGF0aW9uM2RSCHJvdGF0aW9uIpQBChNQcm90b2J1ZlRyYW5zZm9ybTNkEkIKC3RyYW5z" + 
029    "bGF0aW9uGAEgASgLMiAud3BpLnByb3RvLlByb3RvYnVmVHJhbnNsYXRpb24zZFILdHJhbnNsYXRpb24S" + 
030    "OQoIcm90YXRpb24YAiABKAsyHS53cGkucHJvdG8uUHJvdG9idWZSb3RhdGlvbjNkUghyb3RhdGlvbiJx" + 
031    "Cg9Qcm90b2J1ZlR3aXN0M2QSDgoCZHgYASABKAFSAmR4Eg4KAmR5GAIgASgBUgJkeRIOCgJkehgDIAEo" + 
032    "AVICZHoSDgoCcngYBCABKAFSAnJ4Eg4KAnJ5GAUgASgBUgJyeRIOCgJyehgGIAEoAVICcnpCGgoYZWR1" + 
033    "LndwaS5maXJzdC5tYXRoLnByb3RvSp8JCgYSBAAAKAEKCAoBDBIDAAASCggKAQISAwIAEgoICgEIEgME" + 
034    "ADEKCQoCCAESAwQAMQoKCgIEABIEBgAKAQoKCgMEAAESAwYIHQoLCgQEAAIAEgMHAg8KDAoFBAACAAUS" + 
035    "AwcCCAoMCgUEAAIAARIDBwkKCgwKBQQAAgADEgMHDQ4KCwoEBAACARIDCAIPCgwKBQQAAgEFEgMIAggK" + 
036    "DAoFBAACAQESAwgJCgoMCgUEAAIBAxIDCA0OCgsKBAQAAgISAwkCDwoMCgUEAAICBRIDCQIICgwKBQQA" + 
037    "AgIBEgMJCQoKDAoFBAACAgMSAwkNDgoKCgIEARIEDAARAQoKCgMEAQESAwwIGgoLCgQEAQIAEgMNAg8K" + 
038    "DAoFBAECAAUSAw0CCAoMCgUEAQIAARIDDQkKCgwKBQQBAgADEgMNDQ4KCwoEBAECARIDDgIPCgwKBQQB" + 
039    "AgEFEgMOAggKDAoFBAECAQESAw4JCgoMCgUEAQIBAxIDDg0OCgsKBAQBAgISAw8CDwoMCgUEAQICBRID" + 
040    "DwIICgwKBQQBAgIBEgMPCQoKDAoFBAECAgMSAw8NDgoLCgQEAQIDEgMQAg8KDAoFBAECAwUSAxACCAoM" + 
041    "CgUEAQIDARIDEAkKCgwKBQQBAgMDEgMQDQ4KCgoCBAISBBMAFQEKCgoDBAIBEgMTCBoKCwoEBAICABID",
042    "FAIbCgwKBQQCAgAGEgMUAhQKDAoFBAICAAESAxQVFgoMCgUEAgIAAxIDFBkaCgoKAgQDEgQXABoBCgoK" + 
043    "AwQDARIDFwgWCgsKBAQDAgASAxgCKAoMCgUEAwIABhIDGAIXCgwKBQQDAgABEgMYGCMKDAoFBAMCAAMS" + 
044    "AxgmJwoLCgQEAwIBEgMZAiIKDAoFBAMCAQYSAxkCFAoMCgUEAwIBARIDGRUdCgwKBQQDAgEDEgMZICEK" + 
045    "CgoCBAQSBBwAHwEKCgoDBAQBEgMcCBsKCwoEBAQCABIDHQIoCgwKBQQEAgAGEgMdAhcKDAoFBAQCAAES" + 
046    "Ax0YIwoMCgUEBAIAAxIDHSYnCgsKBAQEAgESAx4CIgoMCgUEBAIBBhIDHgIUCgwKBQQEAgEBEgMeFR0K" + 
047    "DAoFBAQCAQMSAx4gIQoKCgIEBRIEIQAoAQoKCgMEBQESAyEIFwoLCgQEBQIAEgMiAhAKDAoFBAUCAAUS" + 
048    "AyICCAoMCgUEBQIAARIDIgkLCgwKBQQFAgADEgMiDg8KCwoEBAUCARIDIwIQCgwKBQQFAgEFEgMjAggK" + 
049    "DAoFBAUCAQESAyMJCwoMCgUEBQIBAxIDIw4PCgsKBAQFAgISAyQCEAoMCgUEBQICBRIDJAIICgwKBQQF" + 
050    "AgIBEgMkCQsKDAoFBAUCAgMSAyQODwoLCgQEBQIDEgMlAhAKDAoFBAUCAwUSAyUCCAoMCgUEBQIDARID" + 
051    "JQkLCgwKBQQFAgMDEgMlDg8KCwoEBAUCBBIDJgIQCgwKBQQFAgQFEgMmAggKDAoFBAUCBAESAyYJCwoM" + 
052    "CgUEBQIEAxIDJg4PCgsKBAQFAgUSAycCEAoMCgUEBQIFBRIDJwIICgwKBQQFAgUBEgMnCQsKDAoFBAUC" + 
053    "BQMSAycOD2IGcHJvdG8z");
054
055  static final Descriptors.FileDescriptor descriptor = Descriptors.FileDescriptor.internalBuildGeneratedFileFrom("geometry3d.proto", "wpi.proto", descriptorData);
056
057  static final Descriptors.Descriptor wpi_proto_ProtobufTranslation3d_descriptor = descriptor.internalContainedType(31, 65, "ProtobufTranslation3d", "wpi.proto.ProtobufTranslation3d");
058
059  static final Descriptors.Descriptor wpi_proto_ProtobufQuaternion_descriptor = descriptor.internalContainedType(98, 76, "ProtobufQuaternion", "wpi.proto.ProtobufQuaternion");
060
061  static final Descriptors.Descriptor wpi_proto_ProtobufRotation3d_descriptor = descriptor.internalContainedType(176, 65, "ProtobufRotation3d", "wpi.proto.ProtobufRotation3d");
062
063  static final Descriptors.Descriptor wpi_proto_ProtobufPose3d_descriptor = descriptor.internalContainedType(244, 143, "ProtobufPose3d", "wpi.proto.ProtobufPose3d");
064
065  static final Descriptors.Descriptor wpi_proto_ProtobufTransform3d_descriptor = descriptor.internalContainedType(390, 148, "ProtobufTransform3d", "wpi.proto.ProtobufTransform3d");
066
067  static final Descriptors.Descriptor wpi_proto_ProtobufTwist3d_descriptor = descriptor.internalContainedType(540, 113, "ProtobufTwist3d", "wpi.proto.ProtobufTwist3d");
068
069  /**
070   * @return this proto file's descriptor.
071   */
072  public static Descriptors.FileDescriptor getDescriptor() {
073    return descriptor;
074  }
075
076  /**
077   * Protobuf type {@code ProtobufTranslation3d}
078   */
079  public static final class ProtobufTranslation3d extends ProtoMessage<ProtobufTranslation3d> implements Cloneable {
080    private static final long serialVersionUID = 0L;
081
082    /**
083     * <code>optional double x = 1;</code>
084     */
085    private double x;
086
087    /**
088     * <code>optional double y = 2;</code>
089     */
090    private double y;
091
092    /**
093     * <code>optional double z = 3;</code>
094     */
095    private double z;
096
097    private ProtobufTranslation3d() {
098    }
099
100    /**
101     * @return a new empty instance of {@code ProtobufTranslation3d}
102     */
103    public static ProtobufTranslation3d newInstance() {
104      return new ProtobufTranslation3d();
105    }
106
107    /**
108     * <code>optional double x = 1;</code>
109     * @return whether the x field is set
110     */
111    public boolean hasX() {
112      return (bitField0_ & 0x00000001) != 0;
113    }
114
115    /**
116     * <code>optional double x = 1;</code>
117     * @return this
118     */
119    public ProtobufTranslation3d clearX() {
120      bitField0_ &= ~0x00000001;
121      x = 0D;
122      return this;
123    }
124
125    /**
126     * <code>optional double x = 1;</code>
127     * @return the x
128     */
129    public double getX() {
130      return x;
131    }
132
133    /**
134     * <code>optional double x = 1;</code>
135     * @param value the x to set
136     * @return this
137     */
138    public ProtobufTranslation3d setX(final double value) {
139      bitField0_ |= 0x00000001;
140      x = value;
141      return this;
142    }
143
144    /**
145     * <code>optional double y = 2;</code>
146     * @return whether the y field is set
147     */
148    public boolean hasY() {
149      return (bitField0_ & 0x00000002) != 0;
150    }
151
152    /**
153     * <code>optional double y = 2;</code>
154     * @return this
155     */
156    public ProtobufTranslation3d clearY() {
157      bitField0_ &= ~0x00000002;
158      y = 0D;
159      return this;
160    }
161
162    /**
163     * <code>optional double y = 2;</code>
164     * @return the y
165     */
166    public double getY() {
167      return y;
168    }
169
170    /**
171     * <code>optional double y = 2;</code>
172     * @param value the y to set
173     * @return this
174     */
175    public ProtobufTranslation3d setY(final double value) {
176      bitField0_ |= 0x00000002;
177      y = value;
178      return this;
179    }
180
181    /**
182     * <code>optional double z = 3;</code>
183     * @return whether the z field is set
184     */
185    public boolean hasZ() {
186      return (bitField0_ & 0x00000004) != 0;
187    }
188
189    /**
190     * <code>optional double z = 3;</code>
191     * @return this
192     */
193    public ProtobufTranslation3d clearZ() {
194      bitField0_ &= ~0x00000004;
195      z = 0D;
196      return this;
197    }
198
199    /**
200     * <code>optional double z = 3;</code>
201     * @return the z
202     */
203    public double getZ() {
204      return z;
205    }
206
207    /**
208     * <code>optional double z = 3;</code>
209     * @param value the z to set
210     * @return this
211     */
212    public ProtobufTranslation3d setZ(final double value) {
213      bitField0_ |= 0x00000004;
214      z = value;
215      return this;
216    }
217
218    @Override
219    public ProtobufTranslation3d copyFrom(final ProtobufTranslation3d other) {
220      cachedSize = other.cachedSize;
221      if ((bitField0_ | other.bitField0_) != 0) {
222        bitField0_ = other.bitField0_;
223        x = other.x;
224        y = other.y;
225        z = other.z;
226      }
227      return this;
228    }
229
230    @Override
231    public ProtobufTranslation3d mergeFrom(final ProtobufTranslation3d other) {
232      if (other.isEmpty()) {
233        return this;
234      }
235      cachedSize = -1;
236      if (other.hasX()) {
237        setX(other.x);
238      }
239      if (other.hasY()) {
240        setY(other.y);
241      }
242      if (other.hasZ()) {
243        setZ(other.z);
244      }
245      return this;
246    }
247
248    @Override
249    public ProtobufTranslation3d clear() {
250      if (isEmpty()) {
251        return this;
252      }
253      cachedSize = -1;
254      bitField0_ = 0;
255      x = 0D;
256      y = 0D;
257      z = 0D;
258      return this;
259    }
260
261    @Override
262    public ProtobufTranslation3d clearQuick() {
263      if (isEmpty()) {
264        return this;
265      }
266      cachedSize = -1;
267      bitField0_ = 0;
268      return this;
269    }
270
271    @Override
272    public boolean equals(Object o) {
273      if (o == this) {
274        return true;
275      }
276      if (!(o instanceof ProtobufTranslation3d)) {
277        return false;
278      }
279      ProtobufTranslation3d other = (ProtobufTranslation3d) o;
280      return bitField0_ == other.bitField0_
281        && (!hasX() || ProtoUtil.isEqual(x, other.x))
282        && (!hasY() || ProtoUtil.isEqual(y, other.y))
283        && (!hasZ() || ProtoUtil.isEqual(z, other.z));
284    }
285
286    @Override
287    public void writeTo(final ProtoSink output) throws IOException {
288      if ((bitField0_ & 0x00000001) != 0) {
289        output.writeRawByte((byte) 9);
290        output.writeDoubleNoTag(x);
291      }
292      if ((bitField0_ & 0x00000002) != 0) {
293        output.writeRawByte((byte) 17);
294        output.writeDoubleNoTag(y);
295      }
296      if ((bitField0_ & 0x00000004) != 0) {
297        output.writeRawByte((byte) 25);
298        output.writeDoubleNoTag(z);
299      }
300    }
301
302    @Override
303    protected int computeSerializedSize() {
304      int size = 0;
305      if ((bitField0_ & 0x00000001) != 0) {
306        size += 9;
307      }
308      if ((bitField0_ & 0x00000002) != 0) {
309        size += 9;
310      }
311      if ((bitField0_ & 0x00000004) != 0) {
312        size += 9;
313      }
314      return size;
315    }
316
317    @Override
318    @SuppressWarnings("fallthrough")
319    public ProtobufTranslation3d mergeFrom(final ProtoSource input) throws IOException {
320      // Enabled Fall-Through Optimization (QuickBuffers)
321      int tag = input.readTag();
322      while (true) {
323        switch (tag) {
324          case 9: {
325            // x
326            x = input.readDouble();
327            bitField0_ |= 0x00000001;
328            tag = input.readTag();
329            if (tag != 17) {
330              break;
331            }
332          }
333          case 17: {
334            // y
335            y = input.readDouble();
336            bitField0_ |= 0x00000002;
337            tag = input.readTag();
338            if (tag != 25) {
339              break;
340            }
341          }
342          case 25: {
343            // z
344            z = input.readDouble();
345            bitField0_ |= 0x00000004;
346            tag = input.readTag();
347            if (tag != 0) {
348              break;
349            }
350          }
351          case 0: {
352            return this;
353          }
354          default: {
355            if (!input.skipField(tag)) {
356              return this;
357            }
358            tag = input.readTag();
359            break;
360          }
361        }
362      }
363    }
364
365    @Override
366    public void writeTo(final JsonSink output) throws IOException {
367      output.beginObject();
368      if ((bitField0_ & 0x00000001) != 0) {
369        output.writeDouble(FieldNames.x, x);
370      }
371      if ((bitField0_ & 0x00000002) != 0) {
372        output.writeDouble(FieldNames.y, y);
373      }
374      if ((bitField0_ & 0x00000004) != 0) {
375        output.writeDouble(FieldNames.z, z);
376      }
377      output.endObject();
378    }
379
380    @Override
381    public ProtobufTranslation3d mergeFrom(final JsonSource input) throws IOException {
382      if (!input.beginObject()) {
383        return this;
384      }
385      while (!input.isAtEnd()) {
386        switch (input.readFieldHash()) {
387          case 120: {
388            if (input.isAtField(FieldNames.x)) {
389              if (!input.trySkipNullValue()) {
390                x = input.readDouble();
391                bitField0_ |= 0x00000001;
392              }
393            } else {
394              input.skipUnknownField();
395            }
396            break;
397          }
398          case 121: {
399            if (input.isAtField(FieldNames.y)) {
400              if (!input.trySkipNullValue()) {
401                y = input.readDouble();
402                bitField0_ |= 0x00000002;
403              }
404            } else {
405              input.skipUnknownField();
406            }
407            break;
408          }
409          case 122: {
410            if (input.isAtField(FieldNames.z)) {
411              if (!input.trySkipNullValue()) {
412                z = input.readDouble();
413                bitField0_ |= 0x00000004;
414              }
415            } else {
416              input.skipUnknownField();
417            }
418            break;
419          }
420          default: {
421            input.skipUnknownField();
422            break;
423          }
424        }
425      }
426      input.endObject();
427      return this;
428    }
429
430    @Override
431    public ProtobufTranslation3d clone() {
432      return new ProtobufTranslation3d().copyFrom(this);
433    }
434
435    @Override
436    public boolean isEmpty() {
437      return ((bitField0_) == 0);
438    }
439
440    public static ProtobufTranslation3d parseFrom(final byte[] data) throws
441        InvalidProtocolBufferException {
442      return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), data).checkInitialized();
443    }
444
445    public static ProtobufTranslation3d parseFrom(final ProtoSource input) throws IOException {
446      return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), input).checkInitialized();
447    }
448
449    public static ProtobufTranslation3d parseFrom(final JsonSource input) throws IOException {
450      return ProtoMessage.mergeFrom(new ProtobufTranslation3d(), input).checkInitialized();
451    }
452
453    /**
454     * @return factory for creating ProtobufTranslation3d messages
455     */
456    public static MessageFactory<ProtobufTranslation3d> getFactory() {
457      return ProtobufTranslation3dFactory.INSTANCE;
458    }
459
460    /**
461     * @return this type's descriptor.
462     */
463    public static Descriptors.Descriptor getDescriptor() {
464      return Geometry3D.wpi_proto_ProtobufTranslation3d_descriptor;
465    }
466
467    private enum ProtobufTranslation3dFactory implements MessageFactory<ProtobufTranslation3d> {
468      INSTANCE;
469
470      @Override
471      public ProtobufTranslation3d create() {
472        return ProtobufTranslation3d.newInstance();
473      }
474    }
475
476    /**
477     * Contains name constants used for serializing JSON
478     */
479    static class FieldNames {
480      static final FieldName x = FieldName.forField("x");
481
482      static final FieldName y = FieldName.forField("y");
483
484      static final FieldName z = FieldName.forField("z");
485    }
486  }
487
488  /**
489   * Protobuf type {@code ProtobufQuaternion}
490   */
491  public static final class ProtobufQuaternion extends ProtoMessage<ProtobufQuaternion> implements Cloneable {
492    private static final long serialVersionUID = 0L;
493
494    /**
495     * <code>optional double w = 1;</code>
496     */
497    private double w;
498
499    /**
500     * <code>optional double x = 2;</code>
501     */
502    private double x;
503
504    /**
505     * <code>optional double y = 3;</code>
506     */
507    private double y;
508
509    /**
510     * <code>optional double z = 4;</code>
511     */
512    private double z;
513
514    private ProtobufQuaternion() {
515    }
516
517    /**
518     * @return a new empty instance of {@code ProtobufQuaternion}
519     */
520    public static ProtobufQuaternion newInstance() {
521      return new ProtobufQuaternion();
522    }
523
524    /**
525     * <code>optional double w = 1;</code>
526     * @return whether the w field is set
527     */
528    public boolean hasW() {
529      return (bitField0_ & 0x00000001) != 0;
530    }
531
532    /**
533     * <code>optional double w = 1;</code>
534     * @return this
535     */
536    public ProtobufQuaternion clearW() {
537      bitField0_ &= ~0x00000001;
538      w = 0D;
539      return this;
540    }
541
542    /**
543     * <code>optional double w = 1;</code>
544     * @return the w
545     */
546    public double getW() {
547      return w;
548    }
549
550    /**
551     * <code>optional double w = 1;</code>
552     * @param value the w to set
553     * @return this
554     */
555    public ProtobufQuaternion setW(final double value) {
556      bitField0_ |= 0x00000001;
557      w = value;
558      return this;
559    }
560
561    /**
562     * <code>optional double x = 2;</code>
563     * @return whether the x field is set
564     */
565    public boolean hasX() {
566      return (bitField0_ & 0x00000002) != 0;
567    }
568
569    /**
570     * <code>optional double x = 2;</code>
571     * @return this
572     */
573    public ProtobufQuaternion clearX() {
574      bitField0_ &= ~0x00000002;
575      x = 0D;
576      return this;
577    }
578
579    /**
580     * <code>optional double x = 2;</code>
581     * @return the x
582     */
583    public double getX() {
584      return x;
585    }
586
587    /**
588     * <code>optional double x = 2;</code>
589     * @param value the x to set
590     * @return this
591     */
592    public ProtobufQuaternion setX(final double value) {
593      bitField0_ |= 0x00000002;
594      x = value;
595      return this;
596    }
597
598    /**
599     * <code>optional double y = 3;</code>
600     * @return whether the y field is set
601     */
602    public boolean hasY() {
603      return (bitField0_ & 0x00000004) != 0;
604    }
605
606    /**
607     * <code>optional double y = 3;</code>
608     * @return this
609     */
610    public ProtobufQuaternion clearY() {
611      bitField0_ &= ~0x00000004;
612      y = 0D;
613      return this;
614    }
615
616    /**
617     * <code>optional double y = 3;</code>
618     * @return the y
619     */
620    public double getY() {
621      return y;
622    }
623
624    /**
625     * <code>optional double y = 3;</code>
626     * @param value the y to set
627     * @return this
628     */
629    public ProtobufQuaternion setY(final double value) {
630      bitField0_ |= 0x00000004;
631      y = value;
632      return this;
633    }
634
635    /**
636     * <code>optional double z = 4;</code>
637     * @return whether the z field is set
638     */
639    public boolean hasZ() {
640      return (bitField0_ & 0x00000008) != 0;
641    }
642
643    /**
644     * <code>optional double z = 4;</code>
645     * @return this
646     */
647    public ProtobufQuaternion clearZ() {
648      bitField0_ &= ~0x00000008;
649      z = 0D;
650      return this;
651    }
652
653    /**
654     * <code>optional double z = 4;</code>
655     * @return the z
656     */
657    public double getZ() {
658      return z;
659    }
660
661    /**
662     * <code>optional double z = 4;</code>
663     * @param value the z to set
664     * @return this
665     */
666    public ProtobufQuaternion setZ(final double value) {
667      bitField0_ |= 0x00000008;
668      z = value;
669      return this;
670    }
671
672    @Override
673    public ProtobufQuaternion copyFrom(final ProtobufQuaternion other) {
674      cachedSize = other.cachedSize;
675      if ((bitField0_ | other.bitField0_) != 0) {
676        bitField0_ = other.bitField0_;
677        w = other.w;
678        x = other.x;
679        y = other.y;
680        z = other.z;
681      }
682      return this;
683    }
684
685    @Override
686    public ProtobufQuaternion mergeFrom(final ProtobufQuaternion other) {
687      if (other.isEmpty()) {
688        return this;
689      }
690      cachedSize = -1;
691      if (other.hasW()) {
692        setW(other.w);
693      }
694      if (other.hasX()) {
695        setX(other.x);
696      }
697      if (other.hasY()) {
698        setY(other.y);
699      }
700      if (other.hasZ()) {
701        setZ(other.z);
702      }
703      return this;
704    }
705
706    @Override
707    public ProtobufQuaternion clear() {
708      if (isEmpty()) {
709        return this;
710      }
711      cachedSize = -1;
712      bitField0_ = 0;
713      w = 0D;
714      x = 0D;
715      y = 0D;
716      z = 0D;
717      return this;
718    }
719
720    @Override
721    public ProtobufQuaternion clearQuick() {
722      if (isEmpty()) {
723        return this;
724      }
725      cachedSize = -1;
726      bitField0_ = 0;
727      return this;
728    }
729
730    @Override
731    public boolean equals(Object o) {
732      if (o == this) {
733        return true;
734      }
735      if (!(o instanceof ProtobufQuaternion)) {
736        return false;
737      }
738      ProtobufQuaternion other = (ProtobufQuaternion) o;
739      return bitField0_ == other.bitField0_
740        && (!hasW() || ProtoUtil.isEqual(w, other.w))
741        && (!hasX() || ProtoUtil.isEqual(x, other.x))
742        && (!hasY() || ProtoUtil.isEqual(y, other.y))
743        && (!hasZ() || ProtoUtil.isEqual(z, other.z));
744    }
745
746    @Override
747    public void writeTo(final ProtoSink output) throws IOException {
748      if ((bitField0_ & 0x00000001) != 0) {
749        output.writeRawByte((byte) 9);
750        output.writeDoubleNoTag(w);
751      }
752      if ((bitField0_ & 0x00000002) != 0) {
753        output.writeRawByte((byte) 17);
754        output.writeDoubleNoTag(x);
755      }
756      if ((bitField0_ & 0x00000004) != 0) {
757        output.writeRawByte((byte) 25);
758        output.writeDoubleNoTag(y);
759      }
760      if ((bitField0_ & 0x00000008) != 0) {
761        output.writeRawByte((byte) 33);
762        output.writeDoubleNoTag(z);
763      }
764    }
765
766    @Override
767    protected int computeSerializedSize() {
768      int size = 0;
769      if ((bitField0_ & 0x00000001) != 0) {
770        size += 9;
771      }
772      if ((bitField0_ & 0x00000002) != 0) {
773        size += 9;
774      }
775      if ((bitField0_ & 0x00000004) != 0) {
776        size += 9;
777      }
778      if ((bitField0_ & 0x00000008) != 0) {
779        size += 9;
780      }
781      return size;
782    }
783
784    @Override
785    @SuppressWarnings("fallthrough")
786    public ProtobufQuaternion mergeFrom(final ProtoSource input) throws IOException {
787      // Enabled Fall-Through Optimization (QuickBuffers)
788      int tag = input.readTag();
789      while (true) {
790        switch (tag) {
791          case 9: {
792            // w
793            w = input.readDouble();
794            bitField0_ |= 0x00000001;
795            tag = input.readTag();
796            if (tag != 17) {
797              break;
798            }
799          }
800          case 17: {
801            // x
802            x = input.readDouble();
803            bitField0_ |= 0x00000002;
804            tag = input.readTag();
805            if (tag != 25) {
806              break;
807            }
808          }
809          case 25: {
810            // y
811            y = input.readDouble();
812            bitField0_ |= 0x00000004;
813            tag = input.readTag();
814            if (tag != 33) {
815              break;
816            }
817          }
818          case 33: {
819            // z
820            z = input.readDouble();
821            bitField0_ |= 0x00000008;
822            tag = input.readTag();
823            if (tag != 0) {
824              break;
825            }
826          }
827          case 0: {
828            return this;
829          }
830          default: {
831            if (!input.skipField(tag)) {
832              return this;
833            }
834            tag = input.readTag();
835            break;
836          }
837        }
838      }
839    }
840
841    @Override
842    public void writeTo(final JsonSink output) throws IOException {
843      output.beginObject();
844      if ((bitField0_ & 0x00000001) != 0) {
845        output.writeDouble(FieldNames.w, w);
846      }
847      if ((bitField0_ & 0x00000002) != 0) {
848        output.writeDouble(FieldNames.x, x);
849      }
850      if ((bitField0_ & 0x00000004) != 0) {
851        output.writeDouble(FieldNames.y, y);
852      }
853      if ((bitField0_ & 0x00000008) != 0) {
854        output.writeDouble(FieldNames.z, z);
855      }
856      output.endObject();
857    }
858
859    @Override
860    public ProtobufQuaternion mergeFrom(final JsonSource input) throws IOException {
861      if (!input.beginObject()) {
862        return this;
863      }
864      while (!input.isAtEnd()) {
865        switch (input.readFieldHash()) {
866          case 119: {
867            if (input.isAtField(FieldNames.w)) {
868              if (!input.trySkipNullValue()) {
869                w = input.readDouble();
870                bitField0_ |= 0x00000001;
871              }
872            } else {
873              input.skipUnknownField();
874            }
875            break;
876          }
877          case 120: {
878            if (input.isAtField(FieldNames.x)) {
879              if (!input.trySkipNullValue()) {
880                x = input.readDouble();
881                bitField0_ |= 0x00000002;
882              }
883            } else {
884              input.skipUnknownField();
885            }
886            break;
887          }
888          case 121: {
889            if (input.isAtField(FieldNames.y)) {
890              if (!input.trySkipNullValue()) {
891                y = input.readDouble();
892                bitField0_ |= 0x00000004;
893              }
894            } else {
895              input.skipUnknownField();
896            }
897            break;
898          }
899          case 122: {
900            if (input.isAtField(FieldNames.z)) {
901              if (!input.trySkipNullValue()) {
902                z = input.readDouble();
903                bitField0_ |= 0x00000008;
904              }
905            } else {
906              input.skipUnknownField();
907            }
908            break;
909          }
910          default: {
911            input.skipUnknownField();
912            break;
913          }
914        }
915      }
916      input.endObject();
917      return this;
918    }
919
920    @Override
921    public ProtobufQuaternion clone() {
922      return new ProtobufQuaternion().copyFrom(this);
923    }
924
925    @Override
926    public boolean isEmpty() {
927      return ((bitField0_) == 0);
928    }
929
930    public static ProtobufQuaternion parseFrom(final byte[] data) throws
931        InvalidProtocolBufferException {
932      return ProtoMessage.mergeFrom(new ProtobufQuaternion(), data).checkInitialized();
933    }
934
935    public static ProtobufQuaternion parseFrom(final ProtoSource input) throws IOException {
936      return ProtoMessage.mergeFrom(new ProtobufQuaternion(), input).checkInitialized();
937    }
938
939    public static ProtobufQuaternion parseFrom(final JsonSource input) throws IOException {
940      return ProtoMessage.mergeFrom(new ProtobufQuaternion(), input).checkInitialized();
941    }
942
943    /**
944     * @return factory for creating ProtobufQuaternion messages
945     */
946    public static MessageFactory<ProtobufQuaternion> getFactory() {
947      return ProtobufQuaternionFactory.INSTANCE;
948    }
949
950    /**
951     * @return this type's descriptor.
952     */
953    public static Descriptors.Descriptor getDescriptor() {
954      return Geometry3D.wpi_proto_ProtobufQuaternion_descriptor;
955    }
956
957    private enum ProtobufQuaternionFactory implements MessageFactory<ProtobufQuaternion> {
958      INSTANCE;
959
960      @Override
961      public ProtobufQuaternion create() {
962        return ProtobufQuaternion.newInstance();
963      }
964    }
965
966    /**
967     * Contains name constants used for serializing JSON
968     */
969    static class FieldNames {
970      static final FieldName w = FieldName.forField("w");
971
972      static final FieldName x = FieldName.forField("x");
973
974      static final FieldName y = FieldName.forField("y");
975
976      static final FieldName z = FieldName.forField("z");
977    }
978  }
979
980  /**
981   * Protobuf type {@code ProtobufRotation3d}
982   */
983  public static final class ProtobufRotation3d extends ProtoMessage<ProtobufRotation3d> implements Cloneable {
984    private static final long serialVersionUID = 0L;
985
986    /**
987     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
988     */
989    private final ProtobufQuaternion q = ProtobufQuaternion.newInstance();
990
991    private ProtobufRotation3d() {
992    }
993
994    /**
995     * @return a new empty instance of {@code ProtobufRotation3d}
996     */
997    public static ProtobufRotation3d newInstance() {
998      return new ProtobufRotation3d();
999    }
1000
1001    /**
1002     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
1003     * @return whether the q field is set
1004     */
1005    public boolean hasQ() {
1006      return (bitField0_ & 0x00000001) != 0;
1007    }
1008
1009    /**
1010     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
1011     * @return this
1012     */
1013    public ProtobufRotation3d clearQ() {
1014      bitField0_ &= ~0x00000001;
1015      q.clear();
1016      return this;
1017    }
1018
1019    /**
1020     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
1021     *
1022     * This method returns the internal storage object without modifying any has state.
1023     * The returned object should not be modified and be treated as read-only.
1024     *
1025     * Use {@link #getMutableQ()} if you want to modify it.
1026     *
1027     * @return internal storage object for reading
1028     */
1029    public ProtobufQuaternion getQ() {
1030      return q;
1031    }
1032
1033    /**
1034     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
1035     *
1036     * This method returns the internal storage object and sets the corresponding
1037     * has state. The returned object will become part of this message and its
1038     * contents may be modified as long as the has state is not cleared.
1039     *
1040     * @return internal storage object for modifications
1041     */
1042    public ProtobufQuaternion getMutableQ() {
1043      bitField0_ |= 0x00000001;
1044      return q;
1045    }
1046
1047    /**
1048     * <code>optional .wpi.proto.ProtobufQuaternion q = 1;</code>
1049     * @param value the q to set
1050     * @return this
1051     */
1052    public ProtobufRotation3d setQ(final ProtobufQuaternion value) {
1053      bitField0_ |= 0x00000001;
1054      q.copyFrom(value);
1055      return this;
1056    }
1057
1058    @Override
1059    public ProtobufRotation3d copyFrom(final ProtobufRotation3d other) {
1060      cachedSize = other.cachedSize;
1061      if ((bitField0_ | other.bitField0_) != 0) {
1062        bitField0_ = other.bitField0_;
1063        q.copyFrom(other.q);
1064      }
1065      return this;
1066    }
1067
1068    @Override
1069    public ProtobufRotation3d mergeFrom(final ProtobufRotation3d other) {
1070      if (other.isEmpty()) {
1071        return this;
1072      }
1073      cachedSize = -1;
1074      if (other.hasQ()) {
1075        getMutableQ().mergeFrom(other.q);
1076      }
1077      return this;
1078    }
1079
1080    @Override
1081    public ProtobufRotation3d clear() {
1082      if (isEmpty()) {
1083        return this;
1084      }
1085      cachedSize = -1;
1086      bitField0_ = 0;
1087      q.clear();
1088      return this;
1089    }
1090
1091    @Override
1092    public ProtobufRotation3d clearQuick() {
1093      if (isEmpty()) {
1094        return this;
1095      }
1096      cachedSize = -1;
1097      bitField0_ = 0;
1098      q.clearQuick();
1099      return this;
1100    }
1101
1102    @Override
1103    public boolean equals(Object o) {
1104      if (o == this) {
1105        return true;
1106      }
1107      if (!(o instanceof ProtobufRotation3d)) {
1108        return false;
1109      }
1110      ProtobufRotation3d other = (ProtobufRotation3d) o;
1111      return bitField0_ == other.bitField0_
1112        && (!hasQ() || q.equals(other.q));
1113    }
1114
1115    @Override
1116    public void writeTo(final ProtoSink output) throws IOException {
1117      if ((bitField0_ & 0x00000001) != 0) {
1118        output.writeRawByte((byte) 10);
1119        output.writeMessageNoTag(q);
1120      }
1121    }
1122
1123    @Override
1124    protected int computeSerializedSize() {
1125      int size = 0;
1126      if ((bitField0_ & 0x00000001) != 0) {
1127        size += 1 + ProtoSink.computeMessageSizeNoTag(q);
1128      }
1129      return size;
1130    }
1131
1132    @Override
1133    @SuppressWarnings("fallthrough")
1134    public ProtobufRotation3d mergeFrom(final ProtoSource input) throws IOException {
1135      // Enabled Fall-Through Optimization (QuickBuffers)
1136      int tag = input.readTag();
1137      while (true) {
1138        switch (tag) {
1139          case 10: {
1140            // q
1141            input.readMessage(q);
1142            bitField0_ |= 0x00000001;
1143            tag = input.readTag();
1144            if (tag != 0) {
1145              break;
1146            }
1147          }
1148          case 0: {
1149            return this;
1150          }
1151          default: {
1152            if (!input.skipField(tag)) {
1153              return this;
1154            }
1155            tag = input.readTag();
1156            break;
1157          }
1158        }
1159      }
1160    }
1161
1162    @Override
1163    public void writeTo(final JsonSink output) throws IOException {
1164      output.beginObject();
1165      if ((bitField0_ & 0x00000001) != 0) {
1166        output.writeMessage(FieldNames.q, q);
1167      }
1168      output.endObject();
1169    }
1170
1171    @Override
1172    public ProtobufRotation3d mergeFrom(final JsonSource input) throws IOException {
1173      if (!input.beginObject()) {
1174        return this;
1175      }
1176      while (!input.isAtEnd()) {
1177        switch (input.readFieldHash()) {
1178          case 113: {
1179            if (input.isAtField(FieldNames.q)) {
1180              if (!input.trySkipNullValue()) {
1181                input.readMessage(q);
1182                bitField0_ |= 0x00000001;
1183              }
1184            } else {
1185              input.skipUnknownField();
1186            }
1187            break;
1188          }
1189          default: {
1190            input.skipUnknownField();
1191            break;
1192          }
1193        }
1194      }
1195      input.endObject();
1196      return this;
1197    }
1198
1199    @Override
1200    public ProtobufRotation3d clone() {
1201      return new ProtobufRotation3d().copyFrom(this);
1202    }
1203
1204    @Override
1205    public boolean isEmpty() {
1206      return ((bitField0_) == 0);
1207    }
1208
1209    public static ProtobufRotation3d parseFrom(final byte[] data) throws
1210        InvalidProtocolBufferException {
1211      return ProtoMessage.mergeFrom(new ProtobufRotation3d(), data).checkInitialized();
1212    }
1213
1214    public static ProtobufRotation3d parseFrom(final ProtoSource input) throws IOException {
1215      return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
1216    }
1217
1218    public static ProtobufRotation3d parseFrom(final JsonSource input) throws IOException {
1219      return ProtoMessage.mergeFrom(new ProtobufRotation3d(), input).checkInitialized();
1220    }
1221
1222    /**
1223     * @return factory for creating ProtobufRotation3d messages
1224     */
1225    public static MessageFactory<ProtobufRotation3d> getFactory() {
1226      return ProtobufRotation3dFactory.INSTANCE;
1227    }
1228
1229    /**
1230     * @return this type's descriptor.
1231     */
1232    public static Descriptors.Descriptor getDescriptor() {
1233      return Geometry3D.wpi_proto_ProtobufRotation3d_descriptor;
1234    }
1235
1236    private enum ProtobufRotation3dFactory implements MessageFactory<ProtobufRotation3d> {
1237      INSTANCE;
1238
1239      @Override
1240      public ProtobufRotation3d create() {
1241        return ProtobufRotation3d.newInstance();
1242      }
1243    }
1244
1245    /**
1246     * Contains name constants used for serializing JSON
1247     */
1248    static class FieldNames {
1249      static final FieldName q = FieldName.forField("q");
1250    }
1251  }
1252
1253  /**
1254   * Protobuf type {@code ProtobufPose3d}
1255   */
1256  public static final class ProtobufPose3d extends ProtoMessage<ProtobufPose3d> implements Cloneable {
1257    private static final long serialVersionUID = 0L;
1258
1259    /**
1260     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1261     */
1262    private final ProtobufTranslation3d translation = ProtobufTranslation3d.newInstance();
1263
1264    /**
1265     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1266     */
1267    private final ProtobufRotation3d rotation = ProtobufRotation3d.newInstance();
1268
1269    private ProtobufPose3d() {
1270    }
1271
1272    /**
1273     * @return a new empty instance of {@code ProtobufPose3d}
1274     */
1275    public static ProtobufPose3d newInstance() {
1276      return new ProtobufPose3d();
1277    }
1278
1279    /**
1280     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1281     * @return whether the translation field is set
1282     */
1283    public boolean hasTranslation() {
1284      return (bitField0_ & 0x00000001) != 0;
1285    }
1286
1287    /**
1288     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1289     * @return this
1290     */
1291    public ProtobufPose3d clearTranslation() {
1292      bitField0_ &= ~0x00000001;
1293      translation.clear();
1294      return this;
1295    }
1296
1297    /**
1298     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1299     *
1300     * This method returns the internal storage object without modifying any has state.
1301     * The returned object should not be modified and be treated as read-only.
1302     *
1303     * Use {@link #getMutableTranslation()} if you want to modify it.
1304     *
1305     * @return internal storage object for reading
1306     */
1307    public ProtobufTranslation3d getTranslation() {
1308      return translation;
1309    }
1310
1311    /**
1312     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1313     *
1314     * This method returns the internal storage object and sets the corresponding
1315     * has state. The returned object will become part of this message and its
1316     * contents may be modified as long as the has state is not cleared.
1317     *
1318     * @return internal storage object for modifications
1319     */
1320    public ProtobufTranslation3d getMutableTranslation() {
1321      bitField0_ |= 0x00000001;
1322      return translation;
1323    }
1324
1325    /**
1326     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1327     * @param value the translation to set
1328     * @return this
1329     */
1330    public ProtobufPose3d setTranslation(final ProtobufTranslation3d value) {
1331      bitField0_ |= 0x00000001;
1332      translation.copyFrom(value);
1333      return this;
1334    }
1335
1336    /**
1337     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1338     * @return whether the rotation field is set
1339     */
1340    public boolean hasRotation() {
1341      return (bitField0_ & 0x00000002) != 0;
1342    }
1343
1344    /**
1345     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1346     * @return this
1347     */
1348    public ProtobufPose3d clearRotation() {
1349      bitField0_ &= ~0x00000002;
1350      rotation.clear();
1351      return this;
1352    }
1353
1354    /**
1355     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1356     *
1357     * This method returns the internal storage object without modifying any has state.
1358     * The returned object should not be modified and be treated as read-only.
1359     *
1360     * Use {@link #getMutableRotation()} if you want to modify it.
1361     *
1362     * @return internal storage object for reading
1363     */
1364    public ProtobufRotation3d getRotation() {
1365      return rotation;
1366    }
1367
1368    /**
1369     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1370     *
1371     * This method returns the internal storage object and sets the corresponding
1372     * has state. The returned object will become part of this message and its
1373     * contents may be modified as long as the has state is not cleared.
1374     *
1375     * @return internal storage object for modifications
1376     */
1377    public ProtobufRotation3d getMutableRotation() {
1378      bitField0_ |= 0x00000002;
1379      return rotation;
1380    }
1381
1382    /**
1383     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1384     * @param value the rotation to set
1385     * @return this
1386     */
1387    public ProtobufPose3d setRotation(final ProtobufRotation3d value) {
1388      bitField0_ |= 0x00000002;
1389      rotation.copyFrom(value);
1390      return this;
1391    }
1392
1393    @Override
1394    public ProtobufPose3d copyFrom(final ProtobufPose3d other) {
1395      cachedSize = other.cachedSize;
1396      if ((bitField0_ | other.bitField0_) != 0) {
1397        bitField0_ = other.bitField0_;
1398        translation.copyFrom(other.translation);
1399        rotation.copyFrom(other.rotation);
1400      }
1401      return this;
1402    }
1403
1404    @Override
1405    public ProtobufPose3d mergeFrom(final ProtobufPose3d other) {
1406      if (other.isEmpty()) {
1407        return this;
1408      }
1409      cachedSize = -1;
1410      if (other.hasTranslation()) {
1411        getMutableTranslation().mergeFrom(other.translation);
1412      }
1413      if (other.hasRotation()) {
1414        getMutableRotation().mergeFrom(other.rotation);
1415      }
1416      return this;
1417    }
1418
1419    @Override
1420    public ProtobufPose3d clear() {
1421      if (isEmpty()) {
1422        return this;
1423      }
1424      cachedSize = -1;
1425      bitField0_ = 0;
1426      translation.clear();
1427      rotation.clear();
1428      return this;
1429    }
1430
1431    @Override
1432    public ProtobufPose3d clearQuick() {
1433      if (isEmpty()) {
1434        return this;
1435      }
1436      cachedSize = -1;
1437      bitField0_ = 0;
1438      translation.clearQuick();
1439      rotation.clearQuick();
1440      return this;
1441    }
1442
1443    @Override
1444    public boolean equals(Object o) {
1445      if (o == this) {
1446        return true;
1447      }
1448      if (!(o instanceof ProtobufPose3d)) {
1449        return false;
1450      }
1451      ProtobufPose3d other = (ProtobufPose3d) o;
1452      return bitField0_ == other.bitField0_
1453        && (!hasTranslation() || translation.equals(other.translation))
1454        && (!hasRotation() || rotation.equals(other.rotation));
1455    }
1456
1457    @Override
1458    public void writeTo(final ProtoSink output) throws IOException {
1459      if ((bitField0_ & 0x00000001) != 0) {
1460        output.writeRawByte((byte) 10);
1461        output.writeMessageNoTag(translation);
1462      }
1463      if ((bitField0_ & 0x00000002) != 0) {
1464        output.writeRawByte((byte) 18);
1465        output.writeMessageNoTag(rotation);
1466      }
1467    }
1468
1469    @Override
1470    protected int computeSerializedSize() {
1471      int size = 0;
1472      if ((bitField0_ & 0x00000001) != 0) {
1473        size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
1474      }
1475      if ((bitField0_ & 0x00000002) != 0) {
1476        size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
1477      }
1478      return size;
1479    }
1480
1481    @Override
1482    @SuppressWarnings("fallthrough")
1483    public ProtobufPose3d mergeFrom(final ProtoSource input) throws IOException {
1484      // Enabled Fall-Through Optimization (QuickBuffers)
1485      int tag = input.readTag();
1486      while (true) {
1487        switch (tag) {
1488          case 10: {
1489            // translation
1490            input.readMessage(translation);
1491            bitField0_ |= 0x00000001;
1492            tag = input.readTag();
1493            if (tag != 18) {
1494              break;
1495            }
1496          }
1497          case 18: {
1498            // rotation
1499            input.readMessage(rotation);
1500            bitField0_ |= 0x00000002;
1501            tag = input.readTag();
1502            if (tag != 0) {
1503              break;
1504            }
1505          }
1506          case 0: {
1507            return this;
1508          }
1509          default: {
1510            if (!input.skipField(tag)) {
1511              return this;
1512            }
1513            tag = input.readTag();
1514            break;
1515          }
1516        }
1517      }
1518    }
1519
1520    @Override
1521    public void writeTo(final JsonSink output) throws IOException {
1522      output.beginObject();
1523      if ((bitField0_ & 0x00000001) != 0) {
1524        output.writeMessage(FieldNames.translation, translation);
1525      }
1526      if ((bitField0_ & 0x00000002) != 0) {
1527        output.writeMessage(FieldNames.rotation, rotation);
1528      }
1529      output.endObject();
1530    }
1531
1532    @Override
1533    public ProtobufPose3d mergeFrom(final JsonSource input) throws IOException {
1534      if (!input.beginObject()) {
1535        return this;
1536      }
1537      while (!input.isAtEnd()) {
1538        switch (input.readFieldHash()) {
1539          case -1840647503: {
1540            if (input.isAtField(FieldNames.translation)) {
1541              if (!input.trySkipNullValue()) {
1542                input.readMessage(translation);
1543                bitField0_ |= 0x00000001;
1544              }
1545            } else {
1546              input.skipUnknownField();
1547            }
1548            break;
1549          }
1550          case -40300674: {
1551            if (input.isAtField(FieldNames.rotation)) {
1552              if (!input.trySkipNullValue()) {
1553                input.readMessage(rotation);
1554                bitField0_ |= 0x00000002;
1555              }
1556            } else {
1557              input.skipUnknownField();
1558            }
1559            break;
1560          }
1561          default: {
1562            input.skipUnknownField();
1563            break;
1564          }
1565        }
1566      }
1567      input.endObject();
1568      return this;
1569    }
1570
1571    @Override
1572    public ProtobufPose3d clone() {
1573      return new ProtobufPose3d().copyFrom(this);
1574    }
1575
1576    @Override
1577    public boolean isEmpty() {
1578      return ((bitField0_) == 0);
1579    }
1580
1581    public static ProtobufPose3d parseFrom(final byte[] data) throws
1582        InvalidProtocolBufferException {
1583      return ProtoMessage.mergeFrom(new ProtobufPose3d(), data).checkInitialized();
1584    }
1585
1586    public static ProtobufPose3d parseFrom(final ProtoSource input) throws IOException {
1587      return ProtoMessage.mergeFrom(new ProtobufPose3d(), input).checkInitialized();
1588    }
1589
1590    public static ProtobufPose3d parseFrom(final JsonSource input) throws IOException {
1591      return ProtoMessage.mergeFrom(new ProtobufPose3d(), input).checkInitialized();
1592    }
1593
1594    /**
1595     * @return factory for creating ProtobufPose3d messages
1596     */
1597    public static MessageFactory<ProtobufPose3d> getFactory() {
1598      return ProtobufPose3dFactory.INSTANCE;
1599    }
1600
1601    /**
1602     * @return this type's descriptor.
1603     */
1604    public static Descriptors.Descriptor getDescriptor() {
1605      return Geometry3D.wpi_proto_ProtobufPose3d_descriptor;
1606    }
1607
1608    private enum ProtobufPose3dFactory implements MessageFactory<ProtobufPose3d> {
1609      INSTANCE;
1610
1611      @Override
1612      public ProtobufPose3d create() {
1613        return ProtobufPose3d.newInstance();
1614      }
1615    }
1616
1617    /**
1618     * Contains name constants used for serializing JSON
1619     */
1620    static class FieldNames {
1621      static final FieldName translation = FieldName.forField("translation");
1622
1623      static final FieldName rotation = FieldName.forField("rotation");
1624    }
1625  }
1626
1627  /**
1628   * Protobuf type {@code ProtobufTransform3d}
1629   */
1630  public static final class ProtobufTransform3d extends ProtoMessage<ProtobufTransform3d> implements Cloneable {
1631    private static final long serialVersionUID = 0L;
1632
1633    /**
1634     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1635     */
1636    private final ProtobufTranslation3d translation = ProtobufTranslation3d.newInstance();
1637
1638    /**
1639     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1640     */
1641    private final ProtobufRotation3d rotation = ProtobufRotation3d.newInstance();
1642
1643    private ProtobufTransform3d() {
1644    }
1645
1646    /**
1647     * @return a new empty instance of {@code ProtobufTransform3d}
1648     */
1649    public static ProtobufTransform3d newInstance() {
1650      return new ProtobufTransform3d();
1651    }
1652
1653    /**
1654     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1655     * @return whether the translation field is set
1656     */
1657    public boolean hasTranslation() {
1658      return (bitField0_ & 0x00000001) != 0;
1659    }
1660
1661    /**
1662     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1663     * @return this
1664     */
1665    public ProtobufTransform3d clearTranslation() {
1666      bitField0_ &= ~0x00000001;
1667      translation.clear();
1668      return this;
1669    }
1670
1671    /**
1672     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1673     *
1674     * This method returns the internal storage object without modifying any has state.
1675     * The returned object should not be modified and be treated as read-only.
1676     *
1677     * Use {@link #getMutableTranslation()} if you want to modify it.
1678     *
1679     * @return internal storage object for reading
1680     */
1681    public ProtobufTranslation3d getTranslation() {
1682      return translation;
1683    }
1684
1685    /**
1686     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1687     *
1688     * This method returns the internal storage object and sets the corresponding
1689     * has state. The returned object will become part of this message and its
1690     * contents may be modified as long as the has state is not cleared.
1691     *
1692     * @return internal storage object for modifications
1693     */
1694    public ProtobufTranslation3d getMutableTranslation() {
1695      bitField0_ |= 0x00000001;
1696      return translation;
1697    }
1698
1699    /**
1700     * <code>optional .wpi.proto.ProtobufTranslation3d translation = 1;</code>
1701     * @param value the translation to set
1702     * @return this
1703     */
1704    public ProtobufTransform3d setTranslation(final ProtobufTranslation3d value) {
1705      bitField0_ |= 0x00000001;
1706      translation.copyFrom(value);
1707      return this;
1708    }
1709
1710    /**
1711     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1712     * @return whether the rotation field is set
1713     */
1714    public boolean hasRotation() {
1715      return (bitField0_ & 0x00000002) != 0;
1716    }
1717
1718    /**
1719     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1720     * @return this
1721     */
1722    public ProtobufTransform3d clearRotation() {
1723      bitField0_ &= ~0x00000002;
1724      rotation.clear();
1725      return this;
1726    }
1727
1728    /**
1729     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1730     *
1731     * This method returns the internal storage object without modifying any has state.
1732     * The returned object should not be modified and be treated as read-only.
1733     *
1734     * Use {@link #getMutableRotation()} if you want to modify it.
1735     *
1736     * @return internal storage object for reading
1737     */
1738    public ProtobufRotation3d getRotation() {
1739      return rotation;
1740    }
1741
1742    /**
1743     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1744     *
1745     * This method returns the internal storage object and sets the corresponding
1746     * has state. The returned object will become part of this message and its
1747     * contents may be modified as long as the has state is not cleared.
1748     *
1749     * @return internal storage object for modifications
1750     */
1751    public ProtobufRotation3d getMutableRotation() {
1752      bitField0_ |= 0x00000002;
1753      return rotation;
1754    }
1755
1756    /**
1757     * <code>optional .wpi.proto.ProtobufRotation3d rotation = 2;</code>
1758     * @param value the rotation to set
1759     * @return this
1760     */
1761    public ProtobufTransform3d setRotation(final ProtobufRotation3d value) {
1762      bitField0_ |= 0x00000002;
1763      rotation.copyFrom(value);
1764      return this;
1765    }
1766
1767    @Override
1768    public ProtobufTransform3d copyFrom(final ProtobufTransform3d other) {
1769      cachedSize = other.cachedSize;
1770      if ((bitField0_ | other.bitField0_) != 0) {
1771        bitField0_ = other.bitField0_;
1772        translation.copyFrom(other.translation);
1773        rotation.copyFrom(other.rotation);
1774      }
1775      return this;
1776    }
1777
1778    @Override
1779    public ProtobufTransform3d mergeFrom(final ProtobufTransform3d other) {
1780      if (other.isEmpty()) {
1781        return this;
1782      }
1783      cachedSize = -1;
1784      if (other.hasTranslation()) {
1785        getMutableTranslation().mergeFrom(other.translation);
1786      }
1787      if (other.hasRotation()) {
1788        getMutableRotation().mergeFrom(other.rotation);
1789      }
1790      return this;
1791    }
1792
1793    @Override
1794    public ProtobufTransform3d clear() {
1795      if (isEmpty()) {
1796        return this;
1797      }
1798      cachedSize = -1;
1799      bitField0_ = 0;
1800      translation.clear();
1801      rotation.clear();
1802      return this;
1803    }
1804
1805    @Override
1806    public ProtobufTransform3d clearQuick() {
1807      if (isEmpty()) {
1808        return this;
1809      }
1810      cachedSize = -1;
1811      bitField0_ = 0;
1812      translation.clearQuick();
1813      rotation.clearQuick();
1814      return this;
1815    }
1816
1817    @Override
1818    public boolean equals(Object o) {
1819      if (o == this) {
1820        return true;
1821      }
1822      if (!(o instanceof ProtobufTransform3d)) {
1823        return false;
1824      }
1825      ProtobufTransform3d other = (ProtobufTransform3d) o;
1826      return bitField0_ == other.bitField0_
1827        && (!hasTranslation() || translation.equals(other.translation))
1828        && (!hasRotation() || rotation.equals(other.rotation));
1829    }
1830
1831    @Override
1832    public void writeTo(final ProtoSink output) throws IOException {
1833      if ((bitField0_ & 0x00000001) != 0) {
1834        output.writeRawByte((byte) 10);
1835        output.writeMessageNoTag(translation);
1836      }
1837      if ((bitField0_ & 0x00000002) != 0) {
1838        output.writeRawByte((byte) 18);
1839        output.writeMessageNoTag(rotation);
1840      }
1841    }
1842
1843    @Override
1844    protected int computeSerializedSize() {
1845      int size = 0;
1846      if ((bitField0_ & 0x00000001) != 0) {
1847        size += 1 + ProtoSink.computeMessageSizeNoTag(translation);
1848      }
1849      if ((bitField0_ & 0x00000002) != 0) {
1850        size += 1 + ProtoSink.computeMessageSizeNoTag(rotation);
1851      }
1852      return size;
1853    }
1854
1855    @Override
1856    @SuppressWarnings("fallthrough")
1857    public ProtobufTransform3d mergeFrom(final ProtoSource input) throws IOException {
1858      // Enabled Fall-Through Optimization (QuickBuffers)
1859      int tag = input.readTag();
1860      while (true) {
1861        switch (tag) {
1862          case 10: {
1863            // translation
1864            input.readMessage(translation);
1865            bitField0_ |= 0x00000001;
1866            tag = input.readTag();
1867            if (tag != 18) {
1868              break;
1869            }
1870          }
1871          case 18: {
1872            // rotation
1873            input.readMessage(rotation);
1874            bitField0_ |= 0x00000002;
1875            tag = input.readTag();
1876            if (tag != 0) {
1877              break;
1878            }
1879          }
1880          case 0: {
1881            return this;
1882          }
1883          default: {
1884            if (!input.skipField(tag)) {
1885              return this;
1886            }
1887            tag = input.readTag();
1888            break;
1889          }
1890        }
1891      }
1892    }
1893
1894    @Override
1895    public void writeTo(final JsonSink output) throws IOException {
1896      output.beginObject();
1897      if ((bitField0_ & 0x00000001) != 0) {
1898        output.writeMessage(FieldNames.translation, translation);
1899      }
1900      if ((bitField0_ & 0x00000002) != 0) {
1901        output.writeMessage(FieldNames.rotation, rotation);
1902      }
1903      output.endObject();
1904    }
1905
1906    @Override
1907    public ProtobufTransform3d mergeFrom(final JsonSource input) throws IOException {
1908      if (!input.beginObject()) {
1909        return this;
1910      }
1911      while (!input.isAtEnd()) {
1912        switch (input.readFieldHash()) {
1913          case -1840647503: {
1914            if (input.isAtField(FieldNames.translation)) {
1915              if (!input.trySkipNullValue()) {
1916                input.readMessage(translation);
1917                bitField0_ |= 0x00000001;
1918              }
1919            } else {
1920              input.skipUnknownField();
1921            }
1922            break;
1923          }
1924          case -40300674: {
1925            if (input.isAtField(FieldNames.rotation)) {
1926              if (!input.trySkipNullValue()) {
1927                input.readMessage(rotation);
1928                bitField0_ |= 0x00000002;
1929              }
1930            } else {
1931              input.skipUnknownField();
1932            }
1933            break;
1934          }
1935          default: {
1936            input.skipUnknownField();
1937            break;
1938          }
1939        }
1940      }
1941      input.endObject();
1942      return this;
1943    }
1944
1945    @Override
1946    public ProtobufTransform3d clone() {
1947      return new ProtobufTransform3d().copyFrom(this);
1948    }
1949
1950    @Override
1951    public boolean isEmpty() {
1952      return ((bitField0_) == 0);
1953    }
1954
1955    public static ProtobufTransform3d parseFrom(final byte[] data) throws
1956        InvalidProtocolBufferException {
1957      return ProtoMessage.mergeFrom(new ProtobufTransform3d(), data).checkInitialized();
1958    }
1959
1960    public static ProtobufTransform3d parseFrom(final ProtoSource input) throws IOException {
1961      return ProtoMessage.mergeFrom(new ProtobufTransform3d(), input).checkInitialized();
1962    }
1963
1964    public static ProtobufTransform3d parseFrom(final JsonSource input) throws IOException {
1965      return ProtoMessage.mergeFrom(new ProtobufTransform3d(), input).checkInitialized();
1966    }
1967
1968    /**
1969     * @return factory for creating ProtobufTransform3d messages
1970     */
1971    public static MessageFactory<ProtobufTransform3d> getFactory() {
1972      return ProtobufTransform3dFactory.INSTANCE;
1973    }
1974
1975    /**
1976     * @return this type's descriptor.
1977     */
1978    public static Descriptors.Descriptor getDescriptor() {
1979      return Geometry3D.wpi_proto_ProtobufTransform3d_descriptor;
1980    }
1981
1982    private enum ProtobufTransform3dFactory implements MessageFactory<ProtobufTransform3d> {
1983      INSTANCE;
1984
1985      @Override
1986      public ProtobufTransform3d create() {
1987        return ProtobufTransform3d.newInstance();
1988      }
1989    }
1990
1991    /**
1992     * Contains name constants used for serializing JSON
1993     */
1994    static class FieldNames {
1995      static final FieldName translation = FieldName.forField("translation");
1996
1997      static final FieldName rotation = FieldName.forField("rotation");
1998    }
1999  }
2000
2001  /**
2002   * Protobuf type {@code ProtobufTwist3d}
2003   */
2004  public static final class ProtobufTwist3d extends ProtoMessage<ProtobufTwist3d> implements Cloneable {
2005    private static final long serialVersionUID = 0L;
2006
2007    /**
2008     * <code>optional double dx = 1;</code>
2009     */
2010    private double dx;
2011
2012    /**
2013     * <code>optional double dy = 2;</code>
2014     */
2015    private double dy;
2016
2017    /**
2018     * <code>optional double dz = 3;</code>
2019     */
2020    private double dz;
2021
2022    /**
2023     * <code>optional double rx = 4;</code>
2024     */
2025    private double rx;
2026
2027    /**
2028     * <code>optional double ry = 5;</code>
2029     */
2030    private double ry;
2031
2032    /**
2033     * <code>optional double rz = 6;</code>
2034     */
2035    private double rz;
2036
2037    private ProtobufTwist3d() {
2038    }
2039
2040    /**
2041     * @return a new empty instance of {@code ProtobufTwist3d}
2042     */
2043    public static ProtobufTwist3d newInstance() {
2044      return new ProtobufTwist3d();
2045    }
2046
2047    /**
2048     * <code>optional double dx = 1;</code>
2049     * @return whether the dx field is set
2050     */
2051    public boolean hasDx() {
2052      return (bitField0_ & 0x00000001) != 0;
2053    }
2054
2055    /**
2056     * <code>optional double dx = 1;</code>
2057     * @return this
2058     */
2059    public ProtobufTwist3d clearDx() {
2060      bitField0_ &= ~0x00000001;
2061      dx = 0D;
2062      return this;
2063    }
2064
2065    /**
2066     * <code>optional double dx = 1;</code>
2067     * @return the dx
2068     */
2069    public double getDx() {
2070      return dx;
2071    }
2072
2073    /**
2074     * <code>optional double dx = 1;</code>
2075     * @param value the dx to set
2076     * @return this
2077     */
2078    public ProtobufTwist3d setDx(final double value) {
2079      bitField0_ |= 0x00000001;
2080      dx = value;
2081      return this;
2082    }
2083
2084    /**
2085     * <code>optional double dy = 2;</code>
2086     * @return whether the dy field is set
2087     */
2088    public boolean hasDy() {
2089      return (bitField0_ & 0x00000002) != 0;
2090    }
2091
2092    /**
2093     * <code>optional double dy = 2;</code>
2094     * @return this
2095     */
2096    public ProtobufTwist3d clearDy() {
2097      bitField0_ &= ~0x00000002;
2098      dy = 0D;
2099      return this;
2100    }
2101
2102    /**
2103     * <code>optional double dy = 2;</code>
2104     * @return the dy
2105     */
2106    public double getDy() {
2107      return dy;
2108    }
2109
2110    /**
2111     * <code>optional double dy = 2;</code>
2112     * @param value the dy to set
2113     * @return this
2114     */
2115    public ProtobufTwist3d setDy(final double value) {
2116      bitField0_ |= 0x00000002;
2117      dy = value;
2118      return this;
2119    }
2120
2121    /**
2122     * <code>optional double dz = 3;</code>
2123     * @return whether the dz field is set
2124     */
2125    public boolean hasDz() {
2126      return (bitField0_ & 0x00000004) != 0;
2127    }
2128
2129    /**
2130     * <code>optional double dz = 3;</code>
2131     * @return this
2132     */
2133    public ProtobufTwist3d clearDz() {
2134      bitField0_ &= ~0x00000004;
2135      dz = 0D;
2136      return this;
2137    }
2138
2139    /**
2140     * <code>optional double dz = 3;</code>
2141     * @return the dz
2142     */
2143    public double getDz() {
2144      return dz;
2145    }
2146
2147    /**
2148     * <code>optional double dz = 3;</code>
2149     * @param value the dz to set
2150     * @return this
2151     */
2152    public ProtobufTwist3d setDz(final double value) {
2153      bitField0_ |= 0x00000004;
2154      dz = value;
2155      return this;
2156    }
2157
2158    /**
2159     * <code>optional double rx = 4;</code>
2160     * @return whether the rx field is set
2161     */
2162    public boolean hasRx() {
2163      return (bitField0_ & 0x00000008) != 0;
2164    }
2165
2166    /**
2167     * <code>optional double rx = 4;</code>
2168     * @return this
2169     */
2170    public ProtobufTwist3d clearRx() {
2171      bitField0_ &= ~0x00000008;
2172      rx = 0D;
2173      return this;
2174    }
2175
2176    /**
2177     * <code>optional double rx = 4;</code>
2178     * @return the rx
2179     */
2180    public double getRx() {
2181      return rx;
2182    }
2183
2184    /**
2185     * <code>optional double rx = 4;</code>
2186     * @param value the rx to set
2187     * @return this
2188     */
2189    public ProtobufTwist3d setRx(final double value) {
2190      bitField0_ |= 0x00000008;
2191      rx = value;
2192      return this;
2193    }
2194
2195    /**
2196     * <code>optional double ry = 5;</code>
2197     * @return whether the ry field is set
2198     */
2199    public boolean hasRy() {
2200      return (bitField0_ & 0x00000010) != 0;
2201    }
2202
2203    /**
2204     * <code>optional double ry = 5;</code>
2205     * @return this
2206     */
2207    public ProtobufTwist3d clearRy() {
2208      bitField0_ &= ~0x00000010;
2209      ry = 0D;
2210      return this;
2211    }
2212
2213    /**
2214     * <code>optional double ry = 5;</code>
2215     * @return the ry
2216     */
2217    public double getRy() {
2218      return ry;
2219    }
2220
2221    /**
2222     * <code>optional double ry = 5;</code>
2223     * @param value the ry to set
2224     * @return this
2225     */
2226    public ProtobufTwist3d setRy(final double value) {
2227      bitField0_ |= 0x00000010;
2228      ry = value;
2229      return this;
2230    }
2231
2232    /**
2233     * <code>optional double rz = 6;</code>
2234     * @return whether the rz field is set
2235     */
2236    public boolean hasRz() {
2237      return (bitField0_ & 0x00000020) != 0;
2238    }
2239
2240    /**
2241     * <code>optional double rz = 6;</code>
2242     * @return this
2243     */
2244    public ProtobufTwist3d clearRz() {
2245      bitField0_ &= ~0x00000020;
2246      rz = 0D;
2247      return this;
2248    }
2249
2250    /**
2251     * <code>optional double rz = 6;</code>
2252     * @return the rz
2253     */
2254    public double getRz() {
2255      return rz;
2256    }
2257
2258    /**
2259     * <code>optional double rz = 6;</code>
2260     * @param value the rz to set
2261     * @return this
2262     */
2263    public ProtobufTwist3d setRz(final double value) {
2264      bitField0_ |= 0x00000020;
2265      rz = value;
2266      return this;
2267    }
2268
2269    @Override
2270    public ProtobufTwist3d copyFrom(final ProtobufTwist3d other) {
2271      cachedSize = other.cachedSize;
2272      if ((bitField0_ | other.bitField0_) != 0) {
2273        bitField0_ = other.bitField0_;
2274        dx = other.dx;
2275        dy = other.dy;
2276        dz = other.dz;
2277        rx = other.rx;
2278        ry = other.ry;
2279        rz = other.rz;
2280      }
2281      return this;
2282    }
2283
2284    @Override
2285    public ProtobufTwist3d mergeFrom(final ProtobufTwist3d other) {
2286      if (other.isEmpty()) {
2287        return this;
2288      }
2289      cachedSize = -1;
2290      if (other.hasDx()) {
2291        setDx(other.dx);
2292      }
2293      if (other.hasDy()) {
2294        setDy(other.dy);
2295      }
2296      if (other.hasDz()) {
2297        setDz(other.dz);
2298      }
2299      if (other.hasRx()) {
2300        setRx(other.rx);
2301      }
2302      if (other.hasRy()) {
2303        setRy(other.ry);
2304      }
2305      if (other.hasRz()) {
2306        setRz(other.rz);
2307      }
2308      return this;
2309    }
2310
2311    @Override
2312    public ProtobufTwist3d clear() {
2313      if (isEmpty()) {
2314        return this;
2315      }
2316      cachedSize = -1;
2317      bitField0_ = 0;
2318      dx = 0D;
2319      dy = 0D;
2320      dz = 0D;
2321      rx = 0D;
2322      ry = 0D;
2323      rz = 0D;
2324      return this;
2325    }
2326
2327    @Override
2328    public ProtobufTwist3d clearQuick() {
2329      if (isEmpty()) {
2330        return this;
2331      }
2332      cachedSize = -1;
2333      bitField0_ = 0;
2334      return this;
2335    }
2336
2337    @Override
2338    public boolean equals(Object o) {
2339      if (o == this) {
2340        return true;
2341      }
2342      if (!(o instanceof ProtobufTwist3d)) {
2343        return false;
2344      }
2345      ProtobufTwist3d other = (ProtobufTwist3d) o;
2346      return bitField0_ == other.bitField0_
2347        && (!hasDx() || ProtoUtil.isEqual(dx, other.dx))
2348        && (!hasDy() || ProtoUtil.isEqual(dy, other.dy))
2349        && (!hasDz() || ProtoUtil.isEqual(dz, other.dz))
2350        && (!hasRx() || ProtoUtil.isEqual(rx, other.rx))
2351        && (!hasRy() || ProtoUtil.isEqual(ry, other.ry))
2352        && (!hasRz() || ProtoUtil.isEqual(rz, other.rz));
2353    }
2354
2355    @Override
2356    public void writeTo(final ProtoSink output) throws IOException {
2357      if ((bitField0_ & 0x00000001) != 0) {
2358        output.writeRawByte((byte) 9);
2359        output.writeDoubleNoTag(dx);
2360      }
2361      if ((bitField0_ & 0x00000002) != 0) {
2362        output.writeRawByte((byte) 17);
2363        output.writeDoubleNoTag(dy);
2364      }
2365      if ((bitField0_ & 0x00000004) != 0) {
2366        output.writeRawByte((byte) 25);
2367        output.writeDoubleNoTag(dz);
2368      }
2369      if ((bitField0_ & 0x00000008) != 0) {
2370        output.writeRawByte((byte) 33);
2371        output.writeDoubleNoTag(rx);
2372      }
2373      if ((bitField0_ & 0x00000010) != 0) {
2374        output.writeRawByte((byte) 41);
2375        output.writeDoubleNoTag(ry);
2376      }
2377      if ((bitField0_ & 0x00000020) != 0) {
2378        output.writeRawByte((byte) 49);
2379        output.writeDoubleNoTag(rz);
2380      }
2381    }
2382
2383    @Override
2384    protected int computeSerializedSize() {
2385      int size = 0;
2386      if ((bitField0_ & 0x00000001) != 0) {
2387        size += 9;
2388      }
2389      if ((bitField0_ & 0x00000002) != 0) {
2390        size += 9;
2391      }
2392      if ((bitField0_ & 0x00000004) != 0) {
2393        size += 9;
2394      }
2395      if ((bitField0_ & 0x00000008) != 0) {
2396        size += 9;
2397      }
2398      if ((bitField0_ & 0x00000010) != 0) {
2399        size += 9;
2400      }
2401      if ((bitField0_ & 0x00000020) != 0) {
2402        size += 9;
2403      }
2404      return size;
2405    }
2406
2407    @Override
2408    @SuppressWarnings("fallthrough")
2409    public ProtobufTwist3d mergeFrom(final ProtoSource input) throws IOException {
2410      // Enabled Fall-Through Optimization (QuickBuffers)
2411      int tag = input.readTag();
2412      while (true) {
2413        switch (tag) {
2414          case 9: {
2415            // dx
2416            dx = input.readDouble();
2417            bitField0_ |= 0x00000001;
2418            tag = input.readTag();
2419            if (tag != 17) {
2420              break;
2421            }
2422          }
2423          case 17: {
2424            // dy
2425            dy = input.readDouble();
2426            bitField0_ |= 0x00000002;
2427            tag = input.readTag();
2428            if (tag != 25) {
2429              break;
2430            }
2431          }
2432          case 25: {
2433            // dz
2434            dz = input.readDouble();
2435            bitField0_ |= 0x00000004;
2436            tag = input.readTag();
2437            if (tag != 33) {
2438              break;
2439            }
2440          }
2441          case 33: {
2442            // rx
2443            rx = input.readDouble();
2444            bitField0_ |= 0x00000008;
2445            tag = input.readTag();
2446            if (tag != 41) {
2447              break;
2448            }
2449          }
2450          case 41: {
2451            // ry
2452            ry = input.readDouble();
2453            bitField0_ |= 0x00000010;
2454            tag = input.readTag();
2455            if (tag != 49) {
2456              break;
2457            }
2458          }
2459          case 49: {
2460            // rz
2461            rz = input.readDouble();
2462            bitField0_ |= 0x00000020;
2463            tag = input.readTag();
2464            if (tag != 0) {
2465              break;
2466            }
2467          }
2468          case 0: {
2469            return this;
2470          }
2471          default: {
2472            if (!input.skipField(tag)) {
2473              return this;
2474            }
2475            tag = input.readTag();
2476            break;
2477          }
2478        }
2479      }
2480    }
2481
2482    @Override
2483    public void writeTo(final JsonSink output) throws IOException {
2484      output.beginObject();
2485      if ((bitField0_ & 0x00000001) != 0) {
2486        output.writeDouble(FieldNames.dx, dx);
2487      }
2488      if ((bitField0_ & 0x00000002) != 0) {
2489        output.writeDouble(FieldNames.dy, dy);
2490      }
2491      if ((bitField0_ & 0x00000004) != 0) {
2492        output.writeDouble(FieldNames.dz, dz);
2493      }
2494      if ((bitField0_ & 0x00000008) != 0) {
2495        output.writeDouble(FieldNames.rx, rx);
2496      }
2497      if ((bitField0_ & 0x00000010) != 0) {
2498        output.writeDouble(FieldNames.ry, ry);
2499      }
2500      if ((bitField0_ & 0x00000020) != 0) {
2501        output.writeDouble(FieldNames.rz, rz);
2502      }
2503      output.endObject();
2504    }
2505
2506    @Override
2507    public ProtobufTwist3d mergeFrom(final JsonSource input) throws IOException {
2508      if (!input.beginObject()) {
2509        return this;
2510      }
2511      while (!input.isAtEnd()) {
2512        switch (input.readFieldHash()) {
2513          case 3220: {
2514            if (input.isAtField(FieldNames.dx)) {
2515              if (!input.trySkipNullValue()) {
2516                dx = input.readDouble();
2517                bitField0_ |= 0x00000001;
2518              }
2519            } else {
2520              input.skipUnknownField();
2521            }
2522            break;
2523          }
2524          case 3221: {
2525            if (input.isAtField(FieldNames.dy)) {
2526              if (!input.trySkipNullValue()) {
2527                dy = input.readDouble();
2528                bitField0_ |= 0x00000002;
2529              }
2530            } else {
2531              input.skipUnknownField();
2532            }
2533            break;
2534          }
2535          case 3222: {
2536            if (input.isAtField(FieldNames.dz)) {
2537              if (!input.trySkipNullValue()) {
2538                dz = input.readDouble();
2539                bitField0_ |= 0x00000004;
2540              }
2541            } else {
2542              input.skipUnknownField();
2543            }
2544            break;
2545          }
2546          case 3654: {
2547            if (input.isAtField(FieldNames.rx)) {
2548              if (!input.trySkipNullValue()) {
2549                rx = input.readDouble();
2550                bitField0_ |= 0x00000008;
2551              }
2552            } else {
2553              input.skipUnknownField();
2554            }
2555            break;
2556          }
2557          case 3655: {
2558            if (input.isAtField(FieldNames.ry)) {
2559              if (!input.trySkipNullValue()) {
2560                ry = input.readDouble();
2561                bitField0_ |= 0x00000010;
2562              }
2563            } else {
2564              input.skipUnknownField();
2565            }
2566            break;
2567          }
2568          case 3656: {
2569            if (input.isAtField(FieldNames.rz)) {
2570              if (!input.trySkipNullValue()) {
2571                rz = input.readDouble();
2572                bitField0_ |= 0x00000020;
2573              }
2574            } else {
2575              input.skipUnknownField();
2576            }
2577            break;
2578          }
2579          default: {
2580            input.skipUnknownField();
2581            break;
2582          }
2583        }
2584      }
2585      input.endObject();
2586      return this;
2587    }
2588
2589    @Override
2590    public ProtobufTwist3d clone() {
2591      return new ProtobufTwist3d().copyFrom(this);
2592    }
2593
2594    @Override
2595    public boolean isEmpty() {
2596      return ((bitField0_) == 0);
2597    }
2598
2599    public static ProtobufTwist3d parseFrom(final byte[] data) throws
2600        InvalidProtocolBufferException {
2601      return ProtoMessage.mergeFrom(new ProtobufTwist3d(), data).checkInitialized();
2602    }
2603
2604    public static ProtobufTwist3d parseFrom(final ProtoSource input) throws IOException {
2605      return ProtoMessage.mergeFrom(new ProtobufTwist3d(), input).checkInitialized();
2606    }
2607
2608    public static ProtobufTwist3d parseFrom(final JsonSource input) throws IOException {
2609      return ProtoMessage.mergeFrom(new ProtobufTwist3d(), input).checkInitialized();
2610    }
2611
2612    /**
2613     * @return factory for creating ProtobufTwist3d messages
2614     */
2615    public static MessageFactory<ProtobufTwist3d> getFactory() {
2616      return ProtobufTwist3dFactory.INSTANCE;
2617    }
2618
2619    /**
2620     * @return this type's descriptor.
2621     */
2622    public static Descriptors.Descriptor getDescriptor() {
2623      return Geometry3D.wpi_proto_ProtobufTwist3d_descriptor;
2624    }
2625
2626    private enum ProtobufTwist3dFactory implements MessageFactory<ProtobufTwist3d> {
2627      INSTANCE;
2628
2629      @Override
2630      public ProtobufTwist3d create() {
2631        return ProtobufTwist3d.newInstance();
2632      }
2633    }
2634
2635    /**
2636     * Contains name constants used for serializing JSON
2637     */
2638    static class FieldNames {
2639      static final FieldName dx = FieldName.forField("dx");
2640
2641      static final FieldName dy = FieldName.forField("dy");
2642
2643      static final FieldName dz = FieldName.forField("dz");
2644
2645      static final FieldName rx = FieldName.forField("rx");
2646
2647      static final FieldName ry = FieldName.forField("ry");
2648
2649      static final FieldName rz = FieldName.forField("rz");
2650    }
2651  }
2652}