当前位置: 首页>>代码示例>>C#>>正文


C# Shapes.PreviewPoint类代码示例

本文整理汇总了C#中VixenModules.Preview.VixenPreview.Shapes.PreviewPoint的典型用法代码示例。如果您正苦于以下问题:C# PreviewPoint类的具体用法?C# PreviewPoint怎么用?C# PreviewPoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PreviewPoint类属于VixenModules.Preview.VixenPreview.Shapes命名空间,在下文中一共展示了PreviewPoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: removeEffects

		protected void removeEffects()
		{
			m_form.SelectedDisplayItems.Clear();
				PreviewPoint translatedPoint = new PreviewPoint(m_newDisplay.Shape.Pixels[0].X, m_newDisplay.Shape.Pixels[0].Y);
				m_form.SelectItemUnderPoint(translatedPoint, false);
			m_form.SeparateTemplateItems(m_newDisplay);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:7,代码来源:PreviewItemsGroupAddedSeparateUndoAction.cs

示例2: PreviewIcicle

        //const int InitialStringLength = 20;

		public PreviewIcicle(PreviewPoint point1, PreviewPoint point2, ElementNode selectedNode, double zoomLevel)
		{
            // If we are creating this fresh, we need to know so we can add strings, etc. as drawn.
            creating = true;
            initialNode = selectedNode;

			ZoomLevel = zoomLevel;
			AddPoint(PointToZoomPoint(point1));
			AddPoint(PointToZoomPoint(point2));

			if (selectedNode != null) {
				if (selectedNode.Children.Count() > 0 && PreviewTools.GetLeafNodes(selectedNode).Count == 0) 
				{
					StringType = StringTypes.Pixel;
                    _strings = new List<PreviewBaseShape>();
                    foreach (ElementNode child in selectedNode.Children)
                    {
                        int pixelCount = child.Children.Count();
                        PreviewLine line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(10, 10), pixelCount, child, ZoomLevel);
                        line.Parent = this;
                        _strings.Add(line);
                    }
                    _stringCount = _strings.Count;
                    creating = false;
				} else
                {
					StringType = StringTypes.Standard;
				}
			}
			Layout();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:33,代码来源:PreviewIcicle.cs

示例3: PreviewMultiString

 public PreviewMultiString(PreviewPoint point1, PreviewPoint point2, ElementNode selectedNode, double zoomLevel)
 {
     ZoomLevel = zoomLevel;
     AddPoint(PointToZoomPoint(point1));
     _strings = new List<PreviewBaseShape>();
     Creating = true;
     inputElements = selectedNode;
 }
开发者ID:forkineye,项目名称:vixen,代码行数:8,代码来源:PreviewMultiString.cs

示例4: PreviewCustom

        public PreviewCustom(PreviewPoint point, List<PreviewBaseShape> shapes)
        {
            _topLeft = point;
            if (shapes != null)
                Strings = shapes;

            Layout();
        }
开发者ID:forkineye,项目名称:vixen,代码行数:8,代码来源:PreviewCustom.cs

示例5: PreviewTriangle

		public PreviewTriangle(PreviewPoint point1, ElementNode selectedNode, double zoomLevel)
		{
			ZoomLevel = zoomLevel;
			_bottomRightPoint = PointToZoomPoint(point1);
			_point1 = new PreviewPoint(_bottomRightPoint);
			_point2 = new PreviewPoint(_bottomRightPoint);
			_point3 = new PreviewPoint(_bottomRightPoint);

			_strings = new List<PreviewBaseShape>();

			if (selectedNode != null) {
				List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
				if (children.Count >= 6)
                    //
				{
					int increment = children.Count/3;
					int pixelsLeft = children.Count;

					StringType = StringTypes.Pixel;

					// Just add lines, they will be layed out in Layout()
					for (int i = 0; i < 3; i++) {
						PreviewLine line;
						if (pixelsLeft >= increment) {
							line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), increment, null, ZoomLevel);
						}
						else {
							line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), pixelsLeft, null, ZoomLevel);
						}
						line.PixelColor = Color.White;
						_strings.Add(line);

						pixelsLeft -= increment;
					}

					int pixelNum = 0;
					foreach (PreviewPixel pixel in Pixels) {
						pixel.Node = children[pixelNum];
						pixel.NodeId = children[pixelNum].Id;
						pixelNum++;
					}
				}
			}

			if (_strings.Count == 0) {
				// Just add lines, they will be layed out in Layout()
				for (int i = 0; i < 3; i++) {
					PreviewLine line;
					line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), 10, selectedNode, ZoomLevel);
					line.PixelColor = Color.White;
					_strings.Add(line);
				}
			}

			Layout();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:56,代码来源:PreviewTriangle.cs

示例6: PreviewRectangle

        public PreviewRectangle(PreviewPoint point1, ElementNode selectedNode)
        {
            _topLeft = point1;
            _topRight = new PreviewPoint(point1);
            _bottomLeft = new PreviewPoint(point1);
            _bottomRight = new PreviewPoint(point1);

            _strings = new List<PreviewBaseShape>();

            if (selectedNode != null) {
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                if (children.Count >= 8) {
                    int increment = children.Count/4;
                    int pixelsLeft = children.Count;

                    StringType = StringTypes.Pixel;

                    // Just add lines, they will be layed out in Layout()
                    for (int i = 0; i < 4; i++) {
                        PreviewLine line;
                        if (pixelsLeft >= increment) {
                            line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), increment, null);
                        }
                        else {
                            line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), pixelsLeft, null);
                        }
                        line.PixelColor = Color.White;
                        _strings.Add(line);

                        pixelsLeft -= increment;
                    }

                    int pixelNum = 0;
                    foreach (PreviewPixel pixel in Pixels) {
                        pixel.Node = children[pixelNum];
                        pixel.NodeId = children[pixelNum].Id;
                        pixelNum++;
                    }
                }
            }

            if (_strings.Count == 0) {
                // Just add lines, they will be layed out in Layout()
                for (int i = 0; i < 4; i++) {
                    PreviewLine line;
                    line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), 10, selectedNode);
                    line.PixelColor = Color.White;
                    _strings.Add(line);
                }
            }

            Layout();

            //DoResize += new ResizeEvent(OnResize);
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:55,代码来源:PreviewRectangle.cs

