• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ControlPointCapabilities类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability) {
			switch (controlPointId) {
				case TopCenterControlPoint:
				case MiddleLeftControlPoint:
				case MiddleRightControlPoint:
				case BottomCenterControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Resize) != 0 || ((controlPointCapability & ControlPointCapabilities.Connect) != 0 && IsConnectionPointEnabled(controlPointId)));
				default:
					return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:jestonitiro,项目名称:nshape,代码行数:12,代码来源:FlowChartShapes.cs


示例2: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			if (controlPointId == controlPoints.Length) {
				return ((controlPointCapability & ControlPointCapabilities.Rotate) > 0
				        || (controlPointCapability & ControlPointCapabilities.Reference) > 0
				        ||
				        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 && IsConnectionPointEnabled(controlPointId)));
			}
			else if (controlPointId >= 1) {
				return ((controlPointCapability & ControlPointCapabilities.Resize) > 0
				        ||
				        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 && IsConnectionPointEnabled(controlPointId)));
			}
			else
				return base.HasControlPointCapability(controlPointId, controlPointCapability);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:18,代码来源:Polygone.cs


示例3: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			switch (controlPointId) {
				case ControlPoint1:
				case ControlPoint2:
				case ControlPoint3:
					return ((controlPointCapability & ControlPointCapabilities.Resize) > 0
					        ||
					        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 &&
					         IsConnectionPointEnabled(controlPointId)));
				case RotateControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Rotate) > 0
					        || (controlPointCapability & ControlPointCapabilities.Reference) > 0
					        ||
					        ((controlPointCapability & ControlPointCapabilities.Connect) > 0 &&
					         IsConnectionPointEnabled(controlPointId)));
				default:
					return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:22,代码来源:TriangleBase.cs


示例4: FindNearestControlPoint

		/// <override></override>
		public override ControlPointId FindNearestControlPoint(int x, int y, int distance,
		                                                       ControlPointCapabilities controlPointCapability)
		{
			if ((controlPointCapability & ControlPointCapabilities.Reference) > 0) {
				if (Geometry.DistancePointPoint(x, y, X, Y) <= distance)
					return ControlPointId.Reference;
			}
			else if ((controlPointCapability & ControlPointCapabilities.Rotate) > 0) {
				if (Geometry.DistancePointPoint(x, y, RotatePoint.X, RotatePoint.Y) <= distance)
					return RotatePointId;
			}
			return ControlPointId.None;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:14,代码来源:ShapeGroup.cs


示例5: HitTest

		/// <override></override>
		public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
		{
			//if ((controlPointCapability & ControlPointCapabilities.Reference) > 0)
			//   if (Geometry.DistancePointPoint(X, Y, x, y) <= distance)
			//      return true;
			if ((controlPointCapability & ControlPointCapabilities.Rotate) > 0) {
				if (Geometry.DistancePointPoint(RotatePoint.X, RotatePoint.Y, x, y) <= range)
					return RotatePointId;
				controlPointCapability ^= ControlPointCapabilities.Rotate;
			}
			foreach (Shape shape in children) {
				ControlPointId pointId = shape.HitTest(x, y, controlPointCapability, range);
				//if (pointId != ControlPointId.None) return pointId;

				// All control points but the rotate point are deactivated
				if (pointId != ControlPointId.None) return ControlPointId.Reference;
			}
			return ControlPointId.None;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:20,代码来源:ShapeGroup.cs


示例6: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     switch (controlPointId) {
         case TopLeftConnectionPoint:
         case TopRightConnectionPoint:
         case BottomLeftConnectionPoint:
         case BottomRightConnectionPoint:
             return ((controlPointCapability & ControlPointCapabilities.Connect) != 0 && IsConnectionPointEnabled(controlPointId));
         default:
             return base.HasControlPointCapability(controlPointId, controlPointCapability);
     }
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:13,代码来源:FlowChartShapes.cs


示例7: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     if (controlPointId == ControlPointId.Reference)
         return (controlPointCapability & ControlPointCapabilities.Connect) != 0;
     else return base.HasControlPointCapability(controlPointId, controlPointCapability);
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:7,代码来源:PathBasedShape.cs


示例8: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     //if (ImageLayout == ImageLayoutMode.Original) {
     //    if ((controlPointCapability & ControlPointCapabilities.Glue) != 0)
     //        return false;
     //    if ((controlPointCapability & ControlPointCapabilities.Connect) != 0 ) {
     //        return (controlPointId != RotateControlPointId && IsConnectionPointEnabled(controlPointId));
     //    }
     //    if ((controlPointCapability & ControlPointCapabilities.Reference) != 0) {
     //        if (controlPointId == RotateControlPointId || controlPointId == ControlPointId.Reference)
     //            return true;
     //    }
     //    if ((controlPointCapability & ControlPointCapabilities.Rotate) != 0) {
     //        if (controlPointId == RotateControlPointId)
     //            return true;
     //    }
     return base.HasControlPointCapability(controlPointId, controlPointCapability);
     //} else return base.HasControlPointCapability(controlPointId, controlPointCapability);
 }
开发者ID:alexdoan102,项目名称:CustomPicture-NShape,代码行数:20,代码来源:CustomPictureBase.cs


示例9: HasControlPointCapability

 /// <override></override>
 public override bool HasControlPointCapability(ControlPointId controlPointId, ControlPointCapabilities controlPointCapability)
 {
     switch (controlPointId) {
         case TopLeftControlPoint:
         case TopCenterControlPoint:
         case TopRightControlPoint:
         case MiddleLeftControlPoint:
         case MiddleRightControlPoint:
         case BottomLeftControlPoint:
         case BottomCenterControlPoint:
         case BottomRightControlPoint:
             return (controlPointCapability & ControlPointCapabilities.Resize) != 0;
         case MiddleCenterControlPoint:
         case ControlPointId.Reference:
             return ((controlPointCapability & ControlPointCapabilities.Rotate) != 0
                 || (controlPointCapability & ControlPointCapabilities.Reference) != 0
                 || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
                     && IsConnectionPointEnabled(controlPointId)));
         default:
             return false;
     }
 }
