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

EggTopstrip Class Reference

Reads a character model and/or animations and strips out the animation from one of the top joints from the entire character. More...

#include <eggTopstrip.h>

Inheritance diagram for EggTopstrip:

EggCharacterFilter EggMultiFilter EggMultiBase ProgramBase List of all members.

Public Types

typedef pdeque< string > Args

Public Member Functions

 EggTopstrip ()
void run ()
void check_transform_channels ()
 Checks the _transform_channels string to ensure that it contains only the expected nine letters, or a subset.

void strip_anim (EggJointData *joint_data, int from_model, EggJointData *top_joint)
 Applies the channels from joint _top_joint in model from_model to the joint referenced by joint_data.

void strip_anim_vertices (EggNode *egg_node, int into_model, int from_model, EggJointData *top_joint)
 Applies the channels from joint _top_joint in model from_model to the vertices at egg_node.

void adjust_transform (LMatrix4d &mat) const
 Adjust the transform extracted from the "top" joint according to the -s and -i/-n options, prior to applying it to the skeleton.

void show_description ()
 Writes the program description to stderr.

void show_usage ()
 Writes the usage line(s) to stderr.

void show_options ()
 Describes each of the available options to stderr.

void show_text (const string &text)
 Formats the indicated text to stderr with the known _terminal_width.

void show_text (const string &prefix, int indent_width, string text)
 Formats the indicated text and its prefix for output to stderr with the known _terminal_width.

virtual void parse_command_line (int argc, char *argv[])
 Dispatches on each of the options on the command line, and passes the remaining parameters to handle_args().

string get_exec_command () const
 Returns the command that invoked this program, as a shell-friendly string, suitable for pasting into the comments of output files.


Public Attributes

string _top_joint_name
bool _got_invert_transform
bool _invert_transform
string _transform_channels
Filename _channel_filename
Filename _program_name
Args _program_args

Protected Types

typedef bool(* OptionDispatchFunction )(const string &opt, const string &parm, void *data)
typedef bool(* OptionDispatchMethod )(ProgramBase *self, const string &opt, const string &parm, void *data)

Protected Member Functions

virtual bool post_command_line ()
 This is called after the command line has been completely processed, and it gives the program a chance to do some last-minute processing and validation of the options and arguments.

virtual void write_eggs ()
 Writes out all of the egg files in the _eggs vector, to the output directory if one is specified, or over the input files if -inplace was specified.

virtual EggCharacterCollectionmake_collection ()
 Allocates and returns a new EggCharacterCollection structure.

virtual bool handle_args (Args &args)
 Does something with the additional arguments on the command line (after all the -options have been parsed).

Filename get_output_filename (const Filename &source_filename) const
 Returns the output filename of the egg file with the given input filename.

void append_command_comment (EggData &_data)
 Inserts a comment into the beginning of the indicated egg file corresponding to the command line that invoked this program.

virtual PointerTo< EggDataread_egg (const Filename &filename)
 Allocates and returns a new EggData structure that represents the indicated egg file.

void set_program_description (const string &description)
 Sets the description of the program that will be reported by show_usage().

void clear_runlines ()
 Removes all of the runlines that were previously added, presumably before adding some new ones.

void add_runline (const string &runline)
 Adds an additional line to the list of lines that will be displayed to describe briefly how the program is to be run.

void clear_options ()
 Removes all of the options that were previously added, presumably before adding some new ones.

void add_option (const string &option, const string &parm_name, int index_group, const string &description, OptionDispatchFunction option_function, bool *bool_var=(bool *) NULL, void *option_data=(void *) NULL)
 Adds (or redefines) a command line option.

void add_option (const string &option, const string &parm_name, int index_group, const string &description, OptionDispatchMethod option_method, bool *bool_var=(bool *) NULL, void *option_data=(void *) NULL)
 This is another variant on add_option(), above, except that it receives a pointer to a "method", which is really just another static (or global) function, whose first parameter is a ProgramBase *.

