Commit Graph

46 Commits

Author SHA1 Message Date
Kacper Donat
d4dc5c01d8 Part: Introduce PreviewUpdateScheduler
This commit introduces PreviewUpdateScheduler class that is responsible
to schedule the true recompute of the preview. View Providers (or other
components) can use this service to ask for the preview recompute to
happend at a time that is convinent for a program and that won't impact
performance.

The provided implementation uses Queued Connections in Qt to calculate
preview essentially on next run of the event loop. It allows business
logic in FreeCAD (like property propagation) to execute fully and then
recompute preview once. This greately reduces number of recompute calls
for previews.
2026-01-11 20:32:50 -06:00
tritao
40a9f46d71 Base: Remove Boost-based signals and switch to FastSignals. 2026-01-07 21:16:16 +00:00
PhoneDroid
842c5f53e1 [ App ]: Update SPDX License Identifiers 2025-12-25 11:55:37 -06:00
Markus Reitböck
73c97bc90f App: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:02 +02:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
wmayer
6f5259af26 App: Apply clang format (part 1) 2024-11-21 07:54:24 +01:00
bgbsww
19e450a667 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
CalligaroV
767b2bd5e4 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Fixed a mistake made in getSubObjectListFlatten()
 * Applied modifications according to review comments

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
CalligaroV
3109301e52 App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Formatted and refactored code imported for the DocumentObject class
 * Formatted and refactored code imported for the SubObjectT class

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-29 11:42:18 -05:00
Zheng, Lei
b6ae0912fe App/Toponaming: import SubObjectT dependencies for SubShapeBinder
* Added SubObjectT methods normalize(), normalized(), hasSubObject() and hasSubElement()
 * Updated DocumentObject::getSubObjectList()
 * Applied modifications to make the code compile
2024-04-29 11:42:18 -05:00
André Caldas
89dbab9b0e Avoids using getNameInDocument() to test if DocumentObject is attached to a Document.
This patch substitutes by isAttachedToDocument() (almost) everywhere where
getNameInDocument() is used for this purpose.

The very few places not touched by this patch demand a (just a little) less trivial change.
When we change the returning type of getNameInDocument() to std::string,
those places will be easily found, because they shall generate a compiler error
(converting std::string to bool).

Rationale:
The fact that getNameInDocument() return nullptr to indicate
that the object is not attached to a document is responsible for lots of bugs
where the developer does not check for "nullptr".

