convert.h
1 /**************************************************************************\
2  *
3  * This source file is part of DIME.
4  * Copyright (C) 1998-2001 by Systems In Motion. All rights reserved.
5  *
6  * This library is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License, version 2, as
8  * published by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * General Public License (the accompanying file named COPYING) for more
14  * details.
15  *
16  **************************************************************************
17  *
18  * If you need DIME for a non-GPL project, contact Systems In Motion
19  * to acquire a Professional Edition License:
20  *
21  * Systems In Motion http://www.sim.no/
22  * Prof. Brochs gate 6 sales@sim.no
23  * N-7030 Trondheim Voice: +47 22114160
24  * NORWAY Fax: +47 22207097
25  *
26 \**************************************************************************/
27 
28 #ifndef _DXF2VRML_CONVERT_H_
29 #define _DXF2VRML_CONVERT_H_
30 
31 #include <stdio.h>
32 #include <dime/Basic.h>
33 
34 class dimeModel;
35 class dxfLayerData;
36 class dimeState;
37 class dimeEntity;
38 
39 class DIME_DLL_API dxfConverter
40 {
41 public:
42  dxfConverter();
43  ~dxfConverter();
44 
45  void setMaxerr(const dxfdouble maxerr) {
46  this->maxerr = maxerr;
47  }
48  void findHeaderVariables(dimeModel &model);
49  bool doConvert(dimeModel &model);
50  bool writeVrml(FILE *out, const bool vrml1 = false,
51  const bool only2d = false);
52 
53  void setNumSub(const int num) {
54  this->numsub = num;
55  }
56  int getNumSub() const {
57  return numsub;
58  }
59  dxfdouble getMaxerr() const {
60  return this->maxerr;
61  }
62 
63  void setFillmode(const bool fill) {
64  this->fillmode = fill;
65  }
66  bool getFillmode() const {
67  return this->fillmode;
68  }
69 
70  bool getLayercol() const {
71  return this->layercol;
72  }
73 
74  void setLayercol(const bool v) {
75  this->layercol = v;
76  }
77 
78  dxfLayerData *getLayerData(const int colidx);
79  dxfLayerData *getLayerData(const dimeEntity *entity);
80  dxfLayerData ** getLayerData();
81  int getColorIndex(const dimeEntity *entity);
83  return currentInsertColorIndex;
84  }
85 
86 private:
87  friend class dime2Profit;
88  friend class dime2So;
89 
90  dxfLayerData *layerData[255];
91  int dummy[4];
92  dxfdouble maxerr;
93  int currentInsertColorIndex;
94  dimeEntity *currentPolyline;
95  int numsub;
96  bool fillmode;
97  bool layercol;
98 
99  bool private_callback(const dimeState * const state,
100  dimeEntity *entity);
101  static bool dime_callback(const dimeState * const state,
102  dimeEntity *entity, void *);
103 
104 };
105 
106 #endif // _DXF2VRML_CONVERT_H_

Copyright © 1998-1999, Systems In Motion <sales@sim.no>. All rights reserved.
System documentation was generated using doxygen.