ResetVertexCount() public method

Reset the vertex count to get vertices of the footprint.
public ResetVertexCount ( ) : void
return void
        //private IGeometry GetFootprint(DiMapParser dimParser)
        //{
        //    IGeometry currFootprint = null;
        //    dimParser.ResetVertexCount();
        //    string xs = "";
        //    string ys = "";
        //    string rows = "";
        //    string cols = "";
        //    double minX = 10000000000.0;
        //    double maxX = -1000000000.00;
        //    double minY = 1000000000.00;
        //    double maxY = -1000000000.00;
        //    double minRow = 1000000000.00;
        //    double maxRow = -1000000000.0;
        //    double minCol = 1000000000.00;
        //    double maxCol = -1000000000.0;
        //    double x = 0.0;
        //    double y = 0.0;
        //    double row = 0.0;
        //    double col = 0.0;

        //    while (dimParser.GetNextVertex(out xs, out ys, out rows, out cols))
        //    {
        //        x = Convert.ToDouble(xs);
        //        y = Convert.ToDouble(ys);
        //        row = Convert.ToDouble(rows);
        //        col = Convert.ToDouble(cols);

        //        if (x < minX)
        //            minX = x;
        //        if (x > maxX)
        //            maxX = x;

        //        if (y < minY)
        //            minY = y;
        //        if (y > maxY)
        //            maxY = y;

        //        if (row < minRow)
        //            minRow = row;
        //        if (row > maxRow)
        //            maxRow = row;

        //        if (col < minCol)
        //            minCol = col;
        //        if (col > maxCol)
        //            maxCol = col;

        //        x = 0.0;
        //        y = 0.0;
        //        row = 0.0;
        //        col = 0.0;
        //        xs = "";
        //        ys = "";
        //        rows = "";
        //        cols = "";
        //    }
        //    x = Convert.ToDouble(xs);
        //    y = Convert.ToDouble(ys);
        //    row = Convert.ToDouble(rows);
        //    col = Convert.ToDouble(cols);

        //    if (x < minX)
        //        minX = x;
        //    if (x > maxX)
        //        maxX = x;

        //    if (y < minY)
        //        minY = y;
        //    if (y > maxY)
        //        maxY = y;

        //    if (row < minRow)
        //        minRow = row;
        //    if (row > maxRow)
        //        maxRow = row;

        //    if (col < minCol)
        //        minCol = col;
        //    if (col > maxCol)
        //        maxCol = col;

        //    currFootprint = new PolygonClass();
        //    IPointCollection currPointColl = (IPointCollection)currFootprint;
        //    IEnvelope rectEnvelope = new EnvelopeClass();
        //    rectEnvelope.PutCoords(minX, minY, maxX, maxY);
        //    ISegmentCollection segmentCollection = (ISegmentCollection)currFootprint;
        //    segmentCollection.SetRectangle(rectEnvelope);

        //    // Get Srs
        //    int epsgcode = Convert.ToInt32((dimParser.SrsCode.Split(':'))[1]);
        //    ISpatialReferenceFactory3 srsfactory = new SpatialReferenceEnvironmentClass();
        //    ISpatialReference dimSrs = srsfactory.CreateSpatialReference(epsgcode);
        //    ISpatialReferenceResolution srsRes = (ISpatialReferenceResolution)dimSrs;
        //    srsRes.ConstructFromHorizon();
        //    srsRes.SetDefaultXYResolution();
        //    ((ISpatialReferenceTolerance)dimSrs).SetDefaultXYTolerance();
        //    currFootprint.SpatialReference = dimSrs;

        //    #region Commented
        //    //IEnvelope extent = new EnvelopeClass();
        //    //extent.XMin = geoDset.Extent.XMin;
        //    //extent.XMax = geoDset.Extent.XMax;
        //    //extent.YMin = geoDset.Extent.YMin;
        //    //extent.YMax = geoDset.Extent.YMax;
        //    //extent.SpatialReference = geoDset.SpatialReference;
        //    //extent.Width = inputFrd.RasterInfo.Extent.Width;
        //    //extent.Height = inputFrd.RasterInfo.Extent.Height;
        //    //currItem.Footprint = (IGeometry)extent;

        //    //myDimParser.ResetVertexCount();
        //    //string x = "";
        //    //string y = "";
        //    //string row = "";
        //    //string col = "";
        //    //IGeometry currFootprint = new PolygonClass();
        //    //IPointCollection currPointColl = (IPointCollection)currFootprint;

        //    // Creating a polygon!!!

        //    ////Build a polygon from a sequence of points. 
        //    ////Add arrays of points to a geometry using the IGeometryBridge2 interface on the 
        //    ////GeometryEnvironment singleton object.
        //    //IGeometryBridge2 geometryBridge2 = new GeometryEnvironmentClass();
        //    //IPointCollection4 pointCollection4 = new PolygonClass();

        //    ////TODO:
        //    ////pointCollection4.SpatialReference = 'Define the spatial reference of the new polygon.

        //    //WKSPoint[] aWKSPointBuffer = null;
        //    //long cPoints = 4; //The number of points in the first part.
        //    //aWKSPointBuffer = new WKSPoint[System.Convert.ToInt32(cPoints - 1) + 1];

        //    ////TODO:
        //    ////aWKSPointBuffer = 'Read cPoints into the point buffer.

        //    //geometryBridge2.SetWKSPoints(pointCollection4, ref aWKSPointBuffer);

        //    //myDimParser.GetNextVertex(out x, out y, out col, out row);
        //    //IPoint currPoint1 = new PointClass();
        //    //currPoint1.X = Convert.ToDouble(x);
        //    //currPoint1.Y = Convert.ToDouble(y);
        //    //myDimParser.GetNextVertex(out x, out y, out col, out row);
        //    //IPoint currPoint2 = new PointClass();
        //    //currPoint1.X = Convert.ToDouble(x);
        //    //currPoint1.Y = Convert.ToDouble(y);
        //    //myDimParser.GetNextVertex(out x, out y, out col, out row);
        //    //IPoint currPoint3 = new PointClass();
        //    //currPoint1.X = Convert.ToDouble(x);
        //    //currPoint1.Y = Convert.ToDouble(y);
        //    //myDimParser.GetNextVertex(out x, out y, out col, out row);
        //    //IPoint currPoint4 = new PointClass();
        //    //currPoint1.X = Convert.ToDouble(x);
        //    //currPoint1.Y = Convert.ToDouble(y);
        //    //object refPoint1 = (object)currPoint1;
        //    //object refPoint2 = (object)currPoint2;
        //    //object refPoint3 = (object)currPoint3;
        //    //object refPoint4 = (object)currPoint4;
        //    //currPointColl.AddPoint(currPoint1, ref refPoint4, ref refPoint2);
        //    //currPointColl.AddPoint(currPoint2, ref refPoint1, ref refPoint3);
        //    //currPointColl.AddPoint(currPoint3, ref refPoint2, ref refPoint4);
        //    //currPointColl.AddPoint(currPoint4, ref refPoint3, ref refPoint1);
        //    //((IPolygon)currFootprint).Close();
        //    //currFootprint.SpatialReference = dimSrs;
        //    #endregion
        //    return currFootprint;
        //}

        /// <summary>
        /// Get the footprint from the dimap file if it exists.
        /// </summary>
        /// <param name="dimParser">Dimap file parser.</param>
        /// <returns>Footprint geomtry.</returns>
        private IGeometry GetFootprint(DiMapParser dimParser)
        {
            IGeometry currFootprint = null;
            dimParser.ResetVertexCount();
            string xs = "";
            string ys = "";
            double minX = 10000000000.0;
            double maxX = -1000000000.00;
            double minY = 1000000000.00;
            double maxY = -1000000000.00;
            double x = 0.0;
            double y = 0.0;
            string units = dimParser.ProductType;
            if (units.ToLower() == "L1T".ToLower())
                units = "M";
            else if (units.ToLower() == "L1R".ToLower())
                units = "Deg";
            // Get vertices from the dimap file and figure out the min,max.
            while (dimParser.GetNextVertex2(out xs, out ys, units))
            {
                x = Convert.ToDouble(xs);
                y = Convert.ToDouble(ys);

                if (x < minX)
                    minX = x;
                if (x > maxX)
                    maxX = x;

                if (y < minY)
                    minY = y;
                if (y > maxY)
                    maxY = y;

                x = 0.0;
                y = 0.0;
                xs = "";
                ys = "";
            }
            x = Convert.ToDouble(xs);
            y = Convert.ToDouble(ys);

            if (x < minX)
                minX = x;
            if (x > maxX)
                maxX = x;

            if (y < minY)
                minY = y;
            if (y > maxY)
                maxY = y;

            // create a new polygon and fill it using the vertices calculated.
            currFootprint = new PolygonClass();
            IPointCollection currPointColl = (IPointCollection)currFootprint;
            IEnvelope rectEnvelope = new EnvelopeClass();
            rectEnvelope.PutCoords(minX, minY, maxX, maxY);
            ISegmentCollection segmentCollection = (ISegmentCollection)currFootprint;
            segmentCollection.SetRectangle(rectEnvelope);

            // Get Srs from the dim file and set it on the footprint.
            int epsgcode = Convert.ToInt32((dimParser.SrsCode.Split(':'))[1]);
            ISpatialReferenceFactory3 srsfactory = new SpatialReferenceEnvironmentClass();
            ISpatialReference dimSrs = srsfactory.CreateSpatialReference(epsgcode);
            ISpatialReferenceResolution srsRes = (ISpatialReferenceResolution)dimSrs;
            srsRes.ConstructFromHorizon();
            srsRes.SetDefaultXYResolution();
            ((ISpatialReferenceTolerance)dimSrs).SetDefaultXYTolerance();
            currFootprint.SpatialReference = dimSrs;
            return currFootprint;
        }