diff --git a/src/Mod/Draft/.gitattributes b/src/Mod/Draft/.gitattributes new file mode 100644 index 000000000000..ef026b610752 --- /dev/null +++ b/src/Mod/Draft/.gitattributes @@ -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 . diff --git a/src/Mod/Draft/App/AppDraftUtils.cpp b/src/Mod/Draft/App/AppDraftUtils.cpp index 252fdfda6ba2..6d365a4559b5 100644 --- a/src/Mod/Draft/App/AppDraftUtils.cpp +++ b/src/Mod/Draft/App/AppDraftUtils.cpp @@ -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 -#endif - -#include -#include -#include - -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 +#endif + +#include +#include +#include + +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); +} diff --git a/src/Mod/Draft/App/AppDraftUtilsPy.cpp b/src/Mod/Draft/App/AppDraftUtilsPy.cpp index f8bcefb29c6a..64d655f11966 100644 --- a/src/Mod/Draft/App/AppDraftUtilsPy.cpp +++ b/src/Mod/Draft/App/AppDraftUtilsPy.cpp @@ -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 -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include "DraftDxf.h" - -namespace DraftUtils { -class Module : public Py::ExtensionModule -{ -public: - Module() : Py::ExtensionModule("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 +#endif + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "DraftDxf.h" + +namespace DraftUtils { +class Module : public Py::ExtensionModule +{ +public: + Module() : Py::ExtensionModule("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 diff --git a/src/Mod/Draft/App/DraftDxf.h b/src/Mod/Draft/App/DraftDxf.h index 3842c985e7ee..f450eb669956 100644 --- a/src/Mod/Draft/App/DraftDxf.h +++ b/src/Mod/Draft/App/DraftDxf.h @@ -26,7 +26,7 @@ #include "dxf.h" #include #include -#include +#include namespace DraftUtils { diff --git a/src/Mod/Draft/App/PreCompiled.cpp b/src/Mod/Draft/App/PreCompiled.cpp index 0e8374b91073..d5cd2b171b4b 100644 --- a/src/Mod/Draft/App/PreCompiled.cpp +++ b/src/Mod/Draft/App/PreCompiled.cpp @@ -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" diff --git a/src/Mod/Draft/App/PreCompiled.h b/src/Mod/Draft/App/PreCompiled.h index f263d391d642..7064fdd774b2 100644 --- a/src/Mod/Draft/App/PreCompiled.h +++ b/src/Mod/Draft/App/PreCompiled.h @@ -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 - -// 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 -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include - -#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 + +// 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#endif // _PreComp_ +#endif + diff --git a/src/Mod/Draft/App/dxf.h b/src/Mod/Draft/App/dxf.h index 74615a90b870..9000924a019b 100644 --- a/src/Mod/Draft/App/dxf.h +++ b/src/Mod/Draft/App/dxf.h @@ -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 -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -//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 starttanx; - std::list starttany; - std::list starttanz; - std::list endtanx; - std::list endtany; - std::list endtanz; - std::list knot; - std::list weight; - std::list controlx; - std::list controly; - std::list controlz; - std::list fitx; - std::list fity; - std::list 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//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 starttanx; + std::list starttany; + std::list starttanz; + std::list endtanx; + std::list endtany; + std::list endtanz; + std::list knot; + std::list weight; + std::list controlx; + std::list controly; + std::list controlz; + std::list fitx; + std::list fity; + std::list 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; + +}; diff --git a/src/Mod/Draft/Init.py b/src/Mod/Draft/Init.py index f3415a091d96..e9001b47caf0 100644 --- a/src/Mod/Draft/Init.py +++ b/src/Mod/Draft/Init.py @@ -1,32 +1,32 @@ -#*************************************************************************** -#* * -#* Copyright (c) 2009 Yorik van Havre * -#* * -#* 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 * +#* * +#* 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") diff --git a/src/Mod/Draft/Resources/Draft.qrc b/src/Mod/Draft/Resources/Draft.qrc index 0e9c089cb453..1acbcdab98b3 100644 --- a/src/Mod/Draft/Resources/Draft.qrc +++ b/src/Mod/Draft/Resources/Draft.qrc @@ -1,154 +1,154 @@ - - - icons/Draft_2DShapeView.svg - icons/Draft_AddPoint.svg - icons/Draft_AddToGroup.svg - icons/Draft_Apply.svg - icons/Draft_Arc.svg - icons/Draft_Arc_3Points.svg - icons/Draft_Array.svg - icons/Draft_AutoGroup.svg - icons/Draft_AutoGroup_on.svg - icons/Draft_AutoGroup_off.svg - icons/Draft_BezCurve.svg - icons/Draft_BezSharpNode.svg - icons/Draft_BezSymNode.svg - icons/Draft_BezTanNode.svg - icons/Draft_BSpline.svg - icons/Draft_Circle.svg - icons/Draft_Clone.svg - icons/Draft_Construction.svg - icons/Draft_CubicBezCurve.svg - icons/Draft_Cursor.svg - icons/Draft_DelPoint.svg - icons/Draft_Dimension.svg - icons/Draft_Dimension_Tree.svg - icons/Draft_Dot.svg - icons/Draft_Downgrade.svg - icons/Draft_Draft.svg - icons/Draft_Draft2Sketch.svg - icons/Draft_Drawing.svg - icons/Draft_Edit.svg - icons/Draft_Ellipse.svg - icons/Draft_Facebinder.svg - icons/Draft_Facebinder_Provider.svg - icons/Draft_Fillet.svg - icons/Draft_Finish.svg - icons/Draft_FlipDimension.svg - icons/Draft_Grid.svg - icons/Draft_Heal.svg - icons/Draft_Join.svg - icons/Draft_Label.svg - icons/Draft_Layer.svg - icons/Draft_Line.svg - icons/Draft_LinkArray.svg - icons/Draft_Lock.svg - icons/Draft_Macro.svg - icons/Draft_Mirror.svg - icons/Draft_Move.svg - icons/Draft_Offset.svg - icons/Draft_PathArray.svg - icons/Draft_PathLinkArray.svg - icons/Draft_Point.svg - icons/Draft_PointArray.svg - icons/Draft_Polygon.svg - icons/Draft_Rectangle.svg - icons/Draft_Rotate.svg - icons/Draft_Scale.svg - icons/Draft_SelectGroup.svg - icons/Draft_SelectPlane.svg - icons/Draft_ShapeString.svg - icons/Draft_Slope.svg - icons/Draft_Snap.svg - icons/Draft_Split.svg - icons/Draft_Stretch.svg - icons/Draft_SubelementHighlight.svg - icons/Draft_SwitchMode.svg - icons/Draft_Text.svg - icons/Draft_Trimex.svg - icons/Draft_Upgrade.svg - icons/Draft_VisGroup.svg - icons/Draft_Wipe.svg - icons/Draft_Wire.svg - icons/Draft_WireToBSpline.svg - icons/DraftWorkbench.svg - icons/preferences-draft.svg - icons/Snap_Angle.svg - icons/Snap_Center.svg - icons/Snap_Dimensions.svg - icons/Snap_Endpoint.svg - icons/Snap_Extension.svg - icons/Snap_Grid.svg - icons/Snap_Intersection.svg - icons/Snap_Lock.svg - icons/Snap_Midpoint.svg - icons/Snap_Near.svg - icons/Snap_Ortho.svg - icons/Snap_Parallel.svg - icons/Snap_Perpendicular.svg - icons/Snap_Special.svg - icons/Snap_WorkingPlane.svg - patterns/brick01 - patterns/concrete.svg - patterns/cross.svg - patterns/diagonal1.svg - patterns/diagonal2.svg - patterns/earth.svg - patterns/hbone.svg - patterns/line.svg - patterns/plus.svg - patterns/simple.svg - patterns/solid.svg - patterns/square.svg - patterns/steel.svg - patterns/wood.svg - patterns/woodgrain.svg - translations/Draft_af.qm - translations/Draft_ar.qm - translations/Draft_ca.qm - translations/Draft_cs.qm - translations/Draft_de.qm - translations/Draft_el.qm - translations/Draft_es-ES.qm - translations/Draft_eu.qm - translations/Draft_fi.qm - translations/Draft_fil.qm - translations/Draft_fr.qm - translations/Draft_gl.qm - translations/Draft_hr.qm - translations/Draft_hu.qm - translations/Draft_id.qm - translations/Draft_it.qm - translations/Draft_ja.qm - translations/Draft_kab.qm - translations/Draft_ko.qm - translations/Draft_lt.qm - translations/Draft_nl.qm - translations/Draft_no.qm - translations/Draft_pl.qm - translations/Draft_pt-BR.qm - translations/Draft_pt-PT.qm - translations/Draft_ro.qm - translations/Draft_ru.qm - translations/Draft_sk.qm - translations/Draft_sl.qm - translations/Draft_sr.qm - translations/Draft_sv-SE.qm - translations/Draft_tr.qm - translations/Draft_uk.qm - translations/Draft_val-ES.qm - translations/Draft_vi.qm - translations/Draft_zh-CN.qm - translations/Draft_zh-TW.qm - ui/preferences-draft.ui - ui/preferences-draftsnap.ui - ui/preferences-drafttexts.ui - ui/preferences-draftvisual.ui - ui/preferences-dwg.ui - ui/preferences-dxf.ui - ui/preferences-oca.ui - ui/preferences-svg.ui - ui/TaskSelectPlane.ui - ui/TaskShapeString.ui - - + + + icons/Draft_2DShapeView.svg + icons/Draft_AddPoint.svg + icons/Draft_AddToGroup.svg + icons/Draft_Apply.svg + icons/Draft_Arc.svg + icons/Draft_Arc_3Points.svg + icons/Draft_Array.svg + icons/Draft_AutoGroup.svg + icons/Draft_AutoGroup_on.svg + icons/Draft_AutoGroup_off.svg + icons/Draft_BezCurve.svg + icons/Draft_BezSharpNode.svg + icons/Draft_BezSymNode.svg + icons/Draft_BezTanNode.svg + icons/Draft_BSpline.svg + icons/Draft_Circle.svg + icons/Draft_Clone.svg + icons/Draft_Construction.svg + icons/Draft_CubicBezCurve.svg + icons/Draft_Cursor.svg + icons/Draft_DelPoint.svg + icons/Draft_Dimension.svg + icons/Draft_Dimension_Tree.svg + icons/Draft_Dot.svg + icons/Draft_Downgrade.svg + icons/Draft_Draft.svg + icons/Draft_Draft2Sketch.svg + icons/Draft_Drawing.svg + icons/Draft_Edit.svg + icons/Draft_Ellipse.svg + icons/Draft_Facebinder.svg + icons/Draft_Facebinder_Provider.svg + icons/Draft_Fillet.svg + icons/Draft_Finish.svg + icons/Draft_FlipDimension.svg + icons/Draft_Grid.svg + icons/Draft_Heal.svg + icons/Draft_Join.svg + icons/Draft_Label.svg + icons/Draft_Layer.svg + icons/Draft_Line.svg + icons/Draft_LinkArray.svg + icons/Draft_Lock.svg + icons/Draft_Macro.svg + icons/Draft_Mirror.svg + icons/Draft_Move.svg + icons/Draft_Offset.svg + icons/Draft_PathArray.svg + icons/Draft_PathLinkArray.svg + icons/Draft_Point.svg + icons/Draft_PointArray.svg + icons/Draft_Polygon.svg + icons/Draft_Rectangle.svg + icons/Draft_Rotate.svg + icons/Draft_Scale.svg + icons/Draft_SelectGroup.svg + icons/Draft_SelectPlane.svg + icons/Draft_ShapeString.svg + icons/Draft_Slope.svg + icons/Draft_Snap.svg + icons/Draft_Split.svg + icons/Draft_Stretch.svg + icons/Draft_SubelementHighlight.svg + icons/Draft_SwitchMode.svg + icons/Draft_Text.svg + icons/Draft_Trimex.svg + icons/Draft_Upgrade.svg + icons/Draft_VisGroup.svg + icons/Draft_Wipe.svg + icons/Draft_Wire.svg + icons/Draft_WireToBSpline.svg + icons/DraftWorkbench.svg + icons/preferences-draft.svg + icons/Snap_Angle.svg + icons/Snap_Center.svg + icons/Snap_Dimensions.svg + icons/Snap_Endpoint.svg + icons/Snap_Extension.svg + icons/Snap_Grid.svg + icons/Snap_Intersection.svg + icons/Snap_Lock.svg + icons/Snap_Midpoint.svg + icons/Snap_Near.svg + icons/Snap_Ortho.svg + icons/Snap_Parallel.svg + icons/Snap_Perpendicular.svg + icons/Snap_Special.svg + icons/Snap_WorkingPlane.svg + patterns/brick01 + patterns/concrete.svg + patterns/cross.svg + patterns/diagonal1.svg + patterns/diagonal2.svg + patterns/earth.svg + patterns/hbone.svg + patterns/line.svg + patterns/plus.svg + patterns/simple.svg + patterns/solid.svg + patterns/square.svg + patterns/steel.svg + patterns/wood.svg + patterns/woodgrain.svg + translations/Draft_af.qm + translations/Draft_ar.qm + translations/Draft_ca.qm + translations/Draft_cs.qm + translations/Draft_de.qm + translations/Draft_el.qm + translations/Draft_es-ES.qm + translations/Draft_eu.qm + translations/Draft_fi.qm + translations/Draft_fil.qm + translations/Draft_fr.qm + translations/Draft_gl.qm + translations/Draft_hr.qm + translations/Draft_hu.qm + translations/Draft_id.qm + translations/Draft_it.qm + translations/Draft_ja.qm + translations/Draft_kab.qm + translations/Draft_ko.qm + translations/Draft_lt.qm + translations/Draft_nl.qm + translations/Draft_no.qm + translations/Draft_pl.qm + translations/Draft_pt-BR.qm + translations/Draft_pt-PT.qm + translations/Draft_ro.qm + translations/Draft_ru.qm + translations/Draft_sk.qm + translations/Draft_sl.qm + translations/Draft_sr.qm + translations/Draft_sv-SE.qm + translations/Draft_tr.qm + translations/Draft_uk.qm + translations/Draft_val-ES.qm + translations/Draft_vi.qm + translations/Draft_zh-CN.qm + translations/Draft_zh-TW.qm + ui/preferences-draft.ui + ui/preferences-draftsnap.ui + ui/preferences-drafttexts.ui + ui/preferences-draftvisual.ui + ui/preferences-dwg.ui + ui/preferences-dxf.ui + ui/preferences-oca.ui + ui/preferences-svg.ui + ui/TaskSelectPlane.ui + ui/TaskShapeString.ui + + diff --git a/src/Mod/Draft/draft.dox b/src/Mod/Draft/draft.dox index 81558a88a355..cf18f75ab0e1 100644 --- a/src/Mod/Draft/draft.dox +++ b/src/Mod/Draft/draft.dox @@ -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 + */ +