Ejemplo n.º 1
0
 internal Line()
 {
     m_Positions = null;
     m_IsArc = false;
     m_IsCurve = false;
     m_Radius = 0.0;
     m_Centre = m_BC = m_EC = null;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Creates a new <c>Feature</c> with default values (zeros and
 /// blank strings).
 /// </summary>
 protected Feature()
 {
     m_Theme = 0;
     m_UserNum = 0;
     m_Type = (int)Ntx.DataType.None;
     m_NorthWest = null;
     m_SouthEast = null;
     m_FeatureCode = String.Empty;
     m_SourceId = String.Empty;
     m_Key = String.Empty;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new <c>Symbol</c> with an undefined (null) position,
 /// flagged as a plain symbol (not an explicit node).
 /// </summary>
 internal Symbol()
 {
     m_Position = null;
     m_IsNode = false;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Does this position coincide with the specified position?
 /// </summary>
 /// <param name="that">The position to compare with</param>
 /// <returns>True if the positions match.</returns>
 /// <remarks>
 /// This uses an arbitrary point match tolerance of 1 micron on the ground,
 /// assuming that no-one stores NTX data to a better resolution than that.
 /// </remarks>
 bool IsAt(Position that)
 {
     return Math.Abs(this.m_Easting - that.m_Easting) < 0.000001 &&
            Math.Abs(this.m_Northing - that.m_Northing) < 0.000001;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Loads positions from a data array
        /// </summary>
        /// <param name="data">The array containing the data</param>
        /// <param name="dataIndex">The index where the first XY can be found</param>
        /// <param name="npt">The number of positions to load</param>
        /// <param name="rlen">The size of a data group (in 32-bit words)</param>
        /// <param name="removeDups">Should any duplicate points be removed (this should be
        /// done for line data types)</param>
        private void LoadPositions(int[] data, int dataIndex, int npt, int rlen, bool removeDups)
        {
            // Ensure there are no duplicate coordinates in lines
            if (removeDups)
            {
                int ndup = NoDuplicates(data, dataIndex, npt, rlen);
                npt -= ndup;
            }

            // Check whether we are dealing with elevations or not
            bool is3d = IsSet(Flag.Is3D);

            // How many do we have to copy? We copy everything only if
            // this is the first DAD in a chain. (Note that names cannot
            // be linked).
            if (m_NumPosition > 0)
            {
                dataIndex += rlen;
                npt--;
            }

            // If position array is not big enough to hold the positions
            // for this DAD, reallocate & copy what we have.
            if (m_NumPosition + npt > m_Positions.Length)
            {
                Position[] newarray = new Position[Math.Max(m_Positions.Length*2, m_NumPosition+npt)];
                Array.Copy(m_Positions, newarray, m_NumPosition);
                m_Positions = newarray;
            }

            // Point to the initial position we will define
            int pRes = m_NumPosition;

            // Remember how many we will have in the array once done
            m_NumPosition += npt;

            // Copy over the positions
            for (; npt>0; dataIndex+=rlen, npt--, pRes++)
            {
                if (is3d && data[dataIndex+3]==0)
                    m_Positions[pRes] = new Position(m_Header.XToGround(data[dataIndex]),
                                                     m_Header.YToGround(data[dataIndex+1]),
                                                     m_Header.ZToGround(data[dataIndex+2]));
                else
                    m_Positions[pRes] = new Position(m_Header.XToGround(data[dataIndex]),
                                                     m_Header.YToGround(data[dataIndex+1]));
            }
        }