Example #1
0
        public static CLabtype FromStream(System.IO.BinaryReader br)
        {
            CLabtype lab = new CLabtype();

            lab.attrVal = br.ReadInt16();

            if (lab.attr == Type.Model)
            {
                CModType mod = new CModType();
                mod.Name = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30));
                lab.Tag  = mod;
            }
            else if (lab.attr == Type.String)
            {
                CStgType stg = new CStgType();
                stg.label = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
                lab.Tag   = stg;
            }
            else if (lab.attr == Type.Point)
            {
                CPTStype pts = CPTStype.FromStream(br);
                lab.Tag = pts;
            }
            else if (lab.attr == Type.Text)
            {
                CTXTtype txt = CTXTtype.FromStream(br);
                lab.Tag = txt;
            }

            return(lab);
        }
Example #2
0
 public void ToStream(System.IO.BinaryWriter bw)
 {
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.ModelName, 30));
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.StringName, 20));
     bw.Write(this.XMin);
     bw.Write(this.YMin);
     bw.Write(this.TextSize);
     bw.Write(this.Rotation);
 }
Example #3
0
        public static ClSTtype FromStream(BinaryReader br)
        {
            ClSTtype lstdata = new ClSTtype();

            lstdata.strMod1 = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30));
            lstdata.strStg  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(lstdata);
        }
Example #4
0
 public void ToStream(BinaryWriter bw)
 {
     bw.Write(this.tx);
     bw.Write(this.ty);
     bw.Write(this.tz);
     bw.Write(this.ts);
     bw.Write(this.tr);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.tg, 60));
 }
Example #5
0
        public static CTXTtype FromStream(BinaryReader br)
        {
            CTXTtype txt = new CTXTtype();

            txt.tx = br.ReadDouble();
            txt.ty = br.ReadDouble();
            txt.tz = br.ReadDouble();
            txt.ts = br.ReadDouble();
            txt.tr = br.ReadDouble();
            txt.tg = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(60));

            return(txt);
        }
Example #6
0
        public static Detail FromStream(System.IO.BinaryReader br)
        {
            Detail detail = new Detail();

            detail.ModelName  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30));
            detail.StringName = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            detail.XMin       = br.ReadDouble();
            detail.YMin       = br.ReadDouble();
            detail.TextSize   = br.ReadDouble();
            detail.Rotation   = br.ReadDouble();

            return(detail);
        }
Example #7
0
 public void ToStream(System.IO.BinaryWriter bw)
 {
     bw.Write(this.elatt);
     bw.Write(this.scatt);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.Layer, 20));
     bw.Write(this.laatt);
     bw.Write(this.xc);
     bw.Write(this.yc);
     bw.Write(this.Radius);
     bw.Write(this.color);
     bw.Write(this.style);
     bw.Write(this.Width);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.Label, 20));
 }
Example #8
0
 public void ToStream(System.IO.BinaryWriter bw)
 {
     bw.Write(this.Length);
     bw.Write(this.scatt);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.Layer, 20));
     bw.Write(this.laatt);
     bw.Write(this.x1);
     bw.Write(this.y1);
     bw.Write(this.Size);
     bw.Write(this.rotn);
     bw.Write(this.Color);
     bw.Write(this.style);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.text, 60));
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.Label, 20));
 }
Example #9
0
        public static Grid FromStream(System.IO.BinaryReader br)
        {
            Grid grid = new Grid();

            grid.ModelName  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30));
            grid.StringName = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            grid.MinX       = br.ReadDouble();
            grid.MinY       = br.ReadDouble();
            grid.MaxX       = br.ReadDouble();
            grid.MaxY       = br.ReadDouble();
            grid.XInterval  = br.ReadDouble();
            grid.YInterval  = br.ReadDouble();
            grid.TextSize   = br.ReadDouble();
            grid.Rotation   = br.ReadDouble();
            return(grid);
        }
Example #10
0
 public void ToStream(BinaryWriter bw)
 {
     bw.Write(this.OffsetType);
     bw.Write(this.AcceptCode);
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.ModelName, 30));
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.StringName, 20));
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.OffsetModel, 30));
     bw.Write(ViewerUtils.ConvertStringToByteArray(this.OffsetString, 20));
     bw.Write(this.StartChainage);
     bw.Write(this.EndChainage);
     bw.Write(this.StartHOffset);
     bw.Write(this.EndHOffset);
     bw.Write(this.StartVOffset);
     bw.Write(this.EndVOffset);
     bw.Write(this.StartSuper);
     bw.Write(this.EndSuper);
 }
Example #11
0
        public string label;      //20 char

        public void ToStream(System.IO.BinaryWriter bw)
        {
            bw.Write(elatt);
            bw.Write(scatt);
            bw.Write(ViewerUtils.ConvertStringToByteArray(layer, 20));
            bw.Write(laatt);
            bw.Write(x1);
            bw.Write(y1);
            bw.Write(z1);
            bw.Write(x2);
            bw.Write(y2);
            bw.Write(z2);
            bw.Write(color);
            bw.Write(style);
            bw.Write(width);
            bw.Write(ViewerUtils.ConvertStringToByteArray(label, 20));
        }
