private void processInsertVertexCommand(Command command)
        {
            var parameters      = command.GetParameters();
            var commandClientID = command.__getClientID();


            var position = new Point3D(double.Parse(parameters[1]),
                                       double.Parse(parameters[2]), double.Parse(parameters[3]));
            var    vertexFullID   = new FullID(commandClientID, int.Parse(parameters[0]));
            Vertex insertedVertex = graph_.__insertVertex(position, vertexFullID);

            if (graph_.IsLoading() && commandClientID == graph_.__getClientID())
            {
                graph_.__setLastCreatedVertexID(vertexFullID.GetIDinCreator());
            }

            graph_.__raiseVertexAddedEvent(insertedVertex);
        }
示例#2
0
        public Edge ConnectTo(Vertex endVertex)
        {
            int edgeClientID    = graph_.__getClientID();
            int edgeIDinCreator = graph_.__getLastCreatedEdgeID() + 1;

            graph_.__setLastCreatedEdgeID(edgeIDinCreator);

            var edge = __connectTo(endVertex, new FullID(edgeClientID, edgeIDinCreator));

            graph_.__getCommandSender().__sendInsertEdgeCommand(edge);

            return(edge);
        }