VTKCollection Class Reference

#include <VTKData.h>

Public Member Functions

 VTKCollection (std::string fileName)
 
 ~VTKCollection ()
 
 operator bool () const
 
void append (std::string filename)
 

Private Member Functions

void writeHeader ()
 
void writeFooter ()
 

Private Attributes

std::ofstream outFile_
 
bool hasHeader_
 
bool hasFooter_
 
std::size_t recordID_
 

Constructor & Destructor Documentation

◆ VTKCollection()

VTKCollection::VTKCollection ( std::string  fileName)
inline
273  : outFile_(fileName), hasHeader_(false), hasFooter_(false), recordID_(0)
274  {
275  }
std::ofstream outFile_
Definition: Tools/VTKData.h:249
bool hasHeader_
Definition: Tools/VTKData.h:250
std::size_t recordID_
Definition: Tools/VTKData.h:252
bool hasFooter_
Definition: Tools/VTKData.h:251

◆ ~VTKCollection()

VTKCollection::~VTKCollection ( )
inline
278  {
279  if (hasHeader_ && !hasFooter_)
280  writeFooter();
281  }
void writeFooter()
Definition: Tools/VTKData.h:263

References hasFooter_, hasHeader_, and writeFooter().

Member Function Documentation

◆ append()

void VTKCollection::append ( std::string  filename)
inline
291  {
292  if (!hasHeader_)
293  writeHeader();
294 
295  outFile_ <<
296  "<DataSet group=\"\" part=\"0\" timestep=\"" << recordID_ << "\" file=\"" << filename << "\" />\n";
297 
298  recordID_++;
299  }
void writeHeader()
Definition: Tools/VTKData.h:254

References hasHeader_, outFile_, recordID_, and writeHeader().

Referenced by transformMercuryToVTK().

◆ operator bool()

VTKCollection::operator bool ( ) const
inline
285  {
286  return outFile_.good();
287  }

References outFile_.

◆ writeFooter()

void VTKCollection::writeFooter ( )
inlineprivate
264  {
265  outFile_ <<
266  " </Collection>\n"
267  "</VTKFile>\n";
268  hasFooter_ = true;
269  }

References hasFooter_, and outFile_.

Referenced by ~VTKCollection().

◆ writeHeader()

void VTKCollection::writeHeader ( )
inlineprivate
255  {
256  outFile_ <<
257  "<?xml version=\"1.0\"?>\n"
258  "<VTKFile type=\"Collection\" version=\"0.1\" byte_order=\"LittleEndian\">\n"
259  " <Collection>\n";
260  hasHeader_ = true;
261  }

References hasHeader_, and outFile_.

Referenced by append().

Member Data Documentation

◆ hasFooter_

bool VTKCollection::hasFooter_
private

Referenced by writeFooter(), and ~VTKCollection().

◆ hasHeader_

bool VTKCollection::hasHeader_
private

Referenced by append(), writeHeader(), and ~VTKCollection().

◆ outFile_

std::ofstream VTKCollection::outFile_
private

◆ recordID_

std::size_t VTKCollection::recordID_
private

Referenced by append().


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