示例7: PreviewNet

        public PreviewNet(PreviewPoint point1, ElementNode selectedNode)
        {
            _topLeft = point1;
            _topRight = new PreviewPoint(point1);
            _bottomLeft = new PreviewPoint(point1);
            _bottomRight = new PreviewPoint(point1);

            initiallyAssignedNode = selectedNode;

            Layout();
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:11,代码来源:PreviewNet.cs

示例8: PreviewNet

		public PreviewNet(PreviewPoint point1, ElementNode selectedNode, double zoomLevel)
		{
			ZoomLevel = zoomLevel;
			_topLeft = PointToZoomPoint(point1);
			_topRight = new PreviewPoint(_topLeft);
			_bottomLeft = new PreviewPoint(_topLeft);
			_bottomRight = new PreviewPoint(_topLeft);

			initiallyAssignedNode = selectedNode;

			Layout();
		}
开发者ID:stewmc,项目名称:vixen,代码行数:12,代码来源:PreviewNet.cs

示例9: PreviewCane

        public PreviewCane(PreviewPoint point, ElementNode selectedNode)
        {
            _topLeftPoint = point;
            _bottomRightPoint = new PreviewPoint(point.X, point.Y);
            _archLeftPoint = new PreviewPoint(point.X, point.Y);

            _archPixelCount = 8;
            _linePixelCount = 8;

            int lightCount = _archPixelCount + _linePixelCount;

            if (selectedNode != null) {
                //List<ElementNode> children = selectedNode.Children.ToList();
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                // is this a single node?
                if (children.Count >= 8) {
                    StringType = StringTypes.Pixel;
                    _archPixelCount = children.Count/2;
                    _linePixelCount = children.Count/2;
                    if (_archPixelCount + _linePixelCount > children.Count) {
                        _archPixelCount -= 1;
                    }
                    else if (_archPixelCount + _linePixelCount < children.Count) {
                        _linePixelCount -= 1;
                    }
                    lightCount = children.Count;
                    // Just add the pixels, they will get layed out next
                    foreach (ElementNode child in children) {
                        PreviewPixel pixel = AddPixel(10, 10);
                        pixel.Node = child;
                        //pixel.NodeId = child.Id;
                        pixel.PixelColor = Color.White;
                    }
                }
            }

            if (_pixels.Count == 0) {
                // Just add the pixels, they will get layed out next
                for (int lightNum = 0; lightNum < lightCount; lightNum++) {
                    PreviewPixel pixel = AddPixel(10, 10);
                    pixel.PixelColor = Color.White;
                    if (selectedNode != null && selectedNode.IsLeaf) {
                        pixel.Node = selectedNode;
                        //pixel.NodeId = selectedNode.Id;
                    }
                }
            }

            // Lay out the pixels
            Layout();

            //DoResize += new ResizeEvent(OnResize);
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:53,代码来源:PreviewCane.cs

示例10: PreviewStar

        public PreviewStar(PreviewPoint point, ElementNode selectedNode, double zoomLevel)
        {
            ZoomLevel = zoomLevel;
            _topLeftPoint = PointToZoomPoint(point);
            _bottomRightPoint = PointToZoomPoint(point);

            _pointCount = 0;
            _pixelCount = 0;
            _insideSize = 40;

            if (selectedNode != null) {

                AddAllChildren(selectedNode);
                if (IsPixelStar(selectedNode))
                    StringType = StringTypes.Pixel;
            }

            if (_pixels.Count >= 5 && _pointCount == 0)
            {
                if (_pixels.Count % 5 == 0)
                {
                    _pointCount = 5;
                }
                else if (_pixels.Count % 3 == 0)
                {
                    _pointCount = 3;
                }
                else if (_pixels.Count % 2 == 0)
                {
                    _pointCount = 4;
                }
            }

            if (_pixels.Count < 5)
            {
                _pixelCount = 40;
                _pointCount = 5;
                // Just add the pixels, they will get layed out next
                for (int lightNum = 0; lightNum < _pixelCount; lightNum++) {
                    PreviewPixel pixel = AddPixel(10, 10);
                    pixel.PixelColor = Color.White;
                    if (selectedNode != null && selectedNode.IsLeaf) {
                        pixel.Node = selectedNode;
                    }
                }
            }

            //Console.WriteLine("Star Pixel Count: " + _pixelCount + ":" + _pixels.Count());

            // Lay out the pixels
            Layout();
        }
开发者ID:forkineye,项目名称:vixen,代码行数:52,代码来源:PreviewStar.cs

示例11: addGroupEffects

		protected void addGroupEffects()
		{
			DisplayItem selectDisplayItem;
			var nextShape = false;
			m_form.SelectedDisplayItems.Clear();
			foreach (var shape in m_newDisplay.Shape.Strings)
			{
				PreviewPoint translatedPoint = new PreviewPoint(shape.Pixels[0].X, shape.Pixels[0].Y);
				m_form.SelectItemUnderPoint(translatedPoint, nextShape);
				nextShape = true;
			}
			m_form.AddNewGroup(out selectDisplayItem, m_form.SelectedDisplayItems);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:13,代码来源:PreviewItemsGroupAddedSeparateUndoAction.cs

示例12: PreviewArch

        public PreviewArch(PreviewPoint point1, ElementNode selectedNode)
        {
            _topLeft = point1;
            _bottomRight = new PreviewPoint(_topLeft.X, _topLeft.Y);

            int lightCount = 25;

            //// Just add the pixels, they will get layed out next
            //for (int lightNum = 0; lightNum < 25; lightNum++)
            //{
            //    PreviewPixel pixel = AddPixel(10, 10);
            //    pixel.PixelColor = Color.White;
            //}

            if (selectedNode != null) {
                //List<ElementNode> children = selectedNode.Children.ToList();
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                // is this a single node?
                if (children.Count >= 4) {
                    StringType = StringTypes.Pixel;
                    lightCount = children.Count;
                    // Just add the pixels, they will get layed out next
                    foreach (ElementNode child in children) {
                        {
                            PreviewPixel pixel = AddPixel(10, 10);
                            pixel.Node = child;
                            //pixel.NodeId = child.Id;
                            pixel.PixelColor = Color.White;
                        }
                    }
                }
            }

            if (_pixels.Count == 0) {
                // Just add the pixels, they will get layed out next
                for (int lightNum = 0; lightNum < lightCount; lightNum++) {
                    PreviewPixel pixel = AddPixel(10, 10);
                    pixel.PixelColor = Color.White;
                    if (selectedNode != null && selectedNode.IsLeaf) {
                        pixel.Node = selectedNode;
                        //pixel.NodeId = selectedNode.Id;
                    }
                }
            }

            // Lay out the pixels
            Layout();

            //DoResize += new ResizeEvent(OnResize);
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:50,代码来源:PreviewArch.cs

示例13: PreviewStarBurst

        public PreviewStarBurst(PreviewPoint point1, ElementNode selectedNode, double zoomLevel)
        {
            ZoomLevel = zoomLevel;
            _topLeft = PointToZoomPoint(point1);
            _topRight = new PreviewPoint(_topLeft);
            _bottomLeft = new PreviewPoint(_topLeft);
            _bottomRight = new PreviewPoint(_topLeft);

            _strings = new List<PreviewBaseShape>();

            if (selectedNode != null)
            {
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                int stringCount = PreviewTools.GetParentNodes(selectedNode).Count();
                if (stringCount >= 4)
                {
                    int spokePixelCount = 0;
                    foreach (ElementNode node in selectedNode.Children)
                    {
                        spokePixelCount = Math.Max(spokePixelCount, node.Children.Count());
                    }

                    StringType = StringTypes.Pixel;

                    foreach (ElementNode node in selectedNode.Children)
                    {
                        PreviewLine line;
                        line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), spokePixelCount, node, ZoomLevel);

                        line.PixelColor = Color.White;
                        _strings.Add(line);
                    }
                }
            }

            if (_strings.Count == 0) {
                // Just add lines, they will be layed out in Layout()
                StringType = StringTypes.Standard;
                for (int i = 0; i < 8; i++) {
                    PreviewLine line;
                    line = new PreviewLine(new PreviewPoint(10, 10), new PreviewPoint(20, 20), 10, selectedNode, ZoomLevel);
                    line.PixelColor = Color.White;
                    line.StringType = StringTypes.Standard;
                    _strings.Add(line);
                }
            }

            Layout();
        }
开发者ID:forkineye,项目名称:vixen,代码行数:49,代码来源:PreviewStarBurst.cs

示例14: PreviewLine

        public PreviewLine(PreviewPoint point1, PreviewPoint point2, int lightCount, ElementNode selectedNode)
        {
            AddPoint(point1);
            AddPoint(point2);

            if (selectedNode != null) {
                //List<ElementNode> children = selectedNode.Children.ToList();
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                // is this a single node?
                if (children.Count == 0) {
                    StringType = StringTypes.Standard;
                    // Just add the pixels, they will get layed out next
                    for (int lightNum = 0; lightNum < lightCount; lightNum++) {
                        //Console.WriteLine("Added: " + lightNum.ToString());
                        PreviewPixel pixel = AddPixel(10, 10);
                        pixel.PixelColor = Color.White;
                        if (selectedNode.IsLeaf)
                            pixel.Node = selectedNode;
                        //pixel.NodeId = selectedNode.Id;
                    }
                }
                else {
                    StringType = StringTypes.Pixel;
                    lightCount = children.Count;
                    // Just add the pixels, they will get layed out next
                    foreach (ElementNode child in children) {
                        {
                            PreviewPixel pixel = AddPixel(10, 10);
                            pixel.Node = child;
                            pixel.NodeId = child.Id;
                            pixel.PixelColor = Color.White;
                        }
                    }
                }
            }
            else {
                // Just add the pixels, they will get layed out next
                for (int lightNum = 0; lightNum < lightCount; lightNum++) {
                    //Console.WriteLine("Added: " + lightNum.ToString());
                    PreviewPixel pixel = AddPixel(10, 10);
                    pixel.PixelColor = Color.White;
                }
            }
            // Lay out the pixels
            Layout();

            //DoResize += new ResizeEvent(OnResize);
        }
开发者ID:Jchuchla,项目名称:vixen,代码行数:48,代码来源:PreviewLine.cs

示例15: PreviewPolyLine

        public PreviewPolyLine(PreviewPoint point1, PreviewPoint point2, ElementNode selectedNode, double zoomLevel)
        {
            ZoomLevel = zoomLevel;
            AddPoint(PointToZoomPoint(point1));

            if (selectedNode != null)
            {
                List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
                // is this a single node?
                if (children.Count == 0)
                {
                    StringType = StringTypes.Standard;
                    PixelCount = 2;
                    _pixels[0].PixelColor = Color.White;
                    if (selectedNode.IsLeaf)
                        _pixels[0].Node = selectedNode;
                    Creating = true;
                    CreateDefaultPixels = true;
                }
                else
                {
                    StringType = StringTypes.Pixel;
                    PixelCount = children.Count;
                    // Just add the pixels, they will get layed out next
                    int pixelNum = 0;
                    foreach (ElementNode child in children)
                    {
                        {
                            PreviewPixel pixel = _pixels[pixelNum];
                            pixel.Node = child;
                            pixel.NodeId = child.Id;
                            pixel.PixelColor = Color.White;
                        }
                        pixelNum++;
                    }
                    Creating = true;
                }
            }
            else
            {
                Creating = true;
                CreateDefaultPixels = true;
                PixelCount = 2;
            }

            Layout();
        }
开发者ID:forkineye,项目名称:vixen,代码行数:47,代码来源:PreviewPolyLine.cs


注:本文中的VixenModules.Preview.VixenPreview.Shapes.PreviewPoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。