Example #1
0
		public IntRect(IntRect ir)
		{
			this.left = ir.left; this.top = ir.top;
			this.right = ir.right; this.bottom = ir.bottom;
		}
Example #2
0
        public IntRect GetBounds()
        {
            IntRect     result      = default(IntRect);
            LocalMinima localMinima = this.m_MinimaList;

            if (localMinima == null)
            {
                return(result);
            }
            result.left   = localMinima.LeftBound.Bot.X;
            result.top    = localMinima.LeftBound.Bot.Y;
            result.right  = localMinima.LeftBound.Bot.X;
            result.bottom = localMinima.LeftBound.Bot.Y;
            while (localMinima != null)
            {
                if (localMinima.LeftBound.Bot.Y > result.bottom)
                {
                    result.bottom = localMinima.LeftBound.Bot.Y;
                }
                TEdge tEdge = localMinima.LeftBound;
                while (true)
                {
                    TEdge tEdge2 = tEdge;
                    while (tEdge.NextInLML != null)
                    {
                        if (tEdge.Bot.X < result.left)
                        {
                            result.left = tEdge.Bot.X;
                        }
                        if (tEdge.Bot.X > result.right)
                        {
                            result.right = tEdge.Bot.X;
                        }
                        tEdge = tEdge.NextInLML;
                    }
                    if (tEdge.Bot.X < result.left)
                    {
                        result.left = tEdge.Bot.X;
                    }
                    if (tEdge.Bot.X > result.right)
                    {
                        result.right = tEdge.Bot.X;
                    }
                    if (tEdge.Top.X < result.left)
                    {
                        result.left = tEdge.Top.X;
                    }
                    if (tEdge.Top.X > result.right)
                    {
                        result.right = tEdge.Top.X;
                    }
                    if (tEdge.Top.Y < result.top)
                    {
                        result.top = tEdge.Top.Y;
                    }
                    if (tEdge2 != localMinima.LeftBound)
                    {
                        break;
                    }
                    tEdge = localMinima.RightBound;
                }
                localMinima = localMinima.Next;
            }
            return(result);
        }
Example #3
0
		//------------------------------------------------------------------------------
		
		public IntRect GetBounds()
		{
			IntRect result = new IntRect();
			LocalMinima lm = m_MinimaList;
			if (lm == null) return result;
			result.left = lm.LeftBound.Bot.X;
			result.top = lm.LeftBound.Bot.Y;
			result.right = lm.LeftBound.Bot.X;
			result.bottom = lm.LeftBound.Bot.Y;
			while (lm != null)
			{
				if (lm.LeftBound.Bot.Y > result.bottom)
					result.bottom = lm.LeftBound.Bot.Y;
				TEdge e = lm.LeftBound;
				for (; ; )
				{
					TEdge bottomE = e;
					while (e.NextInLML != null)
					{
						if (e.Bot.X < result.left) result.left = e.Bot.X;
						if (e.Bot.X > result.right) result.right = e.Bot.X;
						e = e.NextInLML;
					}
					if (e.Bot.X < result.left) result.left = e.Bot.X;
					if (e.Bot.X > result.right) result.right = e.Bot.X;
					if (e.Top.X < result.left) result.left = e.Top.X;
					if (e.Top.X > result.right) result.right = e.Top.X;
					if (e.Top.Y < result.top) result.top = e.Top.Y;
					
					if (bottomE == lm.LeftBound) e = lm.RightBound;
					else break;
				}
				lm = lm.Next;
			}
			return result;
		}