12#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
26 PolygonBlock ( std::istream &in,
int numVtx,
int vtxOfs )
27 : BasicBlock( in,
"Polygon" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx )
30 int get ( std::vector< std::vector< int > > &polygons )
33 std::vector< int > polygon;
34 while( getnextline() )
37 for(
int vtxIdx; getnextentry( vtxIdx ); )
39 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )
40 DUNE_THROW( DGFException,
"Error in " << *
this <<
": Invalid vertex index (" << vtxIdx <<
" not int [" << vtxBegin_ <<
", " << vtxEnd_ <<
"[)" );
41 polygon.push_back( vtxIdx - vtxBegin_ );
44 polygons.push_back( polygon );
46 return polygons.size();
50 int vtxBegin_, vtxEnd_;
Traits for type conversions and type information.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13