bool redescribe_option (const string &option, const string &description)
 Changes the description associated with a previously-defined option.

bool remove_option (const string &option)
 Removes a previously-defined option.

void add_path_replace_options ()
 Adds -pr etc.

void add_path_store_options ()
 Adds -ps etc.


Static Protected Member Functions

void append_command_comment (EggData &_data, const string &comment)
 Inserts a comment into the beginning of the indicated egg file corresponding to the command line that invoked this program.

bool dispatch_none (const string &opt, const string &arg, void *)
 Standard dispatch function for an option that takes no parameters, and does nothing special.

bool dispatch_true (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes no parameters, and when it is present sets a bool variable to the 'true' value.

bool dispatch_false (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes no parameters, and when it is present sets a bool variable to the 'false' value.

bool dispatch_count (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes no parameters, but whose presence on the command line increments an integer counter for each time it appears.

bool dispatch_int (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as an integer.

bool dispatch_int_pair (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes a pair of integer parameters.

bool dispatch_double (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a double.

bool dispatch_double_pair (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes a pair of double parameters.

bool dispatch_double_triple (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes a triple of double parameters.

bool dispatch_double_quad (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes a quad of double parameters.

bool dispatch_color (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes a color, either as r,g,b or as r,g,b,a.

bool dispatch_string (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a string.

bool dispatch_filename (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a filename.

bool dispatch_search_path (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a single directory name to add to a search path.

bool dispatch_coordinate_system (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a coordinate system string.

bool dispatch_units (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a unit of distance measurement.

bool dispatch_image_type (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to indicate an image file type, like rgb, bmp, jpg, etc.

bool dispatch_path_replace (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a single component of a path replace request.

bool dispatch_path_store (const string &opt, const string &arg, void *var)
 Standard dispatch function for an option that takes one parameter, which is to be interpreted as a path store string.

bool handle_help_option (const string &opt, const string &arg, void *)
 Called when the user enters '-h', this describes how to use the program and then exits.

void format_text (ostream &out, bool &last_newline, const string &prefix, int indent_width, const string &text, int line_width)
 Word-wraps the indicated text to the indicated output stream.


Protected Attributes

EggCharacterCollection_collection
bool _allow_empty
bool _got_output_filename
Filename _output_filename
bool _got_output_dirname
Filename _output_dirname
bool _inplace
bool _got_coordinate_system
CoordinateSystem _coordinate_system
PointerTo< PathReplace_path_replace
bool _got_path_store
bool _got_path_directory

Detailed Description

Reads a character model and/or animations and strips out the animation from one of the top joints from the entire character.

Particularly useful for generating stackable character models from separately-extracted characters.

Definition at line 50 of file eggTopstrip.h.


Member Typedef Documentation

typedef pdeque<string> ProgramBase::Args [inherited]
 

Definition at line 66 of file programBase.h.

typedef bool(* ProgramBase::OptionDispatchFunction)(const string &opt, const string &parm, void *data) [protected, inherited]
 

Definition at line 71 of file programBase.h.

typedef bool(* ProgramBase::OptionDispatchMethod)(ProgramBase *self, const string &opt, const string &parm, void *data) [protected, inherited]
 

Definition at line 72 of file programBase.h.


Constructor & Destructor Documentation

EggTopstrip::EggTopstrip  ) 
 

Definition at line 40 of file eggTopstrip.cxx.

References ProgramBase::add_option(), ProgramBase::dispatch_false(), ProgramBase::dispatch_filename(), ProgramBase::dispatch_string(), ProgramBase::dispatch_true(), and NULL.


Member Function Documentation

void ProgramBase::add_option const string &  option,
const string &  parm_name,
int  index_group,
const string &  description,
OptionDispatchMethod  option_method,
bool *  bool_var = (bool *)NULL,
void *  option_data = (void *)NULL
[protected, inherited]
 

This is another variant on add_option(), above, except that it receives a pointer to a "method", which is really just another static (or global) function, whose first parameter is a ProgramBase *.

We can't easily add a variant that accepts a real method, because the C++ syntax for methods requires us to know exactly what class object the method is defined for, and we want to support adding pointers for methods that are defined in other classes. So we have this hacky thing, which requires the "method" to be declared static, and receive its this pointer explicitly, as the first argument.

Definition at line 690 of file programBase.cxx.

References ProgramBase::_got_path_directory, ProgramBase::_got_path_store, ProgramBase::_path_replace, ProgramBase::add_option(), ProgramBase::dispatch_filename(), and ProgramBase::dispatch_path_store().

void ProgramBase::add_option const string &  option,
const string &  parm_name,
int  index_group,
const string &  description,
OptionDispatchFunction  option_function,
bool *  bool_var = (bool *)NULL,
void *  option_data = (void *)NULL
[protected, inherited]
 

Adds (or redefines) a command line option.

When parse_command_line() is executed it will look for these options (followed by a hyphen) on the command line; when a particular option is found it will call the indicated option_function, supplying the provided option_data. This allows the user to define a function that does some special behavior for any given option, or to use any of a number of generic pre-defined functions to fill in data for each option.

Each option may or may not take a parameter. If parm_name is nonempty, it is assumed that the option does take a parameter (and parm_name contains the name that will be printed by show_options()). This parameter will be supplied as the second parameter to the dispatch function. If parm_name is empty, it is assumed that the option does not take a parameter. There is no provision for optional parameters.

The options are listed first in order by their index_group number, and then in the order that add_option() was called. This provides a mechanism for listing the options defined in derived classes before those of the base classes.

Definition at line 634 of file programBase.cxx.

References ProgramBase::_path_replace, ProgramBase::add_option(), ProgramBase::dispatch_path_replace(), ProgramBase::dispatch_search_path(), NULL, and PointerTo< PathReplace >::p().

Referenced by SomethingToEgg::add_animation_options(), ProgramBase::add_option(), EggReader::add_texture_options(), SomethingToEgg::add_units_options(), EggMultiBase::EggMultiBase(), EggMultiFilter::EggMultiFilter(), EggReader::EggReader(), EggTextureCards::EggTextureCards(), EggToBam::EggToBam(), EggToC::EggToC(), EggTopstrip(), EggTrans::EggTrans(), FltTrans::FltTrans(), GtkStats::GtkStats(), ImageResize::ImageResize(), and TestProgram::TestProgram().

void ProgramBase::add_path_replace_options  )  [protected, inherited]
 

Adds -pr etc.

as valid options for this program. These are appropriate for a model converter or model reader type program, and specify how to locate possibly-invalid pathnames in the source model file.

Definition at line 771 of file programBase.cxx.

void ProgramBase::add_path_store_options  )  [protected, inherited]
 

Adds -ps etc.

as valid options for this program. These are appropriate for a model converter type program, and specify how to represent filenames in the output file.

Definition at line 818 of file programBase.cxx.

void ProgramBase::add_runline const string &  runline  )  [protected, inherited]
 

Adds an additional line to the list of lines that will be displayed to describe briefly how the program is to be run.

Each line should be something like "[opts] arg1 arg2", that is, it does *not* include the name of the program, but it includes everything that should be printed after the name of the program.

Normally there is only one runline for a given program, but it is possible to define more than one.

Definition at line 552 of file programBase.cxx.

void EggTopstrip::adjust_transform LMatrix4d &  mat  )  const
 

Adjust the transform extracted from the "top" joint according to the -s and -i/-n options, prior to applying it to the skeleton.

Definition at line 336 of file eggTopstrip.cxx.

void EggMultiBase::append_command_comment EggData _data,
const string &  comment
[static, protected, inherited]
 

Inserts a comment into the beginning of the indicated egg file corresponding to the command line that invoked this program.

Normally this function is called automatically when appropriate by EggWriter, and it's not necessary to call it explicitly.

Definition at line 101 of file eggMultiBase.cxx.

void EggMultiBase::append_command_comment EggData _data  )  [protected, inherited]
 

Inserts a comment into the beginning of the indicated egg file corresponding to the command line that invoked this program.

Normally this function is called automatically when appropriate by EggWriter, and it's not necessary to call it explicitly.

Definition at line 76 of file eggMultiBase.cxx.

References EggData::begin(), and EggData::insert().

void EggTopstrip::check_transform_channels  ) 
 

Checks the _transform_channels string to ensure that it contains only the expected nine letters, or a subset.

Definition at line 208 of file eggTopstrip.cxx.

void ProgramBase::clear_options  )  [protected, inherited]
 

Removes all of the options that were previously added, presumably before adding some new ones.

Normally you wouldn't want to do this unless you want to completely replace all of the options defined by base classes.

Definition at line 573 of file programBase.cxx.

References ProgramBase::Option::_bool_var, ProgramBase::Option::_description, ProgramBase::Option::_index_group, ProgramBase::_next_sequence, ProgramBase::Option::_option, ProgramBase::Option::_option_data, ProgramBase::Option::_option_function, ProgramBase::Option::_option_method, ProgramBase::_options_by_name, ProgramBase::Option::_parm_name, ProgramBase::Option::_sequence, ProgramBase::_sorted_options, and NULL.

void ProgramBase::clear_runlines  )  [protected, inherited]
 

Removes all of the runlines that were previously added, presumably before adding some new ones.

Definition at line 523 of file programBase.cxx.

References ProgramBase::Option::_bool_var, ProgramBase::Option::_description, ProgramBase::Option::_index_group, ProgramBase::_next_sequence, ProgramBase::Option::_option, ProgramBase::Option::_option_data, ProgramBase::Option::_option_function, ProgramBase::Option::_option_method, ProgramBase::_options_by_name, ProgramBase::Option::_parm_name, ProgramBase::Option::_sequence, ProgramBase::_sorted_options, and NULL.

bool ProgramBase::dispatch_color const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes a color, either as r,g,b or as r,g,b,a.

The data pointer is to an array of four floats, e.g. a Colorf.

Definition at line 1159 of file programBase.cxx.

References ProgramBase::show_description(), ProgramBase::show_options(), and ProgramBase::show_usage().

Referenced by EggMakeFont::EggMakeFont(), and EggTextureCards::EggTextureCards().

bool ProgramBase::dispatch_coordinate_system const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a coordinate system string.

The data pointer is to a CoordinateSystem variable.

Definition at line 1281 of file programBase.cxx.

Referenced by EggBase::EggBase(), and EggMultiBase::EggMultiBase().

bool ProgramBase::dispatch_count const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes no parameters, but whose presence on the command line increments an integer counter for each time it appears.

-v is often an option that works this way. The data pointer is to an int counter variable.

Definition at line 944 of file programBase.cxx.

References string_to_float(), and tokenize().

Referenced by MayaToEgg::MayaToEgg(), and TestProgram::TestProgram().

bool ProgramBase::dispatch_double const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a double.

The data pointer is to an double variable.

Definition at line 1024 of file programBase.cxx.

References DSearchPath::append_directory(), Filename::from_os_specific(), and nout.

Referenced by SomethingToEgg::add_animation_options(), EggMakeFont::EggMakeFont(), FltTrans::FltTrans(), ImageResize::ImageResize(), and MayaToEgg::MayaToEgg().

bool ProgramBase::dispatch_double_pair const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes a pair of double parameters.

The data pointer is to an array of two doubles.

Definition at line 1049 of file programBase.cxx.

References CoordinateSystem, CS_invalid, nout, and parse_coordinate_system_string().

Referenced by EggTextureCards::EggTextureCards().

bool ProgramBase::dispatch_double_quad const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes a quad of double parameters.

The data pointer is to an array of four doubles.

Definition at line 1120 of file programBase.cxx.

References PathReplace::add_pattern(), nout, and size_t.

Referenced by EggTextureCards::EggTextureCards().

bool ProgramBase::dispatch_double_triple const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes a triple of double parameters.

The data pointer is to an array of three doubles.

Definition at line 1084 of file programBase.cxx.

References PNMFileTypeRegistry::get_ptr(), PNMFileTypeRegistry::get_type_from_extension(), nout, NULL, and PNMFileTypeRegistry::write_types().

Referenced by EggCrop::EggCrop().

bool ProgramBase::dispatch_false const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes no parameters, and when it is present sets a bool variable to the 'false' value.

This is another way to handle a boolean flag. See also dispatch_none() and dispatch_true().

The data pointer is to a bool variable.

Definition at line 921 of file programBase.cxx.

Referenced by EggTopstrip().

bool ProgramBase::dispatch_filename const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a filename.

The data pointer is to a Filename variable.

Definition at line 1223 of file programBase.cxx.

Referenced by ProgramBase::add_option(), CVSCopy::CVSCopy(), EggMakeFont::EggMakeFont(), EggMultiFilter::EggMultiFilter(), EggPalettize::EggPalettize(), EggTopstrip(), and FltTrans::FltTrans().

bool ProgramBase::dispatch_image_type const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to indicate an image file type, like rgb, bmp, jpg, etc.

The data pointer is to a PNMFileType pointer.

Definition at line 1338 of file programBase.cxx.

References ProgramBase::_got_option_indent, ProgramBase::_got_terminal_width, and ProgramBase::_terminal_width.

Referenced by EggReader::add_texture_options().

bool ProgramBase::dispatch_int const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as an integer.

The data pointer is to an int variable.

Definition at line 964 of file programBase.cxx.

Referenced by EggMakeFont::EggMakeFont(), EggToBam::EggToBam(), GtkStats::GtkStats(), TestProgram::TestProgram(), and TextStats::TextStats().

bool ProgramBase::dispatch_int_pair const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes a pair of integer parameters.

The data pointer is to an array of two integers.

Definition at line 989 of file programBase.cxx.

bool ProgramBase::dispatch_none const string &  opt,
const string &  arg,
void * 
[static, protected, inherited]
 

Standard dispatch function for an option that takes no parameters, and does nothing special.

Typically this would be used for a boolean flag, whose presence means something and whose absence means something else. Use the bool_var parameter to add_option() to determine whether the option appears on the command line or not.

Definition at line 869 of file programBase.cxx.

References nout.

Referenced by BamInfo::BamInfo(), CVSCopy::CVSCopy(), EggMakeFont::EggMakeFont(), EggMultiBase::EggMultiBase(), EggMultiFilter::EggMultiFilter(), EggPalettize::EggPalettize(), EggReader::EggReader(), EggTextureCards::EggTextureCards(), EggToBam::EggToBam(), EggToC::EggToC(), EggToX::EggToX(), EggTrans::EggTrans(), FltInfo::FltInfo(), ImageResize::ImageResize(), MayaCopy::MayaCopy(), MayaToEgg::MayaToEgg(), SoftCVS::SoftCVS(), and TestProgram::TestProgram().

bool ProgramBase::dispatch_path_replace const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a single component of a path replace request.

The data pointer is to a PathReplace variable.

Definition at line 1370 of file programBase.cxx.

Referenced by ProgramBase::add_option().

bool ProgramBase::dispatch_path_store const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a path store string.

The data pointer is to a PathStore variable.

Definition at line 1398 of file programBase.cxx.

Referenced by ProgramBase::add_option().

bool ProgramBase::dispatch_search_path const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a single directory name to add to a search path.

The data pointer is to a DSearchPath variable. This kind of option may appear multiple times on the command line; each time, the new directory is appended.

Definition at line 1254 of file programBase.cxx.

Referenced by ProgramBase::add_option().

bool ProgramBase::dispatch_string const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a string.

The data pointer is to a string variable.

Definition at line 1203 of file programBase.cxx.

Referenced by SomethingToEgg::add_units_options(), CVSCopy::CVSCopy(), EggMakeFont::EggMakeFont(), EggPalettize::EggPalettize(), EggTopstrip(), and SoftCVS::SoftCVS().

bool ProgramBase::dispatch_true const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes no parameters, and when it is present sets a bool variable to the 'true' value.

This is another way to handle a boolean flag. See also dispatch_none() and dispatch_false().

The data pointer is to a bool variable.

Definition at line 894 of file programBase.cxx.

References string_to_double().

Referenced by EggTopstrip().

bool ProgramBase::dispatch_units const string &  opt,
const string &  arg,
void *  var
[static, protected, inherited]
 

Standard dispatch function for an option that takes one parameter, which is to be interpreted as a unit of distance measurement.

The data pointer is to a DistanceUnit variable.

Definition at line 1310 of file programBase.cxx.

void ProgramBase::format_text ostream &  out,
bool &  last_newline,
const string &  prefix,
int  indent_width,
const string &  text,
int  line_width
[static, protected, inherited]
 

Word-wraps the indicated text to the indicated output stream.

The first line is prefixed with the indicated prefix, then tabbed over to indent_width where the text actually begins. A newline is inserted at or before column line_width. Each subsequent line begins with indent_width spaces.

An embedded newline character ('
') forces a line break, while an embedded carriage-return character (''), or two or more consecutive newlines, marks a paragraph break, which is usually printed as a blank line. Redundant newline and carriage-return characters are generally ignored.

The flag last_newline should be initialized to false for the first call to format_text, and then preserved for future calls; it tracks the state of trailing newline characters between calls so we can correctly identify doubled newlines.

Definition at line 1479 of file programBase.cxx.

Referenced by ProgramBase::show_options().

string ProgramBase::get_exec_command  )  const [inherited]
 

Returns the command that invoked this program, as a shell-friendly string, suitable for pasting into the comments of output files.

Definition at line 396 of file programBase.cxx.

Filename EggMultiFilter::get_output_filename const Filename source_filename  )  const [protected, inherited]
 

Returns the output filename of the egg file with the given input filename.

This is based on the user's choice of -inplace, -o, or -d.

Definition at line 177 of file eggMultiFilter.cxx.

References EggData::get_egg_filename(), Filename::make_dir(), nout, and EggData::write_egg().

bool EggMultiFilter::handle_args ProgramBase::Args args  )  [protected, virtual, inherited]
 

Does something with the additional arguments on the command line (after all the -options have been parsed).

Returns true if the arguments are good, false otherwise.

Reimplemented from ProgramBase.

Reimplemented in EggPalettize.

Definition at line 82 of file eggMultiFilter.cxx.

References nout.

bool ProgramBase::handle_help_option const string &  opt,
const string &  arg,
void *  data
[static, protected, inherited]
 

Called when the user enters '-h', this describes how to use the program and then exits.

Definition at line 1423 of file programBase.cxx.

EggCharacterCollection * EggCharacterFilter::make_collection  )  [protected, virtual, inherited]
 

Allocates and returns a new EggCharacterCollection structure.

This is primarily intended as a hook so derived classes can customize the type of EggCharacterCollection object used to represent the character information.

Definition at line 127 of file eggCharacterFilter.cxx.

Referenced by EggCharacterFilter::~EggCharacterFilter().

void ProgramBase::parse_command_line int  argc,
char *  argv[]
[virtual, inherited]
 

Dispatches on each of the options on the command line, and passes the remaining parameters to handle_args().

If an error on the command line is detected, will automatically call show_usage() and exit(1).

Reimplemented in GtkBase.

Definition at line 241 of file programBase.cxx.

References ProgramBase::_options_by_name.

Referenced by GtkBase::~GtkBase().

bool EggCharacterFilter::post_command_line  )  [protected, virtual, inherited]
 

This is called after the command line has been completely processed, and it gives the program a chance to do some last-minute processing and validation of the options and arguments.

It should return true if everything is fine, false if there is an error.

Reimplemented from EggMultiFilter.

Definition at line 62 of file eggCharacterFilter.cxx.

References EggCharacterFilter::_collection, and nout.

PointerTo< EggData > EggMultiBase::read_egg const Filename filename  )  [protected, virtual, inherited]
 

Allocates and returns a new EggData structure that represents the indicated egg file.

If the egg file cannot be read for some reason, returns NULL.

This can be overridden by derived classes to control how the egg files are read, or to extend the information stored with each egg structure, by deriving from EggData.

Definition at line 128 of file eggMultiBase.cxx.

bool ProgramBase::redescribe_option const string &  option,
const string &  description
[protected, inherited]
 

Changes the description associated with a previously-defined option.

Returns true if the option was changed, false if it hadn't been defined.

Definition at line 726 of file programBase.cxx.

Referenced by BamToEgg::BamToEgg(), EggToBam::EggToBam(), FltToEgg::FltToEgg(), LwoToEgg::LwoToEgg(), and XFileToEgg::XFileToEgg().

bool ProgramBase::remove_option const string &  option  )  [protected, inherited]
 

Removes a previously-defined option.

Returns true if the option was removed, false if it hadn't existed.

Definition at line 746 of file programBase.cxx.

void EggTopstrip::run void   ) 
 

Definition at line 95 of file eggTopstrip.cxx.

References _channel_filename, EggCharacterFilter::_collection, nout, and NULL.

void ProgramBase::set_program_description const string &  description  )  [protected, inherited]
 

