Go to the documentation of this file.00001 """autogenerated by genpy from triangle_mesh_msgs/Triangle.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class Triangle(genpy.Message):
00009 _md5sum = "4e5bc1f7ab41ceb0f12378d17f3b763d"
00010 _type = "triangle_mesh_msgs/Triangle"
00011 _has_header = False
00012 _full_text = """int32 i
00013 int32 j
00014 int32 k
00015
00016
00017
00018 """
00019 __slots__ = ['i','j','k']
00020 _slot_types = ['int32','int32','int32']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 i,j,k
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(Triangle, self).__init__(*args, **kwds)
00038
00039 if self.i is None:
00040 self.i = 0
00041 if self.j is None:
00042 self.j = 0
00043 if self.k is None:
00044 self.k = 0
00045 else:
00046 self.i = 0
00047 self.j = 0
00048 self.k = 0
00049
00050 def _get_types(self):
00051 """
00052 internal API method
00053 """
00054 return self._slot_types
00055
00056 def serialize(self, buff):
00057 """
00058 serialize message into buffer
00059 :param buff: buffer, ``StringIO``
00060 """
00061 try:
00062 _x = self
00063 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00064 except struct.error as se: self._check_types(se)
00065 except TypeError as te: self._check_types(te)
00066
00067 def deserialize(self, str):
00068 """
00069 unpack serialized message in str into this message instance
00070 :param str: byte array of serialized message, ``str``
00071 """
00072 try:
00073 end = 0
00074 _x = self
00075 start = end
00076 end += 12
00077 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00078 return self
00079 except struct.error as e:
00080 raise genpy.DeserializationError(e)
00081
00082
00083 def serialize_numpy(self, buff, numpy):
00084 """
00085 serialize message with numpy array types into buffer
00086 :param buff: buffer, ``StringIO``
00087 :param numpy: numpy python module
00088 """
00089 try:
00090 _x = self
00091 buff.write(_struct_3i.pack(_x.i, _x.j, _x.k))
00092 except struct.error as se: self._check_types(se)
00093 except TypeError as te: self._check_types(te)
00094
00095 def deserialize_numpy(self, str, numpy):
00096 """
00097 unpack serialized message in str into this message instance using numpy for array types
00098 :param str: byte array of serialized message, ``str``
00099 :param numpy: numpy python module
00100 """
00101 try:
00102 end = 0
00103 _x = self
00104 start = end
00105 end += 12
00106 (_x.i, _x.j, _x.k,) = _struct_3i.unpack(str[start:end])
00107 return self
00108 except struct.error as e:
00109 raise genpy.DeserializationError(e)
00110
00111 _struct_I = genpy.struct_I
00112 _struct_3i = struct.Struct("<3i")