Panda3D
 All Classes Functions Variables Enumerations
eggToDXFLayer.h
00001 // Filename: eggToDXFLayer.h
00002 // Created by:  drose (04May04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef EGGTODXFLAYER_H
00016 #define EGGTODXFLAYER_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "pmap.h"
00020 #include "pvector.h"
00021 #include "luse.h"
00022 
00023 class EggToDXF;
00024 class EggPolygon;
00025 class EggGroupNode;
00026 
00027 ////////////////////////////////////////////////////////////////////
00028 //       Class : EggToDXFLayer
00029 // Description : A single layer in the DXF file to be written by
00030 //               EggToDXF.
00031 ////////////////////////////////////////////////////////////////////
00032 class EggToDXFLayer {
00033 public:
00034   EggToDXFLayer(EggToDXF *egg2dxf, EggGroupNode *group);
00035   EggToDXFLayer(const EggToDXFLayer &copy);
00036   void operator = (const EggToDXFLayer &copy);
00037 
00038   void add_color(const LColor &color);
00039   void choose_overall_color();
00040 
00041   void write_layer(ostream &out);
00042   void write_polyline(EggPolygon *poly, ostream &out);
00043   void write_3d_face(EggPolygon *poly, ostream &out);
00044   void write_entities(ostream &out);
00045 
00046 private:
00047   int get_autocad_color(const LColor &color);
00048 
00049   typedef pmap<int, int> ColorCounts;
00050   ColorCounts _color_counts;
00051 
00052   EggToDXF *_egg2dxf;
00053   EggGroupNode *_group;
00054   int _layer_color;
00055 };
00056 
00057 typedef pvector<EggToDXFLayer> EggToDXFLayers;
00058 
00059 #endif
 All Classes Functions Variables Enumerations