00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef _CIvfDxfWriter_h_
00026 #define _CIvfDxfWriter_h_
00027
00028 #include <ivffile/IvfFileWriter.h>
00029 #include <ivfmath/IvfMatrixStack.h>
00030
00031 IvfSmartPointer(CIvfDxfWriter);
00032
00036 class IVFFILE_API CIvfDxfWriter : public CIvfFileWriter {
00037 private:
00038 std::fstream m_file;
00039 CIvfMatrixStackPtr m_matrixStack;
00040 std::string m_currentLayer;
00041 int m_currentColor;
00042 protected:
00043 void processShape(CIvfShape* shape);
00044
00045 void dxfTag(int number, const char* value);
00046 void dxfInt(int number, int value);
00047 void dxfFloat(int number, double value);
00048 void dxfBeginSection(const char* value);
00049 void dxfEndSection();
00050 void dxfBeginTables();
00051 void dxfEndTables();
00052 void dxfBeginTable(const char* value);
00053 void dxfEndTable();
00054 void dxfBeginLayer();
00055 void dxfEndLayer();
00056 void dxfBeginEntitites();
00057 void dxfEndEntitites();
00058 void dxfColor(int number);
00059 void dxfLineType(const char* name);
00060 void dxfLine();
00061 void dxfLayer(const char* value);
00062 void dxfFirstPoint(double x, double y, double z);
00063 void dxfSecondPoint(double x, double y, double z);
00064 void dxfThirdPoint(double x, double y, double z);
00065 void dxfFourthPoint(double x, double y, double z);
00066 void dxfPolyline();
00067 void dxfPolylineIntro();
00068 void dxfPolylineFlag(int flag);
00069 void dxfVertex();
00070 void dxfEndSeq();
00071 void dxfSolid();
00072 void dxfEndOfFile();
00073 void dxf3DFace();
00074
00075 void quad(
00076 double x1, double y1, double z1,
00077 double x2, double y2, double z2,
00078 double x3, double y3, double z3,
00079 double x4, double y4, double z4
00080 );
00081
00082 void tri(
00083 double x1, double y1, double z1,
00084 double x2, double y2, double z2,
00085 double x3, double y3, double z3
00086 );
00087
00088 void pushMatrix();
00089 void translate(double dx, double dy, double dz);
00090 void rotate(double vx, double vy, double vz, double theta);
00091 void popMatrix();
00092
00093 void transform(double &x, double &y, double &z);
00094
00095 void setCurrentLayer(const char* layerName);
00096 void setCurrentColor(int color);
00097 public:
00098 CIvfDxfWriter();
00099 virtual ~CIvfDxfWriter();
00100
00101 void write();
00102
00103 IvfClassInfo("CIvfDxfWriter",CIvfFileWriter);
00104 };
00105
00106 #endif