Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFEdgeLink.cs +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ namespace Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph doubleClickManipulator.activators.Clear(); doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 }); this.AddManipulator(doubleClickManipulator); style.color = new Color(239, 239, 239); } public void Clicked() Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFGraphView.cs +59 −42 Original line number Diff line number Diff line Loading @@ -50,9 +50,11 @@ namespace ETSI.ARF.WorldStorage.UI //deleSection deleteSelection += DeleteFunc; this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector()); } //method called when an element is deleted from the graphview Loading Loading @@ -105,7 +107,10 @@ namespace ETSI.ARF.WorldStorage.UI { edgeLink.input.Disconnect(edgeLink); edgeLink.output.Disconnect(edgeLink); if (SaveInfo.instance.linkIds.Contains(edgeLink.GUID)) { SaveInfo.instance.elemsToRemove.Add(edgeLink.GUID, typeof(WorldLink)); } RemoveElement(elt); continue; } Loading @@ -120,7 +125,18 @@ namespace ETSI.ARF.WorldStorage.UI Vector2 localMousePos = evt.localMousePosition; Vector2 actualGraphPosition = viewTransform.matrix.inverse.MultiplyPoint(localMousePos); if (!(evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink)) { evt.menu.AppendSeparator(); evt.menu.AppendAction("Save graph", delegate { if (ServerAndLocalDifferent()) { SaveInServer(); }/* Reload(); SaveInfo.instance.toReFrame = true;*/ }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); evt.menu.AppendAction("Reload graph", delegate { if (ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No")) Loading Loading @@ -174,6 +190,7 @@ namespace ETSI.ARF.WorldStorage.UI CreateAnchorNode(anchor, actualGraphPosition.x, actualGraphPosition.y); }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); } evt.menu.AppendSeparator(); if (evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink) { Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNode.cs +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,12 @@ namespace ETSI.ARF.WorldStorage.UI return node.InstantiatePort(Orientation.Horizontal, portDirection, capacity, typeof(int)); // dummy } //override the BuildContextualMenu method to prevent the "disconnect" option from appearing in the contextual menu public override void BuildContextualMenu(ContextualMenuPopulateEvent evt) { } public abstract ObjectType GetElemType(); } } No newline at end of file Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNodeTrackable.cs +3 −3 Original line number Diff line number Diff line Loading @@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI var colorRectangle = new VisualElement(); colorRectangle.style.height = 160; colorRectangle.style.height = 5; colorRectangle.style.backgroundColor = new Color(0.9f, 0.78f, 0.54f, 0.9f); colorRectangle.style.backgroundColor = new Color(1, 0.31f, 0.31f, 0.9f); mainContainer.Insert(1, colorRectangle); /*PORTS*/ var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); portIn.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portIn.portName = "Target"; // "Input" //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); inputContainer.Add(portIn); var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portOut.portName = "Source"; // "Output"; //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); ; outputContainer.Add(portOut); Loading Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNodeWorldAnchor.cs +3 −3 Original line number Diff line number Diff line Loading @@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI var colorRectangle = new VisualElement(); colorRectangle.style.height = 160; colorRectangle.style.height = 5; colorRectangle.style.backgroundColor = new Color(0.76f, 0.9f, 0.46f, 0.9f); colorRectangle.style.backgroundColor = new Color(1, 0.7f, 0, 0.9f); mainContainer.Insert(1, colorRectangle); /*PORTS*/ var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); portIn.portColor = new Color(0.77f,0.77f,0.77f, 0.77f); portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portIn.portName = "Target"; // "Input"; //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); inputContainer.Add(portIn); var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portOut.portName = "Source"; // "Output"; //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); outputContainer.Add(portOut); Loading Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFEdgeLink.cs +0 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,6 @@ namespace Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph doubleClickManipulator.activators.Clear(); doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 }); this.AddManipulator(doubleClickManipulator); style.color = new Color(239, 239, 239); } public void Clicked() Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFGraphView.cs +59 −42 Original line number Diff line number Diff line Loading @@ -50,9 +50,11 @@ namespace ETSI.ARF.WorldStorage.UI //deleSection deleteSelection += DeleteFunc; this.AddManipulator(new ContentDragger()); this.AddManipulator(new SelectionDragger()); this.AddManipulator(new RectangleSelector()); } //method called when an element is deleted from the graphview Loading Loading @@ -105,7 +107,10 @@ namespace ETSI.ARF.WorldStorage.UI { edgeLink.input.Disconnect(edgeLink); edgeLink.output.Disconnect(edgeLink); if (SaveInfo.instance.linkIds.Contains(edgeLink.GUID)) { SaveInfo.instance.elemsToRemove.Add(edgeLink.GUID, typeof(WorldLink)); } RemoveElement(elt); continue; } Loading @@ -120,7 +125,18 @@ namespace ETSI.ARF.WorldStorage.UI Vector2 localMousePos = evt.localMousePosition; Vector2 actualGraphPosition = viewTransform.matrix.inverse.MultiplyPoint(localMousePos); if (!(evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink)) { evt.menu.AppendSeparator(); evt.menu.AppendAction("Save graph", delegate { if (ServerAndLocalDifferent()) { SaveInServer(); }/* Reload(); SaveInfo.instance.toReFrame = true;*/ }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); evt.menu.AppendAction("Reload graph", delegate { if (ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No")) Loading Loading @@ -174,6 +190,7 @@ namespace ETSI.ARF.WorldStorage.UI CreateAnchorNode(anchor, actualGraphPosition.x, actualGraphPosition.y); }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal); } evt.menu.AppendSeparator(); if (evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink) { Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNode.cs +6 −0 Original line number Diff line number Diff line Loading @@ -95,6 +95,12 @@ namespace ETSI.ARF.WorldStorage.UI return node.InstantiatePort(Orientation.Horizontal, portDirection, capacity, typeof(int)); // dummy } //override the BuildContextualMenu method to prevent the "disconnect" option from appearing in the contextual menu public override void BuildContextualMenu(ContextualMenuPopulateEvent evt) { } public abstract ObjectType GetElemType(); } } No newline at end of file
Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNodeTrackable.cs +3 −3 Original line number Diff line number Diff line Loading @@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI var colorRectangle = new VisualElement(); colorRectangle.style.height = 160; colorRectangle.style.height = 5; colorRectangle.style.backgroundColor = new Color(0.9f, 0.78f, 0.54f, 0.9f); colorRectangle.style.backgroundColor = new Color(1, 0.31f, 0.31f, 0.9f); mainContainer.Insert(1, colorRectangle); /*PORTS*/ var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); portIn.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portIn.portName = "Target"; // "Input" //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); inputContainer.Add(portIn); var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portOut.portName = "Source"; // "Output"; //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); ; outputContainer.Add(portOut); Loading
Assets/ETSI.ARF/ARF World Storage API/Editor/Graph/ARFNodeWorldAnchor.cs +3 −3 Original line number Diff line number Diff line Loading @@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI var colorRectangle = new VisualElement(); colorRectangle.style.height = 160; colorRectangle.style.height = 5; colorRectangle.style.backgroundColor = new Color(0.76f, 0.9f, 0.46f, 0.9f); colorRectangle.style.backgroundColor = new Color(1, 0.7f, 0, 0.9f); mainContainer.Insert(1, colorRectangle); /*PORTS*/ var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi); portIn.portColor = new Color(0.77f,0.77f,0.77f, 0.77f); portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portIn.portName = "Target"; // "Input"; //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); inputContainer.Add(portIn); var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi); portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f); portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f); portOut.portName = "Source"; // "Output"; //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); outputContainer.Add(portOut); Loading