Sets the description of the program that will be reported by show_usage().

The description should be one long string of text. Embedded newline characters are interpreted as paragraph breaks and printed as blank lines.

Definition at line 508 of file programBase.cxx.

Referenced by BamToEgg::BamToEgg(), EggTrans::EggTrans(), FltToEgg::FltToEgg(), FltTrans::FltTrans(), LwoToEgg::LwoToEgg(), and XFileToEgg::XFileToEgg().

void ProgramBase::show_description  )  [inherited]
 

Writes the program description to stderr.

Definition at line 153 of file programBase.cxx.

References ProgramBase::_program_name, ProgramBase::_runlines, Filename::get_basename_wo_extension(), nout, and ProgramBase::show_text().

Referenced by ProgramBase::dispatch_color().

void ProgramBase::show_options  )  [inherited]
 

Describes each of the available options to stderr.

Definition at line 186 of file programBase.cxx.

References ProgramBase::_last_newline, ProgramBase::_terminal_width, ProgramBase::format_text(), and ProgramBase::get_terminal_width().

Referenced by ProgramBase::dispatch_color().

void ProgramBase::show_text const string &  prefix,
int  indent_width,
string  text
[inherited]
 

Formats the indicated text and its prefix for output to stderr with the known _terminal_width.

Definition at line 214 of file programBase.cxx.