Example #12
0
        public static Circletype FromStream(System.IO.BinaryReader br)
        {
            Circletype circle = new Circletype();

            circle.elatt  = br.ReadInt16();
            circle.scatt  = br.ReadInt16();
            circle.Layer  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            circle.laatt  = br.ReadInt16();
            circle.xc     = br.ReadDouble();
            circle.yc     = br.ReadDouble();
            circle.Radius = br.ReadDouble();
            circle.color  = br.ReadInt16();
            circle.style  = br.ReadInt16();
            circle.Width  = br.ReadInt16();
            circle.Label  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(circle);
        }
Example #13
0
        public string Label;         //20

        public static TEXTtype FromStream(System.IO.BinaryReader br)
        {
            TEXTtype text = new TEXTtype();

            text.Length = br.ReadInt16();
            text.scatt  = br.ReadInt16();
            text.Layer  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            text.laatt  = br.ReadInt16();
            text.x1     = br.ReadDouble();
            text.y1     = br.ReadDouble();
            text.Size   = br.ReadDouble();
            text.rotn   = br.ReadDouble();
            text.Color  = br.ReadInt16();
            text.style  = br.ReadInt16();
            text.text   = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(60));
            text.Label  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(text);
        }
Example #14
0
        public string Label;      //20 char

        public static Boxtype FromStream(System.IO.BinaryReader br)
        {
            Boxtype box = new Boxtype();

            box.elatt = br.ReadInt16();
            box.scatt = br.ReadInt16();
            box.Layer = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            box.laatt = br.ReadInt16();
            box.x1    = br.ReadDouble();
            box.y1    = br.ReadDouble();
            box.x2    = br.ReadDouble();
            box.y2    = br.ReadDouble();
            box.color = br.ReadInt16();
            box.style = br.ReadInt16();
            box.Width = br.ReadInt16();
            box.Label = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(box);
        }
Example #15
0
        public static OffsetRec FromStream(BinaryReader br)
        {
            OffsetRec obj = new OffsetRec();

            obj.OffsetType    = br.ReadInt16();
            obj.AcceptCode    = br.ReadInt16();
            obj.ModelName     = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30)); //[30];
            obj.StringName    = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20)); //[20];
            obj.OffsetModel   = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(30)); //[30];
            obj.OffsetString  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20)); //[20];
            obj.StartChainage = br.ReadDouble();
            obj.EndChainage   = br.ReadDouble();
            obj.StartHOffset  = br.ReadDouble();
            obj.EndHOffset    = br.ReadDouble();
            obj.StartVOffset  = br.ReadDouble();
            obj.EndVOffset    = br.ReadDouble();
            obj.StartSuper    = br.ReadDouble();
            obj.EndSuper      = br.ReadDouble();

            return(obj);
        }
Example #16
0
        public static Linetype FromStream(System.IO.BinaryReader br)
        {
            Linetype line = new Linetype();

            line.elatt = br.ReadInt16();
            line.scatt = br.ReadInt16();
            line.layer = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            line.laatt = br.ReadInt16();
            line.x1    = br.ReadDouble();
            line.y1    = br.ReadDouble();
            line.z1    = br.ReadDouble();
            line.x2    = br.ReadDouble();
            line.y2    = br.ReadDouble();
            line.z2    = br.ReadDouble();
            line.color = br.ReadInt16();
            line.style = br.ReadInt16();
            line.width = br.ReadInt16();
            line.label = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(line);
        }
Example #17
0
        public static Arctype FromStream(System.IO.BinaryReader br)
        {
            Arctype arc = new Arctype();

            arc.elatt  = br.ReadInt16();
            arc.scatt  = br.ReadInt16();
            arc.Layer  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));
            arc.laatt  = br.ReadInt16();
            arc.xs     = br.ReadDouble();
            arc.ys     = br.ReadDouble();
            arc.xe     = br.ReadDouble();
            arc.ye     = br.ReadDouble();
            arc.xc     = br.ReadDouble();
            arc.yc     = br.ReadDouble();
            arc.Radius = br.ReadDouble();
            arc.Color  = br.ReadInt16();
            arc.style  = br.ReadInt16();
            arc.Width  = br.ReadInt16();
            arc.Label  = ViewerUtils.ConvertCharArrayToString(br.ReadBytes(20));

            return(arc);
        }
Example #18
0
 public void ToStream(BinaryWriter bw)
 {
     bw.Write(this.attrVal);
     if (this.attr == Type.Model)
     {
         CModType mod = (CModType)this.Tag;
         bw.Write(ViewerUtils.ConvertStringToByteArray(mod.Name, 30));
     }
     else if (this.attr == Type.String)
     {
         CStgType stg = (CStgType)this.Tag;
         bw.Write(ViewerUtils.ConvertStringToByteArray(stg.label, 20));
     }
     else if (this.attr == Type.Point)
     {
         CPTStype pts = (CPTStype)this.Tag;
         pts.ToStream(bw);
     }
     else if (this.attr == Type.Text)
     {
         CTXTtype txt = (CTXTtype)this.Tag;
         txt.ToStream(bw);
     }
 }
Example #19
0
        public string strStg  = ""; //20

        public void ToStream(BinaryWriter bw)
        {
            bw.Write(ViewerUtils.ConvertStringToByteArray(this.strMod1, 30));
            bw.Write(ViewerUtils.ConvertStringToByteArray(this.strStg, 20));
        }