Exemplo n.º 1
0
        public void Read(out Support.BitSet data)
        {
            System.Diagnostics.Debug.Assert(Reading);
            data = null;
            if (CoreObject.Pointer == IntPtr.Zero)
            {
                return;
            }

            unsafe
            {
                int bitCount = 0;
                XndSDK.XNDAttrib_Read(CoreObject, (IntPtr)(&bitCount), sizeof(int));
                data = new Support.BitSet();
                int byteCount = 0;
                XndSDK.XNDAttrib_Read(CoreObject, (IntPtr)(&byteCount), sizeof(int));
                byte[] bitData = new byte[byteCount];
                fixed(byte *p = &bitData[0])
                {
                    XndSDK.XNDAttrib_Read(CoreObject, (IntPtr)(p), sizeof(System.Byte) * byteCount);
                }

                data.Init((UInt32)bitCount, bitData);
            }
        }
Exemplo n.º 2
0
        protected static Support.BitSet ReadSaveFields(TypeDescGenerator.TypeDesc tDesc, IReader pkg)
        {
            var bitSet    = new Support.BitSet();
            var byteArray = TypeDescGenerator.Instance.GetSerializer(typeof(byte[]));

            byte[] bits = byteArray.ReadValue(pkg) as byte[];
            bitSet.Init((UInt32)tDesc.Members.Count, bits);
            return(bitSet);
        }
Exemplo n.º 3
0
        public void Read(out Support.BitSet v)
        {
            unsafe
            {
                int bitCount = 0;
                ReadPtr(&bitCount, sizeof(int));
                v = new Support.BitSet();
                int byteCount = 0;
                ReadPtr(&byteCount, sizeof(int));
                byte[] bitData = new byte[byteCount];
                fixed(byte *p = &bitData[0])
                {
                    ReadPtr(p, sizeof(System.Byte) * byteCount);
                }

                v.Init((UInt32)bitCount, bitData);
            }
        }
Exemplo n.º 4
0
        protected static Support.BitSet WriteSaveFields(ISerializer obj, TypeDescGenerator.TypeDesc tDesc, IWriter pkg)
        {
            var bitSet = new Support.BitSet();

            bitSet.Init((UInt16)tDesc.Members.Count);
            for (int i = 0; i < tDesc.Members.Count; i++)
            {
                bool cmp = tDesc.IsDefaultValue(obj, tDesc.Members[i].PropInfo);
                if (cmp == false)
                {
                    bitSet.SetBit((UInt32)i, true);
                }
            }
            var byteArray = TypeDescGenerator.Instance.GetSerializer(typeof(byte[]));

            byteArray.WriteValue(bitSet.Data, pkg);
            return(bitSet);
        }
Exemplo n.º 5
0
 public CombineVoxel(PVSVoxel vx)
 {
     OriFlagNumber = vx.Bits.FlagNumber;
     CombineBits   = new Support.BitSet();
     CombineBits.Init(vx.Bits.BitCount, vx.Bits.Data);
 }