Hi
I need to write data which I have successfully read in from a text file, to a new file. The original text file contains data for many objects. The read in data is stored using stl vectors in 3 nested objects: Structure, Polygon and Point i.e. a Structure contains >=2 Polygons which in turn comprises >=3 Points. Attached are the .h and .cpp files since they are quite large (planROI.cpp in particular).
Everything was going swimmingly (printing read in values to screen with std::cout) until I tried to write the data out to file.
There are no compilation errors, but when I execute the program the vectors go out of range giving the following error message:
terminate called after throwing an instance of 'std::out_of_range'
what(): vector::_M_range_check
Found 1 PTV(s)
PTV0: "PTV"
Opened file : /home/mark/PTV0.txt
Inspecting the files you will see that I have also tried overloading the ostream << operator for the objects. This did not help.
I know this is a rather vague description of my problem, but I am a bit of a loss to explain this at the moment. I suspect the problem lies with the use of the constructors and member functions to populate the stl vectors that the Structure and Polygon objects contain.
Thanks in anticipation
Mark