A
Anders Eriksson
I have a class that is called Coordinates. It contains coordinates for 4
axes (X, Y, Z, A (rotating axis)).
The coordinates are read from a text file and stored as doubles.
Sometimes there isn't a value for one axis, but since I store them as
double...
How can I store a non-value for an axis?
// Anders
--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.
private class Coordinates
{
private double _x;
private double _y;
private double _z;
private double _a;
public double X { get { return _x; } set { _x = value; } }
public double Y { get { return _y; } set { _y = value; } }
public double Z { get { return _z; } set { _z = value; } }
public double A { get { return _a; } set { _a = value; } }
public void SetCoords(Dictionary<string, string> dict)
{
bool brc = false;
string buf = "";
brc = dict.TryGetValue("MARK_OFFSET_X", out buf);
if (brc)
strY = buf;
else
Y = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_Y", out buf);
if (brc)
X = -1 * Convert.ToDouble(buf, NumberFormatInfo.InvariantInfo);
else
X = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_Z", out buf);
if (brc)
strZ = buf;
else
Z = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_A", out buf);
if (brc)
strA = buf;
else
A = 0.0;
}
}
axes (X, Y, Z, A (rotating axis)).
The coordinates are read from a text file and stored as doubles.
Sometimes there isn't a value for one axis, but since I store them as
double...
How can I store a non-value for an axis?
// Anders
--
English isn't my first language.
So any error or strangeness is due to the translation.
Please correct my English so that I may become better.
private class Coordinates
{
private double _x;
private double _y;
private double _z;
private double _a;
public double X { get { return _x; } set { _x = value; } }
public double Y { get { return _y; } set { _y = value; } }
public double Z { get { return _z; } set { _z = value; } }
public double A { get { return _a; } set { _a = value; } }
public void SetCoords(Dictionary<string, string> dict)
{
bool brc = false;
string buf = "";
brc = dict.TryGetValue("MARK_OFFSET_X", out buf);
if (brc)
strY = buf;
else
Y = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_Y", out buf);
if (brc)
X = -1 * Convert.ToDouble(buf, NumberFormatInfo.InvariantInfo);
else
X = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_Z", out buf);
if (brc)
strZ = buf;
else
Z = 0.0;
brc = dict.TryGetValue("MARK_OFFSET_A", out buf);
if (brc)
strA = buf;
else
A = 0.0;
}
}