/*
* NPlot - A charting library for .NET
*
* IPlotSurface.cs
* Copyright (C) 2003-2006 Matt Howlett and others.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of NPlot nor the names of its contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
using System.Collections;
using System.Drawing;
using System.Drawing.Drawing2D;
namespace NPlot
{
///
/// Defines the PlotSurface2D interface - All specific PlotSurface2D classes
/// that use PlotSurface2D for their underlying operations should implement
/// this class.
///
public interface IPlotSurface2D
{
///
/// Gets or Sets the legend to use with this plot surface.
///
Legend Legend { get; set; }
///
/// Setting this value determines the order (relative to IDrawables added to the plot surface)
/// that the legend is drawn.
///
int LegendZOrder { get; set; }
///
/// The distance in pixels to leave between of the edge of the bounding rectangle
/// supplied to the Draw method, and the markings that make up the plot.
///
int Padding { get; set; }
///
/// A color used to paint the plot background. Mutually exclusive with PlotBackImage and PlotBackBrush
///
Color PlotBackColor { set; }
///
/// An imaged used to paint the plot background. Mutually exclusive with PlotBackColor and PlotBackBrush
///
System.Drawing.Bitmap PlotBackImage { set; }
///
/// A Rectangle brush used to paint the plot background. Mutually exclusive with PlotBackColor and PlotBackBrush
///
IRectangleBrush PlotBackBrush { set; }
///
/// The plot surface title.
///
string Title { get; set; }
///
/// Whether or not the title will be scaled according to size of the plot
/// surface.
///
bool AutoScaleTitle { get; set; }
///
/// When plots are added to the plot surface, the axes they are attached to
/// are immediately modified to reflect data of the plot. If
/// AutoScaleAutoGeneratedAxes is true when a plot is added, the axes will
/// be turned in to auto scaling ones if they are not already [tick marks,
/// tick text and label size scaled to size of plot surface]. If false,
/// axes will not be autoscaling.
///
bool AutoScaleAutoGeneratedAxes { get; set; }
///
/// Sets the title to be drawn using a solid brush of this color.
///
Color TitleColor { set; }
///
/// The brush used for drawing the title.
///
Brush TitleBrush { get; set; }
///
/// The plot title font.
///
Font TitleFont { get; set; }
///
/// Smoothing mode to use when drawing plots.
///
SmoothingMode SmoothingMode { get; set; }
///
/// The bottom abscissa axis.
///
Axis XAxis1 { get; set; }
///
/// The top abscissa axis.
///
Axis XAxis2 { get; set; }
///
/// The left ordinate axis.
///
Axis YAxis1 { get; set; }
///
/// The right ordinate axis.
///
Axis YAxis2 { get; set; }
///
/// Gets an array list containing all drawables currently added to the PlotSurface2D.
///
ArrayList Drawables { get; }
///
/// Adds a drawable object to the plot surface. If the object is an IPlot,
/// the PlotSurface2D axes will also be updated.
///
/// The IDrawable object to add to the plot surface.
/// The z-ordering when drawing (objects with lower numbers are drawn first)
void Add(IDrawable p, int zOrder);
///
/// Adds a drawable object to the plot surface against the specified axes. If
/// the object is an IPlot, the PlotSurface2D axes will also be updated.
///
/// the IDrawable object to add to the plot surface
/// the x-axis to add the plot against.
/// the y-axis to add the plot against.
/// The z-ordering when drawing (objects with lower numbers are drawn first)
void Add(IDrawable p, PlotSurface2D.XAxisPosition xp, PlotSurface2D.YAxisPosition yp, int zOrder);
///
/// Adds a drawable object to the plot surface. If the object is an IPlot,
/// the PlotSurface2D axes will also be updated.
///
/// The IDrawable object to add to the plot surface.
void Add(IDrawable p);
///
/// Adds a drawable object to the plot surface against the specified axes. If
/// the object is an IPlot, the PlotSurface2D axes will also be updated.
///
/// the IDrawable object to add to the plot surface
/// the x-axis to add the plot against.
/// the y-axis to add the plot against.
void Add(IDrawable p, PlotSurface2D.XAxisPosition xax, PlotSurface2D.YAxisPosition yax);
///
/// Clears the PlotSurface2D.
///
void Clear();
///
/// Add an axis constraint to the plot surface. Axis constraints can
/// specify relative world-pixel scalings, absolute axis positions etc.
///
/// The axis constraint to add.
void AddAxesConstraint(AxesConstraint c);
///
/// Remove a drawable object from the plot surface.
///
/// the object to remove
/// whether or not to update the axes after removal.
void Remove(IDrawable p, bool updateAxes);
/*
///
/// Calculates axes approprate to IPlots on PlotSurface. Note that
/// this is done automatically as a new plot is added. You may wish
/// to call this again if you update data in the plot.
///
void AutoCalculateAxes();
///
/// C
///
///
void UpdateAxes( IPlot p );
*/
}
}