/// /// 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.Generic; using System.Text; using System.Drawing; using ILNumerics.Drawing; using ILNumerics.Drawing.Labeling; namespace ILNumerics.Drawing.Interfaces { /// /// interface for all classes capable of renderung (device /// dependend) texts into plot panels /// /// class definitions should also implement the ILRendererAttribute. See for an example. /// public interface IILTextRenderer { /// /// The name of the TextRenderer instance (implementation dependent) /// string Name { get; } /// /// A more descriptive name to be displayed into GUI's (implementation dependent) /// string NameLong { get; } /// /// Get the graphics device type this TextRenderer instance /// is capable to use for drawing /// GraphicDeviceType DeviceType { get; } /// /// Determine, if the text is to be drawn after the rendering /// backbuffer has been swapped and presented to the screen. (implementation dependent) /// bool DrawAfterBufferSwapped { get; } /// /// Determine, if this renderer chaches the output (implementation dependent) /// bool Cached { get; } /// /// Determine the coord system this renderer is specialized to draw in /// CoordSystem CoordSystem { get; } /// /// begins drawing, to be called before Draw()! /// /// extended render properties void Begin (ILRenderProperties p); /// /// begins drawing and queries current model view matrix also /// /// extended render properties /// current modelviewmatrix void Begin (ILRenderProperties p, ref double[] modelview); /// /// Draw the text (screen coords) /// /// contains items to be drawn /// position relative to surface, starting point for drawing /// orientation for item /// initial or default color /// /// Before calling Draw(), the TextRenderer must have been initialized with Begin(g)! /// use this function if drawing in screen coords, the size for render /// output will be taken from the Size member of the render queue (pixels). /// /// on attempt to draw any text without previous initialization void Draw (ILRenderQueue renderQueue, System.Drawing.Point position, TextOrientation orientation, Color color); /// /// Draws the text in world coords /// /// contains items to be drawn /// x1-position /// y1-position /// z1-position /// x2-position /// y2-position /// z2-position /// base color for items not containing individual colors /// /// Before calling Draw(), the TextRenderer must have been initialized with Begin(g)! /// Use this function to draw the render queue in world coords. The position parameters mark the upper left /// and lower right corner of the quads to contain the render queue content. /// /// on attempt to draw any text without previous initialization void Draw (ILRenderQueue renderQueue, float x1, float y1, float z1, float x2, float y2, float z2, Color color); /// /// finalizes the drawing (must prepare it again before drawing!) /// void End(ILRenderProperties p); /// /// Cache single item into the renderer cache. /// /// key used to uniquely identify the item in cache /// item bitmap data /// section in bmp to be transfered into the cache void Cache(string key, Bitmap bmp, RectangleF rect); /// /// test if an item for a specific key is already cached /// /// /// bool ExistsKey(string key); /// /// test if the key exists and return the size of corresponding item on success /// /// key identifying the item /// if the key was found: the size of the corresponding item /// true, if the key exist, false otherwise bool TryGetSize(string key, ref Size size); /// /// if set to a color (not Color.Empty), that color will be used for all renderings. /// The color contained in the rendering queue is ignored than. /// Color ColorOverride { get; set; } /// /// for cached renderers, fires if the internal cache was cleared /// event EventHandler CacheCleared; } }