TechDraw: Header uniformity and whitespace fixes
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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 *
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include "PreCompiled.h"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,15 +1,25 @@
|
||||
/***************************************************************************
|
||||
* *
|
||||
* 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 2002 *
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* 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 <sstream>
|
||||
|
||||
@@ -21,4 +21,4 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include "PreCompiled.h"
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -36,7 +36,7 @@
|
||||
|
||||
using namespace TechDrawGui;
|
||||
|
||||
QGCustomImage::QGCustomImage()
|
||||
QGCustomImage::QGCustomImage()
|
||||
{
|
||||
setCacheMode(QGraphicsItem::NoCache);
|
||||
setAcceptHoverEvents(false);
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
virtual QRectF boundingRect() const override;
|
||||
virtual QPainterPath shape() const override;
|
||||
virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget = 0 ) override;
|
||||
|
||||
|
||||
void inEdit(bool b) { m_inEdit = b; }
|
||||
bool inEdit(void) { return m_inEdit; }
|
||||
void startPathEdit(std::vector<QPointF> pathPoints);
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
std::vector<QPointF> getDeltasFromLeader(void);
|
||||
|
||||
void setScale(double s) { m_scale = s; }
|
||||
double getScale(void) { return m_scale; }
|
||||
double getScale(void) { return m_scale; }
|
||||
|
||||
void setPoints(std::vector<QPointF> pts) { m_ghostPoints = pts; }
|
||||
|
||||
@@ -137,7 +137,7 @@ protected:
|
||||
|
||||
QGILeaderLine* m_parentLeader;
|
||||
QGIPrimPath* m_ghost;
|
||||
|
||||
|
||||
double m_startAdj;
|
||||
double m_endAdj;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2012-2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* 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 *
|
||||
@@ -10,7 +10,7 @@
|
||||
* *
|
||||
* 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 *
|
||||
* 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 *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* 2014 wandererfan <WandererFan@gmail.com> *
|
||||
* Copyright (c) 2014 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -161,14 +161,14 @@ void QGIViewAnnotation::drawAnnotation()
|
||||
//TODO: there is still a bug here. entering "'" works, save and restore works, but edit after
|
||||
// save and restore brings "\'" back into text. manually deleting the "\" fixes it until the next
|
||||
// save/restore/edit cycle.
|
||||
// a guess is that the editor for propertyStringList is too enthusiastic about substituting.
|
||||
// a guess is that the editor for propertyStringList is too enthusiastic about substituting.
|
||||
// the substituting might be necessary for using the strings in Python.
|
||||
// ' doesn't seem to help in this case.
|
||||
// ' doesn't seem to help in this case.
|
||||
|
||||
std::string u8String = Base::Tools::escapedUnicodeToUtf8(*it); //from \x??\x?? to real utf8
|
||||
std::string apos = std::regex_replace((u8String), std::regex("\\\\"), ""); //remove doubles.
|
||||
apos = std::regex_replace((apos), std::regex("\\'"), "'"); //replace escaped apos
|
||||
//"less than" symbol chops off line. need to use html sub.
|
||||
//"less than" symbol chops off line. need to use html sub.
|
||||
std::string lt = std::regex_replace((apos), std::regex("<"), "<");
|
||||
ss << lt;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* 2014 wandererfan <WandererFan@gmail.com> *
|
||||
* Copyright (c) 2014 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* 2014 wandererfan <WandererFan@gmail.com> *
|
||||
* Copyright (c) 2014 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -125,7 +125,7 @@ void QGIViewClip::drawClip()
|
||||
QPointF clipOrigin = mapToItem(m_cliparea,midMapped);
|
||||
|
||||
m_cliparea->setRect(r.adjusted(-1,-1,1,1));
|
||||
|
||||
|
||||
std::vector<std::string> childNames = viewClip->getChildViewNames();
|
||||
//for all child Views in Clip, add the graphics representation of the View to the Clip group
|
||||
for(std::vector<std::string>::iterator it = childNames.begin(); it != childNames.end(); it++) {
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* 2014 wandererfan <WandererFan@gmail.com> *
|
||||
* Copyright (c) 2014 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -134,7 +134,7 @@ void QGIViewSymbol::drawSvg()
|
||||
if (viewSymbol->isDerivedFrom(TechDraw::DrawViewArch::getClassTypeId()) ||
|
||||
viewSymbol->isDerivedFrom(TechDraw::DrawViewDraft::getClassTypeId()) ) {
|
||||
scaling = scaling * rezfactor;
|
||||
} else {
|
||||
} else {
|
||||
scaling = scaling * rezfactor / pxMm;
|
||||
}
|
||||
m_svgItem->setScale(scaling);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* 2014 wandererfan <WandererFan@gmail.com> *
|
||||
* Copyright (c) 2014 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
static QRectF guiRect(QRectF r);
|
||||
static QSize guiSize(QSize s);
|
||||
static QSize appSize(QSize s);
|
||||
|
||||
|
||||
private:
|
||||
static double m_rezFactor;
|
||||
};
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -66,7 +66,7 @@ void SymbolChooser::setUiPrimary()
|
||||
} else {
|
||||
std::string resourceDir = App::Application::getResourceDir();
|
||||
std::string defPath = "Mod/TechDraw/Symbols/Welding/AWS/";
|
||||
resourceDir = resourceDir + defPath;
|
||||
resourceDir = resourceDir + defPath;
|
||||
QString defDir = QString::fromUtf8(resourceDir.c_str());
|
||||
ui->fcSymbolDir->setFileName(defDir);
|
||||
loadSymbolNames(defDir);
|
||||
@@ -83,12 +83,12 @@ void SymbolChooser::setUiPrimary()
|
||||
|
||||
void SymbolChooser::onOKClicked()
|
||||
{
|
||||
QDialog::accept();
|
||||
QDialog::accept();
|
||||
QListWidgetItem* sourceItem = ui->lwSymbols->currentItem();
|
||||
if (!sourceItem)
|
||||
return;
|
||||
QString targetText = sourceItem->text();
|
||||
m_symbolPath = m_symbolDir +
|
||||
m_symbolPath = m_symbolDir +
|
||||
targetText +
|
||||
QString::fromUtf8(".svg");
|
||||
|
||||
@@ -107,7 +107,7 @@ void SymbolChooser::onItemClicked(QListWidgetItem* item)
|
||||
//are item and currentItem() the same? should use item?
|
||||
QListWidgetItem* sourceItem = ui->lwSymbols->currentItem();
|
||||
QString targetText = sourceItem->text();
|
||||
m_symbolPath = m_symbolDir +
|
||||
m_symbolPath = m_symbolDir +
|
||||
targetText +
|
||||
QString::fromUtf8(".svg");
|
||||
Q_EMIT symbolSelected(m_symbolPath, m_source);
|
||||
@@ -135,7 +135,7 @@ void SymbolChooser::loadSymbolNames(QString pathToSymbols)
|
||||
QFileInfo fi(fn);
|
||||
item->setText(fi.baseName());
|
||||
QIcon symbolIcon(pathToSymbols + fn);
|
||||
item->setIcon(symbolIcon);
|
||||
item->setIcon(symbolIcon);
|
||||
ui->lwSymbols->addItem(item);
|
||||
}
|
||||
ui->lwSymbols->setCurrentRow(0);
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -35,7 +35,7 @@ class TechDrawGuiExport SymbolChooser : public QDialog
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SymbolChooser(QWidget *parent = 0,
|
||||
SymbolChooser(QWidget *parent = 0,
|
||||
QString startDir = QString(),
|
||||
QString source = QString());
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -143,7 +143,7 @@ TechDraw::DrawViewSymbol* TaskActiveView::createActiveView(void)
|
||||
std::string fileSpec = Base::Tools::toStdString(tempFile.fileName());
|
||||
fileSpec = Base::Tools::escapeEncodeFilename(fileSpec);
|
||||
|
||||
//double estScale =
|
||||
//double estScale =
|
||||
Grabber3d::copyActiveViewToSvgFile(appDoc, fileSpec,
|
||||
ui->qsbWidth->rawValue(),
|
||||
ui->qsbHeight->rawValue(),
|
||||
@@ -159,7 +159,7 @@ TechDraw::DrawViewSymbol* TaskActiveView::createActiveView(void)
|
||||
#endif
|
||||
Command::doCommand(Command::Doc,"svg = f.read()");
|
||||
// Command::doCommand(Command::Doc,"print('length of svg: {}'.format(len(svg)))");
|
||||
|
||||
|
||||
Command::doCommand(Command::Doc,"f.close()");
|
||||
Command::doCommand(Command::Doc,"App.activeDocument().%s.Symbol = svg",symbolName.c_str());
|
||||
|
||||
@@ -208,7 +208,7 @@ bool TaskActiveView::accept()
|
||||
bool TaskActiveView::reject()
|
||||
{
|
||||
// Base::Console().Message("TAV::reject()\n");
|
||||
//nothing to remove.
|
||||
//nothing to remove.
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -242,7 +242,7 @@ void TaskCenterLine::setUiEdit()
|
||||
ui->rbAligned->setEnabled(false);
|
||||
else
|
||||
ui->rbAligned->setEnabled(true);
|
||||
|
||||
|
||||
Base::Quantity qVal;
|
||||
qVal.setUnit(Base::Unit::Length);
|
||||
qVal.setValue(m_cl->m_vShift);
|
||||
@@ -435,7 +435,7 @@ double TaskCenterLine::getCenterWidth()
|
||||
auto lg = TechDraw::LineGroup::lineGroupFactory(lgName);
|
||||
|
||||
double width = lg->getWeight("Graphic");
|
||||
delete lg;
|
||||
delete lg;
|
||||
Gui::ViewProvider* vp = QGIView::getViewProvider(m_partFeat);
|
||||
auto partVP = dynamic_cast<ViewProviderViewPart*>(vp);
|
||||
if ( partVP != nullptr ) {
|
||||
@@ -491,7 +491,7 @@ bool TaskCenterLine::reject()
|
||||
if (getCreateMode() &&
|
||||
(m_partFeat != nullptr) ) {
|
||||
// Base::Console().Message("TCL::reject - create Mode!!\n");
|
||||
//nothing to remove.
|
||||
//nothing to remove.
|
||||
}
|
||||
|
||||
if (!getCreateMode() &&
|
||||
@@ -500,7 +500,7 @@ bool TaskCenterLine::reject()
|
||||
//nothing to un-update
|
||||
}
|
||||
|
||||
//make sure any dangling objects are cleaned up
|
||||
//make sure any dangling objects are cleaned up
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -106,7 +106,7 @@ TaskCosVertex::TaskCosVertex(TechDraw::DrawViewPart* baseFeat,
|
||||
m_view = m_mdi->getQGVPage();
|
||||
|
||||
setUiPrimary();
|
||||
|
||||
|
||||
connect(ui->pbTracker, SIGNAL(clicked(bool)),
|
||||
this, SLOT(onTrackerClicked(bool)));
|
||||
|
||||
@@ -164,7 +164,7 @@ void TaskCosVertex::addCosVertex(QPointF qPos)
|
||||
{
|
||||
// Base::Console().Message("TCV::addCosVertex(%s)\n", TechDraw::DrawUtil::formatVector(qPos).c_str());
|
||||
Base::Vector3d pos(qPos.x(), -qPos.y());
|
||||
// int idx =
|
||||
// int idx =
|
||||
(void) m_baseFeat->addCosmeticVertex(pos);
|
||||
m_baseFeat->requestPaint();
|
||||
}
|
||||
@@ -350,7 +350,7 @@ bool TaskCosVertex::reject()
|
||||
m_mdi->setContextMenuPolicy(m_saveContextPolicy);
|
||||
}
|
||||
|
||||
//make sure any dangling objects are cleaned up
|
||||
//make sure any dangling objects are cleaned up
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2020 Wandererfan <wandererfan@gmail.com *
|
||||
* Copyright (c) 2020 WandererFan <wandererfan@gmail.com *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -213,14 +213,14 @@ void TaskCosmeticLine::createCosmeticLine(void)
|
||||
y = ui->qsby2->value().getValue();
|
||||
z = ui->qsbz2->value().getValue();
|
||||
Base::Vector3d p1(x, y, z);
|
||||
|
||||
|
||||
Base::Vector3d centroid = m_partFeat->getOriginalCentroid();
|
||||
|
||||
if (ui->rb3d1->isChecked()) {
|
||||
p0 = p0 - centroid;
|
||||
p0 = DrawUtil::invertY(m_partFeat->projectPoint(p0));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ui->rb3d2->isChecked()) {
|
||||
p1 = p1 - centroid;
|
||||
p1 = DrawUtil::invertY(m_partFeat->projectPoint(p1));
|
||||
@@ -284,7 +284,7 @@ bool TaskCosmeticLine::accept()
|
||||
|
||||
bool TaskCosmeticLine::reject()
|
||||
{
|
||||
//there's nothing to do.
|
||||
//there's nothing to do.
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2020 Wandererfan <wandererfan@gmail.com *
|
||||
* Copyright (c) 2020 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -192,7 +192,7 @@ TaskDetail::TaskDetail(TechDraw::DrawViewDetail* detailFeat):
|
||||
m_baseFeat = dynamic_cast<TechDraw::DrawViewPart*>(baseObj);
|
||||
if (m_baseFeat != nullptr) {
|
||||
m_baseName = m_baseFeat->getNameInDocument();
|
||||
} else {
|
||||
} else {
|
||||
Base::Console().Error("TaskDetail - no BaseView. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
@@ -286,8 +286,8 @@ void TaskDetail::setUiFromFeat()
|
||||
Base::Vector3d anchor;
|
||||
|
||||
TechDraw::DrawViewDetail* detailFeat = getDetailFeat();
|
||||
QString detailDisplay = QString::fromUtf8(detailFeat->getNameInDocument()) +
|
||||
QString::fromUtf8(" / ") +
|
||||
QString detailDisplay = QString::fromUtf8(detailFeat->getNameInDocument()) +
|
||||
QString::fromUtf8(" / ") +
|
||||
QString::fromUtf8(detailFeat->Label.getValue());
|
||||
ui->leDetailView->setText(detailDisplay);
|
||||
anchor = detailFeat->AnchorPoint.getValue();
|
||||
@@ -419,7 +419,7 @@ void TaskDetail::editByHighlight()
|
||||
}
|
||||
|
||||
//dragEnd is in scene coords.
|
||||
void TaskDetail::onHighlightMoved(QPointF dragEnd)
|
||||
void TaskDetail::onHighlightMoved(QPointF dragEnd)
|
||||
{
|
||||
// Base::Console().Message("TD::onHighlightMoved(%s) - highlight: %X\n",
|
||||
// DrawUtil::formatVector(dragEnd).c_str(), m_ghost);
|
||||
@@ -551,7 +551,7 @@ QPointF TaskDetail::getAnchorScene()
|
||||
basePos = Base::Vector3d (x, -y, 0.0);
|
||||
scale = dvp->getScale();
|
||||
} else { //part of projection group
|
||||
|
||||
|
||||
DrawProjGroup* dpg = dpgi->getPGroup();
|
||||
if (dpg == nullptr) {
|
||||
Base::Console().Message("TD::getAnchorScene - projection group is confused\n");
|
||||
@@ -568,7 +568,7 @@ QPointF TaskDetail::getAnchorScene()
|
||||
|
||||
Base::Vector3d xyScene = Rez::guiX(basePos);
|
||||
Base::Vector3d anchorOffsetScene = Rez::guiX(anchorPos) * scale;
|
||||
Base::Vector3d netPos = xyScene + anchorOffsetScene;
|
||||
Base::Vector3d netPos = xyScene + anchorOffsetScene;
|
||||
QPointF qAnchor(netPos.x, netPos.y);
|
||||
return qAnchor;
|
||||
}
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -204,7 +204,7 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
m_qgParent = nullptr;
|
||||
m_haveMdi = true;
|
||||
m_mdi = vpp->getMDIViewPage();
|
||||
if (m_mdi != nullptr) {
|
||||
if (m_mdi != nullptr) {
|
||||
m_scene = m_mdi->m_scene;
|
||||
m_view = m_mdi->getQGVPage();
|
||||
if (baseFeat != nullptr) {
|
||||
@@ -217,7 +217,7 @@ TaskLeaderLine::TaskLeaderLine(TechDraw::DrawView* baseFeat,
|
||||
ui->setupUi(this);
|
||||
|
||||
setUiPrimary();
|
||||
|
||||
|
||||
connect(ui->pbTracker, SIGNAL(clicked(bool)),
|
||||
this, SLOT(onTrackerClicked(bool)));
|
||||
connect(ui->pbCancelEdit, SIGNAL(clicked(bool)),
|
||||
@@ -515,7 +515,7 @@ void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
Base::Console().Message("TLL::onTrackerClicked - no Mdi, no Tracker!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if ( (m_pbTrackerState == TRACKERSAVE) &&
|
||||
(getCreateMode()) ){
|
||||
if (m_tracker != nullptr) {
|
||||
@@ -568,7 +568,7 @@ void TaskLeaderLine::onTrackerClicked(bool b)
|
||||
QGVPage* qgvp = m_mdi->getQGVPage();
|
||||
QGIView* qgiv = qgvp->findQViewForDocObj(m_lineFeat);
|
||||
QGILeaderLine* qgLead = dynamic_cast<QGILeaderLine*>(qgiv);
|
||||
|
||||
|
||||
if (qgLead == nullptr) {
|
||||
//tarfu
|
||||
Base::Console().Error("TaskLeaderLine - can't find leader graphic\n");
|
||||
@@ -635,7 +635,7 @@ void TaskLeaderLine::startTracker(void)
|
||||
|
||||
void TaskLeaderLine::onTrackerFinished(std::vector<QPointF> pts, QGIView* qgParent)
|
||||
{
|
||||
//in this case, we already know who the parent is. We don't need QGTracker to tell us.
|
||||
//in this case, we already know who the parent is. We don't need QGTracker to tell us.
|
||||
(void) qgParent;
|
||||
// Base::Console().Message("TTL::onTrackerFinished() - parent: %X\n",qgParent);
|
||||
if (pts.empty()) {
|
||||
@@ -742,7 +742,7 @@ void TaskLeaderLine::onPointEditComplete(void)
|
||||
{
|
||||
// Base::Console().Message("TTL::onPointEditComplete()\n");
|
||||
m_inProgressLock = false;
|
||||
|
||||
|
||||
m_pbTrackerState = TRACKEREDIT;
|
||||
ui->pbTracker->setText(QString::fromUtf8("Edit points"));
|
||||
ui->pbTracker->setEnabled(true);
|
||||
@@ -843,7 +843,7 @@ bool TaskLeaderLine::reject()
|
||||
removeTracker();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
if (!doc) return false;
|
||||
|
||||
@@ -860,7 +860,7 @@ bool TaskLeaderLine::reject()
|
||||
m_trackerMode = QGTracker::TrackerMode::None;
|
||||
removeTracker();
|
||||
|
||||
//make sure any dangling objects are cleaned up
|
||||
//make sure any dangling objects are cleaned up
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2014 Joe Dowsett <dowsettjoe[at]yahoo[dot]co[dot]uk> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -75,8 +75,8 @@ TaskProjGroup::TaskProjGroup(TechDraw::DrawProjGroup* featView, bool mode) :
|
||||
|
||||
setFractionalScale(multiView->getScale());
|
||||
ui->cmbScaleType->setCurrentIndex(multiView->ScaleType.getValue());
|
||||
|
||||
//Allow or prevent scale changing initially
|
||||
|
||||
//Allow or prevent scale changing initially
|
||||
if (multiView->ScaleType.isValue("Custom")) {
|
||||
ui->sbScaleNum->setEnabled(true);
|
||||
ui->sbScaleDen->setEnabled(true);
|
||||
@@ -170,7 +170,7 @@ void TaskProjGroup::restoreGroupState()
|
||||
Base::Console().Message("TPG::restoreGroupState()\n");
|
||||
if (multiView != nullptr) {
|
||||
multiView->ProjectionType.setValue(m_saveProjType.c_str());
|
||||
multiView->ScaleType.setValue(m_saveScaleType.c_str());
|
||||
multiView->ScaleType.setValue(m_saveScaleType.c_str());
|
||||
multiView->Scale.setValue(m_saveScale);
|
||||
multiView->AutoDistribute.setValue(m_saveAutoDistribute);
|
||||
multiView->spacingX.setValue(m_saveSpacingX);
|
||||
@@ -224,7 +224,7 @@ void TaskProjGroup::rotateButtonClicked(void)
|
||||
multiView->rotateRight();
|
||||
} else if ( clicked == ui->butLeftRotate) {
|
||||
multiView->rotateLeft();
|
||||
} else if ( clicked == ui->butCWRotate ) {
|
||||
} else if ( clicked == ui->butCWRotate ) {
|
||||
multiView->spinCW();
|
||||
} else if ( clicked == ui->butCCWRotate) {
|
||||
multiView->spinCCW();
|
||||
@@ -257,7 +257,7 @@ void TaskProjGroup::scaleTypeChanged(int index)
|
||||
if (blockUpdate)
|
||||
return;
|
||||
|
||||
//defaults to prevent scale changing
|
||||
//defaults to prevent scale changing
|
||||
ui->sbScaleNum->setEnabled(false);
|
||||
ui->sbScaleDen->setEnabled(false);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Joe Dowsett <j-dowsett[at]users.sourceforge.net> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
const ViewProviderProjGroup * getViewProvider() const { return viewProvider; }
|
||||
TechDraw::DrawProjGroup * getMultiView() const { return multiView; }
|
||||
|
||||
|
||||
virtual QDialogButtonBox::StandardButtons getStandardButtons() const
|
||||
{ return QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel; }
|
||||
virtual void modifyStandardButtons(QDialogButtonBox* box);
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -108,7 +108,7 @@ TaskRichAnno::TaskRichAnno(TechDrawGui::ViewProviderRichAnno* annoVP) :
|
||||
return;
|
||||
}
|
||||
|
||||
//m_baseFeat can be null
|
||||
//m_baseFeat can be null
|
||||
App::DocumentObject* obj = m_annoFeat->AnnoParent.getValue();
|
||||
if (obj != nullptr) {
|
||||
if ( obj->isDerivedFrom(TechDraw::DrawView::getClassTypeId()) ) {
|
||||
@@ -123,7 +123,7 @@ TaskRichAnno::TaskRichAnno(TechDrawGui::ViewProviderRichAnno* annoVP) :
|
||||
m_mdi = dvp->getMDIViewPage();
|
||||
m_qgParent = nullptr;
|
||||
m_haveMdi = true;
|
||||
if (m_mdi != nullptr) {
|
||||
if (m_mdi != nullptr) {
|
||||
m_view = m_mdi->getQGVPage();
|
||||
if (m_baseFeat != nullptr) {
|
||||
m_qgParent = m_view->findQViewForDocObj(m_baseFeat);
|
||||
@@ -183,7 +183,7 @@ TaskRichAnno::TaskRichAnno(TechDraw::DrawView* baseFeat,
|
||||
m_qgParent = nullptr;
|
||||
m_haveMdi = true;
|
||||
m_mdi = dvp->getMDIViewPage();
|
||||
if (m_mdi != nullptr) {
|
||||
if (m_mdi != nullptr) {
|
||||
m_view = m_mdi->getQGVPage();
|
||||
if (baseFeat != nullptr) {
|
||||
m_qgParent = m_view->findQViewForDocObj(baseFeat);
|
||||
@@ -244,7 +244,7 @@ void TaskRichAnno::setUiPrimary()
|
||||
#endif
|
||||
}
|
||||
|
||||
void TaskRichAnno::enableTextUi(bool b)
|
||||
void TaskRichAnno::enableTextUi(bool b)
|
||||
{
|
||||
ui->pbEditor->setEnabled(b);
|
||||
ui->teAnnoText->setEnabled(b);
|
||||
@@ -266,7 +266,7 @@ void TaskRichAnno::setUiEdit()
|
||||
enableVPUi(true);
|
||||
setWindowTitle(m_title);
|
||||
enableTextUi(true);
|
||||
|
||||
|
||||
if (m_annoFeat != nullptr) {
|
||||
std::string baseName("None");
|
||||
App::DocumentObject* docObj = m_annoFeat->AnnoParent.getValue();
|
||||
@@ -430,7 +430,7 @@ void TaskRichAnno::commonFeatureUpdate(void)
|
||||
{
|
||||
// Base::Console().Message("TRA::commonFeatureUpdate()\n");
|
||||
m_annoFeat->setPosition(Rez::appX(m_attachPoint.x),Rez::appX(- m_attachPoint.y), true);
|
||||
m_annoFeat->AnnoText.setValue(ui->teAnnoText->toHtml().toUtf8());
|
||||
m_annoFeat->AnnoText.setValue(ui->teAnnoText->toHtml().toUtf8());
|
||||
m_annoFeat->MaxWidth.setValue(ui->dsbMaxWidth->value().getValue());
|
||||
m_annoFeat->ShowFrame.setValue(ui->cbShowFrame->isChecked());
|
||||
}
|
||||
@@ -565,7 +565,7 @@ bool TaskRichAnno::reject()
|
||||
// Base::Console().Message("TRA::reject - edit in progress!!\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (m_basePage != nullptr) {
|
||||
Gui::Document* doc = Gui::Application::Instance->getDocument(m_basePage->getDocument());
|
||||
if (!doc) {
|
||||
@@ -577,7 +577,7 @@ bool TaskRichAnno::reject()
|
||||
}
|
||||
}
|
||||
|
||||
//make sure any dangling objects are cleaned up
|
||||
//make sure any dangling objects are cleaned up
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
@@ -132,7 +132,7 @@ TaskWeldingSymbol::TaskWeldingSymbol(TechDraw::DrawWeldSymbol* weld) :
|
||||
Base::Console().Error("TaskWeldingSymbol - bad parameters. Can not proceed.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
App::DocumentObject* obj = m_weldFeat->Leader.getValue();
|
||||
if ( (obj != nullptr) &&
|
||||
(obj->isDerivedFrom(TechDraw::DrawLeaderLine::getClassTypeId())) ) {
|
||||
@@ -429,7 +429,7 @@ void TaskWeldingSymbol::onDirectorySelected(const QString& newDir)
|
||||
void TaskWeldingSymbol::onSymbolSelected(QString symbolPath,
|
||||
QString source)
|
||||
{
|
||||
// Base::Console().Message("TWS::onSymbolSelected(%s) - source: %s\n",
|
||||
// Base::Console().Message("TWS::onSymbolSelected(%s) - source: %s\n",
|
||||
// qPrintable(symbolPath), qPrintable(source));
|
||||
QIcon targetIcon(symbolPath);
|
||||
QSize iconSize(32,32);
|
||||
@@ -483,12 +483,12 @@ void TaskWeldingSymbol::getTileFeats(void)
|
||||
std::vector<TechDraw::DrawTileWeld*> tiles = m_weldFeat->getTiles();
|
||||
m_arrowFeat = nullptr;
|
||||
m_otherFeat = nullptr;
|
||||
|
||||
|
||||
if (!tiles.empty()) {
|
||||
TechDraw::DrawTileWeld* tempTile = tiles.at(0);
|
||||
if (tempTile->TileRow.getValue() == 0) {
|
||||
m_arrowFeat = tempTile;
|
||||
} else {
|
||||
} else {
|
||||
m_otherFeat = tempTile;
|
||||
}
|
||||
}
|
||||
@@ -496,7 +496,7 @@ void TaskWeldingSymbol::getTileFeats(void)
|
||||
TechDraw::DrawTileWeld* tempTile = tiles.at(1);
|
||||
if (tempTile->TileRow.getValue() == 0) {
|
||||
m_arrowFeat = tempTile;
|
||||
} else {
|
||||
} else {
|
||||
m_otherFeat = tempTile;
|
||||
}
|
||||
}
|
||||
@@ -506,7 +506,7 @@ void TaskWeldingSymbol::getTileFeats(void)
|
||||
TechDraw::DrawWeldSymbol* TaskWeldingSymbol::createWeldingSymbol(void)
|
||||
{
|
||||
// Base::Console().Message("TWS::createWeldingSymbol()\n");
|
||||
|
||||
|
||||
std::string symbolName = m_leadFeat->getDocument()->getUniqueObjectName("WeldSymbol");
|
||||
std::string symbolType = "TechDraw::DrawWeldSymbol";
|
||||
|
||||
@@ -680,7 +680,7 @@ bool TaskWeldingSymbol::accept()
|
||||
bool TaskWeldingSymbol::reject()
|
||||
{
|
||||
// Base::Console().Message("TWS::reject()\n");
|
||||
//nothing to remove.
|
||||
//nothing to remove.
|
||||
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"App.activeDocument().recompute()");
|
||||
Gui::Command::doCommand(Gui::Command::Gui,"Gui.ActiveDocument.resetEdit()");
|
||||
|
||||
@@ -66,7 +66,7 @@ void TemplateTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
||||
ui.setFieldContent(tmplte->EditableTexts[fieldNameStr]);
|
||||
|
||||
if (ui.exec() == QDialog::Accepted) {
|
||||
//WF: why is this escaped?
|
||||
//WF: why is this escaped?
|
||||
// "<" is converted elsewhere and no other characters cause problems.
|
||||
// escaping causes "&" to appear as "&" etc
|
||||
//#if QT_VERSION >= 0x050000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
|
||||
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2017 Wandererfan <wandererfan@gmail.com> *
|
||||
* Copyright (c) 2017 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2015 Wandererfan <wandererfan@gmail.com> *
|
||||
* Copyright (c) 2015 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2015 Wandererfan <wandererfan@gmail.com> *
|
||||
* Copyright (c) 2015 WandererFan <wandererfan@gmail.com> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
TechDraw::DrawHatch* getViewObject() const;
|
||||
|
||||
virtual Gui::MDIView *getMDIView() const override;
|
||||
|
||||
|
||||
private:
|
||||
static App::PropertyFloatConstraint::Constraints scaleRange;
|
||||
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2004 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* Copyright (c) 2012 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* Copyright (c) 2012 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
@@ -179,18 +179,18 @@ void ViewProviderPage::updateData(const App::Property* prop)
|
||||
signalChangeIcon();
|
||||
//if the template is changed, rebuild the visual
|
||||
} else if (prop == &(page->Template)) {
|
||||
if (m_mdiView &&
|
||||
if (m_mdiView &&
|
||||
!page->isUnsetting()) {
|
||||
m_mdiView->matchSceneRectToTemplate();
|
||||
m_mdiView->updateTemplate();
|
||||
}
|
||||
} else if (prop == &(page->Label)) {
|
||||
if (m_mdiView &&
|
||||
if (m_mdiView &&
|
||||
!page->isUnsetting()) {
|
||||
m_mdiView->setTabText(page->Label.getValue());
|
||||
}
|
||||
} else if (prop == &page->Views) {
|
||||
if (m_mdiView && !page->isUnsetting())
|
||||
if (m_mdiView && !page->isUnsetting())
|
||||
m_mdiView->fixOrphans();
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ bool ViewProviderPage::onDelete(const std::vector<std::string> &)
|
||||
qApp->translate("Std_Delete", "Object dependencies"), bodyMessage,
|
||||
QMessageBox::Yes, QMessageBox::No);
|
||||
if (DialogResult == QMessageBox::Yes) {
|
||||
removeMDIView();
|
||||
removeMDIView();
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
@@ -328,7 +328,7 @@ std::vector<App::DocumentObject*> ViewProviderPage::claimChildren(void) const
|
||||
// DrawViewDimension
|
||||
// DrawViewBalloon
|
||||
// DrawLeaderLine
|
||||
// DrawRichAnno
|
||||
// DrawRichAnno
|
||||
// any FeatuerView in a DrawViewClip
|
||||
// DrawHatch
|
||||
// DrawWeldSymbol
|
||||
@@ -476,7 +476,7 @@ bool ViewProviderPage::canDelete(App::DocumentObject *obj) const
|
||||
}
|
||||
|
||||
//! Redo the whole visual page
|
||||
void ViewProviderPage::onGuiRepaint(const TechDraw::DrawPage* dp)
|
||||
void ViewProviderPage::onGuiRepaint(const TechDraw::DrawPage* dp)
|
||||
{
|
||||
if (dp == getDrawPage()) {
|
||||
if (!m_mdiView.isNull() &&
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* 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. *
|
||||
* *
|
||||
@@ -161,7 +161,7 @@ bool ViewProviderProjGroup::onDelete(const std::vector<std::string> &)
|
||||
|
||||
// get the items in the group
|
||||
auto objs = claimChildren();
|
||||
|
||||
|
||||
// iterate over all item to check which ones have a section or detail view
|
||||
for (auto ObjectIterator : objs) {
|
||||
// get item
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* Copyright (c) 2014 Luke Parry <l.parry@warwick.ac.uk> *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -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. *
|
||||
* *
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
# FreeCAD init script of the TechDraw module
|
||||
# (c) 2001 Juergen Riegel
|
||||
|
||||
#***************************************************************************
|
||||
#* (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
|
||||
#* Copyright (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
|
||||
#* *
|
||||
#* This file is part of the FreeCAD CAx development system. *
|
||||
#* *
|
||||
@@ -22,7 +19,8 @@
|
||||
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
#* USA *
|
||||
#* *
|
||||
#* Juergen Riegel 2002 *
|
||||
#***************************************************************************/
|
||||
|
||||
# FreeCAD init script of the TechDraw module
|
||||
|
||||
FreeCAD.__unit_test__ += [ "TestTechDrawApp" ]
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
# TechDraw gui init module
|
||||
# (c) 2003 Juergen Riegel
|
||||
#
|
||||
# Gathering all the information to start FreeCAD
|
||||
# This is the second one of three init scripts, the third one
|
||||
# runs when the gui is up
|
||||
|
||||
#***************************************************************************
|
||||
#* (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
|
||||
#* Copyright (c) 2002,2003 Juergen Riegel <juergen.riegel@web.de> *
|
||||
#* *
|
||||
#* This file is part of the FreeCAD CAx development system. *
|
||||
#* *
|
||||
@@ -26,9 +19,14 @@
|
||||
#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
#* USA *
|
||||
#* *
|
||||
#* Juergen Riegel 2002 *
|
||||
#***************************************************************************/
|
||||
|
||||
# TechDraw gui init module
|
||||
#
|
||||
# Gathering all the information to start FreeCAD
|
||||
# This is the second one of three init scripts, the third one
|
||||
# runs when the gui is up
|
||||
|
||||
|
||||
class TechDrawWorkbench (Workbench):
|
||||
"Technical Drawing workbench object"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#**************************************************************************
|
||||
# Copyright (c) 2015 WandererFan <wandererfan@gmail.com> *
|
||||
# *
|
||||
# This file is part of the FreeCAD CAx development system. *
|
||||
|
||||
@@ -1,10 +1,32 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
#**************************************************************************
|
||||
# Copyright (c) 2018 WandererFan <wandererfan@gmail.com> *
|
||||
# *
|
||||
# This file is part of the FreeCAD CAx development system. *
|
||||
# *
|
||||
# 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. *
|
||||
# *
|
||||
# FreeCAD 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 FreeCAD; if not, write to the Free Software *
|
||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
|
||||
# USA *
|
||||
#**************************************************************************
|
||||
|
||||
# move Views from Drawing Page to TechDraw Page in the current document
|
||||
# usage: select 1 Drawing Page and 1 TechDraw Page, run moveViews macro
|
||||
# outcome: Content of Drawing Page will be inserted into TechDraw Page as DrawViewSymbol
|
||||
# (ie an SVG symbol)
|
||||
# Name: moveView macro
|
||||
# About: move Views from Drawing Page to TechDraw Page in the current doc
|
||||
# Usage: select 1 Drawing Page and 1 TechDraw Page, run moveViews macro
|
||||
# Outcome: Content of Drawing Page will be inserted into TechDraw Page as
|
||||
# DrawViewSymbol (ie an SVG symbol)
|
||||
|
||||
import FreeCAD
|
||||
import FreeCADGui
|
||||
|
||||
Reference in New Issue
Block a user