Overview
This project provides a simple, but general, implementation of a reader and writer for streams using the ply format. It has the following features:
- The streams are generally file-streams, but it is very simple to replace these by any other stream, such as the standard in/output stream (i.e. std::cout, std::cin).
- The implementation is general in that it can read and write any file in ply format, irrespective of the actual elements used. The required data is stored by letting the user construct their own subclasses for Object and Storage. Examples are provided in the form of the Vertex, Face and Mesh classes.
- Very easy to use.
- The reader automatically parses the header. After this, it is very easy to check which of your own Object subclasses match.
- All the values are passed through the code as double, making it easier to handle them.
- Possible to easily change the way faults while reading/writing the files are handled (e.g. stop processing, or just an error message).
- Correctly handles each type of stream (i.e. ASCII, little-endian, or big-endian).
- Can process the data very fast and with small memory usage.
- Platform independent due to restriction to ANSI C and standard template libraries. Similarly, both "\n" and "\r\n" line ending are handled.
Disclaimer
The code is based upon Greg Turk's code from 1998. I have written the complete project from scratch and the interface is very different to Turk's code. However, the underlying code ended up very similar to the original, so I feel I should give proper credit here.
Any parts that are significantly different, such as the usage of streams, may be used under the GPL 3.0 license.
Thank you for using this free code. May your data storage be smooth and safe.
Thijs van Lankveld