00001 #include "Gral/IO/complex2d-format-input.h" 00002 00003 00004 void 00005 IstreamComplex2DFmt::read_coords() const 00006 { 00007 base::init(); 00008 typedef point_traits<coord_type> pt; 00009 coords = std::vector<coord_type>(NumOfVertices()); 00010 for(unsigned v = 0; v < NumOfVertices(); ++v) { 00011 pt::ConstructWithDim(spacedim,coords[v]); 00012 for(int i = pt::LowerIndex(coords[v]); i <= pt::UpperIndex(coords[v]); ++i) { 00013 In() >> coords[v][i]; 00014 } 00015 } 00016 coords_read = true; 00017 } 00018 00019 bool 00020 IstreamComplex2DFmt::initialized() const 00021 { return (base::initialized() && coords_read); } 00022 00023 void 00024 IstreamComplex2DFmt::init() const 00025 { 00026 base::init(); 00027 if(! coords_read) { 00028 read_coords(); 00029 } 00030 } 00031