当前位置: 首页>>代码示例>>C++>>正文


C++ LineString::pointN方法代码示例

本文整理汇总了C++中LineString::pointN方法的典型用法代码示例。如果您正苦于以下问题:C++ LineString::pointN方法的具体用法?C++ LineString::pointN怎么用?C++ LineString::pointN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LineString的用法示例。


在下文中一共展示了LineString::pointN方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
        }
    }
}
开发者ID:hdeeken,项目名称:SFCGAL,代码行数:32,代码来源:minkowskiSum.cpp

示例2: distanceLineStringLineString3D

double distanceLineStringLineString3D( const LineString& gA, const LineString& gB )
{
    if ( gA.isEmpty() || gB.isEmpty() ) {
        return std::numeric_limits< double >::infinity() ;
    }

    size_t nsA = gA.numSegments() ;
    size_t nsB = gB.numSegments() ;

    double dMin = std::numeric_limits< double >::infinity() ;

    for ( size_t i = 0; i < nsA; i++ ) {
        for ( size_t j = 0; j < nsB; j++ ) {
            dMin = std::min(
                       dMin,
                       distanceSegmentSegment3D(
                           gA.pointN( i ), gA.pointN( i+1 ),
                           gB.pointN( j ), gB.pointN( j+1 )
                       )
                   ) ;
        }
    }

    return dMin ;
}
开发者ID:Oslandia,项目名称:SFCGAL,代码行数:25,代码来源:distance3d.cpp

示例3: distancePointLineString3D

double distancePointLineString3D( const Point& gA, const LineString& gB )
{
    if ( gA.isEmpty() || gB.isEmpty() ) {
        return std::numeric_limits< double >::infinity() ;
    }

    double dMin = std::numeric_limits< double >::infinity() ;

    for ( size_t i = 0; i < gB.numSegments(); i++ ) {
        dMin = std::min( dMin, distancePointSegment3D( gA, gB.pointN( i ), gB.pointN( i+1 ) ) );
    }

    return dMin ;
}
开发者ID:Oslandia,项目名称:SFCGAL,代码行数:14,代码来源:distance3d.cpp

示例4: offset

/**
 * @brief build LineString offset
 */
void offset( const LineString & lineString, const double& radius, Offset_polygon_set_2 & polygonSet ){
	for ( size_t i = 0; i < lineString.numSegments(); i++ ){
		Polygon_2 P ;
		P.push_back( lineString.pointN(i).toPoint_2() );
		P.push_back( lineString.pointN(i+1).toPoint_2() );
		Offset_polygon_with_holes_2  offset = CGAL::approximated_offset_2( P, radius, SFCGAL_OFFSET_ACCURACY ) ;

		if ( polygonSet.is_empty() ){
			polygonSet.insert( offset );
		}else{
			polygonSet.join( offset );
		}
	}
}
开发者ID:amutu,项目名称:SFCGAL,代码行数:17,代码来源:offset.cpp

示例5: isCounterClockWiseOriented

bool isCounterClockWiseOriented( const LineString& ls )
{
    // Compute the 'z' part of the Newell's formula
    // and test against 0
    Kernel::FT z = 0 ;

    for ( size_t i = 0; i < ls.numSegments(); ++i ) {
        const Point& pi = ls.pointN( i );
        const Point& pj = ls.pointN( i+1 );
        z += ( pi.x() - pj.x() ) * ( pi.y() + pj.y() );
    }

    return z > 0;
}
开发者ID:Ezio47,项目名称:SFCGAL,代码行数:14,代码来源:orientation.cpp

示例6: Geometry

LineString::LineString( const LineString& other ):
    Geometry()
{
    for ( size_t i = 0; i < other.numPoints(); i++ ) {
        _points.push_back( other.pointN( i ).clone() ) ;
    }
}
开发者ID:hjanetzek,项目名称:SFCGAL,代码行数:7,代码来源:LineString.cpp

示例7: visit

void ForceValidityVisitor::visit( LineString& g )
{
    g.forceValidityFlag( valid_ );
    for ( size_t i = 0; i < g.numPoints(); i++ ) {
        visit( g.pointN( i ) );
    }
}
开发者ID:Ezio47,项目名称:SFCGAL,代码行数:7,代码来源:ForceValidityVisitor.cpp

示例8: distanceLineStringTriangle3D

double distanceLineStringTriangle3D( const LineString& gA, const Triangle& gB )
{
    if ( gA.isEmpty() || gB.isEmpty() ) {
        return std::numeric_limits< double >::infinity() ;
    }

    double dMin = std::numeric_limits< double >::infinity() ;

    const Point& tA = gB.vertex( 0 ) ;
    const Point& tB = gB.vertex( 1 ) ;
    const Point& tC = gB.vertex( 2 ) ;

    for ( size_t i = 0; i < gA.numSegments(); i++ ) {
        dMin = std::min( dMin, distanceSegmentTriangle3D( gA.pointN( i ), gA.pointN( i+1 ), tA, tB, tC ) );
    }

    return dMin ;
}
开发者ID:Oslandia,项目名称:SFCGAL,代码行数:18,代码来源:distance3d.cpp

示例9: 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 << ")";
}
开发者ID:mborne,项目名称:sfcgal-with-postgis,代码行数:11,代码来源:WktWriter.cpp

示例10: 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 );
		}
	}
}
开发者ID:amutu,项目名称:SFCGAL,代码行数:21,代码来源:minkowskiSum.cpp

示例11: visit

void GetPointsVisitor::visit( const LineString& g )
{
    for ( size_t i = 0; i < g.numPoints(); i++ ) {
        visit( g.pointN( i ) );
    }
}
开发者ID:HEShuang,项目名称:SFCGAL,代码行数:6,代码来源:GetPointsVisitor.cpp

示例12: transform

void AffineTransform3::transform( LineString& ls )
{
    for ( size_t i = 0; i < ls.numPoints(); ++i ) {
        transform( ls.pointN( i ) );
    }
}
开发者ID:Ezio47,项目名称:SFCGAL,代码行数:6,代码来源:AffineTransform3.cpp


注:本文中的LineString::pointN方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。