NPlot.LogAxis.WorldTickPositions_FirstPass C# (CSharp) Method

WorldTickPositions_FirstPass() private method

Determines the positions, in world coordinates, of the log spaced large ticks.
private WorldTickPositions_FirstPass ( Point physicalMin, Point physicalMax, ArrayList &largeTickPositions, ArrayList &smallTickPositions ) : void
physicalMin Point The physical position corresponding to the world minimum of the axis.
physicalMax Point The physical position corresponding to the world maximum of the axis.
largeTickPositions System.Collections.ArrayList ArrayList containing the positions of the large ticks.
smallTickPositions System.Collections.ArrayList null
return void
        internal override void WorldTickPositions_FirstPass(
            Point physicalMin,
            Point physicalMax,
            out ArrayList largeTickPositions,
            out ArrayList smallTickPositions
            )
        {
            smallTickPositions = null;
            largeTickPositions = new ArrayList();

            if ( double.IsNaN(WorldMin) || double.IsNaN(WorldMax) )
            {
                throw new NPlotException( "world extent of axis not set." );
            }

            double roundTickDist = this.DetermineTickSpacing( );

            // now determine first tick position.
            double first = 0.0f;

            // if the user hasn't specified a large tick position.
            if (double.IsNaN(largeTickValue_))
            {
                if( WorldMin > 0.0 )
                {

                    double nToFirst = Math.Floor(Math.Log10(WorldMin) / roundTickDist)+1.0f;
                    first = nToFirst * roundTickDist;
                }

                // could miss one, if first is just below zero.
                if (first-roundTickDist >= Math.Log10(WorldMin))
                {
                    first -= roundTickDist;
                }
            }

            // the user has specified one place they would like a large tick placed.
            else
            {
                first = Math.Log10( this.LargeTickValue );

                // TODO: check here not too much different.
                // could result in long loop.
                while (first < Math.Log10(WorldMin))
                {
                    first += roundTickDist;
                }

                while (first > Math.Log10(WorldMin)+roundTickDist)
                {
                    first -= roundTickDist;
                }
            }

            double mark = first;
            while (mark <= Math.Log10(WorldMax))
            {
                // up to here only logs are dealt with, but I want to return
                // a real value in the arraylist
                double val;
                val = Math.Pow( 10.0, mark );
                largeTickPositions.Add( val );
                mark += roundTickDist;
            }
        }