public int Reset(String path) { Trace.WriteLine("SliceManager.Reset"); // destroy gl textures foreach (var slice in slices) { slice.Destroy(); } // destroy slices slices.Clear(); // reset height activeSliceHeight = 0; // make new fileSlice, set to active activeSlice = new FileSlice(path, activeSliceHeight, parentWindow); activeSlice.FillFileSliceWithDrives(); if (activeSlice.ShowAllText) { activeSlice.GenerateAllTextures(); } else { activeSlice.ResetVisible(); } activeSlice.Scale = 0f; activeSlice.IsScaled = true; // add to slice list activeSliceNode = slices.AddLast(activeSlice); return(activeSliceHeight); }
public void AddSliceAbove(FileSlice activeNodeChildSlice) { Trace.WriteLine("AddSliceAbove"); // destroy all existing slices above us while (activeSliceNode != slices.Last) { slices.Last.Value.Destroy(); slices.RemoveLast(); } // set its position Vector3 newSlicePosition = activeSlice.Position + (Vector3.UnitY * SLICE_SPACING); // it is now directly above us, move it to line up with parent newSlicePosition.Z += activeSlice.ActiveBox[1] * 6.0f; newSlicePosition.X -= activeSlice.ActiveBox[0] * 6.0f; activeNodeChildSlice.Position = newSlicePosition; //Dimm all nodes in current activeSlice, as it will be replaced with a new one in a second activeSlice.HideAllNodes(); activeSliceNode = slices.AddLast(activeNodeChildSlice); activeSlice = activeNodeChildSlice; if (activeSlice.ShowAllText) { activeSlice.GenerateAllTextures(); } else { activeSlice.ResetVisible(); } activeSlice.Scale = 0f; activeSlice.IsScaled = true; activeSliceHeight++; }