Exemplo n.º 1
0
		public void RemoveAnchor(ARPlaneAnchor arPlaneAnchor)
		{
			if (planeAnchorMap.ContainsKey (arPlaneAnchor.identifier)) {
				ARPlaneAnchorGameObject arpag = planeAnchorMap [arPlaneAnchor.identifier];
				GameObject.Destroy (arpag.gameObject);
				planeAnchorMap.Remove (arPlaneAnchor.identifier);
			}
		}
Exemplo n.º 2
0
 void EnvironmentProbeAnchorRemoved(AREnvironmentProbeAnchor anchorData)
 {
     if (probeAnchorMap.ContainsKey(anchorData.identifier))
     {
         ReflectionProbeGameObject rpgo = probeAnchorMap [anchorData.identifier];
         GameObject.Destroy(rpgo.gameObject);
         probeAnchorMap.Remove(anchorData.identifier);
     }
 }
Exemplo n.º 3
0
 void ObjectAnchorRemoved(ARObjectAnchor anchorData)
 {
     Debug.Log("ObjectAnchorRemoved");
     if (objectAnchorMap.ContainsKey(anchorData.referenceObjectName))
     {
         GameObject rpgo = objectAnchorMap [anchorData.referenceObjectName];
         GameObject.Destroy(rpgo.gameObject);
         objectAnchorMap.Remove(anchorData.identifier);
     }
 }
Exemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        public static void TestDictionary()
        {
            LinkedListDictionary <string, int> dic = new LinkedListDictionary <string, int>();

            dic.Add("ss", 12);
            dic.Add("rng", 58);
            dic.Remove("ss");

            BinarySearchTreeDictionary <string, int> dictionary = new BinarySearchTreeDictionary <string, int>();

            dictionary.Add("edg", 156);
            dictionary.Add("vg", 456);
            dictionary.Set("vg", 789);
            dictionary.Remove("edg");
        }
Exemplo n.º 5
0
 private void RemoveFromUsedResources(int objId)
 {
     kUsedResources.Remove(objId);
 }
Exemplo n.º 6
0
        public CellPairCollection <T> FollowBoundaryAndCollectCandidates(IEnumerable <Edge <T> > periodicEdges)
        {
            LinkedListDictionary <int, List <Edge <T> > > edges = DivideIntoBoundaries(periodicEdges);

            Debug.Assert(edges.Count % 2 == 0);
            CellPairCollection <T> candidates = new CellPairCollection <T>();


            while (edges.Count > 0)
            {
                List <Edge <T> > boundary = edges.First().Value;
                int        boundaryNumber = edges.First().Key;
                Position[] positions      = new Position[boundary.Count];
                for (int i = 0; i < boundary.Count; ++i)
                {
                    Edge <T> edge = boundary[i];
                    if (NodeIsOnRightSideOfEdge(edge.Cell.Node, edge))
                    {
                        if (edge.Twin.Cell.Node != null && NodeIsOnRightSideOfEdge(edge.Twin.Cell.Node, edge))
                        {
                            positions[i] = Position.right;
                            candidates.AddOuterSplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        }
                        else
                        {
                            positions[i] = Position.rightUnsplit;
                            candidates.AddOuterUnsplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        }
                    }
                    else
                    {
                        if (edge.Twin.Cell.Node != null && !NodeIsOnRightSideOfEdge(edge.Twin.Cell.Node, edge))
                        {
                            positions[i] = Position.left;
                            candidates.AddInnerSplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        }
                        else
                        {
                            positions[i] = Position.leftUnsplit;
                            candidates.AddInnerUnsplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        }
                    }
                }
                edges.Remove(boundaryNumber);

                boundaryNumber = map.PeriodicBoundaryCorrelation[boundaryNumber];
                boundary       = edges[boundaryNumber];
                for (int i = 0; i < boundary.Count; ++i)
                {
                    Edge <T> edge = boundary[i];
                    switch (positions[boundary.Count - 1 - i])
                    {
                    case Position.left:
                        candidates.AddOuterSplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        break;

                    case Position.right:
                        candidates.AddInnerSplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        break;

                    case Position.leftUnsplit:
                        candidates.AddOuterUnsplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        break;

                    case Position.rightUnsplit:
                        candidates.AddInnerUnsplitCell(edge.Cell, edge.BoundaryEdgeNumber);
                        break;

                    default:
                        throw new Exception();
                    }
                }
                edges.Remove(boundaryNumber);
            }
            return(candidates);
        }