public Posture(PostureType type, double[][] vectors) { this.type = type; List <VectorType> types = PostureRecognition.getVectorTypeList(type); for (int i = 0; i < types.Count; i++) { setVector(types[i], new Vector(vectors[i][0], vectors[i][1], vectors[i][2])); } }
public String toJsonString() { JSONObject jsonObject = new JSONObject(); List <VectorType> typeList = PostureRecognition.getVectorTypeList(this.type); foreach (VectorType t in typeList) { Vector v = getVector(t); if (v != null) { JSONArray jsonArray = new JSONArray(); jsonArray.Put(v.X); jsonArray.Put(v.Y); jsonArray.Put(v.Z); jsonObject.Put(vectorTypeMap[t], jsonArray); } } return(jsonObject.ToString()); }