Draft: add gitattributes file to let git manage file endings and normalize them

This commit is contained in:
Bernd Hahnebach
2019-12-17 23:37:03 +01:00
parent 789e24cead
commit 8e09ea8a32
10 changed files with 619 additions and 591 deletions

28
src/Mod/Draft/.gitattributes vendored Normal file
View File

@@ -0,0 +1,28 @@
# for more information see forum topic and pull request
# https://github.com/FreeCAD/FreeCAD/pull/2752
# https://forum.freecadweb.org/viewtopic.php?f=17&t=41117
# get all used file types
# in a directory in a bash use
# find . -type f -name '*.*' | sed 's|.*\.||' | sort -u
# add all of them either to text or binary
# Explicitly declare which files we wish to always normalize line-endings on
# standard endings
*.cpp text
*.csv text
*.dox text
*.h text
*.py text
*.qrc text
*.sh text
*.ts text
*.txt text
*.ui text
*.yml text
# use git to manually correct the file endings
# git add --renormalize .

View File

@@ -1,51 +1,51 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
namespace DraftUtils {
extern PyObject* initModule();
}
/* Python entry */
PyMOD_INIT_FUNC(DraftUtils)
{
// load dependent module
try {
Base::Interpreter().loadModule("Part");
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
}
PyObject* mod = DraftUtils::initModule();
Base::Console().Log("Loading DraftUtils module... done\n");
PyMOD_Return(mod);
}
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <Base/Console.h>
#include <Base/PyObjectBase.h>
#include <Base/Interpreter.h>
namespace DraftUtils {
extern PyObject* initModule();
}
/* Python entry */
PyMOD_INIT_FUNC(DraftUtils)
{
// load dependent module
try {
Base::Interpreter().loadModule("Part");
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
}
PyObject* mod = DraftUtils::initModule();
Base::Console().Log("Loading DraftUtils module... done\n");
PyMOD_Return(mod);
}

View File

