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


C# biz.ritter.javapi.isDone方法代码示例

本文整理汇总了C#中biz.ritter.javapi.isDone方法的典型用法代码示例。如果您正苦于以下问题:C# biz.ritter.javapi.isDone方法的具体用法?C# biz.ritter.javapi.isDone怎么用?C# biz.ritter.javapi.isDone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在biz.ritter.javapi的用法示例。


在下文中一共展示了biz.ritter.javapi.isDone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: intersectPath

        /**
         * Returns how many times rectangle stripe cross path or the are intersect
         */
        public static int intersectPath(java.awt.geom.PathIterator p, double x, double y, double w, double h)
        {
            int cross = 0;
            int count;
            double mx, my, cx, cy;
            mx = my = cx = cy = 0.0;
            double[] coords = new double[6];

            double rx1 = x;
            double ry1 = y;
            double rx2 = x + w;
            double ry2 = y + h;

            while (!p.isDone())
            {
                count = 0;
                switch (p.currentSegment(coords))
                {
                    case java.awt.geom.PathIteratorConstants.SEG_MOVETO:
                        if (cx != mx || cy != my)
                        {
                            count = intersectLine(cx, cy, mx, my, rx1, ry1, rx2, ry2);
                        }
                        mx = cx = coords[0];
                        my = cy = coords[1];
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_LINETO:
                        count = intersectLine(cx, cy, cx = coords[0], cy = coords[1], rx1, ry1, rx2, ry2);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_QUADTO:
                        count = intersectQuad(cx, cy, coords[0], coords[1], cx = coords[2], cy = coords[3], rx1, ry1, rx2, ry2);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_CUBICTO:
                        count = intersectCubic(cx, cy, coords[0], coords[1], coords[2], coords[3], cx = coords[4], cy = coords[5], rx1, ry1, rx2, ry2);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_CLOSE:
                        if (cy != my || cx != mx)
                        {
                            count = intersectLine(cx, cy, mx, my, rx1, ry1, rx2, ry2);
                        }
                        cx = mx;
                        cy = my;
                        break;
                }
                if (count == CROSSING)
                {
                    return CROSSING;
                }
                cross += count;
                p.next();
            }
            if (cy != my)
            {
                count = intersectLine(cx, cy, mx, my, rx1, ry1, rx2, ry2);
                if (count == CROSSING)
                {
                    return CROSSING;
                }
                cross += count;
            }
            return cross;
        }
开发者ID:sailesh341,项目名称:JavApi,代码行数:65,代码来源:Crossing.cs

示例2: crossPath

        /**
         * Returns how many times ray from point (x,y) cross path
         */
        public static int crossPath(java.awt.geom.PathIterator p, double x, double y)
        {
            int cross = 0;
            double mx, my, cx, cy;
            mx = my = cx = cy = 0.0;
            double[] coords = new double[6];

            while (!p.isDone())
            {
                switch (p.currentSegment(coords))
                {
                    case java.awt.geom.PathIteratorConstants.SEG_MOVETO:
                        if (cx != mx || cy != my)
                        {
                            cross += crossLine(cx, cy, mx, my, x, y);
                        }
                        mx = cx = coords[0];
                        my = cy = coords[1];
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_LINETO:
                        cross += crossLine(cx, cy, cx = coords[0], cy = coords[1], x, y);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_QUADTO:
                        cross += crossQuad(cx, cy, coords[0], coords[1], cx = coords[2], cy = coords[3], x, y);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_CUBICTO:
                        cross += crossCubic(cx, cy, coords[0], coords[1], coords[2], coords[3], cx = coords[4], cy = coords[5], x, y);
                        break;
                    case java.awt.geom.PathIteratorConstants.SEG_CLOSE:
                        if (cy != my || cx != mx)
                        {
                            cross += crossLine(cx, cy, cx = mx, cy = my, x, y);
                        }
                        break;
                }

                // checks if the point (x,y) is the vertex of shape with PathIterator p
                if (x == cx && y == cy)
                {
                    cross = 0;
                    cy = my;
                    break;
                }
                p.next();
            }
            if (cy != my)
            {
                cross += crossLine(cx, cy, mx, my, x, y);
            }
            return cross;
        }
开发者ID:sailesh341,项目名称:JavApi,代码行数:54,代码来源:Crossing.cs


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