Panda3D
 All Classes Functions Variables Enumerations
eggToDXFLayer.h
1 // Filename: eggToDXFLayer.h
2 // Created by: drose (04May04)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef EGGTODXFLAYER_H
16 #define EGGTODXFLAYER_H
17 
18 #include "pandatoolbase.h"
19 #include "pmap.h"
20 #include "pvector.h"
21 #include "luse.h"
22 
23 class EggToDXF;
24 class EggPolygon;
25 class EggGroupNode;
26 
27 ////////////////////////////////////////////////////////////////////
28 // Class : EggToDXFLayer
29 // Description : A single layer in the DXF file to be written by
30 // EggToDXF.
31 ////////////////////////////////////////////////////////////////////
33 public:
34  EggToDXFLayer(EggToDXF *egg2dxf, EggGroupNode *group);
35  EggToDXFLayer(const EggToDXFLayer &copy);
36  void operator = (const EggToDXFLayer &copy);
37 
38  void add_color(const LColor &color);
39  void choose_overall_color();
40 
41  void write_layer(ostream &out);
42  void write_polyline(EggPolygon *poly, ostream &out);
43  void write_3d_face(EggPolygon *poly, ostream &out);
44  void write_entities(ostream &out);
45 
46 private:
47  int get_autocad_color(const LColor &color);
48 
50  ColorCounts _color_counts;
51 
52  EggToDXF *_egg2dxf;
53  EggGroupNode *_group;
54  int _layer_color;
55 };
56 
58 
59 #endif
void write_3d_face(EggPolygon *poly, ostream &out)
Writes a polygon as a 3DFACE entity.
void write_polyline(EggPolygon *poly, ostream &out)
Writes a polygon as a POLYLINE entity.
A base class for nodes in the hierarchy that are not leaf nodes.
Definition: eggGroupNode.h:51
void write_layer(ostream &out)
Writes the layer definition into the table at the beginning of the DXF file.
void write_entities(ostream &out)
Writes out the "entities", e.g.
A single polygon.
Definition: eggPolygon.h:26
This is the base class for all three-component vectors and points.
Definition: lvecBase4.h:111
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:29
A single layer in the DXF file to be written by EggToDXF.
Definition: eggToDXFLayer.h:32
void add_color(const LColor &color)
Records that one polygon is defined using the indicated color.