The idea is to eliminate all those uses of getNameInDocument() and, in the near future,
make getNameInDocument() return always a valid std::string.
2023-12-11 17:37:58 +01:00
wmayer
1cf1a90a17 App: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
1efde78d74 App: modernize C++: use equals default 2023-08-20 18:10:17 +02:00
wmayer
af8c05c507 App: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
948cbfccd9 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
Pesc0
c65f049d20 [Toponaming] create ElementMap class (#9175)
* Copypaste ElementMap
* Add MappedNameRef
* Fix missing include
* Copypaste `findTagInElementName`
* fix error introduced _somewhere_
* refactor toponaming constants
* Move `findTagInElementName` in `MappedName`
* reintroduce workaround to compile ElementMap
* Added missing functions copied from complexgeodata
* fix last compile errors, reorder and format files
* remove recursive refs to ComplexGeoData
* Add more comments
* fixed comments and added tests
* added FIXME, make functions private, misc fixes
* Move static functions from complexGeoData to PostfixStringReferences. Rename to ElementNamingUtils
* Fix broken includes due to previous change
* Revert constants from string to const char*
* added childmap tests and made hasher public
* Make functions private
* Added remaining tests
* removed bool return from `erase` functions
* fix missing appexport

Co-authored-by: John Dupuy <jdupuy98@gmail.com>
2023-06-15 09:05:24 -05:00
wmayer
656890be38 App: modernize C++: replace 'typedef' with 'using' 2022-08-29 12:58:39 +02:00
berniev
d2babf0eb5 App: Single arg ctors must be explicit 2022-08-24 07:20:57 +02:00
berniev
22dcf5866f App: use empty 2022-08-06 19:29:59 +02:00
berniev
b6cae3bfdf App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
wmayer
1f606e40e1 App: implement '*' operator for weak pointer classes 2022-06-13 13:52:21 +02:00
Zheng, Lei
9455d869d4 Gui: refactor Object Selection Dialog
It is originally used for dependency selection when copying object.
Modified to improve auto dependency selection, and for use by Link
configuration object setup, which also involves dependency selection.
2022-03-26 10:19:20 -04:00
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
Uwe
09ce5ce137 [App] Document: remove unused includes 2022-02-23 01:56:26 +01:00
wmayer
4f814afa57 App: add a function to document observer to be notified if the active document changes 2022-01-29 18:33:39 +01:00
wmayer
b35623e680 App: Bugfix for NULL-Pointer dereference of Property->getName() 2022-01-16 14:30:51 +01:00
wmayer
1bb8b29e28 App: [skip ci] add overloaded constructor of DocumentObjectT 2021-10-02 07:05:37 +02:00
wmayer
6fb9ec1b25 App: [skip ci] rename class to PropertyLinkT 2021-03-29 01:16:04 +02:00
wmayer
53de0c4720 App: [skip ci] add class PropertyListT 2021-03-29 00:47:38 +02:00
wmayer
9e39b41ca6 App: in document observer classes replace boost::bind with std::bind to fix build failure with C++17 2021-03-05 13:26:26 +01:00
luz paz
84553bf191 App: Fix header uniformity, trailing whitespace, and doxygen headers 2020-11-19 13:38:37 +01:00
wmayer
19c7fbd096 LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two') 2020-07-27 14:39:14 +02:00
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
0a905d1f13 App: [skip ci] implement WekPtrT to simplify using DocumentObjectWeakPtrT 2020-03-16 15:11:11 +01:00
wmayer
8e26c4a2df App: [skip ci] add further constructor to SubObjectT 2020-02-28 21:14:34 +01:00
wmayer
454fe91c3c App/Gui: implement a lightweight weak_ptr like class to work with Document, DocumentObject and ViewProvider 2020-02-19 19:58:34 +01:00
Zheng, Lei
e4978be7a4 App: add new convenient class SubObjectT
Derived from App::DocumentObjectT to add support of sub object

Also some minor changes to App::DocumentObjectT

Changed Gui::SelectionChanges to make use of SubObjectT
2020-02-11 15:40:27 -05:00
Zheng, Lei
ad57821cf9 Python feature/observer related changes
* Add new API and signal handler in document observer

* Pre initialize python handler function to improve performance. In
  case Python code use dynamic patching, i.e. add class method at
  runtime (which is rare and should be discouraged), the python feature
  can be re-initialized by simply assign proeprty Proxy again.

* Add property tracking in DocumentObjectT

* WidgetFactory adds support for accepting python QIcon, which is used
  by ViewProviderPythonFeature
2019-08-17 15:08:34 +02:00
wmayer
42601fc4e4 add/extend helper classes to savely access document, document objects or view providers 2018-10-31 11:24:45 +01:00
wmayer
36271b4052 move from deprecated boost.signals to boost.signals2 library 2018-10-30 19:09:03 +01:00
Stefan Tröger
e571a6e07a Add signals for recomputed objects 2018-10-08 10:43:32 +02:00
wmayer
c636974ec8 fix -Wextra in FreeCADApp 2016-09-21 16:05:36 +02:00
wmayer
d8f9fc8f74 + make method cancelObservation() not pure virtual 2015-12-19 11:31:59 +01:00
wmayer
e5a99461f5 + add helper classes to store names of doument and object and not a pointer 2015-11-06 14:28:03 +01:00
wmayer
120ca87015 + unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-10-10 13:44:52 +00:00