#include <Parser.h>
Collaboration diagram for ns_vu1112112::Parser:
Public Member Functions | |
Parser () | |
Default constructor - set initial values. | |
~Parser () | |
Destructor. | |
bool | Parse (const char *filename, vu1112112 &scene) |
Parse the file represented by "filename" and. | |
Private Member Functions | |
void | CheckError (void) |
Check if an error was encountered during parsing. | |
bool | ReadString (char *s) |
Try to read the static text given by "s" from the buffer. | |
bool | ReadString (char *prefix, char *s) |
Try to read a string prefixed by "prefix" from the buffer. | |
bool | ReadNumber (char *prefix, float &t) |
Try to read a number prefixed by "prefix" from the buffer. | |
bool | ReadVector3 (char *prefix, vuVector &v) |
Try to read a vector prefixed by "prefix" from the buffer. | |
bool | ReadvuVector (char *prefix, vuVector &v) |
Try to read a vector prefixed by "prefix" from the buffer. | |
bool | ReadRGB (char *prefix, vuColourRGBa &r) |
Try to read an vuColourRGBa prefixed by "prefix" from the buffer. | |
bool | ReadvuColourRGBa (char *prefix, vuColourRGBa &r) |
Try to read an vuColourRGBa prefixed by "prefix" from the buffer. | |
bool | ReadSpectrum31 (char *prefix, vuColour31a &s) |
bool | ReadvuColour31a (char *prefix, vuColour31a &s) |
Try to read a vuColour31a prefixed by "prefix" from the buffer. | |
bool | ReadSpectrum7 (char *prefix, vuColour7a &s) |
Try to read a vuColour7a prefixed by "prefix" from the buffer. | |
bool | ReadvuColour7a (char *prefix, vuColour7a &s) |
Try to read a vuColour7a prefixed by "prefix" from the buffer. | |
bool | ReadSpectrum9 (char *prefix, vuColour9a &s) |
Try to read a vuColour9a prefixed by "prefix" from the buffer. | |
bool | ReadvuColour9a (char *prefix, vuColour9a &s) |
Try to read a vuColour9a prefixed by "prefix" from the buffer. | |
bool | ReadColourType (char *prefix, ColourType &c, ColourUsage u) |
Try to read a colour prefixed by "prefix" from the buffer. | |
bool | ReadMaterial (vu1112112 &r) |
Try to read an Material from the buffer. | |
bool | ReadGeneral (vu1112112 &s) |
Try to read the "general" block from the buffer. | |
bool | ReadTarga (vu1112112 &s) |
Try to read the "image" block from the buffer. | |
bool | ReadLight (vu1112112 &scene) |
Try to read a "light" block from the buffer. | |
void | FixName (char *str) |
crop the string | |
Private Attributes | |
vuColour31a | m_Ambient |
saves the ambient light of the scene This is used to normalize spectra that are read with this parser. | |
bool | m_ReadAmbient |
a flag | |
char * | m_Buffer |
The character buffer (contains input file text). | |
int | m_Pos |
Current position in the character buffer. |
The parser is used to read scene-files describing objects in a given scene. Hopefully, this class expires when we have a transfer function panel with support for various colour models and load/save facility.
Definition at line 34 of file Parser.h.
|
Default constructor - set initial values.
Definition at line 26 of file Parser.cpp. References m_Buffer, m_Pos, and m_ReadAmbient. |
|
Destructor.
Definition at line 34 of file Parser.cpp. |
|
Check if an error was encountered during parsing. Report the position in the file that was successfully parsed up to. Definition at line 131 of file Parser.cpp. References m_Buffer, and ReadString(). Referenced by Parse(). |
Here is the call graph for this function:
|
crop the string
Definition at line 710 of file Parser.cpp. Referenced by ReadTarga(). |
|
Parse the file represented by "filename" and.
Definition at line 42 of file Parser.cpp. References CheckError(), m_Buffer, ReadGeneral(), ReadLight(), ReadMaterial(), and ReadTarga(). Referenced by ns_vu1112112::vu1112112::load_scene(). |
Here is the call graph for this function:
|
Try to read a colour prefixed by "prefix" from the buffer. Do not read the alpha channel. Definition at line 469 of file Parser.cpp. References ns_vu1112112::cLight, ColourType, vuColour7a::from(), m_Ambient, m_ReadAmbient, ReadRGB(), ReadSpectrum31(), ReadSpectrum7(), ReadSpectrum9(), ReadvuColour31a(), ReadvuColour7a(), ReadvuColour9a(), and ReadvuColourRGBa(). Referenced by ReadGeneral(), ReadLight(), and ReadMaterial(). |
Here is the call graph for this function:
|
Try to read the "general" block from the buffer.
Definition at line 89 of file Parser.cpp. References ns_vu1112112::vu1112112::Background, ns_vu1112112::vu1112112::brightness, ns_vu1112112::cColour, ColourType, ns_vu1112112::vu1112112::diffuse, ns_vu1112112::vu1112112::light_scale, ns_vu1112112::vu1112112::m_LightDir, vuVector::normalize(), ReadColourType(), ReadNumber(), ReadString(), and ReadVector3(). Referenced by Parse(). |
Here is the call graph for this function:
|
Try to read a "light" block from the buffer.
Definition at line 683 of file Parser.cpp. References ns_vu1112112::vu1112112::add_light(), ns_vu1112112::cLight, ColourType, ReadColourType(), and ReadString(). Referenced by Parse(). |
Here is the call graph for this function:
|
Try to read an Material from the buffer.
Definition at line 604 of file Parser.cpp. References ns_vu1112112::Material::absorption, ns_vu1112112::vu1112112::add_material(), ns_vu1112112::cColour, ns_vu1112112::Material::check_absorption(), ColourType, ns_vu1112112::Material::high_th, ns_vu1112112::Material::low_th, ReadColourType(), ReadNumber(), ReadString(), ns_vu1112112::Material::scattering, and ns_vu1112112::Material::xray. Referenced by Parse(). |
Here is the call graph for this function:
|
Try to read a number prefixed by "prefix" from the buffer.
Definition at line 230 of file Parser.cpp. References m_Buffer, and m_Pos. Referenced by ReadGeneral(), ReadMaterial(), ReadRGB(), ReadSpectrum31(), ReadSpectrum7(), ReadSpectrum9(), ReadTarga(), ReadVector3(), ReadvuColour31a(), ReadvuColour7a(), ReadvuColour9a(), ReadvuColourRGBa(), and ReadvuVector(). |
|
Try to read an vuColourRGBa prefixed by "prefix" from the buffer. Only read the RGB values. Definition at line 286 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Definition at line 325 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a vuColour7a prefixed by "prefix" from the buffer. Do not read the alpha channel. Definition at line 373 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a vuColour9a prefixed by "prefix" from the buffer. Do not read the alpha channel. Definition at line 421 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a string prefixed by "prefix" from the buffer.
Definition at line 209 of file Parser.cpp. References m_Buffer, m_Pos, and ReadString(). |
Here is the call graph for this function:
|
Try to read the static text given by "s" from the buffer.
Definition at line 193 of file Parser.cpp. References m_Buffer, and m_Pos. Referenced by CheckError(), ReadGeneral(), ReadLight(), ReadMaterial(), ReadRGB(), ReadSpectrum31(), ReadSpectrum7(), ReadSpectrum9(), ReadString(), ReadTarga(), ReadVector3(), ReadvuColour31a(), ReadvuColour7a(), ReadvuColour9a(), ReadvuColourRGBa(), and ReadvuVector(). |
|
Try to read the "image" block from the buffer.
Definition at line 648 of file Parser.cpp. References FixName(), vu1::m_Camera, ReadNumber(), ReadString(), vuCamera::setHeight(), and vuCamera::setWidth(). Referenced by Parse(). |
Here is the call graph for this function:
|
Try to read a vector prefixed by "prefix" from the buffer. The vector read must have 3 members. Definition at line 247 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadGeneral(). |
Here is the call graph for this function:
|
Try to read a vuColour31a prefixed by "prefix" from the buffer. Read all channels. Definition at line 349 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a vuColour7a prefixed by "prefix" from the buffer. Read all channels. Definition at line 397 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a vuColour9a prefixed by "prefix" from the buffer. Read all channels. Definition at line 445 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read an vuColourRGBa prefixed by "prefix" from the buffer. Read all of the vuColourRGBa values. Definition at line 305 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). Referenced by ReadColourType(). |
Here is the call graph for this function:
|
Try to read a vector prefixed by "prefix" from the buffer. The vector read must have 4 members. Definition at line 266 of file Parser.cpp. References m_Pos, ReadNumber(), and ReadString(). |
Here is the call graph for this function:
|
saves the ambient light of the scene This is used to normalize spectra that are read with this parser. We would use it if the colour model was RGB which it is not, the case. Definition at line 127 of file Parser.h. Referenced by ReadColourType(). |
|
The character buffer (contains input file text).
Definition at line 131 of file Parser.h. Referenced by CheckError(), Parse(), Parser(), ReadNumber(), and ReadString(). |
|
Current position in the character buffer.
Definition at line 132 of file Parser.h. Referenced by Parser(), ReadNumber(), ReadRGB(), ReadSpectrum31(), ReadSpectrum7(), ReadSpectrum9(), ReadString(), ReadVector3(), ReadvuColour31a(), ReadvuColour7a(), ReadvuColour9a(), ReadvuColourRGBa(), and ReadvuVector(). |
|
a flag
Definition at line 128 of file Parser.h. Referenced by Parser(), and ReadColourType(). |