示例#1
0
        private void WriteSymbol(DrawSymbol symbol)
        {
            WriteTag(VexDrawTag.SymbolDefinition);

            WriteBits(symbol.Id, idBitCount);
            WriteRect(symbol.StrokeBounds);

            // write paths, get nBits for path numbers
            WriteBits(symbol.Paths.Count, 11); // number of path defs
            uint pathIndexNBits = MinBits((uint)symbol.Paths.Count);

            // ***WriteBits(pathIndexNBits, 5); // number of path defs
            WriteNBitsCount(pathIndexNBits);

            for (int i = 0; i < symbol.Paths.Count; i++)
            {
                WritePath(symbol.Paths[i]);
            }

            WriteBits(symbol.Shapes.Count, 11); // number of shape defs
            for (int i = 0; i < symbol.Shapes.Count; i++)
            {
                WriteShape(symbol.Shapes[i], pathIndexNBits);
            }

            FlushTag();
        }
示例#2
0
        private void GetDrawSymbols(List <Symbol> symbols)
        {
            drawSymbols = new List <DrawSymbol>();

            foreach (Symbol symbol in symbols)
            {
                DrawSymbol ds = new DrawSymbol(symbol);
                drawSymbols.Add(ds);
            }
        }
示例#3
0
        private void WriteSymbol(DrawSymbol symbol)
        {
            WriteTag(VexDrawTag.SymbolDefinition);

            WriteBits(symbol.Id, idBitCount);
            WriteRect(symbol.StrokeBounds);

            // write paths, get nBits for path numbers
            WriteBits(symbol.Paths.Count, 11); // number of path defs
            uint pathIndexNBits = MinBits((uint)symbol.Paths.Count);
            // ***WriteBits(pathIndexNBits, 5); // number of path defs
            WriteNBitsCount(pathIndexNBits);

            for (int i = 0; i < symbol.Paths.Count; i++)
            {
                WritePath(symbol.Paths[i]);
            }

            WriteBits(symbol.Shapes.Count, 11); // number of shape defs
            for (int i = 0; i < symbol.Shapes.Count; i++)
            {
                WriteShape(symbol.Shapes[i], pathIndexNBits);
            }

            FlushTag();
        }
示例#4
0
        private void GetDrawSymbols(List<Symbol> symbols)
        {
            drawSymbols = new List<DrawSymbol>();

            foreach (Symbol symbol in symbols)
            {
                DrawSymbol ds = new DrawSymbol(symbol);
                drawSymbols.Add(ds);
            }
        }