本文整理汇总了C++中Polyline::getNumberOfPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ Polyline::getNumberOfPoints方法的具体用法?C++ Polyline::getNumberOfPoints怎么用?C++ Polyline::getNumberOfPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polyline
的用法示例。
在下文中一共展示了Polyline::getNumberOfPoints方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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));
}
示例2: 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;
}
示例3: isLineSegmentIntersecting
bool isLineSegmentIntersecting(const Polyline& ply, GEOLIB::Point const& s0, GEOLIB::Point const& s1)
{
const size_t n(ply.getNumberOfPoints() - 1);
bool intersect(false);
GEOLIB::Point intersection_pnt;
for (size_t k(0); k < n && !intersect; k++)
{
intersect = MathLib::lineSegmentIntersect(*(ply.getPoint(k)), *(ply.getPoint(k + 1)), s0, s1, intersection_pnt);
}
return intersect;
}
示例4: isPartOfPolylineInPolygon
bool Polygon::isPartOfPolylineInPolygon(const Polyline& ply) const
{
const std::size_t ply_size (ply.getNumberOfPoints());
// check points
for (std::size_t k(0); k < ply_size; k++) {
if (isPntInPolygon (*(ply.getPoint(k)))) {
return true;
}
}
GeoLib::Point s;
for (auto polygon_seg : *this) {
for (auto polyline_seg : ply) {
if (GeoLib::lineSegmentIntersect(polyline_seg, polygon_seg, s)) {
return true;
}
}
}
return false;
}
示例5: 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;
}