Particle Universe  1.2
ParticleUniverse::ParticleScriptSerializer Class Reference

#include <ParticleUniverseScriptSerializer.h>

Inheritance diagram for ParticleUniverse::ParticleScriptSerializer:

Public Member Functions

 ParticleScriptSerializer (void)
 
virtual ~ParticleScriptSerializer (void)
 
void writeScript (const ParticleSystem *particleSystem, const String &fileName)
 
const StringwriteScript (const ParticleSystem *particleSystem)
 
void writeLine (const String &s0, const String &s1, const String &s2, const String &s3, const String &s4, short indentation0=-1, short indentation1=-1, short indentation2=-1, short indentation3=-1, short indentation4=-1)
 
void writeLine (const String &s0, const String &s1, const String &s2, const String &s3, short indentation0=-1, short indentation1=-1, short indentation2=-1, short indentation3=-1)
 
void writeLine (const String &s0, const String &s1, const String &s2, short indentation0=-1, short indentation1=-1, short indentation2=-1)
 
void writeLine (const String &s0, const String &s1, short indentation0=-1, short indentation1=-1)
 
void writeLine (const String &s0, short indentation0=-1)
 
void setDefaultTabs (short tab0=0, short tab1=48, short tab2=52, short tab3=56, short tab4=60)
 
void setPath (const String &path)
 
const short getIndentation (void) const
 
void setIndentation (const short indentation)
 
const StringgetKeyword (void) const
 
void setKeyword (const String &keyword)
 

Static Public Member Functions

static String toString (vector< Real > vector, bool applySqrt=false)
 

Public Attributes

Context context
 

Protected Member Functions

void _appendTabbedString (size_t index, String &base, const String &s, short indentation)
 
void _stream (const String &string)
 

Protected Attributes

ParticleSystemWriter mParticleSystemWriter
 
String mPath
 
std::ofstream mScriptFile
 
StringStream mScript
 
String mScriptString
 
short mTab [5]
 
short mIndentation
 
String mKeyword
 
bool mStreamToFile
 

Detailed Description

The ParticleScriptSerializer class is responsible for writing objects and attributes to a particle system script.

Constructor & Destructor Documentation

ParticleUniverse::ParticleScriptSerializer::ParticleScriptSerializer ( void  )
virtual ParticleUniverse::ParticleScriptSerializer::~ParticleScriptSerializer ( void  )
inlinevirtual

Member Function Documentation

void ParticleUniverse::ParticleScriptSerializer::_appendTabbedString ( size_t  index,
String base,
const String s,
short  indentation 
)
protected

Concatenate base string and string 's', with the proper indentation.

void ParticleUniverse::ParticleScriptSerializer::_stream ( const String string)
protected

Writes to a file or to a string

const short ParticleUniverse::ParticleScriptSerializer::getIndentation ( void  ) const

Get/set the indentation. To be used in cases where it is unkown what the indentation is.

const String& ParticleUniverse::ParticleScriptSerializer::getKeyword ( void  ) const

Get/set the keyword. To be used in cases where it is unkown what the keyword is or in case serialisation is spread across multiple objects.

void ParticleUniverse::ParticleScriptSerializer::setDefaultTabs ( short  tab0 = 0,
short  tab1 = 48,
short  tab2 = 52,
short  tab3 = 56,
short  tab4 = 60 
)

Set the default tab values. If a writeline doesn't contain any indentation value, the default tab values are used.

void ParticleUniverse::ParticleScriptSerializer::setIndentation ( const short  indentation)
void ParticleUniverse::ParticleScriptSerializer::setKeyword ( const String keyword)
void ParticleUniverse::ParticleScriptSerializer::setPath ( const String path)

Set the directory to which files are serialized.

static String ParticleUniverse::ParticleScriptSerializer::toString ( vector< Real vector,
bool  applySqrt = false 
)
static

Creates a string from a vector with Reals. This function contains an additional argument. If set to true, the square root is applied to all real values (don't ask!).

void ParticleUniverse::ParticleScriptSerializer::writeLine ( const String s0,
const String s1,
const String s2,
const String s3,
const String s4,
short  indentation0 = -1,
short  indentation1 = -1,
short  indentation2 = -1,
short  indentation3 = -1,
short  indentation4 = -1 
)

Writes a line to a script file.

void ParticleUniverse::ParticleScriptSerializer::writeLine ( const String s0,
const String s1,
const String s2,
const String s3,
short  indentation0 = -1,
short  indentation1 = -1,
short  indentation2 = -1,
short  indentation3 = -1 
)

Writes a line to a script file.

void ParticleUniverse::ParticleScriptSerializer::writeLine ( const String s0,
const String s1,
const String s2,
short  indentation0 = -1,
short  indentation1 = -1,
short  indentation2 = -1 
)

Writes a line to a script file.

void ParticleUniverse::ParticleScriptSerializer::writeLine ( const String s0,
const String s1,
short  indentation0 = -1,
short  indentation1 = -1 
)

Writes a line to a script file.

void ParticleUniverse::ParticleScriptSerializer::writeLine ( const String s0,
short  indentation0 = -1 
)

Writes a line to a script file.

void ParticleUniverse::ParticleScriptSerializer::writeScript ( const ParticleSystem particleSystem,
const String fileName 
)

Writes a ParticleSystem to a file in the script format.

const String& ParticleUniverse::ParticleScriptSerializer::writeScript ( const ParticleSystem particleSystem)

If no filename has been given, serialisation is done to a string.

Member Data Documentation

Context ParticleUniverse::ParticleScriptSerializer::context
short ParticleUniverse::ParticleScriptSerializer::mIndentation
protected
String ParticleUniverse::ParticleScriptSerializer::mKeyword
protected
ParticleSystemWriter ParticleUniverse::ParticleScriptSerializer::mParticleSystemWriter
protected
String ParticleUniverse::ParticleScriptSerializer::mPath
protected
StringStream ParticleUniverse::ParticleScriptSerializer::mScript
protected
std::ofstream ParticleUniverse::ParticleScriptSerializer::mScriptFile
protected
String ParticleUniverse::ParticleScriptSerializer::mScriptString
protected
bool ParticleUniverse::ParticleScriptSerializer::mStreamToFile
protected
short ParticleUniverse::ParticleScriptSerializer::mTab[5]
protected

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