本文整理汇总了C++中LineString::numPoints方法的典型用法代码示例。如果您正苦于以下问题:C++ LineString::numPoints方法的具体用法?C++ LineString::numPoints怎么用?C++ LineString::numPoints使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineString
的用法示例。
在下文中一共展示了LineString::numPoints方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: minkowskiSum
void minkowskiSum( const LineString& gA, const Polygon_2& gB, Polygon_set_2& polygonSet )
{
if ( gA.isEmpty() ) {
return ;
}
int npt = gA.numPoints() ;
for ( int i = 0; i < npt - 1 ; i++ ) {
Polygon_2 P;
P.push_back( gA.pointN( i ).toPoint_2() );
P.push_back( gA.pointN( i+1 ).toPoint_2() );
//
// We want to compute the "minkowski sum" on each segment of the line string
// This is not very well defined. But it appears CGAL supports it.
// However we must use the explicit "full convolution" method for that particular case in CGAL >= 4.7
#if CGAL_VERSION_NR < 1040701000 // version 4.7
Polygon_with_holes_2 part = minkowski_sum_2( P, gB );
#else
Polygon_with_holes_2 part = minkowski_sum_by_full_convolution_2( P, gB );
#endif
// merge into a polygon set
if ( polygonSet.is_empty() ) {
polygonSet.insert( part );
}
else {
polygonSet.join( part );
}
}
}
示例2: Geometry
LineString::LineString( const LineString& other ):
Geometry()
{
for ( size_t i = 0; i < other.numPoints(); i++ ) {
_points.push_back( other.pointN( i ).clone() ) ;
}
}
示例3: visit
void ForceValidityVisitor::visit( LineString& g )
{
g.forceValidityFlag( valid_ );
for ( size_t i = 0; i < g.numPoints(); i++ ) {
visit( g.pointN( i ) );
}
}
示例4: writeInner
void WktWriter::writeInner( const LineString & g )
{
_s << "(";
for ( size_t i = 0; i < g.numPoints(); i++ ){
if ( i != 0 )
_s << ",";
write( g.pointN(i).coordinates() );
}
_s << ")";
}
示例5: minkowskiSum
void minkowskiSum( const LineString& gA, const Polygon_2 & gB, Polygon_set_2 & polygonSet ){
if ( gA.isEmpty() ){
return ;
}
int npt = gA.numPoints() ;
for ( int i = 0; i < npt - 1 ; i++ ){
Polygon_2 P;
P.push_back( gA.pointN(i).toPoint_2() );
P.push_back( gA.pointN(i+1).toPoint_2() );
Polygon_with_holes_2 part = minkowski_sum_2( P, gB );
// merge into a polygon set
if ( polygonSet.is_empty() ){
polygonSet.insert( part );
}else{
polygonSet.join( part );
}
}
}
示例6: visit
void GetPointsVisitor::visit( const LineString& g )
{
for ( size_t i = 0; i < g.numPoints(); i++ ) {
visit( g.pointN( i ) );
}
}
示例7: transform
void AffineTransform3::transform( LineString& ls )
{
for ( size_t i = 0; i < ls.numPoints(); ++i ) {
transform( ls.pointN( i ) );
}
}