Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
DrawingVolume.cs
1using System;
2using System.Collections.Generic;
3using System.Numerics;
6
8{
12 public class DrawingVolume
13 {
14 private Dictionary<string, double> xLabelPositions = null;
15 private Dictionary<string, double> yLabelPositions = null;
16 private Dictionary<string, double> zLabelPositions = null;
17 private readonly IElement minX;
18 private readonly IElement maxX;
19 private readonly IElement minY;
20 private readonly IElement maxY;
21 private readonly IElement minZ;
22 private readonly IElement maxZ;
23 private readonly int offsetX;
24 private readonly int offsetY;
25 private readonly int offsetZ;
26 private readonly int width;
27 private readonly int height;
28 private readonly int depth;
29 private readonly float? origoX;
30 private readonly float? origoY;
31 private readonly float? origoZ;
32
53 int Width, int Height, int Depth, float? OrigoX, float? OrigoY, float? OrigoZ)
54 {
55 this.minX = MinX;
56 this.maxX = MaxX;
57 this.minY = MinY;
58 this.maxY = MaxY;
59 this.minZ = MinZ;
60 this.maxZ = MaxZ;
61 this.offsetX = OffsetX;
62 this.offsetY = OffsetY;
63 this.offsetZ = OffsetZ;
64 this.width = Width;
65 this.height = Height;
66 this.depth = Depth;
67 this.origoX = OrigoX;
68 this.origoY = OrigoY;
69 this.origoZ = OrigoZ;
70 }
71
76 {
77 get
78 {
79 return this.minX;
80 }
81 }
82
86 public IElement MaxX => this.maxX;
87
91 public IElement MinY => this.minY;
92
96 public IElement MaxY => this.maxY;
97
101 public IElement MinZ => this.minZ;
102
106 public IElement MaxZ => this.maxZ;
107
111 public int OffsetX => this.offsetX;
112
116 public int OffsetY => this.offsetY;
117
121 public int OffsetZ => this.offsetZ;
122
126 public int Width => this.width;
127
131 public int Height => this.height;
132
136 public int Depth => this.depth;
137
141 public float? OrigoX => this.origoX;
142
146 public float? OrigoY => this.origoY;
147
151 public float? OrigoZ => this.origoZ;
152
156 public Dictionary<string, double> XLabelPositions
157 {
158 get => this.xLabelPositions;
159 set => this.xLabelPositions = value;
160 }
161
165 public Dictionary<string, double> YLabelPositions
166 {
167 get => this.yLabelPositions;
168 set => this.yLabelPositions = value;
169 }
170
174 public Dictionary<string, double> ZLabelPositions
175 {
176 get => this.zLabelPositions;
177 set => this.zLabelPositions = value;
178 }
179
186 public Vector4[,] Scale(IMatrix MatrixX, IMatrix MatrixY, IMatrix MatrixZ)
187 {
188 return Graph3D.Scale(MatrixX, MatrixY, MatrixZ, this.minX, this.maxX,
189 this.minY, this.maxY, this.minZ, this.maxZ,
190 this.offsetX, this.offsetY, this.offsetZ,
191 this.width, this.height, this.depth,
192 this.xLabelPositions, this.yLabelPositions, this.zLabelPositions);
193 }
194
199 public double[,] ScaleX(IMatrix Matrix)
200 {
201 return Graph3D.Scale(Matrix, this.minX, this.maxX, this.offsetX, this.width, this.xLabelPositions);
202 }
203
208 public double[] ScaleX(IVector Vector)
209 {
210 return Graph2D.Scale(Vector, this.minX, this.maxX, this.offsetX, this.width, this.xLabelPositions);
211 }
212
217 public double[,] ScaleY(IMatrix Matrix)
218 {
219 return Graph3D.Scale(Matrix, this.minY, this.maxY, this.offsetY, this.height, this.yLabelPositions);
220 }
221
226 public double[] ScaleY(IVector Vector)
227 {
228 return Graph2D.Scale(Vector, this.minY, this.maxY, this.offsetY, this.height, this.yLabelPositions);
229 }
230
235 public double[,] ScaleZ(IMatrix Matrix)
236 {
237 return Graph3D.Scale(Matrix, this.maxZ, this.minZ, this.offsetZ, this.depth, this.zLabelPositions);
238 }
239
244 public double[] ScaleZ(IVector Vector)
245 {
246 return Graph2D.Scale(Vector, this.maxZ, this.minZ, this.offsetZ, this.depth, this.zLabelPositions);
247 }
248
253 public IElement DescaleX(double Value)
254 {
255 return Graph.Descale(Value, this.minX, this.maxX, this.offsetX, this.width);
256 }
257
262 public IElement DescaleY(double Value)
263 {
264 return Graph.Descale(Value, this.minY, this.maxY, this.offsetY, this.height);
265 }
266
271 public IElement DescaleZ(double Value)
272 {
273 return Graph.Descale(Value, this.maxZ, this.minZ, this.offsetZ, this.depth);
274 }
275
276 }
277}
Contains information about the current drawing area.
int OffsetY
Y-offset of drawing area, relative to the canvas origin.
IElement DescaleZ(double Value)
Descales a scaled value along the Z-axis.
IElement MinZ
Smallest value of Z.
double[,] ScaleX(IMatrix Matrix)
Scales a matrix with x-coordinates to fit a given volume.
Dictionary< string, double > XLabelPositions
Optional fixed X-Label positions.
DrawingVolume(IElement MinX, IElement MaxX, IElement MinY, IElement MaxY, IElement MinZ, IElement MaxZ, int OffsetX, int OffsetY, int OffsetZ, int Width, int Height, int Depth, float? OrigoX, float? OrigoY, float? OrigoZ)
Contains information about the current drawing area.
double[,] ScaleY(IMatrix Matrix)
Scales a matrix with y-coordinates to fit a given volume.
float? OrigoX
X-coordinate for the origo.
IElement MaxY
Largest value of Y.
IElement MaxZ
Largest value of Z.
IElement MinY
Smallest value of Y.
double[] ScaleZ(IVector Vector)
Scales a vector of z-coordinates to fit a given volume.
double[] ScaleY(IVector Vector)
Scales a vector of y-coordinates to fit a given volume.
float? OrigoY
Y-coordinate for the origo.
int Depth
Depth of drawing area.
Vector4[,] Scale(IMatrix MatrixX, IMatrix MatrixY, IMatrix MatrixZ)
Scales three matrices of equal size to point vectors in space.
IElement DescaleX(double Value)
Descales a scaled value along the X-axis.
Dictionary< string, double > YLabelPositions
Optional fixed Y-Label positions.
int OffsetZ
Z-offset of drawing area, relative to the canvas origin.
IElement DescaleY(double Value)
Descales a scaled value along the Y-axis.
int Width
Width of drawing area.
Dictionary< string, double > ZLabelPositions
Optional fixed Z-Label positions.
double[] ScaleX(IVector Vector)
Scales a vector of x-coordinates to fit a given volume.
IElement MaxX
Largest value of X.
float? OrigoZ
Z-coordinate for the origo.
IElement MinX
Smallest value of X.
double[,] ScaleZ(IMatrix Matrix)
Scales a matrix with z-coordinates to fit a given volume.
int OffsetX
X-offset of drawing area, relative to the canvas origin.
int Height
Height of drawing area.
Handles three-dimensional graphs.
Definition: Graph3D.cs:28
static Vector4[,] Scale(IMatrix MatrixX, IMatrix MatrixY, IMatrix MatrixZ, IElement MinX, IElement MaxX, IElement MinY, IElement MaxY, IElement MinZ, IElement MaxZ, double OffsetX, double OffsetY, double OffsetZ, double Width, double Height, double Depth, Dictionary< string, double > XLabelPositions, Dictionary< string, double > YLabelPositions, Dictionary< string, double > ZLabelPositions)
Scales three matrices of equal size to point vectors in space.
Definition: Graph3D.cs:1116
Handles two-dimensional graphs.
Definition: Graph2D.cs:26
Base class for graphs.
Definition: Graph.cs:79
static IElement Descale(double Value, IElement Min, IElement Max, double Offset, double Size)
Descales a scaled value.
Definition: Graph.cs:747
static SKPoint[] Scale(IVector VectorX, IVector VectorY, IElement MinX, IElement MaxX, IElement MinY, IElement MaxY, double OffsetX, double OffsetY, double Width, double Height, Dictionary< string, double > XLabelPositions, Dictionary< string, double > YLabelPositions)
Scales two vectors of equal size to points in a rectangular area.
Definition: Graph.cs:496
Basic interface for all types of elements.
Definition: IElement.cs:20
Basic interface for matrices.
Definition: IMatrix.cs:9
Basic interface for vectors.
Definition: IVector.cs:9