开发者ID:LudovicT,项目名称:NShape,代码行数:23,代码来源:SoftwareArchitectureShapes.cs


示例10: HitTest

 ///// <summary>Overriden method. Check base class for documentation.</summary>
 //public override Point CalculateConnectionFoot(int x1, int y1, int x2, int y2) {
 //    return CalculateConnectionFoot(x1, y1);
 //}
 /// <summary>Overriden method. Check base class for documentation.</summary>
 public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
 {
     ControlPointId result = ControlPointId.None;
     //
     // We first search for a hit control point
     for (int cpIdx = 0; cpIdx < ControlPointCount; ++cpIdx) {
         // Get positions of the current control points and test on hit.
         LineControlPoint ctrlPoint = GetControlPoint(cpIdx);
         Point currPos = ctrlPoint.GetPosition();
         if (Geometry.DistancePointPoint(x, y, currPos.X, currPos.Y) <= range) {
             if (HasControlPointCapability(ctrlPoint.Id, controlPointCapability))
                 result = GetControlPointId(cpIdx);
             break;
         }
     }
     if (result == ControlPointId.None) {
         int lineRange = (int)Math.Ceiling(LineStyle.LineWidth / 2f) + 1;
         Point lastKnee;
         int cpIdx = -1;
         FindNextKnee(ref cpIdx, out lastKnee);
         Point knee;
         while (FindNextKnee(ref cpIdx, out knee)) {
             if (Geometry.DistancePointLine(x, y, lastKnee.X, lastKnee.Y, knee.X, knee.Y, true) <= lineRange) {
                 result = ControlPointId.Reference;
                 break;
             }
             lastKnee = knee;
         }
     }
     return result;
 }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:36,代码来源:RectangularLineBase.cs


