Example #1
0
        public static void Write(Document d, Stream s)
        {
            StreamWriter sr = new StreamWriter(s);

            WriteHeader(d.header,sr);
            WriteTables(d.tables,sr);
            WriteBlocks(d.blocks,sr);
            WriteEntities(d.entities,sr);
            WriteData(new Data(0,"EOF"),sr);
            sr.Close();
        }
Example #2
0
        /// <summary>
        /// 绘制结束标志
        /// </summary>
        /// <param name="doc"></param>
        void IDecorateLabel.Draw(DXFLibrary.Document doc)
        {
            /*绘制T形标志*/
            DXFLibrary.Line l = null;
            if (CurrentDirection == Direction.Down)
            {
                l = new DXFLibrary.Line("TrainID", OriginX, -OriginY, OriginX, -(OriginY + VerticalBarHeight));
            }
            else
            {
                l = new DXFLibrary.Line("TrainID", OriginX, -OriginY, OriginX, -(OriginY - VerticalBarHeight));
            }
            doc.add(l);

            l = new DXFLibrary.Line("TrainID", BaseLineLeft, -BaseLineY, BaseLineRight, -BaseLineY);
            doc.add(l);

            /*交出标记的修饰*/
            if (IsTerminal)
            {
                if (CurrentDirection == Direction.Down)
                {
                    l = new DXFLibrary.Line("TrainID", BaseLineLeft, -BaseLineY, BaseLineLeft + BaseLineWidth / 2, -(BaseLineY + BaseLineWidth / 2));
                    doc.add(l);
                    l = new DXFLibrary.Line("TrainID", BaseLineRight, -BaseLineY, BaseLineRight - BaseLineWidth / 2, -(BaseLineY + BaseLineWidth / 2));
                    doc.add(l);
                }
                else
                {
                    l = new DXFLibrary.Line("TrainID", BaseLineLeft, -BaseLineY, BaseLineLeft + BaseLineWidth / 2, -(BaseLineY - BaseLineWidth / 2));
                    doc.add(l);
                    l = new DXFLibrary.Line("TrainID", BaseLineRight, -BaseLineY, BaseLineRight - BaseLineWidth / 2, -(BaseLineY - BaseLineWidth / 2));
                    doc.add(l);
                }
            }
            else
            {
                if (CurrentDirection == Direction.Down)
                {
                    l = new DXFLibrary.Line("TrainID", BaseLineRight, -BaseLineY, BaseLineRight - BaseLineWidth / 2, -(BaseLineY + BaseLineWidth / 2));
                    doc.add(l);
                }
                else
                {
                    l = new DXFLibrary.Line("TrainID", BaseLineRight, -BaseLineY, BaseLineRight - BaseLineWidth / 2, -(BaseLineY - BaseLineWidth / 2));
                    doc.add(l);
                }
            }
        }