I'm trying to get on a professor's research project. He told me that at my level the best way to get involved is to help program this visual simulation thing for him. So I read through the first 11 chapters (Part 1 "the C# language") of Professional C# 3e by Simon Robinson et. I know I should finish the book, but I'm not a fast reader. I just wonder if anyone can tell me the specific topics I should read to get on this task, of which I will give the description below:
It's a form application which contains a button. The event handler upon click creates a 200*200-element (custom-developed GraphPane objects) color map, whose color distribution (ie element distribution) is at the present hard coded into the event handler. The color map can zoom in and out much like in autocad (I haven't read through the supporting classes yet, mostly because of my lack of knowledge). THE TASK IS TO ENABLE THE USER TO CUSTOMIZE THE COLORS ON THE DISPLAY.
I hope I've described enough for an expert to suggest specific reading.
I also have two additional questions:
1. My conception is that if I can identify the methods that enable the users to zoom in and out by pulling rectangular selection boxes, I may be able to build my "color custimization" method(s) on them. however I have no idea how to enable color selection. Should I make a color bar on the side with each color patch being a small button (is this even possible?) whose event handler turns the selected region into its color?
2. I simply don't understand the difference between two arrays whose indexing are marked [][] and [ , ] repectively. I probably overlooked a section in my reading because it seems to be an elementary concept. Here is an example code. My questions are written as comments
public void SetXY(double[] x, double[] y)
{
hBeta = y;
hAlpha = new double[hBeta.Length][];
for (int i = 0; i < hBeta.Length; i++)
hAlpha[i] = x; //does this mean "for (0 to x.length) hAlpha[i][k]=x[k]"?
values = new double[hBeta.Length][];
for (int i = 0; i < hBeta.Length; i++)
values[i] = new double[x.Length];
}
and the SetXYZ:
public void SetXYZ(double[] x, double[] y, double[,] z)
{
if (x.Length != z.GetLength(0) || y.Length != z.GetLength(1))
// does z.GetLength(0) mean the length of the array at index 0 of z[ , ]? if so, does this mean z[ , ]
// is a 2d rectangular array , as opposed to a SQUARE array? does [][] indicate a SQUARE array?
// is that the difference between [][] and [ , ]
throw new Exception("x.Length * y.Length is not equal to z.GetLength(0)*z.GetLength(1)");
SetXY(x, y);
values = new double[hBeta.Length][];
for (int i = 0; i < hBeta.Length; i++)
values[i] = new double[x.Length];
for (int i = 0; i < x.Length; i++)
for (int j = 0; j < y.Length; j++)
values[j][i] = z[i, j];
}