示例11: ReferenceControlPointHasCapability

 protected override bool ReferenceControlPointHasCapability(ControlPointCapabilities controlPointCapability)
 {
     return (controlPointCapability & ControlPointCapabilities.Reference) > 0 ||
            (controlPointCapability & ControlPointCapabilities.Connect) > 0;
 }
开发者ID:naztrain,项目名称:vixen,代码行数:5,代码来源:ConfigFiltersAndPatching-Shapes.cs


示例12: HasControlPointCapability

        public override bool HasControlPointCapability(ControlPointId controlPointId,
            ControlPointCapabilities controlPointCapability)
        {
            if (controlPointId == ControlPointId.None || controlPointId == ControlPointId.Any)
                return false;

            // all control points have at least the 'none' capability. Hopefully, they might even have more...
            if (controlPointCapability == ControlPointCapabilities.None)
                return true;

            int index = GetControlPointIndex(controlPointId);
            if (index > 0 && index <= InputCount + OutputCount) {
                return ((controlPointCapability & ControlPointCapabilities.Connect) > 0 ||
                        (controlPointCapability & ControlPointCapabilities.Resize) > 0);
            }

            if (controlPointId == ControlPointId.Reference || index == 0) {
                return ReferenceControlPointHasCapability(controlPointCapability);
            }

            // default to any other control points not having any capabilities (shouldn't be any left, really)
            return false;
        }
开发者ID:naztrain,项目名称:vixen,代码行数:23,代码来源:ConfigFiltersAndPatching-Shapes.cs


示例13: FindShapesSortedByZOrder

		public IEnumerable<Shape> FindShapesSortedByZOrder(IDiagramPresenter diagramPresenter, int x, int y,
		                                                   ControlPointCapabilities pointCapabilities, int distance)
		{
			return FindVisibleShapes(diagramPresenter, x, y, pointCapabilities, distance).OrderByDescending(s => s.ZOrder);
		}
开发者ID:stewmc,项目名称:vixen,代码行数:5,代码来源:ConfigFiltersAndPatching-Tools.cs


示例14: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			switch (controlPointId) {
				case ControlPointId.Reference:
				case RotatePointControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Reference) != 0
					        || (controlPointCapability & ControlPointCapabilities.Rotate) != 0
					        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
					            && IsConnectionPointEnabled(controlPointId)));
				default:
					if (controlPointId > 0 && controlPointId < RotatePointControlPoint)
						return ((controlPointCapability & ControlPointCapabilities.Resize) != 0
						        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
						            && IsConnectionPointEnabled(controlPointId)));
					else
						return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:20,代码来源:RectangleShape.cs


示例15: HitTest

 /// <override></override>
 public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
 {
     return base.HitTest(x, y, controlPointCapability, range);
 }
开发者ID:alexdoan102,项目名称:CustomPicture-NShape,代码行数:5,代码来源:CustomPictureBase.cs


示例16: HitTest

 /// <override></override>
 public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
 {
     // First, check control points
     foreach (ControlPointId pointId in GetControlPointIds(ControlPointCapabilities.All)) {
         Point p = GetControlPointPosition(pointId);
         if (Geometry.DistancePointPoint(x, y, p.X, p.Y) <= range)
             if (HasControlPointCapability(pointId, controlPointCapability) && IsConnectionPointEnabled(pointId))
                 return pointId;
     }
     // Afterwards, check shape outline
     Point startPos = StartPoint;
     Point endPos = EndPoint;
     if (IsLine) {
         if (Geometry.DistancePointLine(x, y, startPos.X, startPos.Y, endPos.X, endPos.Y, true) <= range) {
             if (HasControlPointCapability(ControlPointId.Reference, controlPointCapability)
                     && !(Geometry.DistancePointPoint(x, y, startPos.X, startPos.Y) <= range)
                     && !(Geometry.DistancePointPoint(x, y, endPos.X, endPos.Y) <= range)
                     && IsConnectionPointEnabled(ControlPointId.Reference))
                 return ControlPointId.Reference;
         }
     } else {
         Point radPos = RadiusPoint;
         float hitTestRange = (int)Math.Ceiling(LineStyle.LineWidth / 2f) + 1;
         if (Geometry.ArcContainsPoint(startPos.X, startPos.Y, radPos.X, radPos.Y, endPos.X, endPos.Y, Center.X, Center.Y, Radius, x, y, hitTestRange)) {
             if (HasControlPointCapability(ControlPointId.Reference, controlPointCapability)
                 && !(Geometry.DistancePointPoint(x, y, startPos.X, startPos.Y) <= range)
                 && !(Geometry.DistancePointPoint(x, y, endPos.X, endPos.Y) <= range)
                 && IsConnectionPointEnabled(ControlPointId.Reference))
                 return ControlPointId.Reference;
         }
     }
     return ControlPointId.None;
 }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:34,代码来源:CircularArcBase.cs


