/// /// This file is part of ILNumerics Community Edition. /// /// ILNumerics Community Edition - high performance computing for applications. /// Copyright (C) 2006 - 2012 Haymo Kutschbach, http://ilnumerics.net /// /// ILNumerics Community Edition is free software: you can redistribute it and/or modify /// it under the terms of the GNU General Public License version 3 as published by /// the Free Software Foundation. /// /// ILNumerics Community Edition is distributed in the hope that it will be useful, /// but WITHOUT ANY WARRANTY; without even the implied warranty of /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the /// GNU General Public License for more details. /// /// You should have received a copy of the GNU General Public License /// along with ILNumerics Community Edition. See the file License.txt in the root /// of your distribution package. If not, see . /// /// In addition this software uses the following components and/or licenses: /// /// ================================================================================= /// The Open Toolkit Library License /// /// Copyright (c) 2006 - 2009 the Open Toolkit library. /// /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights to /// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of /// the Software, and to permit persons to whom the Software is furnished to do /// so, subject to the following conditions: /// /// The above copyright notice and this permission notice shall be included in all /// copies or substantial portions of the Software. /// /// ================================================================================= /// using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Drawing; namespace ILNumerics.Drawing.Labeling { /// /// the class collects renderable items which define /// the graphical output for a render expression /// /// ILRenderQueues are semi-immutable. Instances - once created - can only be cleared and /// re-created, but not altered. Therefore, they keep the size of the output cached over their livetime. public class ILRenderQueue : IEnumerable { #region attributes Size m_size; List m_list; String m_expression; #endregion #region constructor /// /// constructor, creates a new render queue with content /// /// expression, which led to this queue /// prepared queue /// size of content after rendering public ILRenderQueue(string expression, List queue, Size size) : base () { m_size = size; m_list = queue; m_expression = expression; } #endregion #region properties /// /// overall size of content of this render queue /// public Size Size { get { return m_size; } } /// /// Expression which led to this queue /// public string Expression { get { return m_expression; } } #endregion #region IList Member public int IndexOf(ILRenderQueueItem item) { return m_list.IndexOf(item); } //public void Insert(int index, ILRenderQueueItem item) { // m_list.Insert(index,item); //} //public void RemoveAt(int index) { // m_list.RemoveAt(index); //} public ILRenderQueueItem this[int index] { get { return m_list[index]; } //set { // m_list[index] = value; //} } #endregion #region ICollection Member //public void Add(ILRenderQueueItem item) { // // todo: implement pooling of render queue item objects! // m_list.Add(item); //} public void Clear() { // todo: implement pooling of render queue item objects! m_list.Clear(); } public bool Contains(ILRenderQueueItem item) { return m_list.Contains(item); } public void CopyTo(ILRenderQueueItem[] array, int arrayIndex) { m_list.CopyTo(array,arrayIndex); } public int Count { get { return m_list.Count; } } public bool IsReadOnly { get { return false; } } //public bool Remove(ILRenderQueueItem item) { // return m_list.Remove(item); //} #endregion #region IEnumerable Member public IEnumerator GetEnumerator() { foreach (ILRenderQueueItem item in m_list) yield return item; } #endregion #region IEnumerable Member IEnumerator IEnumerable.GetEnumerator() { return m_list.GetEnumerator(); } #endregion } }