00001 /**************************************************************************\ 00002 * 00003 * This source file is part of DIME. 00004 * Copyright (C) 1998-2001 by Systems In Motion. All rights reserved. 00005 * 00006 * This library is free software; you can redistribute it and/or modify it 00007 * under the terms of the GNU General Public License, version 2, as 00008 * published by the Free Software Foundation. 00009 * 00010 * This library is distributed in the hope that it will be useful, but 00011 * WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * General Public License (the accompanying file named COPYING) for more 00014 * details. 00015 * 00016 ************************************************************************** 00017 * 00018 * If you need DIME for a non-GPL project, contact Systems In Motion 00019 * to acquire a Professional Edition License: 00020 * 00021 * Systems In Motion http://www.sim.no/ 00022 * Prof. Brochs gate 6 sales@sim.no 00023 * N-7030 Trondheim Voice: +47 22114160 00024 * NORWAY Fax: +47 22207097 00025 * 00026 \**************************************************************************/ 00027 00028 #ifndef _DXF2VRML_CONVERT_H_ 00029 #define _DXF2VRML_CONVERT_H_ 00030 00031 #include <stdio.h> 00032 #include <dime/Basic.h> 00033 00034 class dimeModel; 00035 class dxfLayerData; 00036 class dimeState; 00037 class dimeEntity; 00038 00039 class dxfConverter 00040 { 00041 public: 00042 dxfConverter(); 00043 ~dxfConverter(); 00044 00045 void setMaxerr(const dxfdouble maxerr) { 00046 this->maxerr = maxerr; 00047 } 00048 void findHeaderVariables(dimeModel &model); 00049 bool doConvert(dimeModel &model); 00050 bool writeVrml(FILE *out, const bool vrml1 = false); 00051 00052 void setNumSub(const int num) { 00053 this->numsub = num; 00054 } 00055 int getNumSub() const { 00056 return numsub; 00057 } 00058 dxfdouble getMaxerr() const { 00059 return this->maxerr; 00060 } 00061 00062 void setFillmode(const bool fill) { 00063 this->fillmode = fill; 00064 } 00065 bool getFillmode() const { 00066 return this->fillmode; 00067 } 00068 00069 bool getLayercol() const { 00070 return this->layercol; 00071 } 00072 00073 void setLayercol(const bool v) { 00074 this->layercol = v; 00075 } 00076 00077 dxfLayerData *getLayerData(const int colidx); 00078 dxfLayerData *getLayerData(const dimeEntity *entity); 00079 dxfLayerData ** getLayerData(); 00080 int getColorIndex(const dimeEntity *entity); 00081 int getCurrentInsertColorIndex() const { 00082 return currentInsertColorIndex; 00083 } 00084 00085 private: 00086 friend class dime2Profit; 00087 friend class dime2So; 00088 00089 dxfLayerData *layerData[255]; 00090 int dummy[4]; 00091 dxfdouble maxerr; 00092 int currentInsertColorIndex; 00093 dimeEntity *currentPolyline; 00094 int numsub; 00095 bool fillmode; 00096 bool layercol; 00097 00098 bool private_callback(const dimeState * const state, 00099 dimeEntity *entity); 00100 static bool dime_callback(const dimeState * const state, 00101 dimeEntity *entity, void *); 00102 00103 }; 00104 00105 #endif // _DXF2VRML_CONVERT_H_