示例17: HasControlPointCapability

		/// <override></override>
		public override bool HasControlPointCapability(ControlPointId controlPointId,
		                                               ControlPointCapabilities controlPointCapability)
		{
			switch (controlPointId) {
				case ArrowTipControlPoint:
				case BodyEndControlPoint:
					// ToDo: Implement GluePoint behavior for ThickArrows
					return ((controlPointCapability & ControlPointCapabilities.Resize) != 0
					        //|| (controlPointCapability & ControlPointCapabilities.Glue) != 0
					        ||
					        ((controlPointCapability & ControlPointCapabilities.Connect) != 0 &&
					         IsConnectionPointEnabled(controlPointId)));
				case ArrowTopControlPoint:
				case BodyTopControlPoint:
				case BodyBottomControlPoint:
				case ArrowBottomControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Resize) != 0
					        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
					            && IsConnectionPointEnabled(controlPointId)));

				case RotateControlPoint:
					return ((controlPointCapability & ControlPointCapabilities.Reference) != 0
					        || (controlPointCapability & ControlPointCapabilities.Rotate) != 0
					        || ((controlPointCapability & ControlPointCapabilities.Connect) != 0
					            && IsConnectionPointEnabled(controlPointId)));
				default:
					return base.HasControlPointCapability(controlPointId, controlPointCapability);
			}
		}
开发者ID:stewmc,项目名称:vixen,代码行数:30,代码来源:MiscShapes.cs


示例18: GetControlPointIds

 /// <override></override>
 public override IEnumerable<ControlPointId> GetControlPointIds(ControlPointCapabilities controlPointCapability)
 {
     return base.GetControlPointIds(controlPointCapability);
 }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:5,代码来源:TriangleBase.cs


示例19: GetControlPointIds

		/// <override></override>
		public override IEnumerable<ControlPointId> GetControlPointIds(ControlPointCapabilities controlPointCapability)
		{
			if ((controlPointCapability & ControlPointCapabilities.Reference) > 0
			    || (controlPointCapability & ControlPointCapabilities.Rotate) > 0)
				yield return RotatePointId;
		}
开发者ID:stewmc,项目名称:vixen,代码行数:7,代码来源:ShapeGroup.cs


示例20: HitTest

        /// <override></override>
        public override ControlPointId HitTest(int x, int y, ControlPointCapabilities controlPointCapability, int range)
        {
            ControlPointId result = base.HitTest(x, y, controlPointCapability, range);
            if (result != ControlPointId.None)
                return result;

            UpdateDrawCache();
            for (int i = 0; i < 3; ++i) {
                int j = i < 2 ? i + 1 : 0;
                int x1 = controlPoints[i].X + X;
                int y1 = controlPoints[i].Y + Y;
                if (Geometry.DistancePointPoint(x, y, x1, y1) <= range)
                    return i + 1;
            }
            if ((controlPointCapability & ControlPointCapabilities.Rotate) > 0)
                if (Geometry.DistancePointPoint(X, Y, x, y) <= range)
                    return RotateControlPoint;
            return ControlPointId.None;
        }
开发者ID:kjburns31,项目名称:vixen-modules,代码行数:20,代码来源:TriangleBase.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ControlPointId类代码示例发布时间:2022-05-24
下一篇:
C# ControlInfo类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap