public ShapeDataPacket ExportToPacket() { ShapeDataPacket packet = new ShapeDataPacket(); ExportToPacket(packet); return(packet); }
public void ExportToPacket(ShapeDataPacket packet) { if (packet != null) { foreach (ShapeFrameIdPair iteration in Iterations) { packet.Shapes.Add(iteration.ExportToPacket()); } } }
public void ExportToPacket(ShapeDataPacket packet) { if (packet != null) { foreach (ShapeIterations shapeIterations in ShapeData.Values) { shapeIterations.ExportToPacket(packet); } } }
public void ImportFromPacket(ShapeDataPacket packet) { if (packet != null) { foreach (ShapeFrameIterationPacket iterationPacket in packet.Shapes) { switch (iterationPacket.ShapeType) { case ShapeTypePacket.Obb: ObbShape createdObb = new ObbShape(); createdObb.ImportFromPacket(iterationPacket.ObbShape); AddNewShape(iterationPacket.FrameId, createdObb); break; case ShapeTypePacket.Sphere: break; case ShapeTypePacket.Cone: break; case ShapeTypePacket.ConvexHull: ConvexHullShape createdConvexHull = new ConvexHullShape(); createdConvexHull.ImportFromPacket(iterationPacket.ConvexHullShape); AddNewShape(iterationPacket.FrameId, createdConvexHull); break; case ShapeTypePacket.Tetrahedron: TetrahedronShape createdTetrahedron = new TetrahedronShape(); createdTetrahedron.ImportFromPacket(iterationPacket.TetrahedronShape); AddNewShape(iterationPacket.FrameId, createdTetrahedron); break; default: break; } } } }