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[]) {