コード例 #1
0
        public UnitPoint GetPointFromVertexId(eVertexId vId)
        {
            UnitPoint pt = UnitPoint.Empty;
            float     halfWidth, halfHeight;

            GetHalfWidthAndHeight(out halfWidth, out halfHeight);
            switch (vId)
            {
            case eVertexId.LeftTopCorner:
                pt = m_p1;
                break;

            case eVertexId.RightBottomCorner:
                pt = m_p3;
                break;

            case eVertexId.BottomEdgeMidPoint:
                pt = new UnitPoint(Center.X, Center.Y - halfHeight);
                break;

            case eVertexId.TopEdgeMidPoint:
                pt = new UnitPoint(Center.X, Center.Y + halfHeight);
                break;

            case eVertexId.LeftEdgeMidPoint:
                pt = new UnitPoint(Center.X - halfWidth, Center.Y);
                break;

            case eVertexId.RigthEdgeMidPoint:
                pt = new UnitPoint(Center.X + halfWidth, Center.Y);
                break;

            default:
                throw new Exception("not match");
            }

            return(pt);
        }
コード例 #2
0
 public ConnectionCrvNodeToRectBaseNodePair(INodePoint node, eVertexId rectNodeId)
 {
     this.connectionCrvNode = node;
     this.rectNodeId        = rectNodeId;
 }