diff --git a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java index 7776d42b6a..f6a8507dbd 100644 --- a/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java +++ b/cave/com.raytheon.uf.viz.collaboration.ui/src/com/raytheon/uf/viz/collaboration/ui/rsc/rendering/ShapeRenderingHandler.java @@ -40,6 +40,7 @@ import com.raytheon.uf.viz.remote.graphics.events.shapes.ShadedShapeDataEvent.Da import com.raytheon.uf.viz.remote.graphics.events.shapes.ShadedShapeDataEvent.ShadedShapeData; import com.raytheon.uf.viz.remote.graphics.events.shapes.WireframeShapeDataEvent; import com.raytheon.uf.viz.remote.graphics.events.shapes.WireframeShapeDataEvent.Label; +import com.vividsolutions.jts.geom.Coordinate; /** * Handles render events for IShapes @@ -111,7 +112,10 @@ public class ShapeRenderingHandler extends CollaborationRenderingHandler { for (Label label : event.getLabels()) { shape.addLabel(label.getText(), label.getPoint()); } - for (double[][] coords : event.getCoordinates()) { + for (double[][] coords : event.getPixelCoordinates()) { + shape.addLineSegment(coords); + } + for (Coordinate[] coords : event.getWorldCoordiantes()) { shape.addLineSegment(coords); } if (event.isCompile()) { diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java index 00e85be8a3..f31fbfb08e 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/DispatchGraphicsTarget.java @@ -871,7 +871,7 @@ public class DispatchGraphicsTarget extends DispatchingObject GeneralGridGeometry targetGeometry, boolean tesselate) { DispatchingShadedShape shape = new DispatchingShadedShape( wrappedObject.createShadedShape(mutable, targetGeometry, - tesselate), getDispatcher(), targetGeometry); + tesselate), getDispatcher()); // Send creation event CreateShadedShapeEvent event = RemoteGraphicsEventFactory.createEvent( CreateShadedShapeEvent.class, shape); diff --git a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/shapes/WireframeShapeDataEvent.java b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/shapes/WireframeShapeDataEvent.java index 3c49231b2d..66564b4b4c 100644 --- a/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/shapes/WireframeShapeDataEvent.java +++ b/cave/com.raytheon.uf.viz.remote.graphics/src/com/raytheon/uf/viz/remote/graphics/events/shapes/WireframeShapeDataEvent.java @@ -31,6 +31,7 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; import com.raytheon.uf.common.serialization.annotations.DynamicSerializeTypeAdapter; import com.raytheon.uf.viz.remote.graphics.events.AbstractDispatchingObjectEvent; import com.raytheon.uf.viz.remote.graphics.events.shapes.WireframeShapeDataEvent.WireframeShapeDataAdapter; +import com.vividsolutions.jts.geom.Coordinate; /** * Wireframe shape data event which contains coordinates and labels to add to @@ -73,13 +74,24 @@ public class WireframeShapeDataEvent extends AbstractDispatchingObjectEvent { serializer.writeString(l.getText()); serializer.writeDoubleArray(l.getPoint()); } - serializer.writeI32(object.coordinates.size()); - for (double[][] coords : object.coordinates) { + serializer.writeI32(object.pixelCoordinates.size()); + for (double[][] coords : object.pixelCoordinates) { serializer.writeI32(coords.length); for (double[] coord : coords) { serializer.writeDoubleArray(coord); } } + serializer.writeI32(object.worldCoordiantes.size()); + for (Coordinate[] coordArray : object.worldCoordiantes) { + double[] packedCoords = new double[coordArray.length * 3]; + int i = 0; + for (Coordinate coord : coordArray) { + packedCoords[i++] = coord.x; + packedCoords[i++] = coord.y; + packedCoords[i++] = coord.z; + } + serializer.writeDoubleArray(packedCoords); + } } /* @@ -101,6 +113,7 @@ public class WireframeShapeDataEvent extends AbstractDispatchingObjectEvent { data.addLabel(deserializer.readString(), deserializer.readDoubleArray()); } + size = deserializer.readI32(); for (int i = 0; i < size; ++i) { int size2 = deserializer.readI32(); @@ -108,8 +121,20 @@ public class WireframeShapeDataEvent extends AbstractDispatchingObjectEvent { for (int j = 0; j < size2; ++j) { coords[j] = deserializer.readDoubleArray(); } - data.addCoordinates(coords); + data.addPixelCoordinates(coords); } + + size = deserializer.readI32(); + for (int i = 0; i < size; ++i) { + double[] packedCoords = deserializer.readDoubleArray(); + Coordinate[] worldCoords = new Coordinate[packedCoords.length / 3]; + for (int j = 0, k = 0; j < worldCoords.length; j++) { + worldCoords[j] = new Coordinate(packedCoords[k++], + packedCoords[k++], packedCoords[k++]); + } + data.addWorldCoordinates(worldCoords); + } + return data; } } @@ -164,7 +189,10 @@ public class WireframeShapeDataEvent extends AbstractDispatchingObjectEvent { } @DynamicSerializeElement - private List coordinates = new LinkedList(); + private List pixelCoordinates = new LinkedList(); + + @DynamicSerializeElement + private List worldCoordiantes = new LinkedList(); @DynamicSerializeElement private List