Logo Search packages:      
Sourcecode: sailcut version File versions  Download package

sailwriter-dxf.h

/*
 * Copyright (C) 1993-2005 Robert & Jeremy Lainé
 * See AUTHORS file for a full list of contributors.
 *
 * $Id: sailwriter-dxf.h,v 1.6 2005/11/17 21:18:35 sailcuter Exp $
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

#ifndef SAILWRITER_DXF_H
#define SAILWRITER_DXF_H

#include "filewriter.h"
#include "sail.h"
#include <iostream>
#include <fstream>

/** An abstract class containing the methods needed for DXF writing.
 */
00032 class CSailDxfWriter : public CFileWriter
{
protected:
    /** the sail to write */
00036     CSail _sail;
    /** the output stream */
00038     ofstream _out;

public:
    /** The constructor.
     *
     * @param sail the sail to write
     */
00045     CSailDxfWriter(const CSail &sail)
            : CFileWriter(sail.sailID, ".dxf", "DXF files"), _sail(sail)
    {}
    ;

    /** the destructor.
     */
00052     ~CSailDxfWriter()
    {}
    ;

    void writeAtom(int code, const QString& content);
    void writeFace(CPoint3d p0, CPoint3d p1, CPoint3d p2, unsigned int layer);
    void writePolyline( unsigned int layer, unsigned int color);
    void writeVertex(CPoint3d p0, unsigned int layer);

};


/** A class used to write a CSail to a simple 2D DXF file.
 */
00066 class CSailDxfWriter2d : public CSailDxfWriter
{
public:
    /** The constructor.
     *
     * @param sail the sail to write
     */
00073     CSailDxfWriter2d(const CSail &sail)
            : CSailDxfWriter(sail)
    {}
    ;

    void write(const QString &filename);
    void writePanel(unsigned int panel);
};


/** A class used to write a CSail to a 2D DXF file with one block per panel.
 */
00085 class CSailDxfWriter2dBlocks : public CSailDxfWriter2d
{
public:
    /** The constructor.
     *
     * @param sail the sail to write
     */
00092     CSailDxfWriter2dBlocks(const CSail &sail)
            : CSailDxfWriter2d(sail)
    {}
    ;

    void write(const QString &filename);
};



/** A class used to write a CSail to a 3D DXF file.
 */
00104 class CSailDxfWriter3d : public CSailDxfWriter
{
public:
    /** The constructor.
     *
     * @param sail the sail to write
     */
00111     CSailDxfWriter3d(const CSail &sail)
            : CSailDxfWriter(sail)
    {}
    ;

    void write(const QString &filename);
    void writePanel(unsigned int panel);
};


#endif

Generated by  Doxygen 1.6.0   Back to index