PLY reader/writer  1.2.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
Public Member Functions | Public Attributes | List of all members
PLY::Reader Struct Reference

The reader for extracting Objects from a ply stream. More...

#include <io.h>

Public Member Functions

 Reader (Header &h)
 Base constructor. More...
 
 Reader (Header &h, std::istream &is)
 Construct from existing stream. More...
 
 Reader (Header &h, const char *file_name)
 Construct and open a file. More...
 
bool open_file (const char *file_name)
 Open a file for reading. More...
 
void close_file ()
 Close the stream. More...
 
bool read_header ()
 Read the Header from the current stream. More...
 
bool read_data (Storage *store)
 Read the Object data from the current stream. More...
 

Public Attributes

Headerheader
 The Header of the ply file.
 
std::istream * stream
 The stream to read from.
 

Detailed Description

The reader for extracting Objects from a ply stream.

See Also
Writer.

Constructor & Destructor Documentation

PLY::Reader::Reader ( Header h)
inline

Base constructor.

In order to be able to share a Header, for example with a Writer, it is stored as a reference.

Parameters
[in,out]hthe Header to use.
PLY::Reader::Reader ( Header h,
std::istream &  is 
)
inline

Construct from existing stream.

It is assumed that the stream was opened correctly. In order to be able to read any binary file, the stream must be opened in binary mode.

Parameters
[in,out]hthe Header to use.
[in,out]isthe stream to use.
PLY::Reader::Reader ( Header h,
const char *  file_name 
)
inline

Construct and open a file.

This constructor tries to open a file for reading and reads the Header if the file could be opened.

Parameters
[in,out]hthe Header to use.
file_namethe name of the file to read.

Member Function Documentation

void PLY::Reader::close_file ( )

Close the stream.

Note that this will throw an exception when trying to close a standard io stream.

bool PLY::Reader::open_file ( const char *  file_name)

Open a file for reading.

Parameters
file_namethe file to open.
Returns
true if the file could be successfully opened.
bool PLY::Reader::read_data ( Storage store)

Read the Object data from the current stream.

Parameters
[out]storewhere to store the Objects.
Returns
true if all the data could be successfully read.
bool PLY::Reader::read_header ( )

Read the Header from the current stream.

Returns
true if the header could be correctly read.

The documentation for this struct was generated from the following files: