本文整理汇总了C++中Polyline::getPointID方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyline::getPointID方法的具体用法?C++ Polyline::getPointID怎么用?C++ Polyline::getPointID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyline
的用法示例。
在下文中一共展示了Polyline::getPointID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: n
bool operator==(Polyline const& lhs, Polyline const& rhs)
{
if (lhs.getNumberOfPoints() != rhs.getNumberOfPoints())
return false;
const size_t n(lhs.getNumberOfPoints());
for (size_t k(0); k < n; k++)
{
if (lhs.getPointID(k) != rhs.getPointID(k))
return false;
}
return true;
}
示例2: GeoObject
Polyline::Polyline(const Polyline& ply) : GeoObject(), _ply_pnts(ply._ply_pnts)
{
for (size_t k(0); k < ply.getNumberOfPoints(); ++k)
_ply_pnt_ids.push_back(ply.getPointID(k));
if (ply.getNumberOfPoints() > 0)
for (size_t k(0); k < ply.getNumberOfPoints(); ++k)
_length.push_back(ply.getLength(k));
}
示例3: containsEdge
bool containsEdge(const Polyline& ply, size_t id0, size_t id1)
{
if (id0 == id1)
{
std::cerr << "no valid edge id0 == id1 == " << id0 << "\n";
return false;
}
if (id0 > id1)
BASELIB::swap(id0, id1);
const size_t n(ply.getNumberOfPoints() - 1);
for (size_t k(0); k < n; k++)
{
size_t ply_pnt0(ply.getPointID(k));
size_t ply_pnt1(ply.getPointID(k + 1));
if (ply_pnt0 > ply_pnt1)
BASELIB::swap(ply_pnt0, ply_pnt1);
if (ply_pnt0 == id0 && ply_pnt1 == id1)
return true;
}
return false;
}