Ejemplo n.º 1
0
 public void Write(TProtocol oprot)
 {
     oprot.IncrementRecursionDepth();
     try
     {
         TStruct struc = new TStruct("MGeometryConstraint");
         oprot.WriteStructBegin(struc);
         TField field = new TField();
         if (ParentObjectID == null)
         {
             throw new TProtocolException(TProtocolException.INVALID_DATA, "required field ParentObjectID not set");
         }
         field.Name = "ParentObjectID";
         field.Type = TType.String;
         field.ID   = 1;
         oprot.WriteFieldBegin(field);
         oprot.WriteString(ParentObjectID);
         oprot.WriteFieldEnd();
         if (ParentToConstraint != null && __isset.ParentToConstraint)
         {
             field.Name = "ParentToConstraint";
             field.Type = TType.Struct;
             field.ID   = 2;
             oprot.WriteFieldBegin(field);
             ParentToConstraint.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (TranslationConstraint != null && __isset.TranslationConstraint)
         {
             field.Name = "TranslationConstraint";
             field.Type = TType.Struct;
             field.ID   = 3;
             oprot.WriteFieldBegin(field);
             TranslationConstraint.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (RotationConstraint != null && __isset.RotationConstraint)
         {
             field.Name = "RotationConstraint";
             field.Type = TType.Struct;
             field.ID   = 4;
             oprot.WriteFieldBegin(field);
             RotationConstraint.Write(oprot);
             oprot.WriteFieldEnd();
         }
         if (__isset.WeightingFactor)
         {
             field.Name = "WeightingFactor";
             field.Type = TType.Double;
             field.ID   = 5;
             oprot.WriteFieldBegin(field);
             oprot.WriteDouble(WeightingFactor);
             oprot.WriteFieldEnd();
         }
         oprot.WriteFieldStop();
         oprot.WriteStructEnd();
     }
     finally
     {
         oprot.DecrementRecursionDepth();
     }
 }