25 set_binary_output(
true);
26 set_program_brief(
"convert .egg files to AutoCAD .dxf files");
27 set_program_description
28 (
"This program converts files from egg format to AutoCAD DXF format. "
29 "Since DXF does not support nested hierarchies, vertex normals, or any "
30 "fancy stuff you are probably used to, there is some information lost "
35 "Use POLYLINE to represent polygons instead of the default, 3DFACE.",
36 &EggToDXF::dispatch_none, &_use_polyline);
38 _coordinate_system = CS_zup_right;
39 _got_coordinate_system =
true;
48 if (_layers.empty()) {
49 nout <<
"Egg file contains no polygons. Output file not written.\n";
68 nout <<
"An error occurred while writing.\n";
79 bool has_polys =
false;
83 EggGroupNode::iterator ci;
84 for (ci = group->begin(); ci != group->end(); ++ci) {
86 if (child->
is_of_type(EggPolygon::get_class_type())) {
92 }
else if (child->
is_of_type(EggGroupNode::get_class_type())) {
98 layer.choose_overall_color();
99 _layers.push_back(layer);
110 write_tables(std::ostream &out) {
111 out <<
"0\nSECTION\n"
115 <<
"70\n" << _layers.size() <<
"\n";
117 EggToDXFLayers::iterator li;
118 for (li = _layers.begin(); li != _layers.end(); ++li) {
119 (*li).write_layer(out);
130 write_entities(std::ostream &out) {
131 out <<
"0\nSECTION\n"
134 EggToDXFLayers::iterator li;
135 for (li = _layers.begin(); li != _layers.end(); ++li) {
136 (*li).write_entities(out);
139 out <<
"0\nENDSEC\n";
144 int main(
int argc,
char *argv[]) {
LColor get_color() const
Returns the color set on this particular attribute.
A base class for nodes in the hierarchy that are not leaf nodes.
A base class for things that may be directly added into the egg hierarchy.
A single layer in the DXF file to be written by EggToDXF.
A program to read an egg file and write a DXF file.
This is the general base class for a file-converter program that reads some model file format and gen...
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_...
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
std::ostream & get_output()
Returns an output stream that corresponds to the user's intended egg file output–either stdout,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.