public Edge ChangeEdgeTransparency(float Transparency) { var curColor = myARObject.GetComponent <MeshRenderer>().material.color; curColor.a = Transparency; myARObject.GetComponent <MeshRenderer>().material.color = curColor; myLogs.LogMessage(ARTypes.LoggingLevels.Verbose, "Changed Transparency to (a):" + myARObject.GetComponent <MeshRenderer>().material.color.a.ToString(), Module: "Edge.ChangeEdgeTransparency", Version: "ALPHA"); return(this); }
private void Awake() { myLogs.LogMessage(ARTypes.LoggingLevels.Verbose, "Awake Node Method Called", Module: "Node.Awake", Version: "ALPHA"); myARObject = Visuals.UnityHelperFunctions.CreateGameObject(Types.GraphProperties.Node, PrimitiveType.Sphere, Visuals.Colors.Blue); myARObject.transform.localScale = new Vector3( ARTypes.GraphConfiguration.NODE_DIAMETER, ARTypes.GraphConfiguration.NODE_DIAMETER, Types.GraphConfiguration.NODE_DIAMETER); }
//Move Nodes Around public void RandomMoveAllNodes(Boolean in2d) { myLogs.LogMessage(LoggingLevels.Verbose, "Starting NodeMovements", Module: "Graph.RandomMoveAllNodes", Version: "ALPHA"); System.Random r = new System.Random((int)DateTime.Now.Ticks); foreach (Node Nodes in AllNodes.Values) { var yShift = in2d ? 0 : r.Next(GraphConfiguration.GRAPHBOUNDINGBOX_ZMIN * 100, GraphConfiguration.GRAPHBOUNDINGBOX_ZMAX * 100) / 100f; Nodes.MoveTo(r.Next(GraphConfiguration.GRAPHBOUNDINGBOX_XMIN * 100, GraphConfiguration.GRAPHBOUNDINGBOX_XMAX * 100) / 100f, yShift, r.Next(GraphConfiguration.GRAPHBOUNDINGBOX_ZMIN * 100, GraphConfiguration.GRAPHBOUNDINGBOX_ZMAX * 100) / 100f ); } }
private Neo4jConnector() { myLogs = Logging.DBLogger.getInstance(); myLogs.LogMessage(LoggingLevels.Error, "Init Neo4jConnection: " + PostURL, Module: "Neo4jConnector.Neo4jConnector", Version: "ALPHA"); }
public Graph() { removeSpeach = false; AllNodes = new Dictionary <String, Node>(); AllEdges = new Dictionary <UInt32, Edge>(); myLogs = Logging.DBLogger.getInstance(); myLogs.LogMessage(LoggingLevels.Verbose, "Graph Constructor Called", Module: "Graph.Start", Version: "ALPHA"); }
public Node() { ID = ++Globals.ID_NodesUsed; UserID = ID.ToString(); myLogs = Logging.DBLogger.getInstance(); //properties below isVisited = false; Properties = new Dictionary <string, object>(); EdgesOut = new Dictionary <uint, Edge>(); EdgesIn = new Dictionary <uint, Edge>(); myLogs.LogMessage(ARTypes.LoggingLevels.Verbose, "Start Node Method Called", Module: "Node.Start", Version: "ALPHA"); Label = ""; }
private void Awake() { myLogs.LogMessage(LoggingLevels.Verbose, "SpeechProcessing Awake Called", Module: "SpeechProcessing.Awake", Version: "ALPHA"); m_Recognizer = new KeywordRecognizer(m_Keywords); m_Recognizer.OnPhraseRecognized += OnPhraseRecognized; m_Recognizer.Start(); }
public SpeechProcessing() { myLogs = Logging.DBLogger.getInstance(); myLogs.LogMessage(LoggingLevels.Verbose, "SpeechProcessing Constructor Called", Module: "SpeechProcessing.SpeechProcessing", Version: "ALPHA"); }
public void GetGraphFromQuery(Graph.Graph retGraph, String Query, Boolean readNodeEdgeProps) { try { var neo4jGraph = CypherQueryReturnGraph(Query); foreach (var dataarray in neo4jGraph.data) { var x = dataarray[0]; //convert for String StartNodePath = x.start; String EndNodePath = x.end; var SNodeSplit = StartNodePath.Split('/'); var ENodeSplit = EndNodePath.Split('/'); Graph.Node StartNode = null; Graph.Node EndNode = null; if (retGraph.GetNode(SNodeSplit[SNodeSplit.Length - 1]) == null) { StartNode = retGraph.AddNodes(SNodeSplit[SNodeSplit.Length - 1], null); StartNode.Neo4jPath = StartNodePath; } else { StartNode = retGraph.GetNode(SNodeSplit[SNodeSplit.Length - 1]); } if (retGraph.GetNode(ENodeSplit[ENodeSplit.Length - 1]) == null) { EndNode = retGraph.AddNodes(ENodeSplit[ENodeSplit.Length - 1], null); EndNode.Neo4jPath = EndNodePath; } else { EndNode = retGraph.GetNode(ENodeSplit[ENodeSplit.Length - 1]); } var nextEdge = retGraph.AddEdges(StartNode, EndNode); //don't rip remaining properties from site if (!readNodeEdgeProps) { continue; } //get StartNode Properties String JsonOfProps = AR.Core.Communications.Neo4jConnector.getInstance().GetNodeProperties(StartNode.ID.ToString()); var Nodeprops = AR.Core.IO.SimpleJson.DeserializeObject <Dictionary <String, System.Object> >(JsonOfProps); foreach (var kv in Nodeprops) { Double dblVal = 0; Int32 intval = 0; if (StartNode.Properties.ContainsKey(kv.Key.ToString())) { continue; } if (Double.TryParse(kv.Value.ToString(), out dblVal)) { StartNode.Properties.Add(kv.Key, dblVal); continue; } if (Int32.TryParse(kv.Value.ToString(), out intval)) { StartNode.Properties.Add(kv.Key, dblVal); continue; } StartNode.Properties.Add(kv.Key, kv.Value.ToString()); } //get EndNode Properties JsonOfProps = AR.Core.Communications.Neo4jConnector.getInstance().GetNodeProperties(EndNode.ID.ToString()); Nodeprops = AR.Core.IO.SimpleJson.DeserializeObject <Dictionary <String, System.Object> >(JsonOfProps); foreach (var kv in Nodeprops) { Double dblVal = 0; Int32 intval = 0; if (EndNode.Properties.ContainsKey(kv.Key.ToString())) { continue; } if (Double.TryParse(kv.Value.ToString(), out dblVal)) { EndNode.Properties.Add(kv.Key, dblVal); continue; } if (Int32.TryParse(kv.Value.ToString(), out intval)) { EndNode.Properties.Add(kv.Key, dblVal); continue; } EndNode.Properties.Add(kv.Key, kv.Value.ToString()); } //get Edge Properties JsonOfProps = AR.Core.Communications.Neo4jConnector.getInstance().GetNodeProperties(nextEdge.ID.ToString()); var Edgeprops = AR.Core.IO.SimpleJson.DeserializeObject <Dictionary <String, System.Object> >(JsonOfProps); foreach (var kv in Edgeprops) { Double dblVal = 0; Int32 intval = 0; if (nextEdge.Properties.ContainsKey(kv.Key.ToString())) { continue; } if (Double.TryParse(kv.Value.ToString(), out dblVal)) { nextEdge.Properties.Add(kv.Key, dblVal); continue; } if (Int32.TryParse(kv.Value.ToString(), out intval)) { nextEdge.Properties.Add(kv.Key, dblVal); continue; } nextEdge.Properties.Add(kv.Key, kv.Value.ToString()); } //TODO only ripping first element off array if (x.relationships[0].Length > 0) { nextEdge.Neo4jPath = x.relationships[0]; } } } catch (Exception exp) { myLogs.LogMessage(LoggingLevels.Error, "Init Neo4jConnector Exception: " + exp.Message, Module: "Neo4jConnector.GetGraphFromQuery", Version: "ALPHA"); return; } return; }