Panda3D
eggFilter.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file eggFilter.cxx
10  * @author drose
11  * @date 2000-02-14
12  */
13 
14 #include "eggFilter.h"
15 
16 /**
17  *
18  */
19 EggFilter::
20 EggFilter(bool allow_last_param, bool allow_stdout) :
21  EggWriter(allow_last_param, allow_stdout)
22 {
23  // The default path store for programs that read egg files and write them
24  // again is PS_relative.
25  _path_replace->_path_store = PS_relative;
26 
27  clear_runlines();
28  if (allow_last_param) {
29  add_runline("[opts] input.egg output.egg");
30  }
31  add_runline("[opts] -o output.egg input.egg");
32  if (allow_stdout) {
33  add_runline("[opts] input.egg >output.egg");
34  }
35 
36  redescribe_option
37  ("cs",
38  "Specify the coordinate system of the resulting egg file. This may be "
39  "one of 'y-up', 'z-up', 'y-up-left', or 'z-up-left'. The default "
40  "is the same coordinate system as the input egg file. If this is "
41  "different from the input egg file, a conversion will be performed.");
42 }
43 
44 
45 /**
46  * Does something with the additional arguments on the command line (after all
47  * the -options have been parsed). Returns true if the arguments are good,
48  * false otherwise.
49  */
50 bool EggFilter::
51 handle_args(ProgramBase::Args &args) {
52  if (!check_last_arg(args, 1)) {
53  return false;
54  }
55 
56  if (!_got_path_directory && _got_output_filename) {
57  // Put in the name of the output directory.
58  _path_replace->_path_directory = _output_filename.get_dirname();
59  }
60 
61  return EggReader::handle_args(args);
62 }
63 
64 /**
65  *
66  */
67 bool EggFilter::
68 post_command_line() {
69  // writer first, so we can fiddle with the _path_replace options if
70  // necessary.
71  return EggWriter::post_command_line() && EggReader::post_command_line();
72 }
This is the base class for a program that generates an egg file output, but doesn't read any for inpu...
Definition: eggWriter.h:28
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.