From fdeb7dfec83c185d1c7b63dd398fc8213ecfcb0d Mon Sep 17 00:00:00 2001 From: David Rose Date: Wed, 25 Apr 2001 00:37:54 +0000 Subject: [PATCH] *** empty log message *** --- pandatool/src/eggbase/eggWriter.cxx | 4 ++-- pandatool/src/eggbase/somethingToEgg.cxx | 20 +++++++++++++++----- pandatool/src/eggbase/somethingToEgg.h | 2 ++ pandatool/src/fltprogs/fltToEgg.cxx | 2 ++ 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/pandatool/src/eggbase/eggWriter.cxx b/pandatool/src/eggbase/eggWriter.cxx index 1580e2f78a..fe1a10af04 100644 --- a/pandatool/src/eggbase/eggWriter.cxx +++ b/pandatool/src/eggbase/eggWriter.cxx @@ -89,7 +89,7 @@ EggWriter(bool allow_last_param, bool allow_stdout) : //////////////////////////////////////////////////////////////////// -// Function: EggWriter::add_normals_options(); +// Function: EggWriter::add_normals_options // Access: Public // Description: Adds -no, -np, etc. as valid options for this // program. If the user specifies one of the options on @@ -127,7 +127,7 @@ add_normals_options() { } //////////////////////////////////////////////////////////////////// -// Function: EggWriter::add_transform_options(); +// Function: EggWriter::add_transform_options // Access: Public // Description: Adds -TS, -TT, etc. as valid options for this // program. If the user specifies one of the options on diff --git a/pandatool/src/eggbase/somethingToEgg.cxx b/pandatool/src/eggbase/somethingToEgg.cxx index 1d7701abdc..f8e49af753 100644 --- a/pandatool/src/eggbase/somethingToEgg.cxx +++ b/pandatool/src/eggbase/somethingToEgg.cxx @@ -36,6 +36,21 @@ SomethingToEgg(const string &format_name, "Specify the coordinate system of the input " + _format_name + " file. Normally, this can inferred from the file itself."); + _input_units = DU_invalid; + _output_units = DU_invalid; +} + +//////////////////////////////////////////////////////////////////// +// Function: SomethingToEgg::add_units_options +// Access: Public +// Description: Adds -ui and -uo as valid options for this program. +// If the user specifies -uo and -ui, or just -uo and +// the program specifies -ui by setting _input_units, +// the indicated units conversion will be automatically +// applied before writing out the egg file. +//////////////////////////////////////////////////////////////////// +void SomethingToEgg:: +add_units_options() { add_option ("ui", "units", 40, "Specify the units of the input " + _format_name + @@ -49,11 +64,6 @@ SomethingToEgg(const string &format_name, "necessary to make the appropriate units conversion; otherwise, " "the vertices will be left as they are.", &SomethingToEgg::dispatch_units, NULL, &_output_units); - - _input_units = DU_invalid; - _output_units = DU_invalid; - - add_transform_options(); } //////////////////////////////////////////////////////////////////// diff --git a/pandatool/src/eggbase/somethingToEgg.h b/pandatool/src/eggbase/somethingToEgg.h index 715d0d8792..44f9c95232 100644 --- a/pandatool/src/eggbase/somethingToEgg.h +++ b/pandatool/src/eggbase/somethingToEgg.h @@ -26,6 +26,8 @@ public: bool allow_last_param = true, bool allow_stdout = true); + void add_units_options(); + protected: void apply_units_scale(EggData &data); diff --git a/pandatool/src/fltprogs/fltToEgg.cxx b/pandatool/src/fltprogs/fltToEgg.cxx index 5a17ffe4bf..0cb5a72057 100644 --- a/pandatool/src/fltprogs/fltToEgg.cxx +++ b/pandatool/src/fltprogs/fltToEgg.cxx @@ -16,7 +16,9 @@ FltToEgg:: FltToEgg() : SomethingToEgg("MultiGen", ".flt") { + add_units_options(); add_normals_options(); + add_transform_options(); set_program_description ("This program converts MultiGen OpenFlight (.flt) files to egg. Most "