// }
// write out he cell array as it is
// loop over all cells and for each cell write out the 3 link ids into the cell array for neighbors
public void write(JmeExporter e) throws IOException {
OutputCapsule capsule = e.getCapsule(this);
// capsule.writeSavableArrayList(m_CellArray, "cellarray", null);
capsule.write(mCellArray, "mCellArray", null);
HashMap<Cell, Integer> tmp = new HashMap<Cell, Integer>();
int[] links = new int[mCellArray.length*3];
for(int i =0; i<mCellArray.length; i++)
tmp.put(mCellArray[i], i);
Cell c = null;
for(int i =0,j=0; i<mCellArray.length; i++){
c = mCellArray[i];
links[j++]= (c.m_Link[0] != null?tmp.get(c.m_Link[0]):-1);
links[j++]= (c.m_Link[1] != null?tmp.get(c.m_Link[1]):-1);
links[j++]= (c.m_Link[2] != null?tmp.get(c.m_Link[2]):-1);
}
capsule.write(links, "links", null);
tmp.clear();
}