40 lines
1.1 KiB
C#
40 lines
1.1 KiB
C#
using Graphing.Forms;
|
|
|
|
namespace Graphing;
|
|
|
|
public abstract class Graphable
|
|
{
|
|
private static int defaultColorsUsed;
|
|
public static readonly uint[] DefaultColors =
|
|
[
|
|
0xEF_B34D47, // Red
|
|
0xEF_4769B3, // Blue
|
|
0xEF_50B347, // Green
|
|
0xEF_7047B3, // Purple
|
|
0xEF_B38B47, // Orange
|
|
0xEF_5B5B5B // Black
|
|
];
|
|
|
|
public Color Color { get; set; }
|
|
public string Name { get; set; }
|
|
|
|
public Graphable()
|
|
{
|
|
Color = Color.FromArgb((int)DefaultColors[defaultColorsUsed % DefaultColors.Length]);
|
|
defaultColorsUsed++;
|
|
|
|
Name = "Unnamed Graphable.";
|
|
}
|
|
|
|
public abstract IEnumerable<IGraphPart> GetItemsToRender(in GraphForm graph);
|
|
|
|
public abstract Graphable DeepCopy();
|
|
|
|
public abstract void EraseCache();
|
|
public abstract long GetCacheBytes();
|
|
public abstract void Preload(Float2 xRange, Float2 yRange, double step);
|
|
|
|
public abstract bool ShouldSelectGraphable(in GraphForm graph, Float2 graphMousePos, double factor);
|
|
public abstract Float2 GetSelectedPoint(in GraphForm graph, Float2 graphMousePos);
|
|
}
|