10#include <dune/grid/io/file/dgfparser/blocks/basic.hh>
24 PolygonBlock ( std::istream &in,
int numVtx,
int vtxOfs )
25 : BasicBlock( in,
"Polygon" ), vtxBegin_( vtxOfs ), vtxEnd_( vtxOfs + numVtx )
28 int get ( std::vector< std::vector< int > > &polygons )
31 std::vector< int > polygon;
32 while( getnextline() )
35 for(
int vtxIdx; getnextentry( vtxIdx ); )
37 if( (vtxBegin_ > vtxIdx) || (vtxIdx >= vtxEnd_) )
38 DUNE_THROW( DGFException,
"Error in " << *
this <<
": Invalid vertex index (" << vtxIdx <<
" not int [" << vtxBegin_ <<
", " << vtxEnd_ <<
"[)" );
39 polygon.push_back( vtxIdx - vtxBegin_ );
42 polygons.push_back( polygon );
44 return polygons.size();
48 int vtxBegin_, vtxEnd_;
Traits for type conversions and type information.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
Dune namespace.
Definition: alignedallocator.hh:14