Output.h
1 /**************************************************************************\
2  *
3  * FILE: Output.h
4  *
5  * This source file is part of DIME.
6  * Copyright (C) 1998-1999 by Systems In Motion. All rights reserved.
7  *
8  * This library is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License, version 2, as
10  * published by the Free Software Foundation.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License (the accompanying file named COPYING) for more
16  * details.
17  *
18  **************************************************************************
19  *
20  * If you need DIME for a non-GPL project, contact Systems In Motion
21  * to acquire a Professional Edition License:
22  *
23  * Systems In Motion http://www.sim.no/
24  * Prof. Brochs gate 6 sales@sim.no
25  * N-7030 Trondheim Voice: +47 22114160
26  * NORWAY Fax: +47 67172912
27  *
28 \**************************************************************************/
29 
30 #ifndef DIME_OUTPUT_H
31 #define DIME_OUTPUT_H
32 
33 #include <dime/Basic.h>
34 #include <stdio.h>
35 
36 class dimeModel;
37 
38 class DIME_DLL_API dimeOutput
39 {
40 public:
41  dimeOutput();
42  ~dimeOutput();
43 
44  void setCallback(const int numrecords,
45  int (*cb)(float, void *), void *cbdata);
46  bool setFileHandle(FILE *fp);
47  bool setFilename(const char * const filename);
48  void setBinary(const bool state = true);
49  bool isBinary() const;
50 
51  bool writeHeader() {return true;}
52  bool writeGroupCode(const int groupcode);
53  bool writeInt8(const int8 val);
54  bool writeInt16(const int16 val);
55  bool writeInt32(const int32 val);
56  bool writeFloat(const float val);
57  bool writeDouble(const dxfdouble val);
58  bool writeString(const char * const str);
59 
60  int getUniqueHandleId();
61 
62 private:
63  friend class dimeModel;
64  dimeModel *model;
65  FILE *fp;
66  bool binary;
67 
68  int (*callback)(float, void*);
69  void *callbackdata;
70  int numrecords;
71  int numwrites;
72  bool aborted;
73  bool didOpenFile;
74 
75 }; // class dimeOutput
76 
77 #endif // ! DIME_OUTPUT_H
78 

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