public VisEventArgs(Visualisation visualisation, VisualisationElement element, MouseEventArgs mouse)
 {
     this.mouse = mouse;
     this.element = element;
     this.visualisation = visualisation;
 }
 /// <summary>
 /// Find the absolute pixel postition for an element
 /// </summary>
 /// <param name="Element"></param>
 /// <returns></returns>
 public override RectangleInt GetDrawRegion(VisualisationElement Element)
 {
     return (Element as RootPathElement).Region;
 }
示例#3
0
 /// <summary>
 /// Find the absolute pixel postition for an element
 /// </summary>
 /// <param name="Element"></param>
 /// <returns></returns>
 public abstract RectangleInt GetDrawRegion(VisualisationElement Element);
        /// <summary>
        /// Find the absolute pixel postition for an element
        /// </summary>
        /// <param name="Element"></param>
        /// <returns></returns>
        public override RectangleInt GetDrawRegion(VisualisationElement Element)
        {
            NodeListVisualisationElement nodeElement = Element as NodeListVisualisationElement;
            if (nodeElement == null) return null;

            VectorInt logical = GetLogicalPosition(nodeElement.Node);
            if (logical == null) return null;

            VectorInt topLeft = logical.Multiply(cellSize).Add(RenderCanvas.TopLeft).Add(windowRegion.TopLeft);

            return new RectangleInt(topLeft, cellSize);
        }
        /// <summary>
        /// Find the absolute pixel postition for an element
        /// </summary>
        /// <param name="Element"></param>
        /// <returns></returns>
        public override RectangleInt GetDrawRegion(VisualisationElement Element)
        {
            GridVisualisationElement gridElement = Element as GridVisualisationElement;
            if (gridElement == null) throw new NotSupportedException("Element");

            return new RectangleInt(RenderCanvas.TopLeft.Add(gridElement.LogicalPosition.Multiply(CellSize)), CellSize);
        }
        /// <summary>
        /// Find the absolute pixel postition for an element
        /// </summary>
        /// <param name="Element"></param>
        /// <returns></returns>
        public override RectangleInt GetDrawRegion(VisualisationElement Element)
        {
            TreeVisualisationElement treeElement = Element as TreeVisualisationElement;
            if (treeElement != null)
            {
                int elementDepth = treeElement.Node.Depth;
                if (elementDepth >= regions.Count) return null;

                SegmentRegion region = regions[elementDepth];
                if (region == null) return null;

                int height = 0;
                for (int cc = 0; cc < elementDepth; cc++)
                {
                    height += regions[cc].RenderRegion.Height;
                }

                return new RectangleInt(region.GetNodePixelPosition(treeElement.Node).Add(0, height), cellSize);
            }
            return null;
        }