References ProgramBase::_program_args, ProgramBase::_program_name, argv, Filename::from_os_specific(), long_options, and options.

void ProgramBase::show_text const string &  text  )  [inline, inherited]
 

Formats the indicated text to stderr with the known _terminal_width.

Definition at line 34 of file programBase.I.

Referenced by ProgramBase::show_description(), ProgramBase::show_usage(), and WordWrapStreamBuf::write_chars().

void ProgramBase::show_usage  )  [inherited]
 

Writes the usage line(s) to stderr.

Definition at line 166 of file programBase.cxx.

References ProgramBase::Option::_description, ProgramBase::_got_option_indent, ProgramBase::Option::_option, ProgramBase::_option_indent, ProgramBase::_options_by_index, ProgramBase::Option::_parm_name, ProgramBase::_terminal_width, ProgramBase::get_terminal_width(), nout, ProgramBase::show_text(), and ProgramBase::sort_options().

Referenced by ProgramBase::dispatch_color().

void EggTopstrip::strip_anim EggJointData joint_data,
int  from_model,
EggJointData top_joint
 

Applies the channels from joint _top_joint in model from_model to the joint referenced by joint_data.

Definition at line 251 of file eggTopstrip.cxx.

References nout, and num_frames.

void EggTopstrip::strip_anim_vertices EggNode egg_node,
int  into_model,
int  from_model,
EggJointData top_joint
 

