示例#1
0
 /// <summary>
 /// Allows accessing base tracks in an array-like fashion.
 /// </summary>
 /// <param name="index">the Id of the track to be retrieved.</param>
 /// <returns>the requested microtrack.</returns>
 public override SySal.Scanning.MIPBaseTrack this[int index]
 {
     get
     {
         if (m_LastTrack != null && m_LastTrack.Id == index)
         {
             return(m_LastTrack);
         }
         m_Stream.Seek(Tracks_SP + MIPBaseTrack.Size * index, System.IO.SeekOrigin.Begin);
         return(m_LastTrack = new MIPBaseTrack((Side)m_Top, (Side)m_Bottom, index, r));
     }
 }
示例#2
0
        public LinkedZone(System.IO.StreamReader r)
        {
            this.m_Transform.MXX = this.m_Transform.MYY = 1.0;
            this.m_Transform.MXY = this.m_Transform.MYX = 0.0;
            this.m_Transform.TX  = this.m_Transform.TY = this.m_Transform.TZ = 0.0;
            this.m_Transform.RX  = this.m_Transform.RY = 0.0;
            System.Collections.ArrayList ar = new System.Collections.ArrayList();
            string line;

            while (((line = r.ReadLine()) != null) && ((line = line.Trim()) != ""))
            {
                int pos = 0;
                SySal.Tracking.MIPEmulsionTrackInfo info = new SySal.Tracking.MIPEmulsionTrackInfo();
                info.Count       = Convert.ToUInt16(GetNextToken(line, ref pos));
                info.Field       = 0;
                info.AreaSum     = Convert.ToUInt32(GetNextToken(line, ref pos));
                info.Intercept.X = Convert.ToDouble(GetNextToken(line, ref pos));
                info.Intercept.Y = Convert.ToDouble(GetNextToken(line, ref pos));
                info.Intercept.Z = 0.0;
                info.Slope.X     = Convert.ToDouble(GetNextToken(line, ref pos));
                info.Slope.Y     = Convert.ToDouble(GetNextToken(line, ref pos));
                info.Slope.Z     = 1.0;
                info.Sigma       = Convert.ToDouble(GetNextToken(line, ref pos));
                info.TopZ        = 43.0;
                info.BottomZ     = -243.0;
                ar.Add(info);
            }
            int i;

            MIPIndexedEmulsionTrack [] ttkarr = new MIPIndexedEmulsionTrack[ar.Count];
            m_Top = new Side(ttkarr, 43.0, 0.0);
            for (i = 0; i < ttkarr.Length; i++)
            {
                ttkarr[i] = new MIPIndexedEmulsionTrack(i, (SySal.Tracking.MIPEmulsionTrackInfo)ar[i], true, (View)((Side)m_Top).View(0));
            }
            MIPIndexedEmulsionTrack [] btkarr = new MIPIndexedEmulsionTrack[ar.Count];
            m_Bottom = new Side(btkarr, -200.0, -243.0);
            for (i = 0; i < btkarr.Length; i++)
            {
                btkarr[i] = new MIPIndexedEmulsionTrack(i, (SySal.Tracking.MIPEmulsionTrackInfo)ar[i], false, (View)((Side)m_Bottom).View(0));
            }
            m_Tracks = new MIPBaseTrack[ar.Count];
            for (i = 0; i < m_Tracks.Length; i++)
            {
                m_Tracks[i] = new MIPBaseTrack(i, (SySal.Tracking.MIPEmulsionTrackInfo)ar[i], ttkarr[i], btkarr[i]);
            }
        }