本文整理汇总了C++中GeomPtr::equals方法的典型用法代码示例。如果您正苦于以下问题:C++ GeomPtr::equals方法的具体用法?C++ GeomPtr::equals怎么用?C++ GeomPtr::equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeomPtr
的用法示例。
在下文中一共展示了GeomPtr::equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: wkt
template<>
template<>
void object::test<1>()
{
std::string wkt("POLYGON((20 220, 40 220, 60 220, 80 220, 100 220, \
120 220, 140 220, 140 180, 100 180, 60 180, 20 180, 20 220))");
GeomPtr g(wktreader.read(wkt));
GeomPtr simplified = DouglasPeuckerSimplifier::simplify(
g.get(), 10.0);
ensure( simplified->isValid() );
// topology is unchanged
ensure( simplified->equals(g.get()) );
}
// 2 - PolygonReductionWithSplit
template<>
template<>
void object::test<2>()
{
std::string wkt_in("POLYGON ((40 240, 160 241, 280 240, 280 160, \
160 240, 40 140, 40 240))");
std::string wkt_ex("MULTIPOLYGON (((40.0 240.0, 160.0 240.0, 40.0 140.0, 40.0 240.0)), \
((160.0 240.0, 280.0 240.0, 280.0 160.0, 160.0 240.0)))");
GeomPtr g(wktreader.read(wkt_in));
示例2: wkt
//
// PolygonNoReduction
template<>
template<>
void object::test<1>()
{
std::string wkt("POLYGON((20 220, 40 220, 60 220, 80 220, \
100 220, 120 220, 140 220, 140 180, 100 180, \
60 180, 20 180, 20 220))");
GeomPtr g(wktreader.read(wkt));
GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
ensure( "Simplified geometry is invalid!", simplified->isValid() );
ensure( "Simplified and original geometry inequal", simplified->equals(g.get()) );
ensure_equals_geometry( g.get(), simplified.get() );
}
// PolygonNoReductionWithConflicts
template<>
template<>
void object::test<2>()
{
std::string wkt("POLYGON ((40 240, 160 241, 280 240, 280 160, \
160 240, 40 140, 40 240))");
GeomPtr g(wktreader.read(wkt));
GeomPtr simplified = TopologyPreservingSimplifier::simplify(g.get(), 10.0);
ensure( "Simplified geometry is invalid!", simplified->isValid() );