Commit Graph

616 Commits

Author SHA1 Message Date
wmayer
378de3c8a1 fix -Wcatch-value=, fix -Wpedantic 2019-09-18 14:36:23 +02:00
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
wmayer
006e1198dd use NaN for invalid quantities instead of DOUBLE_MIN 2019-09-16 18:00:24 +02:00
wmayer
1f3d2389bc start to replace old C-style casts with static_cast or reinterpret_cast, avoid implicit casts 2019-09-16 17:59:18 +02:00
wmayer
570165fc0d move method setTransform() from ViewVolumeProjection to ViewProjMethod, restructure ViewProjMethod 2019-09-10 23:21:09 +02:00
wmayer
9b15d01b29 fix implementation of Rotation::isSame(const Rotation& q, double tol) and extend Python bindings 2019-09-10 14:17:07 +02:00
Zheng, Lei
4b0baba39f Base: fix Matrix4D::hasScale() tol checking 2019-09-10 14:17:06 +02:00
Zheng, Lei
95dfd5a6cd Base: fix verbose checking in Console::Log() 2019-09-10 14:17:06 +02:00
wmayer
e228f23b27 fix -Wreturn-std-move 2019-09-07 14:45:03 +02:00
wmayer
15c9ae1e26 remove wrong typename keyword 2019-09-07 00:29:18 +02:00
wmayer
e981537446 fix -Wunused-local-typedef 2019-09-06 23:03:43 +02:00
wmayer
9f7075bb8f extend convertTo function to also support SbRotation/Base::Rotation 2019-09-06 21:29:51 +02:00
Dietmar Czekay
c3f0288ea5 add VacuumPermittivity and fix adding user values to material editor in FEM 2019-09-04 11:29:09 -03:00
wmayer
10cd535ceb use shared_ptr to avoid possible memory leaks and improve exception-safety 2019-09-03 17:21:13 +02:00
Jean-Marie Verdun
85198f08a7 Destroy XMLReader object attached to Reader one when this one is gone as to avoid
potential memory leaks.
2019-09-03 17:21:08 +02:00
Jean-Marie Verdun
27e7b9913a Add initial version of the Cloud workbench 2019-09-03 17:21:05 +02:00
Zheng, Lei
69268ce7f4 Base: fix pyCall() exception
This function is wildly used in FeaturePython and
ViewProviderPythonFeature, which explicitly catches Py::Exception, not
Base::Exception. So pyCall() should throw Py::Exception, too.
2019-08-30 15:47:04 +02:00
Zheng, Lei
22541cfbdf Base: fix line ending in PyObjectBase.h 2019-08-28 17:46:06 +02:00
wmayer
218d849355 use GNU directory structure on non-Windows systems 2019-08-22 16:57:11 +02:00
Tomas Pavlicek
46c73062ff TechDraw: Radius drawing refactored - ASME support 2019-08-21 19:27:12 -04:00
wmayer
7e70438ae3 fix -Winconsistent-missing-override 2019-08-17 19:51:33 +02:00
Zheng, Lei
9e3a981d37 Base: fix duplicated exception message
Because the exception can propagate across C++ and Python boundary
multiple times, prepending extra information may cause duplication,
something like,

"FreeCAD exception thrown(FreeCAD exception thrown(..."
2019-08-17 15:32:49 +02:00
luz.paz
5b74dc8b0d Fix typos in src/Base 2019-08-17 15:32:49 +02:00
Zheng, Lei
aa3e81f4fc Base::Reader: support reading child element with the same name as parent
Future GuiDocument.xml will save recursive tree item expansion status
using child element with the same name as the parent.
2019-08-17 14:52:11 +02:00
Zheng, Lei
8227103ceb Gui: AutoSaver and recovery changes
* Fix AutoSaver inconsistent BinaryBrep setting

* Use temperary name when auto saving, so that it won't overwrite the
  original file, which may cause corruption when crashing in the middel
  of auto saving, especially if auto saving in a separate thread.

* Support auto recovery document containing external links

* Do not mark success after auto recover, in case the program crash
  again before the user remember to save the just recovered file. Only
  mark when user saves the document.
2019-08-17 14:52:11 +02:00
Zheng, Lei
94c228973d App: API changes for document recompute/save/restore/import/export
This patch adds support of recomputation with external linked object,
as well as external document auto loading and partial loading.

