Commit Graph

39 Commits

Author SHA1 Message Date
pre-commit-ci[bot]
9fe130cd73 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Markus Reitböck
a72a0d6405 Gui: 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:03 +02:00
Benjamin Nauck
df3c324b7d Gui: use contains() and isEmpty() instead of count() where possible 2025-05-03 22:19:51 +02:00
wmayer
15dcd1e9be Gui: add security checks to view provider extensions because they can be accessed if a document objects is not yet attached 2024-04-09 22:15:51 +02: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
fa8978ce99 Gui: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
berniev
3d1f70765a Gui: redundant void 2 2022-08-08 10:21:44 +02:00
berniev
066656f62a Gui: use emplace_back 2022-08-05 10:33:41 +02:00
wmayer
66819f82fd Gui: fix visibility of front nodes when moving an object to Part container 2022-05-30 03:21:52 +02:00
wmayer
1178df06b4 Gui: modernize C++11
* use nullptr
2022-03-23 18:41:21 +01:00
wmayer
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
e0e7bc7072 [Gui] ViewProviderFeature etc.: remove unused includes 2022-03-06 00:34:35 +01:00
luz paz
38815b9550 Gui: Fix header uniformity, whitespace, and doxygen fixes 2020-11-26 10:14:56 +01:00
Zheng, Lei
b7225460f5 Gui: fix restoring of geo feature group 2020-05-02 12:40:45 -04:00
luz.paz
04ba2872f0 src/Gui: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/Gui` files
2019-12-25 11:39:17 +01:00
Zheng, Lei
ed3a759018 Gui: fix GeoFeatureGroupExtension
The change in ViewProviderGeoFeatureGroupExtension.claimChildren() is
so that GeoFeatureGroupExtension.getSubObjects() can exclude non direct
children.
2019-08-30 15:45:21 +02:00
Kunda
d755fe3632 Misc. typo 2017-10-01 10:15:31 +02:00
Stefan Tröger
5e079d331b Improve GeoFeatureGroup claim children algorithm and remove special Body impelmentation 2017-09-21 13:02:16 +02:00
wmayer
ca77c54d10 rename status bit 'Delete' to 'Remove' as it fits better for its purpose, add new bit 'Destroy' 2017-09-13 15:47:48 +02:00
wmayer
3a0c3499e5 improve whitespaces 2017-09-09 18:07:46 +02:00
Stefan Tröger
c14e508c74 Fix GeoFeatureGroup claimChildren in case some out-of-group item links to a child 2017-09-09 16:55:55 +02:00
Stefan Tröger
a65856c022 Ensure that GeoFeatureGroup claims children when a parent of it is deleted. fixes #0003150 2017-09-09 16:55:55 +02:00
Stefan Tröger
97828a9ce5 Ensure viewprovider is shown after drop from claimChildren3D fixes #0003078 2017-09-09 16:47:07 +02:00
Stefan Tröger
81572d4a14 Tree: Adopt to special GeoFeatureGroup behaviours 2017-09-09 16:47:07 +02:00
luzpaz
ba17b99cfb typo fix 2017-07-10 19:29:55 -03:00
wmayer
90653787a6 various fixes:
+ fix typos
+ fix const correctness
+ whitespace improvements
2017-06-19 17:18:16 +02:00
Stefan Tröger
2939f290ad Groups: Handle add and remove object correctly 2017-06-19 15:37:09 +02:00
Stefan Tröger
fd62ef30f3 Unify and fix group handling in geofeaturegroups 2017-06-19 15:37:09 +02:00
Stefan Tröger
d5022483c6 Fix drag&drop of geofeature groups. fixes #0002835 fixes #0002796 2017-06-19 15:37:09 +02:00
wmayer
727ebec27f fix crash in ViewProviderGeoFeatureGroupExtension::getLinkedObjects 2017-02-01 12:04:41 +01:00
Stefan Tröger
ea73e55eb6 Extensions: Fix GeoFeatureGroup drag&drop 2017-01-04 16:01:58 +01:00
Stefan Tröger
a025a20bed Extensions: GeoFeatureGroup only for GeoFeature 2017-01-04 16:01:58 +01:00
wmayer
f1127dd2f4 Fix issues:
+ improve formatting
+ remove superfluous semicolons
+ comment unused parameters
+ rename Initialisation to Initialization
+ rename Deinitialisation to Finalization
+ remove spaces
2016-10-08 12:48:34 +02:00
Stefan Tröger
0ae9346b3c Extenions: Drop virtual inheritance
Due to problems onthe windows platform the virtual inheritance approach must be dropped. NExt to the already reimplemented proeprty interface the Type interface is reimplemented too. This change allows to revert some earlier changes.
2016-10-08 12:48:34 +02:00
Stefan Tröger
89bbb81521 Extension: Fix order-of-initialisation crash
FreeCADs property system utilises some pointer math to calculate the offset between
property and base class. Due to virtual inheritance of th ePropertyContainer the memory
layout has been changed to rather random, which has lead to crashes dependend on the
order of object initialisation.

The solution is to not make PropertyContaner virtual but a class below, Base::Persitance.
Then the memory layout is random for Persistance, but it is perfectly aligned for the
base class chains from PropertyContainer onwards as well as from Extension onwards.
Hence the proeprty system was changed to take the offset always from those two.
2016-10-08 12:48:34 +02:00
Stefan Tröger
3e1ba47d61 Extensions: Handle new dynamic_cast's 2016-10-08 12:48:34 +02:00
Stefan Tröger
1b150a86c3 Extensions: Add ViewProvider extension python types 2016-10-08 12:48:34 +02:00
Stefan Tröger
fedcfd9407 Extension: Port ViewProvider of OriginGroup 2016-10-08 12:48:34 +02:00
Stefan Tröger
5b9aea71d5 Extensions: Port ViewProvider of GeoFeatureGroup 2016-10-08 12:48:34 +02:00