Panda3D
|
This is a base class for both EggSingleBase and EggMultiBase. More...
#include "eggBase.h"
Public Member Functions | |
void | add_normals_options () |
Adds -no, -np, etc. | |
void | add_points_options () |
Adds -points as a valid option for this program. | |
void | add_transform_options () |
Adds -TS, -TT, etc. | |
Static Public Member Functions | |
static void | convert_paths (EggNode *node, PathReplace *path_replace, const DSearchPath &additional_path) |
Recursively walks the egg hierarchy. | |
Protected Types | |
enum | NormalsMode { NM_strip, NM_polygon, NM_vertex, NM_preserve } |
Protected Member Functions | |
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. | |
bool | ns_dispatch_normals (const string &opt, const string &arg, void *mode) |
Accepts one of -no, -np, etc. | |
bool | ns_dispatch_rotate_axis (const string &opt, const string &arg, void *var) |
Handles -TA, which specifies a rotate transform about an arbitrary axis. | |
bool | ns_dispatch_rotate_xyz (const string &opt, const string &arg, void *var) |
Handles -TR, which specifies a rotate transform about the three cardinal axes. | |
Static Protected Member Functions | |
static 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. | |
static bool | dispatch_normals (ProgramBase *self, const string &opt, const string &arg, void *mode) |
Accepts one of -no, -np, etc. | |
static bool | dispatch_rotate_axis (ProgramBase *self, const string &opt, const string &arg, void *var) |
Handles -TA, which specifies a rotate transform about an arbitrary axis. | |
static bool | dispatch_rotate_xyz (ProgramBase *self, const string &opt, const string &arg, void *var) |
Handles -TR, which specifies a rotate transform about the three cardinal axes. | |
static bool | dispatch_scale (const string &opt, const string &arg, void *var) |
Handles -TS, which specifies a scale transform. | |
static bool | dispatch_translate (const string &opt, const string &arg, void *var) |
Handles -TT, which specifies a translate transform. | |
Protected Attributes | |
CoordinateSystem | _coordinate_system |
bool | _got_coordinate_system |
bool | _got_tbnall |
bool | _got_tbnauto |
bool | _got_transform |
bool | _make_points |
bool | _noabs |
NormalsMode | _normals_mode |
double | _normals_threshold |
vector_string | _tbn_names |
LMatrix4d | _transform |
This is a base class for both EggSingleBase and EggMultiBase.
Don't inherit directly from this; use one of those two classes instead.
This is just a base class; see EggReader, EggWriter, or EggFilter according to your particular I/O needs.
void EggBase::add_normals_options | ( | ) |
Adds -no, -np, etc.
as valid options for this program. If the user specifies one of the options on the command line, the normals will be adjusted when the egg file is written out.
Definition at line 63 of file eggBase.cxx.
References ProgramBase::add_option(), ProgramBase::dispatch_none(), dispatch_normals(), and ProgramBase::dispatch_vector_string().
void EggBase::add_points_options | ( | ) |
Adds -points as a valid option for this program.
Definition at line 119 of file eggBase.cxx.
References ProgramBase::add_option(), and ProgramBase::dispatch_none().
void EggBase::add_transform_options | ( | ) |
Adds -TS, -TT, etc.
as valid options for this program. If the user specifies one of the options on the command line, the data will be transformed when the egg file is written out.
Definition at line 135 of file eggBase.cxx.
References ProgramBase::add_option(), dispatch_rotate_axis(), dispatch_rotate_xyz(), dispatch_scale(), and dispatch_translate().
void EggBase::append_command_comment | ( | EggData * | data | ) | [protected] |
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 218 of file eggBase.cxx.
References ProgramBase::get_exec_command().
Referenced by EggMultiFilter::post_command_line(), and EggWriter::post_command_line().
void EggBase::append_command_comment | ( | EggData * | data, |
const string & | comment | ||
) | [static, protected] |
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 234 of file eggBase.cxx.
void EggBase::convert_paths | ( | EggNode * | node, |
PathReplace * | path_replace, | ||
const DSearchPath & | additional_path | ||
) | [static] |
Recursively walks the egg hierarchy.
Any filenames encountered are replaced according to the indicated PathReplace.
Definition at line 170 of file eggBase.cxx.
References PathReplace::full_convert_path(), EggTexture::get_alpha_filename(), EggFilenameNode::get_filename(), EggTexture::has_alpha_filename(), TypedObject::is_of_type(), EggTexture::set_alpha_filename(), EggTexture::set_alpha_fullpath(), and EggFilenameNode::set_fullpath().
Referenced by EggReader::handle_args().
bool EggBase::dispatch_normals | ( | ProgramBase * | self, |
const string & | opt, | ||
const string & | arg, | ||
void * | mode | ||
) | [static, protected] |
Accepts one of -no, -np, etc.
and sets _normals_mode as indicated. The void * argument is a pointer to a NormalsMode variable that indicates which switch was passed.
Definition at line 247 of file eggBase.cxx.
References ns_dispatch_normals().
Referenced by add_normals_options().
bool EggBase::dispatch_rotate_axis | ( | ProgramBase * | self, |
const string & | opt, | ||
const string & | arg, | ||
void * | var | ||
) | [static, protected] |
Handles -TA, which specifies a rotate transform about an arbitrary axis.
Var is an LMatrix4d.
Definition at line 372 of file eggBase.cxx.
References ns_dispatch_rotate_axis().
Referenced by add_transform_options().
bool EggBase::dispatch_rotate_xyz | ( | ProgramBase * | self, |
const string & | opt, | ||
const string & | arg, | ||
void * | var | ||
) | [static, protected] |
Handles -TR, which specifies a rotate transform about the three cardinal axes.
Var is an LMatrix4d.
Definition at line 321 of file eggBase.cxx.
References ns_dispatch_rotate_xyz().
Referenced by add_transform_options().
bool EggBase::dispatch_scale | ( | const string & | opt, |
const string & | arg, | ||
void * | var | ||
) | [static, protected] |
Handles -TS, which specifies a scale transform.
Var is an LMatrix4d.
Definition at line 282 of file eggBase.cxx.
References LMatrix4d::scale_mat().
Referenced by add_transform_options().
bool EggBase::dispatch_translate | ( | const string & | opt, |
const string & | arg, | ||
void * | var | ||
) | [static, protected] |
Handles -TT, which specifies a translate transform.
Var is an LMatrix4d.
Definition at line 420 of file eggBase.cxx.
References LMatrix4d::translate_mat().
Referenced by add_transform_options().
bool EggBase::ns_dispatch_normals | ( | const string & | opt, |
const string & | arg, | ||
void * | mode | ||
) | [protected] |
Accepts one of -no, -np, etc.
and sets _normals_mode as indicated. The void * argument is a pointer to a NormalsMode variable that indicates which switch was passed.
Definition at line 261 of file eggBase.cxx.
Referenced by dispatch_normals().
bool EggBase::ns_dispatch_rotate_axis | ( | const string & | opt, |
const string & | arg, | ||
void * | var | ||
) | [protected] |
Handles -TA, which specifies a rotate transform about an arbitrary axis.
Var is an LMatrix4d.
Definition at line 384 of file eggBase.cxx.
References LMatrix4d::rotate_mat().
Referenced by dispatch_rotate_axis().
bool EggBase::ns_dispatch_rotate_xyz | ( | const string & | opt, |
const string & | arg, | ||
void * | var | ||
) | [protected] |
Handles -TR, which specifies a rotate transform about the three cardinal axes.
Var is an LMatrix4d.
Definition at line 333 of file eggBase.cxx.
References LMatrix4d::rotate_mat().
Referenced by dispatch_rotate_xyz().