private void Awake() { if (_tileModelManager != null) { _tileModel = _tileModelManager.TileModel; } _analysisGraph.Initialize(); }
private void Awake() { if (_tileModelManager != null) { _tilemodel = _tileModelManager.TileModel; } _analysisGraph.Initialize(); _graphvisualizer = GetComponent<GraphVisualizer>(); }
private void Awake() { _averageForces = new float[_originalGraph.VertexObjects.Count]; _averageTorques = new float[_originalGraph.VertexObjects.Count]; if (_tileModelManager != null) { _tileModel = _tileModelManager.TileModel; } _analysisGraph.Initialize(); _graphVisualizer = GetComponent <GraphVisualizer>(); }
/// <summary> /// /// </summary> /// <returns></returns> public void ExtractSharedEdgeGraph(SharedAnalysisEdgeGraph analysisGraph) { if (_model == null) { Initialize(); } var g0 = _tileGraph.Graph; analysisGraph.Initialize(g0.VertexCount); analysisGraph.VertexObjects = _tileGraph.VertexObjects; for (int i = 0; i < g0.VertexCount; i++) { analysisGraph.Vertices[i] = _tileGraph.VertexObjects[i].transform.position; } var n = _map.TileDegree; for (int v0 = 0; v0 < g0.VertexCount; v0++) { var tile = _model.GetAssigned(v0); int tilenum = (int)tile; if (_applyTileFilter == true && _ignoreTiles.Contains(tilenum)) { continue; } Vector3 v0position = _tileGraph.VertexObjects[v0].transform.position; for (int i = 0; i < n; i++) { var label = _map.GetLabel(i, tile); if (_labelSet.Contains(label)) { int v1 = g0.GetVertexNeighborOut(v0, i); if (v0 != v1) { if (!analysisGraph.Graph.HasEdge(v1, v0) && !analysisGraph.Graph.HasEdge(v0, v1)) { analysisGraph.Graph.AddEdge(v0, v1); analysisGraph.LineIndices.Add(v0); analysisGraph.LineIndices.Add(v1); } } } } } }