/*
 * This file is part of ATLAS. It is subject to the license terms in
 * the LICENSE file found in the top-level directory of this distribution.
 * (Also available at http://www.apache.org/licenses/LICENSE-2.0.txt)
 * You may not use this file except in compliance with the License.
 */
package de.dfki.asr.atlas.model;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.vecmath.Matrix4f;

public class ArrayMatrix4f extends Matrix4f {
	private static final long serialVersionUID = 5264274544357406927L;

	public ArrayMatrix4f(Iterator<Float> it) {
		super(it.next(), it.next(), it.next(), it.next(),
				it.next(), it.next(), it.next(), it.next(),
				it.next(), it.next(), it.next(), it.next(),
				it.next(), it.next(), it.next(), it.next());
	}

	public ArrayMatrix4f(List<Float> list) {
		this(list.iterator());
	}

	public ArrayMatrix4f(ArrayMatrix4f other) {
		super(other);
	}

	public ArrayMatrix4f() {

	}

	public List<Float> asListColumnMajor() {
		List<Float> list = new ArrayList<>();
		for (int i = 0; i < 16; i++) {
			list.add(getElement(i % 4, i / 4));
		}
		return list;
	}

}

@@ -327,110 +327,344 @@
 ort 
-java.util.ArrayList;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport javax.vecmath.Matrix4f;%0A
+com.fasterxml.jackson.annotation.JsonIgnoreProperties;%0Aimport com.fasterxml.jackson.annotation.JsonValue;%0Aimport java.util.ArrayList;%0Aimport java.util.Iterator;%0Aimport java.util.List;%0Aimport javax.vecmath.Matrix4f;%0A%0A@JsonIgnoreProperties(%7B%22m00%22,%22m01%22,%22m02%22,%22m03%22,%22m10%22,%22m11%22,%22m12%22,%22m13%22,%22m20%22,%22m21%22,%22m22%22,%22m23%22,%22m30%22,%22m31%22,%22m32%22,%22m33%22%7D)
 %0Apub
@@ -1364,10 +1364,196 @@
 st;%0A%09%7D%0A%0A
+%09@JsonValue%0A%09public List%3CFloat%3E asListRowMajor() %7B%0A%09%09List%3CFloat%3E list = new ArrayList%3C%3E();%0A%09%09for (int i = 0; i %3C 16; i++) %7B%0A%09%09%09list.add(getElement(i / 4, i %25 4));%0A%09%09%7D%0A%09%09return list;%0A%09%7D%0A%0A
 %7D%0A

Annotate JSON serialization (add row major listing)