コード例 #1
0
        private bool IsOver(double x, double y)
        {
            double xp = m_xs1 + (m_xs2 - m_xs1) * m_value;
            double yp = (m_ys1 + m_ys2) / 2.0;

            return(PictorMath.CalculateDistance(x, y, xp, yp) <= m_Bounds.Top - m_Bounds.Bottom);
        }
コード例 #2
0
        public bool IsEqual(VertexDistance val)
        {
            bool ret = (dist = PictorMath.CalculateDistance(x, y, val.x, val.y)) > PictorMath.vertex_dist_epsilon;

            if (!ret)
            {
                dist = 1.0 / PictorMath.vertex_dist_epsilon;
            }
            return(ret);
        }
コード例 #3
0
ファイル: PathStorage.cs プロジェクト: djlw78/Mosa
        public void join_path(PathStorage vs, uint path_id)
        {
            double x, y;

            vs.Rewind(path_id);
            uint PathAndFlags = vs.Vertex(out x, out y);

            if (!Path.IsStop(PathAndFlags))
            {
                if (Path.IsVertex(PathAndFlags))
                {
                    double x0, y0;
                    uint   PathAndFlags0 = last_vertex(out x0, out y0);
                    if (Path.IsVertex(PathAndFlags0))
                    {
                        if (PictorMath.CalculateDistance(x, y, x0, y0) > PictorMath.vertex_dist_epsilon)
                        {
                            if (Path.IsMoveTo(PathAndFlags))
                            {
                                PathAndFlags = (uint)Path.EPathCommands.LineTo;
                            }
                            m_vertices.add_vertex(x, y, PathAndFlags);
                        }
                    }
                    else
                    {
                        if (Path.IsStop(PathAndFlags0))
                        {
                            PathAndFlags = (uint)Path.EPathCommands.MoveTo;
                        }
                        else
                        {
                            if (Path.IsMoveTo(PathAndFlags))
                            {
                                PathAndFlags = (uint)Path.EPathCommands.LineTo;
                            }
                        }
                        m_vertices.add_vertex(x, y, PathAndFlags);
                    }
                }
                while (!Path.IsStop(PathAndFlags = vs.Vertex(out x, out y)))
                {
                    m_vertices.add_vertex(x, y, Path.IsMoveTo(PathAndFlags) ?
                                          (uint)Path.EPathCommands.LineTo :
                                          PathAndFlags);
                }
            }
        }