Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Loop through the file's data one line at a time until it runs out of data/lines.
- while (std::getline(fileData, singleLine))
- {
- // Store each line as a stringstream.
- istringstream lineData(singleLine);
- // Each line has a known structure so use variables to grab the values from the line's stringstream.
- // Each line consists of: placeZ X Y, with X and Y being coordinate numbers and Z being the
- // place number.
- // E.g. place0 1234 5678.
- string placeName;
- double xPos;
- double yPos;
- lineData >> placeName; // Grab the placename from the stream.
- lineData >> xPos; // Grab the X coordinate from the stream.
- lineData >> yPos; // Grab the Y coordinate from the stream.
- // Create a feature node with the recently collected data.
- PlaceNode* tempNode = new PlaceNode(placeName, xPos, yPos);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement