Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

TxaFile Class Reference

This represents the .txa file (usually textures.txa) that contains the user instructions for resizing, grouping, etc. More...

#include <txaFile.h>

List of all members.

Public Member Functions

 TxaFile ()
bool read (Filename filename)
 Reads the indicated .txa filename, and returns true if successful, or false if there is an error.

bool match_egg (EggFile *egg_file) const
 Searches for a matching line in the .txa file for the given egg file and applies its specifications.

bool match_texture (TextureImage *texture) const
 Searches for a matching line in the .txa file for the given texture and applies its specifications.

void write (ostream &out) const
 Outputs a representation of the lines that were read in to the indicated output stream.


Private Types

typedef pvector< TxaLineLines

Private Member Functions

bool parse_group_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":group" and indicates the relationships between one or more groups.

bool parse_palette_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":palette" and indicates the appropriate size for the palette images.

bool parse_margin_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":margin" and indicates the default margin size.

bool parse_coverage_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":coverage" and indicates the default coverage threshold.

bool parse_imagetype_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":imagetype" and indicates the default image file type to convert palettes and textures to.

bool parse_shadowtype_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":shadowtype" and indicates the image file type to convert working copies of the palette images to.

bool parse_round_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":round" and indicates how or whether to round up UV minmax boxes.

bool parse_remap_line (const vector_string &words)
 Handles the line in a .txa file that begins with the keyword ":remap" and indicates how or whether to remap UV coordinates in egg files to the unit box.

bool parse_remapchar_line (const vector_string &words)

Private Attributes

Lines _lines


Detailed Description

This represents the .txa file (usually textures.txa) that contains the user instructions for resizing, grouping, etc.

the various textures.

Definition at line 45 of file txaFile.h.


Member Typedef Documentation

typedef pvector<TxaLine> TxaFile::Lines [private]
 

Definition at line 67 of file txaFile.h.


Constructor & Destructor Documentation

TxaFile::TxaFile  ) 
 

Definition at line 39 of file txaFile.cxx.

References nout, Filename::open_read(), and Filename::set_text().


Member Function Documentation

bool TxaFile::match_egg EggFile egg_file  )  const
 

Searches for a matching line in the .txa file for the given egg file and applies its specifications.

If a match is found, returns true; otherwise, returns false. Also returns false if all the matching lines for the egg file include the keyword "cont".

Definition at line 151 of file txaFile.cxx.

References _lines.

bool TxaFile::match_texture TextureImage texture  )  const
 

Searches for a matching line in the .txa file for the given texture and applies its specifications.

If a match is found, returns true; otherwise, returns false. Also returns false if all the matching lines for the texture include the keyword "cont".

Definition at line 179 of file txaFile.cxx.

Referenced by PaletteGroup::is_preferred_over().

bool TxaFile::parse_coverage_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":coverage" and indicates the default coverage threshold.

Definition at line 353 of file txaFile.cxx.

References Palettizer::_shadow_alpha_type, Palettizer::_shadow_color_type, PNMFileTypeRegistry::get_ptr(), nout, pal, parse_image_type_request(), and PNMFileTypeRegistry::write_types().

bool TxaFile::parse_group_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":group" and indicates the relationships between one or more groups.

Definition at line 224 of file txaFile.cxx.

bool TxaFile::parse_imagetype_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":imagetype" and indicates the default image file type to convert palettes and textures to.

Definition at line 387 of file txaFile.cxx.

References pal.

bool TxaFile::parse_margin_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":margin" and indicates the default margin size.

Definition at line 320 of file txaFile.cxx.

bool TxaFile::parse_palette_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":palette" and indicates the appropriate size for the palette images.

Definition at line 285 of file txaFile.cxx.

References nout.

bool TxaFile::parse_remap_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":remap" and indicates how or whether to remap UV coordinates in egg files to the unit box.

Definition at line 495 of file txaFile.cxx.

bool TxaFile::parse_remapchar_line const vector_string &  words  )  [private]
 

bool TxaFile::parse_round_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":round" and indicates how or whether to round up UV minmax boxes.

Definition at line 448 of file txaFile.cxx.

bool TxaFile::parse_shadowtype_line const vector_string &  words  )  [private]
 

Handles the line in a .txa file that begins with the keyword ":shadowtype" and indicates the image file type to convert working copies of the palette images to.

Definition at line 418 of file txaFile.cxx.

References Palettizer::_remap_char_uv, Palettizer::_remap_uv, nout, pal, Palettizer::RU_invalid, and Palettizer::string_remap().

bool TxaFile::read Filename  filename  ) 
 

Reads the indicated .txa filename, and returns true if successful, or false if there is an error.

Definition at line 53 of file txaFile.cxx.

References size_t.

void TxaFile::write ostream &  out  )  const
 

Outputs a representation of the lines that were read in to the indicated output stream.

This is primarily useful for debugging.

Definition at line 203 of file txaFile.cxx.


Member Data Documentation

Lines TxaFile::_lines [private]
 

Definition at line 68 of file txaFile.h.

Referenced by match_egg().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:28:07 2003 for Panda-Tool by doxygen1.3