我如何找到所有的点在Android的一个路径? [英] How do I find all the Points in a Path in Android?

查看:161
本文介绍了我如何找到所有的点在Android的一个路径?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一段时间回来,我问一个问题,看看我能找到一个对的路径具体问题;然而,这一次,我想知道是否有一种方法可以知道路径的所有点? (我无法找到一个方法,这样做了,这是不幸的,因为Java提供了一个办法做到这一点,只是没有的Andr​​oid?)

Awhile back I asked a question to see if I was able to find a pair of specific points in a path; however, this time I want to know if there is a way to know all points in a path? (I couldn't find a method that did so, which is unfortunate because Java provides a way to do this, just not Android?)

我问这个的原因是因为我有多个几何图形,我想比较点,看看他们相交。

The reason I ask this is because I have multiple geometric graphs and I want to compare the points to see where they intersect.

我AP preciate任何有帮助的回应

I appreciate any helpful responses

推荐答案

如果您已经创建了一个路径这意味着,在某些时候你的code,你知道确切的(GEO)点。你为什么不把这个点(S)在的ArrayList 或类似的东西?

If you have created a Path that means that in some point of your code, you know the exact (Geo)point. Why don't you put this point(s) on a ArrayList or something similar?

因此​​,例如在做之前:

So for example before doing:

path.lineTo(point.x, point.y);

你可以这样做:

you can do:

yourList.add(point);
path.lineTo(point.x, point.y);

和以后你可以从的ArrayList 您的所有问题。 请注意你,你可以把增强的for循环语法优势对的ArrayList 执行的三倍快。

And later you can get all your points from the ArrayList. Note you that you can take advantage of the Enhanced For Loop Syntax of ArrayList that execute up to three times faster.

这篇关于我如何找到所有的点在Android的一个路径?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