source: git/trunk/src/exportfilter.h @ 7bb8184

Last change on this file since 7bb8184 was 7bb8184, checked in by Olly Betts <olly@…>, 13 years ago

Retagging 1.2.0

git-svn-id: file:///home/survex-svn/survex/tags/1.2.0@3664 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/* exportfilter.h
2 * Export to CAD-like formats (DXF, Sketch, SVG, EPS, HPGL) and also Compass
3 * PLT.
4 */
5
6/* Copyright (C) 2005 Olly Betts
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
21 */
22
23#ifndef SURVEX_EXPORTFILTER_H
24#define SURVEX_EXPORTFILTER_H
25
26#include <stdio.h>
27
28#include "img.h"
29
30class ExportFilter {
31  protected:
32    FILE * fh;
33  public:
34    ExportFilter() : fh(NULL) { }
35    // FIXME: deal with errors closing file... (safe_fclose?)
36    virtual ~ExportFilter() { if (fh) fclose(fh); }
37    virtual const int * passes() const;
38    virtual bool fopen(const char *fnm_out) {
39        fh = ::fopen(fnm_out, "wb");
40        return (fh != NULL);
41    }
42    virtual void header(const char *) { }
43    virtual void start_pass(int) { }
44    virtual void line(const img_point *, const img_point *, bool, bool) = 0;
45    virtual void label(const img_point *, const char *, bool) = 0;
46    virtual void cross(const img_point *, bool) { }
47    virtual void footer() { }
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.