PLYwoot
Header-only C++17 library for parsing and writing PLY files
Loading...
Searching...
No Matches
plywoot::OStream Class Reference

#include <plywoot.hpp>

Public Member Functions

 OStream (PlyFormat format)
 
 OStream (PlyFormat format, std::vector< Comment > comments)
 
template<typename... Ts>
void add (const PlyElement &element, const reflect::Layout< Ts... > layout)
 
void add (const PlyElementData &elementData)
 
void write (std::ostream &os) const
 

Detailed Description

Represents an output PLY data stream that can be used to output data to a PLY format.

Definition at line 203 of file plywoot.hpp.

Constructor & Destructor Documentation

◆ OStream() [1/2]

plywoot::OStream::OStream ( PlyFormat  format)
inline

Constructs an output PLY data stream of the given format type.

Parameters
formatformat of the output PLY data stream

Definition at line 209 of file plywoot.hpp.

◆ OStream() [2/2]

plywoot::OStream::OStream ( PlyFormat  format,
std::vector< Comment comments 
)
inline

Constructs an output PLY data stream of the given format type, with the specified comments that should be written to the header. Line numbers of the comments should start from line 2, since according to the specification, comments may not occur in the first two lines of the header.

Parameters
formatformat of the output PLY data stream
commentscomments to store in the header of the output PLY data stream

Definition at line 219 of file plywoot.hpp.

Member Function Documentation

◆ add() [1/2]

template<typename... Ts>
void plywoot::OStream::add ( const PlyElement element,
const reflect::Layout< Ts... >  layout 
)
inline

Queues an element with the associated data for writing. Elements will be stored in the same order they are queued.

Parameters
elementPLY element to add for streaming to this output stream
layoutPLY property to target type mapping representing the way PLY properties should be mapped on the various target type member types

Definition at line 234 of file plywoot.hpp.

◆ add() [2/2]

void plywoot::OStream::add ( const PlyElementData elementData)
inline

Queues the given element data for writing. This takes ownership of the data to be written, to ensure it does not go out of scope prior to committing all data to the output stream through write().

Parameters
elementDataraw element data to stream to this output stream

Definition at line 250 of file plywoot.hpp.

◆ write()

void plywoot::OStream::write ( std::ostream &  os) const
inline

Writes all data as a PLY file queued through addElement() to the given output stream.

Parameters
osoutput stream to write the queued element data to

Definition at line 268 of file plywoot.hpp.


The documentation for this class was generated from the following file: