private WorldTickPositions_FirstPass ( Point physicalMin, Point physicalMax, |
||
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 | ArrayList containing the positions of the large ticks. | |
smallTickPositions | null | |
return | void |
internal override void WorldTickPositions_FirstPass(
Point physicalMin,
Point physicalMax,
out ArrayList largeTickPositions,
out ArrayList smallTickPositions
)
{
smallTickPositions = null;
largeTickPositions = new ArrayList();
// if ticks correspond to position of text
if (!ticksBetweenText_)
{
for (int i=0; i<labels_.Count; ++i)
{
if ((double)numbers_[i] > WorldMin && (double)numbers_[i] < WorldMax)
{
largeTickPositions.Add( numbers_[i] );
}
}
}
// if ticks correspond to gaps between text
else
{
ArrayList numbers_copy;
if (sortDataIfNecessary_)
{
numbers_copy = (ArrayList)numbers_.Clone(); // shallow copy.
numbers_copy.Sort();
}
else
{
numbers_copy = numbers_;
}
for (int i=1; i<labels_.Count; ++i)
{
double worldPosition = ((double)numbers_copy[i] + (double)numbers_copy[i-1])/2.0;
if (worldPosition > WorldMin && worldPosition < WorldMax)
{
largeTickPositions.Add( worldPosition );
}
}
}
}