TechDraw: Header uniformity and whitespace fixes

This commit is contained in:
luz paz
2020-11-14 06:36:36 -05:00
committed by wwmayer
parent 82beefa98d
commit a3cb87b117
87 changed files with 454 additions and 254 deletions

View File

@@ -1,14 +1,24 @@
/***************************************************************************
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
* *
* This program 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. *
* for detail see the LICENCE text file. *
* Jürgen Riegel 2007 *
* 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>

View File

@@ -1,3 +1,22 @@
/***************************************************************************
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
* *
* 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,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -47,7 +47,7 @@ using namespace TechDraw;
PROPERTY_SOURCE(TechDraw::DrawLeaderLine, TechDraw::DrawView)
//TODO: share this between DrawViewBalloon, DrawLeaderLine, QGIArrow, Prefs, etc
//const char* DrawLeaderLine::ArrowTypeEnums[]= {
//const char* DrawLeaderLine::ArrowTypeEnums[]= {
// "FILLED_ARROW",
// "OPEN_ARROW",
// "TICK",
@@ -57,7 +57,7 @@ PROPERTY_SOURCE(TechDraw::DrawLeaderLine, TechDraw::DrawView)
// "FILLED_TRIANGLE",
// "NONE"
// NULL};
//const char* DrawLeaderLine::ArrowTypeEnums2[]= {
//const char* DrawLeaderLine::ArrowTypeEnums2[]= {
// "FILLED_ARROW",
// "OPEN_ARROW",
// "TICK",
@@ -77,7 +77,7 @@ DrawLeaderLine::DrawLeaderLine(void)
LeaderParent.setScope(App::LinkScope::Global);
ADD_PROPERTY_TYPE(WayPoints,(Base::Vector3d()) ,group, App::Prop_None,
"Intermediate points for Leader line");
// EndType.setEnums(ArrowTypeEnums);
// ADD_PROPERTY(EndType,(prefEnd()));
@@ -124,7 +124,7 @@ short DrawLeaderLine::mustExecute() const
if (result) {
return result;
}
const App::DocumentObject* docObj = getBaseObject();
if (docObj != nullptr) {
result = docObj->isTouched(); //object property points to is touched
@@ -137,7 +137,7 @@ short DrawLeaderLine::mustExecute() const
}
App::DocumentObjectExecReturn *DrawLeaderLine::execute(void)
{
{
// Base::Console().Message("DLL::execute()\n");
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;
@@ -165,7 +165,7 @@ App::DocumentObject* DrawLeaderLine::getBaseObject(void) const
DrawView* view = getBaseView();
if (view != nullptr) {
result = view;
}
}
return result;
}
@@ -219,7 +219,7 @@ Base::Vector3d DrawLeaderLine::getAttachPoint(void)
return result;
}
void DrawLeaderLine::adjustLastSegment(void)
void DrawLeaderLine::adjustLastSegment(void)
{
// Base::Console().Message("DLL::adjustLastSegment()\n");
bool adjust = AutoHorizontal.getValue();

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -81,7 +81,7 @@ short DrawTile::mustExecute() const
}
App::DocumentObjectExecReturn *DrawTile::execute(void)
{
{
// Base::Console().Message("DT::execute()\n");
return DocumentObject::execute();
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -51,7 +51,7 @@ public:
virtual short mustExecute() const;
virtual App::DocumentObjectExecReturn *execute(void);
virtual void onDocumentRestored();
virtual void onDocumentRestored();
virtual void setupObject();
virtual const char* getViewProviderName(void) const {

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2018 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2018 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,6 +1,6 @@
/***************************************************************************
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -121,7 +121,7 @@ App::DocumentObjectExecReturn *DrawViewDimExtent::execute(void)
std::vector<std::string> edgeNames = getSubNames();
int direction = DirExtent.getValue();
std::pair<Base::Vector3d, Base::Vector3d> endPoints =
std::pair<Base::Vector3d, Base::Vector3d> endPoints =
DrawDimHelper::minMax(dvp,
edgeNames,
direction);
@@ -156,7 +156,7 @@ App::DocumentObjectExecReturn *DrawViewDimExtent::execute(void)
CosmeticVertex* cvTemp = dvp->getCosmeticVertex(cTags[0]);
cvTemp->permaPoint = refMin / scale;
cvTemp = dvp->getCosmeticVertex(cTags[1]);
cvTemp->permaPoint = refMax / scale;
cvTemp->permaPoint = refMax / scale;
}
}
}
@@ -169,7 +169,7 @@ std::vector<std::string> DrawViewDimExtent::getSubNames(void)
{
std::vector<std::string> result;
std::vector<std::string> edgeNames = Source.getSubValues();
if (!edgeNames.empty() &&
if (!edgeNames.empty() &&
(edgeNames[0].size() == 0)) {
//garbage first entry - nop
} else {

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -2,6 +2,7 @@
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -163,7 +163,7 @@ PyObject* DrawViewPartPy::makeCosmeticVertex(PyObject *args)
std::string dvpName = dvp->getNameInDocument();
Base::Vector3d pnt1 = static_cast<Base::VectorPy*>(pPnt1)->value();
std::string id = dvp->addCosmeticVertex(pnt1);
//int link =
//int link =
dvp->add1CVToGV(id);
dvp->requestPaint();
return PyUnicode_FromString(id.c_str()); //return tag for new CV
@@ -181,9 +181,9 @@ PyObject* DrawViewPartPy::makeCosmeticVertex3d(PyObject *args)
Base::Vector3d centroid = dvp->getOriginalCentroid();
pnt1 = pnt1 - centroid;
Base::Vector3d projected = DrawUtil::invertY(dvp->projectPoint(pnt1));
std::string id = dvp->addCosmeticVertex(projected);
//int link =
//int link =
dvp->add1CVToGV(id);
dvp->refreshCVGeoms();
dvp->requestPaint();
@@ -208,7 +208,7 @@ PyObject* DrawViewPartPy::getCosmeticVertex(PyObject *args)
return result;
}
//get by selection name
//get by selection name
PyObject* DrawViewPartPy::getCosmeticVertexBySelection(PyObject *args)
{
PyObject* result = nullptr;
@@ -217,7 +217,7 @@ PyObject* DrawViewPartPy::getCosmeticVertexBySelection(PyObject *args)
throw Py::TypeError("expected (string)");
}
DrawViewPart* dvp = getDrawViewPartPtr();
TechDraw::CosmeticVertex* cv = dvp->getCosmeticVertexBySelection(selName);
if (cv != nullptr) {
result = cv->getPyObject();
@@ -272,7 +272,7 @@ PyObject* DrawViewPartPy::removeCosmeticVertex(PyObject *args)
}
} else {
throw Py::TypeError("expected (CosmeticVertex or [CosmeticVertex])");
}
}
return Py_None;
}
@@ -281,7 +281,7 @@ PyObject* DrawViewPartPy::replaceCosmeticVertex(PyObject *args)
(void) args;
Base::Console().Message("DVPP::replaceCosmeticVertex() - deprecated. do not use.\n");
return PyBool_FromLong(0l);
}
@@ -321,7 +321,7 @@ PyObject* DrawViewPartPy::makeCosmeticLine(PyObject *args)
Base::Console().Message("%s\n",msg.c_str());
throw Py::RuntimeError(msg);
}
//int link =
//int link =
dvp->add1CEToGE(newTag);
dvp->requestPaint();
return PyUnicode_FromString(newTag.c_str()); //return tag for new CE
@@ -369,7 +369,7 @@ PyObject* DrawViewPartPy::makeCosmeticLine3D(PyObject *args)
Base::Console().Message("%s\n",msg.c_str());
throw Py::RuntimeError(msg);
}
//int link =
//int link =
dvp->add1CEToGE(newTag);
dvp->requestPaint();
return PyUnicode_FromString(newTag.c_str()); //return tag for new CE
@@ -409,7 +409,7 @@ PyObject* DrawViewPartPy::makeCosmeticCircle(PyObject *args)
Base::Console().Message("%s\n",msg.c_str());
throw Py::RuntimeError(msg);
}
//int link =
//int link =
dvp->add1CEToGE(newTag);
dvp->requestPaint();
return PyUnicode_FromString(newTag.c_str()); //return tag for new CE
@@ -453,7 +453,7 @@ PyObject* DrawViewPartPy::makeCosmeticCircleArc(PyObject *args)
throw Py::RuntimeError(msg);
}
//int link =
//int link =
dvp->add1CEToGE(newTag);
dvp->requestPaint();
return PyUnicode_FromString(newTag.c_str()); //return tag for new CE
@@ -530,7 +530,7 @@ PyObject* DrawViewPartPy::removeCosmeticEdge(PyObject *args)
}
DrawViewPart* dvp = getDrawViewPartPtr();
dvp->removeCosmeticEdge(tag);
Py_INCREF(Py_None);
Py_INCREF(Py_None);
return Py_None;
}
@@ -580,7 +580,7 @@ PyObject* DrawViewPartPy::makeCenterLine(PyObject *args)
throw Py::RuntimeError(msg);
}
}
//int link =
//int link =
dvp->add1CLToGE(tag);
dvp->requestPaint();
@@ -653,7 +653,7 @@ PyObject* DrawViewPartPy::removeCenterLine(PyObject *args)
}
DrawViewPart* dvp = getDrawViewPartPtr();
dvp->removeCenterLine(tag);
Py_INCREF(Py_None);
Py_INCREF(Py_None);
return Py_None;
}

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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"
@@ -16,11 +37,6 @@ std::string DrawViewPy::representation(void) const
}
PyObject *DrawViewPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
@@ -28,7 +44,5 @@ PyObject *DrawViewPy::getCustomAttributes(const char* /*attr*/) const
int DrawViewPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
{
return 0;
return 0;
}

