本文整理汇总了C++中LineString::startPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ LineString::startPoint方法的具体用法?C++ LineString::startPoint怎么用?C++ LineString::startPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LineString
的用法示例。
在下文中一共展示了LineString::startPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: visit
void BoundaryVisitor::visit( const LineString& g )
{
if ( g.isEmpty() ) {
_boundary.reset();
return ;
}
if ( g.startPoint().coordinate() == g.endPoint().coordinate() ) {
_boundary.reset() ;
}
else {
std::auto_ptr< MultiPoint > boundary( new MultiPoint );
boundary->addGeometry( g.startPoint() );
boundary->addGeometry( g.endPoint() );
_boundary.reset( boundary.release() );
}
}
示例2: bottom
std::auto_ptr< Geometry > building(
const Polygon& g,
const Kernel::FT& wallHeight,
const Kernel::FT& roofSlope
)
{
//typedef Straight_skeleton_2::Vertex_const_handle Vertex_const_handle ;
typedef Straight_skeleton_2::Halfedge_const_handle Halfedge_const_handle ;
//typedef Straight_skeleton_2::Halfedge_const_iterator Halfedge_const_iterator ;
typedef Straight_skeleton_2::Face_const_iterator Face_const_iterator ;
// convert to CGAL polygon and generate straight skeleton
Polygon_with_holes_2 polygon = g.toPolygon_with_holes_2() ;
// fix orientation
algorithm::makeValidOrientation( polygon ) ;
boost::shared_ptr< Straight_skeleton_2 > skeleton = CGAL::create_interior_straight_skeleton_2( polygon ) ;
std::auto_ptr< PolyhedralSurface > shell( new PolyhedralSurface );
// bottom part
{
Polygon bottom( polygon );
bottom.reverse();
algorithm::force3D( bottom );
shell->addPolygon( bottom );
}
// walls
{
//exterior rings
_buildingWall( polygon.outer_boundary(), wallHeight, *shell ) ;
//interior rings
for ( Polygon_with_holes_2::Hole_const_iterator it = polygon.holes_begin(); it != polygon.holes_end(); ++it ) {
_buildingWall( *it, wallHeight, *shell ) ;
}
}
// roof
{
for ( Face_const_iterator it = skeleton->faces_begin(); it != skeleton->faces_end(); ++it ) {
LineString roofFaceRing ;
Halfedge_const_handle h = it->halfedge(), done( h ) ;
bool infiniteTimeFound = false ;
do {
infiniteTimeFound = infiniteTimeFound || h->has_infinite_time() ;
Point_2 point = h->vertex()->point() ;
Kernel::FT zPoint = wallHeight + h->vertex()->time() * roofSlope ;
roofFaceRing.addPoint( Point( point.x(), point.y(), zPoint ) );
h = h->next() ;
}
while ( h != done && ! infiniteTimeFound );
if ( ! infiniteTimeFound ) {
roofFaceRing.addPoint( roofFaceRing.startPoint() );
shell->addPolygon( Polygon( roofFaceRing ) );
}
}
}
return std::auto_ptr< Geometry >( new Solid( shell.release() ) );
}