Application:

* Modified new/openDocument()/signalNewDocument to choose whether to
  signal GUI for creating a view for the document. This makes it possible
  to suppress view creation when opening external documents.

* New API openDocuments() which does the actual job of loading the
  document together with any external dependencies. There are afew
  extra arguments to allow setting FileName property differently from
  the actual file path, which are required when auto loading
  dependencies during document recovery (with future patch to
  Gui::DocumentRecovery)

* openDocumentPrivate() is an internal helper for opening individual
  document.

* New signalStart/FinishOpenDocument to be signaled before and after
  opening a document. There may be multiple depending documents actually
  opened in between these two signals.

* New signalBeforeRecomputeDocument signaled before recompute a
  document.

* New API addPendingDocument() for use by external capable link
  properties' to queue up external documents.

* isRestoring/isClosingAll(), for convenience status reporting.

Document:

* signalFinishImport/RestoreObjects, new signal triggered after imported
  or restored all input objects

* signalBeforeRecompute, signaled before start recomputing this document

* Modified signalRecomputed with additional recomputed objects, this is
  to make it more efficient for Gui::TreeWidget to check recomputation
  result.

* signalSkipRecompute, signal to inform which objects are skipped
  during recomputation because of their owner document SkipRecompute
  setting.

* restore/save/read/writeObjects() modified to suport partial
  loading. See [here](https://git.io/fj6PY) for more information.

* afterRestore(), internal function called to finish restore. The
  function is separated from restore() because there is quite a few
  critical steps needed to fully restore a document with external
  linking. See [here](https://git.io/fj6P4) for more information.

* DocumentP::_RecomputeLog is modified to store more accurate object
  recomputation error, including those happened during restore/import.

* isExporting(), new API for checking if an object is exporting.
  External linking properties will use this function to decide how to
  export.

* copyObject(), modified to support external linking objects, and
  accepts multiple input objects.

* moveObject(), modified to support arbitary object moves. The original
  implementation may cause crash if undo/redo is enabled. Furthermore,
  because the original information fakes the object's deletion to break
  its dependency, it does not work for objects that may auto delete their
  children when being deleted. The new implementation copy the object,
  and than paste it to the other document. It then deletes the input
  objects from the original document. In case of recursive move, it only
  deletes the depending object if it has an empty in list.

* importLinks(), new API to import any external object linked by the
  input objects into this document. It will auto correct all link
  references after importing.

* getDependencyList/_rebuildDependencyList(), these two APIs are unified
  and implemented by an internal function _buildDependencyList() with a
  new algorithm to handle external objects. The returned dependency list
  will now include objects from external documents. In case of cyclic
  dependencies, getDpendencyList() will report the actual objects
  involved in dependency loops.

* mustExecute(), new API to check if there are any object requires
  recomputation. This function will call _buildDependencyList() and
  check for external objects as well.

* addRecomputeObject(), new API for marking changes during document
  restore. It only marks the object but does not actually recompute
  them for performance reason. One use case is for geo feature to
  request for recomputation to generate geometry topological names.

* recompute(), support partial, external, and inverse dependency
  recomputation. Improve error handling during recomputation.
  See [here](https://git.io/fj6PO) for more information.

* _recomputeFeature(), suppoert user abort.

* getDependentDocuments/getInList(), new API to obtain an optional
  dependency sorted list of depending documents.

DocumentObject:

* Add various ObjectStatus flags

* isExporting/getExportName(), return a safe name for exporting, in the
  form of <ObjName>@<DocName>, which is guarrenteed to be unique.
  Various link property will save linked object using this name if the
  the linked object is exported together with the owner object, see
  [PropertyLinkBase::restoreLabelReference()](https://git.io/fj6XO)
  for more information.

* recomputeFeature(), add option to recompute this object together with
  all its dependent objects.

* canLoadPartial(), new API for [partial document loading](https://git.io/fj6PY).

MergeDocuments:

* Move object name mapping logic to various link properties. See

Base::Sequencer:

* Add new API checkAbort() for checking user abort.
2019-08-17 14:52:10 +02:00
Zheng, Lei
3fcbf71fb5 Base: misc patches
Convenience macros/function (in Interpreter.h)

* FC_PY_GetObject/Callable(), look for callables in a python object,
  which will be used in future patch to improve performance in various
  python observer/features.

* pyCall(WithKeywords)(), helper function to invoke the callable

Matrix4D:

* hasScale(), check if there is any scale in the transformation. If so,
  further check if the scale is uniform or not. This will be used in
  future patch for Part::TopoShape to decide which type of transform to
  apply.

Placement:

* translate/rotate(), new convenience API

Rotation:

* isSame/multiVec(), new convenience API

Polygon2d:

* Intersect(), GetCenter(), new convenience API.

FlagToggler:

* New class for exception safe flag toggling, similar to StateLocker
  but with template (actually, FlagToggler is added earlier by me).

BitsetLocker:

* New class for exception manipulation of a std::bitset variable.
2019-08-17 14:52:08 +02:00
Zheng, Lei
59417068f5 Base: improve exception
For better FC and Python exception mapping.
2019-08-17 14:52:08 +02:00
Zheng, Lei
aa7d780f5d Base::FileInfo: fix left overs in transient directory
Setting ReadWrite permssion removes executable permission, causing
error when removing directory on Linux.
2019-08-17 14:52:08 +02:00
Zheng, Lei
50cefc5104 Console: improve console logging facility 2019-08-17 14:52:08 +02:00
wmayer
df05840212 handle gimbal lock when converting between quaternion and Euler angles (issue #0004062) 2019-07-22 16:31:42 +02:00
mwganson
3cc93d1961 [enable report view on warnings/erros] add reportoutputobserver class, manage report view visibility via QDocketWidget toggleViewAction() rather than directly with show(), remove unnecessary variables 2019-07-21 15:58:12 +02:00
mwganson
b20dd0da10 Show report view on all warnings or errors by default, can be disabled in preferences 2019-07-21 15:57:57 +02:00
Yorik van Havre
057c79c11c Doxygen tweaks 2019-07-17 18:01:56 -03:00
Yorik van Havre
8048f93627 Cleanup in doxygen stuff 2019-07-15 23:20:52 -03:00
Abdullah Tahiri
1a401a6a50 MSVC2013 c++11 has make_unique pointer definition, so do not overload it. 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
cf813ea89f Clang complains of the specialisation after implicit instantiation with the inversed order 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
3554cd9832 Base: Move std::make_unique to Base 2019-07-14 12:37:35 +02:00
Abdullah Tahiri
fb5e8b4df7 Part: GeometryDefaultExtensions template
========================================

Generalisation of code for a default geometry extension in the form of a template.

Default geometry extensions provide a standard interface for an extension having a single stored value (e.g. one int or one string).

Python implementation must be provided separatedly.
2019-07-14 12:37:31 +02:00
wmayer
3203ace267 simplify handling of static Python libs 2019-07-03 16:09:47 +02:00
wmayer
e0db5b62be workaround in PyCXX classes due to removed support of old-style classes 2019-06-25 18:15:10 +02:00
wmayer
3789a26014 add define to inactivate some code blocks if needed 2019-06-03 18:40:45 +02:00
lo
9369816f3c cmake: add option to disable linking of python extension modules to python-libraries 2019-05-24 14:37:33 +02:00
wmayer
81ae5688d4 replace raw string with normal C string to fix build failure 2019-05-23 23:28:33 +02:00
ezzieyguywuf
81bae31085 Added python virtual environment initialization, if present. 2019-05-22 13:53:47 +02:00
luz.paz
11f4f30a37 Misc. typo fixes
Found via `codespell -q 3 -I ../fc-word-whitelist.txt -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller -L pard,wallthickness,commen,byteorder,alocation`
2019-05-17 13:19:36 +02:00
Bernd Hahnebach
aa67d56361 Units: add AngleOfFriction as another parameter with Angle unit 2019-04-30 07:41:56 +02:00
Abdullah Tahiri
95ad7dcee6 MSVC2013 constexpr to const 2019-04-24 17:56:37 +02:00
Abdullah Tahiri
875197f4a1 Base::Console avoid magic numbers and enable external string size checks 2019-04-24 17:56:37 +02:00
wmayer
cd4269e6af rename BUILD_uSE_PCH to FREECAD_USE_PCH to be consistent with other build options 2019-04-15 13:31:31 +02:00