Panda3D
eggToDXFLayer.h
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 eggToDXFLayer.h
10  * @author drose
11  * @date 2004-05-04
12  */
13 
14 #ifndef EGGTODXFLAYER_H
15 #define EGGTODXFLAYER_H
16 
17 #include "pandatoolbase.h"
18 #include "pmap.h"
19 #include "pvector.h"
20 #include "luse.h"
21 
22 class EggToDXF;
23 class EggPolygon;
24 class EggGroupNode;
25 
26 /**
27  * A single layer in the DXF file to be written by EggToDXF.
28  */
30 public:
31  EggToDXFLayer(EggToDXF *egg2dxf, EggGroupNode *group);
32  EggToDXFLayer(const EggToDXFLayer &copy);
33  void operator = (const EggToDXFLayer &copy);
34 
35  void add_color(const LColor &color);
36  void choose_overall_color();
37 
38  void write_layer(std::ostream &out);
39  void write_polyline(EggPolygon *poly, std::ostream &out);
40  void write_3d_face(EggPolygon *poly, std::ostream &out);
41  void write_entities(std::ostream &out);
42 
43 private:
44  int get_autocad_color(const LColor &color);
45 
47  ColorCounts _color_counts;
48 
49  EggToDXF *_egg2dxf;
50  EggGroupNode *_group;
51  int _layer_color;
52 };
53 
55 
56 #endif
void write_3d_face(EggPolygon *poly, std::ostream &out)
Writes a polygon as a 3DFACE entity.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:46
void write_polyline(EggPolygon *poly, std::ostream &out)
Writes a polygon as a POLYLINE entity.
void write_layer(std::ostream &out)
Writes the layer definition into the table at the beginning of the DXF file.
A single polygon.
Definition: eggPolygon.h:24
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void choose_overall_color()
After all polygons have been accounted for, chooses the polygon color that occurred most often as the...
A program to read an egg file and write a DXF file.
Definition: eggToDXF.h:27
void write_entities(std::ostream &out)
Writes out the "entities", e.g.
A single layer in the DXF file to be written by EggToDXF.
Definition: eggToDXFLayer.h:29
void add_color(const LColor &color)
Records that one polygon is defined using the indicated color.