@@ -1,100 +1,100 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
#include <Base/Console.h>
#include <Base/VectorPy.h>
#include <Base/FileInfo.h>
#include <Base/Interpreter.h>
#include <App/Document.h>
#include <App/DocumentObjectPy.h>
#include <App/Application.h>
#include "DraftDxf.h"
namespace DraftUtils {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("DraftUtils")
{
add_varargs_method("readDXF",&Module::readDXF,
"readDXF(filename,[document,ignore_errors]): Imports a DXF file into the given document. ignore_errors is True by default."
);
initialize("The DraftUtils module contains utility functions for the Draft module."); // register with Python
}
virtual ~Module() {}
private:
Py::Object readDXF(const Py::Tuple& args)
{
Base::Console().Warning("DraftUtils.readDXF is deprecated. Use Import.readDxf instead.\n");
char* Name;
const char* DocName=0;
bool IgnoreErrors=true;
if (!PyArg_ParseTuple(args.ptr(), "et|sb","utf-8",&Name,&DocName,&IgnoreErrors))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
Base::FileInfo file(EncodedName.c_str());
if (!file.exists())
throw Py::RuntimeError("File doesn't exist");
App::Document *pcDoc;
if (DocName)
pcDoc = App::GetApplication().getDocument(DocName);
else
pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument(DocName);
try {
// read the DXF file
DraftDxfRead dxf_file(EncodedName,pcDoc);
dxf_file.DoRead(IgnoreErrors);
pcDoc->recompute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace DraftUtils
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
#ifndef _PreComp_
# include <Python.h>
#endif
#include <CXX/Extensions.hxx>
#include <CXX/Objects.hxx>
#include <Base/Console.h>
#include <Base/VectorPy.h>
#include <Base/FileInfo.h>
#include <Base/Interpreter.h>
#include <App/Document.h>
#include <App/DocumentObjectPy.h>
#include <App/Application.h>
#include "DraftDxf.h"
namespace DraftUtils {
class Module : public Py::ExtensionModule<Module>
{
public:
Module() : Py::ExtensionModule<Module>("DraftUtils")
{
add_varargs_method("readDXF",&Module::readDXF,
"readDXF(filename,[document,ignore_errors]): Imports a DXF file into the given document. ignore_errors is True by default."
);
initialize("The DraftUtils module contains utility functions for the Draft module."); // register with Python
}
virtual ~Module() {}
private:
Py::Object readDXF(const Py::Tuple& args)
{
Base::Console().Warning("DraftUtils.readDXF is deprecated. Use Import.readDxf instead.\n");
char* Name;
const char* DocName=0;
bool IgnoreErrors=true;
if (!PyArg_ParseTuple(args.ptr(), "et|sb","utf-8",&Name,&DocName,&IgnoreErrors))
throw Py::Exception();
std::string EncodedName = std::string(Name);
PyMem_Free(Name);
Base::FileInfo file(EncodedName.c_str());
if (!file.exists())
throw Py::RuntimeError("File doesn't exist");
App::Document *pcDoc;
if (DocName)
pcDoc = App::GetApplication().getDocument(DocName);
else
pcDoc = App::GetApplication().getActiveDocument();
if (!pcDoc)
pcDoc = App::GetApplication().newDocument(DocName);
try {
// read the DXF file
DraftDxfRead dxf_file(EncodedName,pcDoc);
dxf_file.DoRead(IgnoreErrors);
pcDoc->recompute();
}
catch (const Base::Exception& e) {
throw Py::RuntimeError(e.what());
}
return Py::None();
}
};
PyObject* initModule()
{
return (new Module)->module().ptr();
}
} // namespace DraftUtils

View File

@@ -26,7 +26,7 @@
#include "dxf.h"
#include <Mod/Part/App/TopoShape.h>
#include <App/Document.h>
#include <gp_Pnt.hxx>
#include <gp_Pnt.hxx>
namespace DraftUtils
{

View File

@@ -1,24 +1,24 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#include "PreCompiled.h"

View File

@@ -1,62 +1,62 @@
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAFTUTILS_PRECOMPILED_H
#define DRAFTUTILS_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define DraftUtilsExport __declspec(dllexport)
# define PartExport __declspec(dllexport)
# define BaseExport __declspec(dllimport)
#else // for Linux
# define DraftUtilsExport
# define PartExport
# define BaseExport
#endif
#ifdef _MSC_VER
# pragma warning(disable : 4275)
#endif
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <cctype>
#include <Python.h>
#endif // _PreComp_
#endif
/***************************************************************************
* Copyright (c) Yorik van Havre (yorik@uncreated.net) 2015 *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
* modify it under the terms of the GNU Library General Public *
* License as published by the Free Software Foundation; either *
* version 2 of the License, or (at your option) any later version. *
* *
* This library 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 Library General Public License for more details. *
* *
* You should have received a copy of the GNU Library General Public *
* License along with this library; see the file COPYING.LIB. If not, *
* write to the Free Software Foundation, Inc., 59 Temple Place, *
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
#ifndef DRAFTUTILS_PRECOMPILED_H
#define DRAFTUTILS_PRECOMPILED_H
#include <FCConfig.h>
// Exporting of App classes
#ifdef FC_OS_WIN32
# define DraftUtilsExport __declspec(dllexport)
# define PartExport __declspec(dllexport)
# define BaseExport __declspec(dllimport)
#else // for Linux
# define DraftUtilsExport
# define PartExport
# define BaseExport
#endif
#ifdef _MSC_VER
# pragma warning(disable : 4275)
#endif
#ifdef _PreComp_
// standard
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <bitset>
#include <cctype>
#include <Python.h>
#endif // _PreComp_
#endif

View File

@@ -1,162 +1,162 @@
// dxf.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include <algorithm>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
//Following is required to be defined on Ubuntu with OCC 6.3.1
#ifndef HAVE_IOSTREAM
#define HAVE_IOSTREAM
#endif
typedef int Aci_t; // AutoCAD color index
typedef enum
{
eUnspecified = 0, // Unspecified (No units)
eInches,
eFeet,
eMiles,
eMillimeters,
eCentimeters,
eMeters,
eKilometers,
eMicroinches,
eMils,
eYards,
eAngstroms,
eNanometers,
eMicrons,
eDecimeters,
eDekameters,
eHectometers,
eGigameters,
eAstronomicalUnits,
eLightYears,
eParsecs
} eDxfUnits_t;
struct SplineData
{
double norm[3];
int degree;
int knots;
int control_points;
int fit_points;
int flag;
std::list<double> starttanx;
std::list<double> starttany;
std::list<double> starttanz;
std::list<double> endtanx;
std::list<double> endtany;
std::list<double> endtanz;
std::list<double> knot;
std::list<double> weight;
std::list<double> controlx;
std::list<double> controly;
std::list<double> controlz;
std::list<double> fitx;
std::list<double> fity;
std::list<double> fitz;
};
class CDxfWrite{
private:
std::ofstream* m_ofs;
bool m_fail;
public:
CDxfWrite(const char* filepath);
~CDxfWrite();
bool Failed(){return m_fail;}
void WriteLine(const double* s, const double* e, const char* layer_name );
void WritePoint(const double*, const char*);
void WriteArc(const double* s, const double* e, const double* c, bool dir, const char* layer_name );
void WriteEllipse(const double* c, double major_radius, double minor_radius, double rotation, double start_angle, double end_angle, bool dir, const char* layer_name );
void WriteCircle(const double* c, double radius, const char* layer_name );
};
// derive a class from this and implement it's virtual functions
class CDxfRead{
private:
std::ifstream* m_ifs;
bool m_fail;
char m_str[1024];
char m_unused_line[1024];
eDxfUnits_t m_eUnits;
bool m_measurement_inch;
char m_layer_name[1024];
char m_section_name[1024];
char m_block_name[1024];
bool m_ignore_errors;
typedef std::map< std::string,Aci_t > LayerAciMap_t;
LayerAciMap_t m_layer_aci; // layer names -> layer color aci map
bool ReadUnits();
bool ReadLayer();
bool ReadLine();
bool ReadText();
bool ReadArc();
bool ReadCircle();
bool ReadEllipse();
bool ReadPoint();
bool ReadSpline();
bool ReadLwPolyLine();
bool ReadPolyLine();
bool ReadVertex(double *pVertex, bool *bulge_found, double *bulge);
void OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden);
void OnReadCircle(const double* c, double radius, bool hidden);
void OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle);
bool ReadInsert();
bool ReadDimension();
bool ReadBlockInfo();
void get_line();
void put_line(const char *value);
void DerefACI();
protected:
Aci_t m_aci; // manifest color name or 256 for layer color
public:
CDxfRead(const char* filepath); // this opens the file
~CDxfRead(); // this closes the file
bool Failed(){return m_fail;}
void DoRead(const bool ignore_errors = false); // this reads the file and calls the following functions
double mm( double value ) const;
bool IgnoreErrors() const { return(m_ignore_errors); }
virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/){}
virtual void OnReadPoint(const double* /*s*/){}
virtual void OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/){}
virtual void OnReadArc(const double* /*s*/, const double* /*e*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadEllipse(const double* /*c*/, double /*major_radius*/, double /*minor_radius*/, double /*rotation*/, double /*start_angle*/, double /*end_angle*/, bool /*dir*/){}
virtual void OnReadSpline(struct SplineData& /*sd*/){}
virtual void OnReadInsert(const double* /*point*/, const double* /*scale*/, const char* /*name*/, double /*rotation*/){}
virtual void OnReadDimension(const double* /*s*/, const double* /*e*/, const double* /*point*/, double /*rotation*/){}
virtual void AddGraphics() const { }
std::string LayerName() const;
};
// dxf.h
// Copyright (c) 2009, Dan Heeks
// This program is released under the BSD license. See the file COPYING for details.
#pragma once
#include <algorithm>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <fstream>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
//Following is required to be defined on Ubuntu with OCC 6.3.1
#ifndef HAVE_IOSTREAM
#define HAVE_IOSTREAM
#endif
typedef int Aci_t; // AutoCAD color index
typedef enum
{
eUnspecified = 0, // Unspecified (No units)
eInches,
eFeet,
eMiles,
eMillimeters,
eCentimeters,
eMeters,
eKilometers,
eMicroinches,
eMils,
eYards,
eAngstroms,
eNanometers,
eMicrons,
eDecimeters,
eDekameters,
eHectometers,
eGigameters,
eAstronomicalUnits,
eLightYears,
eParsecs
} eDxfUnits_t;
struct SplineData
{
double norm[3];
int degree;
int knots;
int control_points;
int fit_points;
int flag;
std::list<double> starttanx;
std::list<double> starttany;
std::list<double> starttanz;
std::list<double> endtanx;
std::list<double> endtany;
std::list<double> endtanz;
std::list<double> knot;
std::list<double> weight;
std::list<double> controlx;
std::list<double> controly;
std::list<double> controlz;
std::list<double> fitx;
std::list<double> fity;
std::list<double> fitz;
};
class CDxfWrite{
private:
std::ofstream* m_ofs;
bool m_fail;
public:
CDxfWrite(const char* filepath);
~CDxfWrite();
bool Failed(){return m_fail;}
void WriteLine(const double* s, const double* e, const char* layer_name );
void WritePoint(const double*, const char*);
void WriteArc(const double* s, const double* e, const double* c, bool dir, const char* layer_name );
void WriteEllipse(const double* c, double major_radius, double minor_radius, double rotation, double start_angle, double end_angle, bool dir, const char* layer_name );
void WriteCircle(const double* c, double radius, const char* layer_name );
};
// derive a class from this and implement it's virtual functions
class CDxfRead{
private:
std::ifstream* m_ifs;
bool m_fail;
char m_str[1024];
char m_unused_line[1024];
eDxfUnits_t m_eUnits;
bool m_measurement_inch;
char m_layer_name[1024];
char m_section_name[1024];
char m_block_name[1024];
bool m_ignore_errors;
typedef std::map< std::string,Aci_t > LayerAciMap_t;
LayerAciMap_t m_layer_aci; // layer names -> layer color aci map
bool ReadUnits();
bool ReadLayer();
bool ReadLine();
bool ReadText();
bool ReadArc();
bool ReadCircle();
bool ReadEllipse();
bool ReadPoint();
bool ReadSpline();
bool ReadLwPolyLine();
bool ReadPolyLine();
bool ReadVertex(double *pVertex, bool *bulge_found, double *bulge);
void OnReadArc(double start_angle, double end_angle, double radius, const double* c, double z_extrusion_dir, bool hidden);
void OnReadCircle(const double* c, double radius, bool hidden);
void OnReadEllipse(const double* c, const double* m, double ratio, double start_angle, double end_angle);
bool ReadInsert();
bool ReadDimension();
bool ReadBlockInfo();
void get_line();
void put_line(const char *value);
void DerefACI();
protected:
Aci_t m_aci; // manifest color name or 256 for layer color
public:
CDxfRead(const char* filepath); // this opens the file
~CDxfRead(); // this closes the file
bool Failed(){return m_fail;}
void DoRead(const bool ignore_errors = false); // this reads the file and calls the following functions
double mm( double value ) const;
bool IgnoreErrors() const { return(m_ignore_errors); }
virtual void OnReadLine(const double* /*s*/, const double* /*e*/, bool /*hidden*/){}
virtual void OnReadPoint(const double* /*s*/){}
virtual void OnReadText(const double* /*point*/, const double /*height*/, const char* /*text*/){}
virtual void OnReadArc(const double* /*s*/, const double* /*e*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadCircle(const double* /*s*/, const double* /*c*/, bool /*dir*/, bool /*hidden*/){}
virtual void OnReadEllipse(const double* /*c*/, double /*major_radius*/, double /*minor_radius*/, double /*rotation*/, double /*start_angle*/, double /*end_angle*/, bool /*dir*/){}
virtual void OnReadSpline(struct SplineData& /*sd*/){}
virtual void OnReadInsert(const double* /*point*/, const double* /*scale*/, const char* /*name*/, double /*rotation*/){}
virtual void OnReadDimension(const double* /*s*/, const double* /*e*/, const double* /*point*/, double /*rotation*/){}
virtual void AddGraphics() const { }
std::string LayerName() const;
};

View File

@@ -1,32 +1,32 @@
#***************************************************************************
#* *
#* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* 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 Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library 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 *
#* *
#***************************************************************************
# add Import/Export types
App.addImportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addImportType("SVG as geometry (*.svg)","importSVG")
App.addImportType("Open CAD Format (*.oca *.gcad)","importOCA")
App.addImportType("Common airfoil data (*.dat)","importAirfoilDAT")
App.addExportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addExportType("Flattened SVG (*.svg)","importSVG")
App.addExportType("Open CAD Format (*.oca)","importOCA")
App.addImportType("Autodesk DWG 2D (*.dwg)","importDWG")
App.addExportType("Autodesk DWG 2D (*.dwg)","importDWG")
#***************************************************************************
#* *
#* Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
#* *
#* This program is free software; you can redistribute it and/or modify *
#* it under the terms of the GNU Lesser General Public License (LGPL) *
#* as published by the Free Software Foundation; either version 2 of *
#* the License, or (at your option) any later version. *
#* for detail see the LICENCE text file. *
#* *
#* 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 Library General Public License for more details. *
#* *
#* You should have received a copy of the GNU Library 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 *
#* *
#***************************************************************************
# add Import/Export types
App.addImportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addImportType("SVG as geometry (*.svg)","importSVG")
App.addImportType("Open CAD Format (*.oca *.gcad)","importOCA")
App.addImportType("Common airfoil data (*.dat)","importAirfoilDAT")
App.addExportType("Autodesk DXF 2D (*.dxf)","importDXF")
App.addExportType("Flattened SVG (*.svg)","importSVG")
App.addExportType("Open CAD Format (*.oca)","importOCA")
App.addImportType("Autodesk DWG 2D (*.dwg)","importDWG")
App.addExportType("Autodesk DWG 2D (*.dwg)","importDWG")

View File

@@ -1,154 +1,154 @@
<RCC>
<qresource>
<file>icons/Draft_2DShapeView.svg</file>
<file>icons/Draft_AddPoint.svg</file>
<file>icons/Draft_AddToGroup.svg</file>
<file>icons/Draft_Apply.svg</file>
<file>icons/Draft_Arc.svg</file>
<file>icons/Draft_Arc_3Points.svg</file>
<file>icons/Draft_Array.svg</file>
<file>icons/Draft_AutoGroup.svg</file>
<file>icons/Draft_AutoGroup_on.svg</file>
<file>icons/Draft_AutoGroup_off.svg</file>
<file>icons/Draft_BezCurve.svg</file>
<file>icons/Draft_BezSharpNode.svg</file>
<file>icons/Draft_BezSymNode.svg</file>
<file>icons/Draft_BezTanNode.svg</file>
<file>icons/Draft_BSpline.svg</file>
<file>icons/Draft_Circle.svg</file>
<file>icons/Draft_Clone.svg</file>
<file>icons/Draft_Construction.svg</file>
<file>icons/Draft_CubicBezCurve.svg</file>
<file>icons/Draft_Cursor.svg</file>
<file>icons/Draft_DelPoint.svg</file>
<file>icons/Draft_Dimension.svg</file>
<file>icons/Draft_Dimension_Tree.svg</file>
<file>icons/Draft_Dot.svg</file>
<file>icons/Draft_Downgrade.svg</file>
<file>icons/Draft_Draft.svg</file>
<file>icons/Draft_Draft2Sketch.svg</file>
<file>icons/Draft_Drawing.svg</file>
<file>icons/Draft_Edit.svg</file>
<file>icons/Draft_Ellipse.svg</file>
<file>icons/Draft_Facebinder.svg</file>
<file>icons/Draft_Facebinder_Provider.svg</file>
<file>icons/Draft_Fillet.svg</file>
<file>icons/Draft_Finish.svg</file>
<file>icons/Draft_FlipDimension.svg</file>
<file>icons/Draft_Grid.svg</file>
<file>icons/Draft_Heal.svg</file>
<file>icons/Draft_Join.svg</file>
<file>icons/Draft_Label.svg</file>
<file>icons/Draft_Layer.svg</file>
<file>icons/Draft_Line.svg</file>
<file>icons/Draft_LinkArray.svg</file>
<file>icons/Draft_Lock.svg</file>
<file>icons/Draft_Macro.svg</file>
<file>icons/Draft_Mirror.svg</file>
<file>icons/Draft_Move.svg</file>
<file>icons/Draft_Offset.svg</file>
<file>icons/Draft_PathArray.svg</file>
<file>icons/Draft_PathLinkArray.svg</file>
<file>icons/Draft_Point.svg</file>
<file>icons/Draft_PointArray.svg</file>
<file>icons/Draft_Polygon.svg</file>
<file>icons/Draft_Rectangle.svg</file>
<file>icons/Draft_Rotate.svg</file>
<file>icons/Draft_Scale.svg</file>
<file>icons/Draft_SelectGroup.svg</file>
<file>icons/Draft_SelectPlane.svg</file>
<file>icons/Draft_ShapeString.svg</file>
<file>icons/Draft_Slope.svg</file>
<file>icons/Draft_Snap.svg</file>
<file>icons/Draft_Split.svg</file>
<file>icons/Draft_Stretch.svg</file>
<file>icons/Draft_SubelementHighlight.svg</file>
<file>icons/Draft_SwitchMode.svg</file>
<file>icons/Draft_Text.svg</file>
<file>icons/Draft_Trimex.svg</file>
<file>icons/Draft_Upgrade.svg</file>
<file>icons/Draft_VisGroup.svg</file>
<file>icons/Draft_Wipe.svg</file>
<file>icons/Draft_Wire.svg</file>
<file>icons/Draft_WireToBSpline.svg</file>
<file>icons/DraftWorkbench.svg</file>
<file>icons/preferences-draft.svg</file>
<file>icons/Snap_Angle.svg</file>
<file>icons/Snap_Center.svg</file>
<file>icons/Snap_Dimensions.svg</file>
<file>icons/Snap_Endpoint.svg</file>
<file>icons/Snap_Extension.svg</file>
<file>icons/Snap_Grid.svg</file>
<file>icons/Snap_Intersection.svg</file>
<file>icons/Snap_Lock.svg</file>
<file>icons/Snap_Midpoint.svg</file>
<file>icons/Snap_Near.svg</file>
<file>icons/Snap_Ortho.svg</file>
<file>icons/Snap_Parallel.svg</file>
<file>icons/Snap_Perpendicular.svg</file>
<file>icons/Snap_Special.svg</file>
<file>icons/Snap_WorkingPlane.svg</file>
<file>patterns/brick01</file>
<file>patterns/concrete.svg</file>
<file>patterns/cross.svg</file>
<file>patterns/diagonal1.svg</file>
<file>patterns/diagonal2.svg</file>
<file>patterns/earth.svg</file>
<file>patterns/hbone.svg</file>
<file>patterns/line.svg</file>
<file>patterns/plus.svg</file>
<file>patterns/simple.svg</file>
<file>patterns/solid.svg</file>
<file>patterns/square.svg</file>
<file>patterns/steel.svg</file>
<file>patterns/wood.svg</file>
<file>patterns/woodgrain.svg</file>
<file>translations/Draft_af.qm</file>
<file>translations/Draft_ar.qm</file>
<file>translations/Draft_ca.qm</file>
<file>translations/Draft_cs.qm</file>
<file>translations/Draft_de.qm</file>
<file>translations/Draft_el.qm</file>
<file>translations/Draft_es-ES.qm</file>
<file>translations/Draft_eu.qm</file>
<file>translations/Draft_fi.qm</file>
<file>translations/Draft_fil.qm</file>
<file>translations/Draft_fr.qm</file>
<file>translations/Draft_gl.qm</file>
<file>translations/Draft_hr.qm</file>
<file>translations/Draft_hu.qm</file>
<file>translations/Draft_id.qm</file>
<file>translations/Draft_it.qm</file>
<file>translations/Draft_ja.qm</file>
<file>translations/Draft_kab.qm</file>
<file>translations/Draft_ko.qm</file>
<file>translations/Draft_lt.qm</file>
<file>translations/Draft_nl.qm</file>
<file>translations/Draft_no.qm</file>
<file>translations/Draft_pl.qm</file>
<file>translations/Draft_pt-BR.qm</file>
<file>translations/Draft_pt-PT.qm</file>
<file>translations/Draft_ro.qm</file>
<file>translations/Draft_ru.qm</file>
<file>translations/Draft_sk.qm</file>
<file>translations/Draft_sl.qm</file>
<file>translations/Draft_sr.qm</file>
<file>translations/Draft_sv-SE.qm</file>
<file>translations/Draft_tr.qm</file>
<file>translations/Draft_uk.qm</file>
<file>translations/Draft_val-ES.qm</file>
<file>translations/Draft_vi.qm</file>
<file>translations/Draft_zh-CN.qm</file>
<file>translations/Draft_zh-TW.qm</file>
<file>ui/preferences-draft.ui</file>
<file>ui/preferences-draftsnap.ui</file>
<file>ui/preferences-drafttexts.ui</file>
<file>ui/preferences-draftvisual.ui</file>
<file>ui/preferences-dwg.ui</file>
<file>ui/preferences-dxf.ui</file>
<file>ui/preferences-oca.ui</file>
<file>ui/preferences-svg.ui</file>
<file>ui/TaskSelectPlane.ui</file>
<file>ui/TaskShapeString.ui</file>
</qresource>
</RCC>
<RCC>
<qresource>
<file>icons/Draft_2DShapeView.svg</file>
<file>icons/Draft_AddPoint.svg</file>
<file>icons/Draft_AddToGroup.svg</file>
<file>icons/Draft_Apply.svg</file>
<file>icons/Draft_Arc.svg</file>
<file>icons/Draft_Arc_3Points.svg</file>
<file>icons/Draft_Array.svg</file>
<file>icons/Draft_AutoGroup.svg</file>
<file>icons/Draft_AutoGroup_on.svg</file>
<file>icons/Draft_AutoGroup_off.svg</file>
<file>icons/Draft_BezCurve.svg</file>
<file>icons/Draft_BezSharpNode.svg</file>
<file>icons/Draft_BezSymNode.svg</file>
<file>icons/Draft_BezTanNode.svg</file>
<file>icons/Draft_BSpline.svg</file>
<file>icons/Draft_Circle.svg</file>
<file>icons/Draft_Clone.svg</file>
<file>icons/Draft_Construction.svg</file>
<file>icons/Draft_CubicBezCurve.svg</file>
<file>icons/Draft_Cursor.svg</file>
<file>icons/Draft_DelPoint.svg</file>
<file>icons/Draft_Dimension.svg</file>
<file>icons/Draft_Dimension_Tree.svg</file>
<file>icons/Draft_Dot.svg</file>
<file>icons/Draft_Downgrade.svg</file>
<file>icons/Draft_Draft.svg</file>
<file>icons/Draft_Draft2Sketch.svg</file>
<file>icons/Draft_Drawing.svg</file>
<file>icons/Draft_Edit.svg</file>
<file>icons/Draft_Ellipse.svg</file>
<file>icons/Draft_Facebinder.svg</file>
<file>icons/Draft_Facebinder_Provider.svg</file>
<file>icons/Draft_Fillet.svg</file>
<file>icons/Draft_Finish.svg</file>
<file>icons/Draft_FlipDimension.svg</file>
<file>icons/Draft_Grid.svg</file>
<file>icons/Draft_Heal.svg</file>
<file>icons/Draft_Join.svg</file>
<file>icons/Draft_Label.svg</file>
<file>icons/Draft_Layer.svg</file>
<file>icons/Draft_Line.svg</file>
<file>icons/Draft_LinkArray.svg</file>
<file>icons/Draft_Lock.svg</file>
<file>icons/Draft_Macro.svg</file>
<file>icons/Draft_Mirror.svg</file>
<file>icons/Draft_Move.svg</file>
<file>icons/Draft_Offset.svg</file>
<file>icons/Draft_PathArray.svg</file>
<file>icons/Draft_PathLinkArray.svg</file>
<file>icons/Draft_Point.svg</file>
<file>icons/Draft_PointArray.svg</file>
<file>icons/Draft_Polygon.svg</file>
<file>icons/Draft_Rectangle.svg</file>
<file>icons/Draft_Rotate.svg</file>
<file>icons/Draft_Scale.svg</file>
<file>icons/Draft_SelectGroup.svg</file>
<file>icons/Draft_SelectPlane.svg</file>
<file>icons/Draft_ShapeString.svg</file>
<file>icons/Draft_Slope.svg</file>
<file>icons/Draft_Snap.svg</file>
<file>icons/Draft_Split.svg</file>
<file>icons/Draft_Stretch.svg</file>
<file>icons/Draft_SubelementHighlight.svg</file>
<file>icons/Draft_SwitchMode.svg</file>
<file>icons/Draft_Text.svg</file>
<file>icons/Draft_Trimex.svg</file>
<file>icons/Draft_Upgrade.svg</file>
<file>icons/Draft_VisGroup.svg</file>
<file>icons/Draft_Wipe.svg</file>
<file>icons/Draft_Wire.svg</file>
<file>icons/Draft_WireToBSpline.svg</file>
<file>icons/DraftWorkbench.svg</file>
<file>icons/preferences-draft.svg</file>
<file>icons/Snap_Angle.svg</file>
<file>icons/Snap_Center.svg</file>
<file>icons/Snap_Dimensions.svg</file>
<file>icons/Snap_Endpoint.svg</file>
<file>icons/Snap_Extension.svg</file>
<file>icons/Snap_Grid.svg</file>
<file>icons/Snap_Intersection.svg</file>
<file>icons/Snap_Lock.svg</file>
<file>icons/Snap_Midpoint.svg</file>
<file>icons/Snap_Near.svg</file>
<file>icons/Snap_Ortho.svg</file>
<file>icons/Snap_Parallel.svg</file>
<file>icons/Snap_Perpendicular.svg</file>
<file>icons/Snap_Special.svg</file>
<file>icons/Snap_WorkingPlane.svg</file>
<file>patterns/brick01</file>
<file>patterns/concrete.svg</file>
<file>patterns/cross.svg</file>
<file>patterns/diagonal1.svg</file>
<file>patterns/diagonal2.svg</file>
<file>patterns/earth.svg</file>
<file>patterns/hbone.svg</file>
<file>patterns/line.svg</file>
<file>patterns/plus.svg</file>
<file>patterns/simple.svg</file>
<file>patterns/solid.svg</file>
<file>patterns/square.svg</file>
<file>patterns/steel.svg</file>
<file>patterns/wood.svg</file>
<file>patterns/woodgrain.svg</file>
<file>translations/Draft_af.qm</file>
<file>translations/Draft_ar.qm</file>
<file>translations/Draft_ca.qm</file>
<file>translations/Draft_cs.qm</file>
<file>translations/Draft_de.qm</file>
<file>translations/Draft_el.qm</file>
<file>translations/Draft_es-ES.qm</file>
<file>translations/Draft_eu.qm</file>
<file>translations/Draft_fi.qm</file>
<file>translations/Draft_fil.qm</file>
<file>translations/Draft_fr.qm</file>
<file>translations/Draft_gl.qm</file>
<file>translations/Draft_hr.qm</file>
<file>translations/Draft_hu.qm</file>
<file>translations/Draft_id.qm</file>
<file>translations/Draft_it.qm</file>
<file>translations/Draft_ja.qm</file>
<file>translations/Draft_kab.qm</file>
<file>translations/Draft_ko.qm</file>
<file>translations/Draft_lt.qm</file>
<file>translations/Draft_nl.qm</file>
<file>translations/Draft_no.qm</file>
<file>translations/Draft_pl.qm</file>
<file>translations/Draft_pt-BR.qm</file>
<file>translations/Draft_pt-PT.qm</file>
<file>translations/Draft_ro.qm</file>
<file>translations/Draft_ru.qm</file>
<file>translations/Draft_sk.qm</file>
<file>translations/Draft_sl.qm</file>
<file>translations/Draft_sr.qm</file>
<file>translations/Draft_sv-SE.qm</file>
<file>translations/Draft_tr.qm</file>
<file>translations/Draft_uk.qm</file>
<file>translations/Draft_val-ES.qm</file>
<file>translations/Draft_vi.qm</file>
<file>translations/Draft_zh-CN.qm</file>
<file>translations/Draft_zh-TW.qm</file>
<file>ui/preferences-draft.ui</file>
<file>ui/preferences-draftsnap.ui</file>
<file>ui/preferences-drafttexts.ui</file>
<file>ui/preferences-draftvisual.ui</file>
<file>ui/preferences-dwg.ui</file>
<file>ui/preferences-dxf.ui</file>
<file>ui/preferences-oca.ui</file>
<file>ui/preferences-svg.ui</file>
<file>ui/TaskSelectPlane.ui</file>
<file>ui/TaskShapeString.ui</file>
</qresource>
</RCC>

View File

@@ -1,5 +1,5 @@
/** \defgroup DRAFT Draft
* \ingroup PYTHONWORKBENCHES
* \brief Basic 2D drawing tools and other generic tools
*/
/** \defgroup DRAFT Draft
* \ingroup PYTHONWORKBENCHES
* \brief Basic 2D drawing tools and other generic tools
*/