View File

@@ -2,6 +2,7 @@
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
* This library is free software; you can redistribute it and/or *
@@ -67,7 +68,7 @@ public:
App::PropertyVector SectionNormal;
App::PropertyVector SectionOrigin;
App::PropertyEnumeration SectionDirection;
App::PropertyEnumeration CutSurfaceDisplay; //new v019
App::PropertyFile FileHatchPattern;
App::PropertyFile FileGeomPattern; //new v019

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,3 +1,24 @@
/***************************************************************************
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* 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,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -69,7 +69,7 @@ DrawWeldSymbol::~DrawWeldSymbol()
{
}
//DWS always has exactly 2 child tiles - ArrowSide and OtherSide.
//DWS always has exactly 2 child tiles - ArrowSide and OtherSide.
//OtherSide tile may be hidden;
//once DWS has been added to the document, add 2x DrawTileWeld
//but if this is a restore of an existing DWS, the tiles will loaded elsewhere
@@ -120,7 +120,7 @@ short DrawWeldSymbol::mustExecute() const
}
App::DocumentObjectExecReturn *DrawWeldSymbol::execute(void)
{
{
// Base::Console().Message("DWS::execute()\n");
if (!keepUpdated()) {
return App::DocumentObject::StdReturn;

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 Wanderer Fan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan (wandererfan@gmail.com) *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2016 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -372,7 +372,7 @@ std::vector<TopoDS_Wire> EdgeWalker::sortStrip(std::vector<TopoDS_Wire> fw, bool
if (BRep_Tool::IsClosed(w)) {
closedWires.push_back(w);
}
}
}
std::vector<TopoDS_Wire> sortedWires = sortWiresBySize(closedWires,false); //biggest 1st
if (!sortedWires.size()) {
Base::Console().Log("INFO - EW::sortStrip - no sorted Wires!\n");
@@ -382,7 +382,7 @@ std::vector<TopoDS_Wire> EdgeWalker::sortStrip(std::vector<TopoDS_Wire> fw, bool
if (!includeBiggest) {
sortedWires.erase(sortedWires.begin());
}
return sortedWires;
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2016 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2016 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -54,7 +54,7 @@ typedef
boost::property<boost::edge_index_t, int>
>
graph;
typedef
boost::graph_traits < graph >::vertex_descriptor
vertex_t;

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -85,12 +85,12 @@ Base::Vector3d LineSet::calcApparentStart(TechDraw::BaseGeom* g)
Base::Vector3d result;
Base::Vector3d start(g->getStartPoint().x,g->getStartPoint().y,0.0);
double angle = getPATLineSpec().getAngle();
if (angle == 0.0) { //horizontal
if (angle == 0.0) { //horizontal
result = Base::Vector3d(getMinX(),start.y,0.0);
} else if ((angle == 90.0) ||
(angle == -90.0)) { //vertical
result = Base::Vector3d(start.x,getMinY(),0.0);
} else {
} else {
double slope = getPATLineSpec().getSlope();
double y = getMinY();
double x = ((y - start.y) / slope) + start.x;
@@ -162,7 +162,7 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeom* g, double &offs
double distX,distY;
int overlayIndex = 0;
//interval & offset are not patternscaled
//figure out which line this is in the overlay
if (angle == 0.0) { //odd case - horizontal line
distY = (thisStart.y - atomStart.y); //this is patternscaled
@@ -202,12 +202,12 @@ Base::Vector3d LineSet::getPatternStartPoint(TechDraw::BaseGeom* g, double &offs
} else {
// //ugly case - partial pattern
result = gStart;
offset = patsStartOrg - (int)patsStartOrg; //fraction of a patternLength
offset = patsStartOrg - (int)patsStartOrg; //fraction of a patternLength
offset = offset * patternLength;
}
} else if (lenStartOrg > lenEndOrg) { //origin is after end
} else if (lenStartOrg > lenEndOrg) { //origin is after end
double c = ceil(patsEndOrg);
if (c <= patsStartOrg) { //c is an integer pattern count in [patsStartOrg,patsEndOrg]
if (c <= patsStartOrg) { //c is an integer pattern count in [patsStartOrg,patsEndOrg]
result = lineOrigin - c*patternLength*getUnitDir();
offset = 0.0;
} else {
@@ -320,7 +320,7 @@ std::vector<PATLineSpec> PATLineSpec::getSpecsForPattern(std::string& parmFile,
Base::Console().Message( "Could not find pattern: %s\n",parmName.c_str() );
return result;
}
//decode definition lines into PATLineSpec objects
for (auto& l: lineSpecs) {
PATLineSpec hl(l);
@@ -431,7 +431,7 @@ bool PATLineSpec::isDashed(void)
//! X component of distance between lines
double PATLineSpec::getIntervalX(void)
{
{
if (getAngle() == 0.0) {
return 0.0;
} else if ((getAngle() == 90.0) || (getAngle() == -90.0)) {
@@ -444,14 +444,14 @@ double PATLineSpec::getIntervalX(void)
//! Y component of distance between lines
double PATLineSpec::getIntervalY(void)
{
{
if (getAngle() == 0.0) {
return getInterval();
} else if ((getAngle() == 90.0) || (getAngle() == -90.0)) {
return 0.0;
} else {
double perpAngle = fabs(getAngle() - 90.0);
return fabs(getInterval() * tan(perpAngle * M_PI/180.0));
return fabs(getInterval() * tan(perpAngle * M_PI/180.0));
}
}
@@ -484,7 +484,7 @@ void DashSpec::dump(const char* title)
}
Base::Console().Message("DUMP - DashSpec - %s\n",ss.str().c_str());
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -19,7 +19,7 @@
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
//! HatchLine - Classes related to processing PAT files
#ifndef _TechDraw_HATCHLINE_H_
@@ -48,11 +48,11 @@ class DrawUtil;
//DashSpec is the parsed portion of a PATLineSpec related to mark/space/dot
class TechDrawExport DashSpec
{
public:
public:
DashSpec() {}
DashSpec(std::vector<double> p) { m_parms = p; }
~DashSpec() {}
double get(int i) {return m_parms.at(i); }
std::vector<double> get(void) {return m_parms;}
bool empty(void) {return m_parms.empty();}
@@ -60,7 +60,7 @@ public:
double length(void);
void dump(const char* title);
DashSpec reversed(void);
private:
std::vector<double> m_parms;
};
@@ -72,7 +72,7 @@ public:
PATLineSpec();
PATLineSpec(std::string& lineSpec);
~PATLineSpec();
void load(std::string& lineSpec);
double getAngle(void) {return m_angle;}
@@ -89,12 +89,12 @@ public:
static bool findPatternStart(std::ifstream& inFile, std::string& parmName);
static std::vector<std::string> loadPatternDef(std::ifstream& inFile);
static std::vector<std::string> getPatternList(std::string& parmFile);
bool isDashed(void);
void dump(const char* title);
private:
private:
void init(void);
std::vector<double> split(std::string line);
//PAT line extracted tokens
@@ -111,7 +111,7 @@ class TechDrawExport LineSet
public:
LineSet() {}
~LineSet() {}
void setPATLineSpec(const PATLineSpec& s) { m_hatchLine = s; }
void setEdges(std::vector<TopoDS_Edge> e) {m_edges = e;}
void setGeoms(std::vector<TechDraw::BaseGeom*> g) {m_geoms = g;}
@@ -124,7 +124,7 @@ public:
PATLineSpec getPATLineSpec(void) { return m_hatchLine; }
double getOffset(void) { return m_hatchLine.getOffset(); } //delta X offset
double getAngle(void) { return m_hatchLine.getAngle(); }
Base::Vector3d getOrigin(void) { return m_hatchLine.getOrigin(); }
Base::Vector3d getOrigin(void) { return m_hatchLine.getOrigin(); }
double getInterval(void) {return m_hatchLine.getInterval(); } //space between lines
double getIntervalX(void) { return m_hatchLine.getIntervalX(); } //interval X-component
double getIntervalY(void) { return m_hatchLine.getIntervalY(); } //interval Y-component
@@ -132,7 +132,7 @@ public:
double getPatternLength(void) { return m_hatchLine.getLength(); }
Base::Vector3d getUnitDir(void);
Base::Vector3d getUnitOrtho(void);
DashSpec getDashSpec(void) { return m_hatchLine.getDashParms();}
DashSpec getDashSpec(void) { return m_hatchLine.getDashParms();}
Base::Vector3d calcApparentStart(TechDraw::BaseGeom* g);
Base::Vector3d findAtomStart(void);
Base::Vector3d getLineOrigin(void); //point corresponding to pattern origin for this line (O + n*intervalX)
@@ -145,7 +145,7 @@ public:
double getMaxY(void);
bool isDashed(void);
private:
std::vector<TopoDS_Edge> m_edges;
std::vector<TechDraw::BaseGeom*> m_geoms;

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -19,7 +19,7 @@
* Suite 330, Boston, MA 02111-1307, USA *
* *
***************************************************************************/
//! LineGroup - Classes related to processing LineGroup definition CSV files
#ifndef _TechDraw_LINEGROUP_H_
@@ -32,7 +32,7 @@ namespace TechDraw
class TechDrawExport LineGroup
{
public:
public:
LineGroup();
LineGroup(std::string groupName);
~LineGroup();
@@ -52,7 +52,7 @@ public:
//static LineGroup maker
static LineGroup* lineGroupFactory(std::string groupName);
static double getDefaultWidth(std::string weightName,
static double getDefaultWidth(std::string weightName,
std::string groupName = std::string());

View File

@@ -20,4 +20,4 @@
* *
***************************************************************************/
#include "PreCompiled.h"
#include "PreCompiled.h"

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -145,7 +145,7 @@ TopoDS_Shape ShapeExtractor::getShapes(const std::vector<App::DocumentObject*> l
TopoDS_Shape shape = BuilderCopy.Shape();
builder.Add(comp, shape);
}
//it appears that an empty compound is !IsNull(), so we need to check a different way
//it appears that an empty compound is !IsNull(), so we need to check a different way
//if we added anything to the compound.
if (!found) {
Base::Console().Error("SE::getSourceShapes - source shape is empty!\n");
@@ -181,7 +181,7 @@ std::vector<TopoDS_Shape> ShapeExtractor::getXShapes(const App::Link* xLink)
if (cLinkElem->hasPlacement()) {
childPlm = cLinkElem->getLinkPlacementProperty()->getValue();
}
}
}
auto shape = Part::Feature::getShape(l);
if(!shape.IsNull()) {
Base::Placement netPlm = linkPlm;
@@ -234,7 +234,7 @@ std::vector<TopoDS_Shape> ShapeExtractor::getShapesFromObject(const App::Documen
{
// Base::Console().Message("SE::getShapesFromObject(%s)\n", docObj->getNameInDocument());
std::vector<TopoDS_Shape> result;
const App::GroupExtension* gex = dynamic_cast<const App::GroupExtension*>(docObj);
App::Property* gProp = docObj->getPropertyByName("Group");
App::Property* sProp = docObj->getPropertyByName("Shape");
@@ -335,8 +335,8 @@ std::vector<TopoDS_Shape> ShapeExtractor::extractDrawableShapes(const TopoDS_Sha
extShapes.push_back(s);
}
}
//vs using 2d geom as construction geom?
//get edges not part of a solid
//vs using 2d geom as construction geom?
//get edges not part of a solid
//???? should this look for Faces(Wires?) before Edges?
TopExp_Explorer expEdge(shapeIn, TopAbs_EDGE, TopAbs_SOLID);
for (int i = 1; expEdge.More(); expEdge.Next(), i++) {
@@ -349,7 +349,7 @@ std::vector<TopoDS_Shape> ShapeExtractor::extractDrawableShapes(const TopoDS_Sha
//not a Compound or a CompSolid just push_back shape_In)
extShapes.push_back(shapeIn);
}
result = extShapes;
if (!extEdges.empty()) {
result.insert(std::end(result), std::begin(extEdges), std::end(extEdges));
@@ -375,11 +375,11 @@ bool ShapeExtractor::isEdgeType(App::DocumentObject* obj)
// if (t.isDerivedFrom(Part::Line::getClassTypeId()) ) {
// result = true;
// } else if (t.isDerivedFrom(Part::Circle::getClassTypeId())) {
// result = true;
// result = true;
// } else if (t.isDerivedFrom(Part::Ellipse::getClassTypeId())) {
// result = true;
// result = true;
// } else if (t.isDerivedFrom(Part::RegularPolygon::getClassTypeId())) {
// result = true;
// result = true;
// }
return result;
}
@@ -389,7 +389,7 @@ bool ShapeExtractor::isPointType(App::DocumentObject* obj)
bool result = false;
Base::Type t = obj->getTypeId();
if (t.isDerivedFrom(Part::Vertex::getClassTypeId())) {
result = true;
result = true;
} else if (isDraftPoint(obj)) {
result = true;
}
@@ -443,7 +443,7 @@ bool ShapeExtractor::prefAdd2d(void)
{
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/General");
bool result = hGrp->GetBool("ShowLoose2d", false);
bool result = hGrp->GetBool("ShowLoose2d", false);
return result;
}

View File

@@ -1,5 +1,5 @@
/***************************************************************************
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* Copyright (c) 2019 WandererFan <wandererfan@gmail.com> *
* *
* This file is part of the FreeCAD CAx development system. *
* *
@@ -45,7 +45,7 @@ namespace TechDraw
class TechDrawExport ShapeExtractor
{
public:
static TopoDS_Shape getShapes(const std::vector<App::DocumentObject*> links);
static TopoDS_Shape getShapes(const std::vector<App::DocumentObject*> links);
static std::vector<TopoDS_Shape> getShapes2d(const std::vector<App::DocumentObject*> links);
static std::vector<TopoDS_Shape> getXShapes(const App::Link* xLink);
static std::vector<TopoDS_Shape> getShapesFromObject(const App::DocumentObject* docObj);