Applies the channels from joint _top_joint in model from_model to the vertices at egg_node.

Definition at line 307 of file eggTopstrip.cxx.

References EggMultiBase::_coordinate_system, _transform_channels, decompose_matrix(), nout, and size_t.

void EggCharacterFilter::write_eggs  )  [protected, virtual, inherited]
 

Writes out all of the egg files in the _eggs vector, to the output directory if one is specified, or over the input files if -inplace was specified.

Reimplemented from EggMultiFilter.

Definition at line 98 of file eggCharacterFilter.cxx.


Member Data Documentation

bool EggMultiFilter::_allow_empty [protected, inherited]
 

Definition at line 52 of file eggMultiFilter.h.

Filename EggTopstrip::_channel_filename
 

Definition at line 69 of file eggTopstrip.h.

Referenced by run().

EggCharacterCollection* EggCharacterFilter::_collection [protected, inherited]
 

Definition at line 64 of file eggCharacterFilter.h.

Referenced by EggCharacterFilter::EggCharacterFilter(), EggCharacterFilter::post_command_line(), run(), and EggCharacterFilter::~EggCharacterFilter().

CoordinateSystem EggMultiBase::_coordinate_system [protected, inherited]
 

Definition at line 63 of file eggMultiBase.h.

Referenced by strip_anim_vertices().

