Commit Graph

628 Commits

Author SHA1 Message Date
wmayer
6222cb310b add method RotationPy.toMatrix() 2019-10-07 19:27:54 +02:00
wmayer
edcb33f120 improve RotationPy::number_power_handler: make computation more efficient and less prone to round-off errors 2019-10-07 19:23:14 +02:00
Zheng, Lei
cc94eb9966 Base: add RotationPy.RawAxis
Expose rotation raw axis
2019-10-07 17:24:31 +02:00
Zheng, Lei
b2ba93c4fc Base: fix __pow__ operator in MatrixPy/PlacementPy/RotationPy 2019-10-07 17:24:30 +02:00
Zheng, Lei
c5fd45f762 Base: remove VectorPy right multiplication to matrix/placement/rotation 2019-10-07 17:24:30 +02:00
luz.paz
fb32601746 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -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,./src/Doc/FreeCAD.uml`
2019-10-03 07:57:13 +02:00
wmayer
9e5f602acd add function to escape special characters in strings 2019-10-03 01:43:08 +02:00
wmayer
504590902d add function to escape special characters in file names 2019-09-28 19:32:34 +02:00
Zheng, Lei
f16c265f00 App: fix QuantityPy __add__ and __sub__ 2019-09-28 15:32:12 +02:00
Zheng, Lei
ff3ec0c7fd Base: add Python number protocol support to Placement/Rotation 2019-09-28 15:32:00 +02:00
Zheng, Lei
1efadc928e Base: improve base python object number protocol 2019-09-28 15:30:23 +02:00
Tomas Pavlicek
cdb978efee Polish classes in Tools2D 2019-09-25 15:18:58 +02:00
wmayer
5746c37b7e fix -Wcatch-value=, fix -Wpedantic 2019-09-18 14:36:23 +02:00
wmayer
9fa56345cf 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
5c9d30b25a use NaN for invalid quantities instead of DOUBLE_MIN 2019-09-16 18:00:24 +02:00
wmayer
52916175ed 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
6ebd0f4e5b move method setTransform() from ViewVolumeProjection to ViewProjMethod, restructure ViewProjMethod 2019-09-10 23:21:09 +02:00
wmayer
3726006942 fix implementation of Rotation::isSame(const Rotation& q, double tol) and extend Python bindings 2019-09-10 14:17:07 +02:00
Zheng, Lei
7e3c7a165e Base: fix Matrix4D::hasScale() tol checking 2019-09-10 14:17:06 +02:00
Zheng, Lei
14fedb0965 Base: fix verbose checking in Console::Log() 2019-09-10 14:17:06 +02:00
wmayer
cc2e507817 fix -Wreturn-std-move 2019-09-07 14:45:03 +02:00
wmayer
19abb09fab remove wrong typename keyword 2019-09-07 00:29:18 +02:00
wmayer
530b75d594 fix -Wunused-local-typedef 2019-09-06 23:03:43 +02:00
wmayer
b14cf8a00d extend convertTo function to also support SbRotation/Base::Rotation 2019-09-06 21:29:51 +02:00
Dietmar Czekay
65ccdee9d8 add VacuumPermittivity and fix adding user values to material editor in FEM 2019-09-04 11:29:09 -03:00
wmayer
f88dad0905 use shared_ptr to avoid possible memory leaks and improve exception-safety 2019-09-03 17:21:13 +02:00
Jean-Marie Verdun
e20456dc1f 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
a2e21f79f2 Add initial version of the Cloud workbench 2019-09-03 17:21:05 +02:00
Zheng, Lei
0c0ae77f2c 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
74db105fb5 Base: fix line ending in PyObjectBase.h 2019-08-28 17:46:06 +02:00
wmayer
8e582d68c4 use GNU directory structure on non-Windows systems 2019-08-22 16:57:11 +02:00
Tomas Pavlicek
b23243b1af TechDraw: Radius drawing refactored - ASME support 2019-08-21 19:27:12 -04:00
wmayer
99287c3ebf fix -Winconsistent-missing-override 2019-08-17 19:51:33 +02:00
Zheng, Lei
e288bb672d 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
e9caeef557 Fix typos in src/Base 2019-08-17 15:32:49 +02:00
Zheng, Lei
576d51a78a 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
35534149a4 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
b057952a7e 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
2d9ca92594 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
8f16147a40 Base: improve exception
For better FC and Python exception mapping.
2019-08-17 14:52:08 +02:00
Zheng, Lei
ea8965cbc2 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
bfa68f2676 Console: improve console logging facility 2019-08-17 14:52:08 +02:00
wmayer
d1b47718cf handle gimbal lock when converting between quaternion and Euler angles (issue #0004062) 2019-07-22 16:31:42 +02:00
mwganson
89a62366ab [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
287eff3b31 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
b5a3d28fee Doxygen tweaks 2019-07-17 18:01:56 -03:00
Yorik van Havre
a6334a4bfd Cleanup in doxygen stuff 2019-07-15 23:20:52 -03:00
Abdullah Tahiri
b568c64260 MSVC2013 c++11 has make_unique pointer definition, so do not overload it. 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
2d7805d963 Clang complains of the specialisation after implicit instantiation with the inversed order 2019-07-14 12:37:37 +02:00
Abdullah Tahiri
1d2c45c845 Base: Move std::make_unique to Base 2019-07-14 12:37:35 +02:00