Example #1
0
        public void AddSliceAbove(String path)
        {
            // destroy all existing slices above us
            while (activeSliceNode != slices.Last)
            {
                slices.Last.Value.Destroy();
                slices.RemoveLast();
            }

            // make new slice
            FileSlice upperSlice = new FileSlice(path, activeSliceHeight + 1, parentWindow);

            // 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;

            upperSlice.Position = newSlicePosition;
            upperSlice.ResetVisible();

            activeSlice.HideLabels();

            activeSliceNode      = slices.AddLast(upperSlice);
            activeSlice          = upperSlice;
            activeSlice.Scale    = 0f;
            activeSlice.IsScaled = true;

            activeSliceHeight++;
        }
Example #2
0
        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);
        }
Example #3
0
        public void AddSliceAbove(String path)
        {
            // destroy all existing slices above us
            while(activeSliceNode != slices.Last) {
                slices.Last.Value.Destroy();
                slices.RemoveLast();
            }

            // make new slice
            FileSlice upperSlice = new FileSlice(path, activeSliceHeight +1, parentWindow);

            // 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;

            upperSlice.Position = newSlicePosition;
            upperSlice.ResetVisible();

            activeSlice.HideLabels();

            activeSliceNode = slices.AddLast(upperSlice);
            activeSlice = upperSlice;
            activeSlice.Scale = 0f;
            activeSlice.IsScaled = true;

            activeSliceHeight++;
        }
Example #4
0
        public int AddSliceBelow()
        {
            Trace.WriteLine("AddSliceBelow");
            String parentPath;

            // check if we are at the root
            try {
                parentPath = Directory.GetParent(activeSlice.Path).FullName;
            } catch {
                return(activeSliceHeight);
            }

            // make new slice
            FileSlice lowerSlice = new FileSlice(parentPath, activeSliceHeight - 1, parentWindow);

            // set its position
            Vector3 newSlicePosition = activeSlice.Position - (Vector3.UnitY * SLICE_SPACING);

            // it is now directly below us, move it to line up with parent
            lowerSlice.ActivateNode(activeSlice.Path);
            newSlicePosition.Z -= lowerSlice.ActiveBox[1] * 6.0f;
            newSlicePosition.X += lowerSlice.ActiveBox[0] * 6.0f;

            lowerSlice.Position = newSlicePosition;
            lowerSlice.ResetVisible();

            activeSliceNode = slices.AddFirst(lowerSlice);

            activeSlice = lowerSlice;

            activeSliceHeight--;

            foreach (var slice in slices)
            {
                if (slice.SliceHeight - activeSliceHeight >= 2)
                {
                    slice.Visible = false;
                }
            }

            return(activeSliceHeight);
        }
Example #5
0
        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++;
        }
Example #6
0
        public int AddSliceBelow()
        {
            String parentPath;

            // check if we are at the root
            try {
                parentPath = Directory.GetParent(activeSlice.Path).FullName;
            } catch {
                return activeSliceHeight;
            }

            // make new slice
            FileSlice lowerSlice = new FileSlice(parentPath, activeSliceHeight -1, parentWindow);

            // set its position
            Vector3 newSlicePosition = activeSlice.Position - (Vector3.UnitY * SLICE_SPACING);

            // it is now directly below us, move it to line up with parent
            lowerSlice.ActivateNode(activeSlice.Path);
            newSlicePosition.Z -= lowerSlice.ActiveBox[1] * 6.0f;
            newSlicePosition.X += lowerSlice.ActiveBox[0] * 6.0f;

            lowerSlice.Position = newSlicePosition;
            lowerSlice.ResetVisible();

            activeSliceNode = slices.AddFirst(lowerSlice);

            activeSlice = lowerSlice;

            activeSliceHeight--;

            foreach(var slice in slices) {
                if(slice.SliceHeight - activeSliceHeight >= 2) {
                    slice.Visible = false;
                }
            }

            return activeSliceHeight;
        }