bool EggMultiBase::_got_coordinate_system [protected, inherited]
 

Definition at line 62 of file eggMultiBase.h.

bool EggTopstrip::_got_invert_transform
 

Definition at line 66 of file eggTopstrip.h.

bool EggMultiFilter::_got_output_dirname [protected, inherited]
 

Definition at line 55 of file eggMultiFilter.h.

Referenced by EggMultiFilter::post_command_line().

bool EggMultiFilter::_got_output_filename [protected, inherited]
 

Definition at line 53 of file eggMultiFilter.h.

bool ProgramBase::_got_path_directory [protected, inherited]
 

Definition at line 125 of file programBase.h.

Referenced by ProgramBase::add_option(), and EggWriter::post_process_egg_file().

bool ProgramBase::_got_path_store [protected, inherited]
 

Definition at line 124 of file programBase.h.

Referenced by ProgramBase::add_option().

bool EggMultiFilter::_inplace [protected, inherited]
 

Definition at line 57 of file eggMultiFilter.h.

Referenced by EggMultiFilter::post_command_line().

bool EggTopstrip::_invert_transform
 

Definition at line 67 of file eggTopstrip.h.

Filename EggMultiFilter::_output_dirname [protected, inherited]
 

Definition at line 56 of file eggMultiFilter.h.

Referenced by EggMultiFilter::post_command_line().

Filename EggMultiFilter::_output_filename [protected, inherited]
 

Definition at line 54 of file eggMultiFilter.h.

Referenced by EggMultiFilter::post_command_line().

PointerTo< PathReplace > ProgramBase::_path_replace [protected, inherited]
 

Definition at line 123 of file programBase.h.

Referenced by ProgramBase::add_option(), and EggWriter::post_process_egg_file().

Args ProgramBase::_program_args [inherited]
 

Definition at line 68 of file programBase.h.

Referenced by ProgramBase::show_text().

Filename ProgramBase::_program_name [inherited]
 

Definition at line 67 of file programBase.h.

Referenced by ProgramBase::show_description(), and ProgramBase::show_text().

string EggTopstrip::_top_joint_name
 

Definition at line 65 of file eggTopstrip.h.

string EggTopstrip::_transform_channels
 

Definition at line 68 of file eggTopstrip.h.

Referenced by strip_anim_vertices().


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