public void Transform(Matrix3 m, OnlineMonitor form1, ChartStyle cs) { // Normalize the point:初始化点 float x1 = (X - cs.XMin) / (cs.XMax - cs.XMin) - 0.5f; float y1 = (Y - cs.YMin) / (cs.YMax - cs.YMin) - 0.5f; float z1 = (Z - cs.ZMin) / (cs.ZMax - cs.ZMin) - 0.5f; // Perform transformation on the point using matrix m:用矩阵m 完成点的转换 float[] result = m.VectorMultiply(new float[4] { x1, y1, z1, W }); X = result[0]; Y = result[1]; // Coordinate transformation from World to Device system: float xShift = 1.05f; float xScale = 1; float yShift = 1.05f; float yScale = 0.9f; if (cs.Title == "No Title") { yShift = 0.95f; yScale = 1; } if (cs.IsColorBar) { xShift = 0.95f; xScale = 0.9f; } X = (xShift + xScale * X) * form1.PlotPanel.Width / 2; Y = (yShift - yScale * Y) * form1.PlotPanel.Height / 2; }
public ChartStyle2D(OnlineMonitor fm1) { form1 = fm1; Rectangle rect = form1.ClientRectangle; _mchartArea = new Rectangle(rect.X, rect.Y, rect.Width, 3 * rect.Height / 5); _mchartBackColor = fm1.BackColor; _mchartBorderColor = fm1.BackColor; }
public DrawChart(OnlineMonitor fm1) { form1 = fm1; }
public ChartStyle(OnlineMonitor fm1) { form1 = fm1; _mgridStyle = new LineStyle(); _maxisStyle = new LineStyle(); }