protected void parse6d(String msg) { int id = 0; ARTPoint position = ARTPoint.Empty(); ARTAngle angle = ARTAngle.Empty(); ARTMatrix matrix = ARTMatrix.Empty(); msg = msg.Replace("]", ""); msg = msg.Replace("[", "x"); String[] tmp = msg.Split('x'); if (tmp.Length >= 4) { numberOf6dTargets = parseInt(tmp[0]); String[] tmp2 = tmp[1].Split(' '); if (tmp2.Length >= 2) { id = parseInt(tmp2[0]); } tmp2 = tmp[2].Split(' '); if (tmp2.Length >= 6) { position = new ARTPoint(parseFloat(tmp2[0]), parseFloat(tmp2[1]), parseFloat(tmp2[2])); angle = new ARTAngle(parseFloat(tmp2[3]), parseFloat(tmp2[4]), parseFloat(tmp2[5])); } tmp2 = tmp[3].Split(' '); if (tmp2.Length >= 9) { matrix = new ARTMatrix(parseFloatArray(tmp2)); } add6dObject(new ART6d(id, position, angle, matrix)); for (int i = 0; i < observers.Count; i++) { ((ARTObserver)observers[i]).on6dUpdate(this); } } }
public ART6d(int id, ARTPoint position, ARTAngle angle, ARTMatrix matrix) : base(id, position, matrix) { this.angle = angle; }
public static ART6d Empty() { return(new ART6d(-1, ARTPoint.Empty(), ARTAngle.Empty(), ARTMatrix.Empty())); }