Commit Graph

60 Commits

Author SHA1 Message Date
Pieter Hijma
f113e775a1 Doc: Improve the App::Expression documentation 2026-01-31 19:52:33 +01:00
PhoneDroid
8abd25c999 [ App ]: Update SPDX License Identifiers 2025-12-25 11:55:37 -06:00
PaddleStroke
7a8135d863 Core: Add getPlacementOf replacing previous getGlobalPlacement logic. (#26059)
* Core: Add getPlacementOf replacing previous getGlobalPlacement logic.

* Update src/App/DocumentObject.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update DocumentObject.cpp

* Fix error when called from python with targetObj == None

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-12-10 22:47:20 +01:00
PaddleStroke
6e4d2a94d5 Core: GeoFeature::getPlacementFromProp prevent potential crash 2025-09-19 08:40:06 -05:00
Markus Reitböck
d05e2a0431 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
Bas Ruigrok
921620ba8a Use longest edge in face for horizontal/vertical alignment (#20374)
* App: Add second direction to getCameraAlignmentDirection()

* Part: Find longest face edge for horizontal/vertical alignment

* Gui: Use longest face edge for horizontal/vertical alignment

* App: Improve horizontal/vertical alignment for Datums and LCS
2025-04-14 11:20:49 -05:00
Kacper Donat
b300c80b90 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
35a9673a75 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Chris Hennes
c1ada6bc40 App: Coverity fixes 2025-03-18 15:59:22 +01:00
Chris Hennes
4dc8b26e8d Merge pull request #18791 from CalligaroV/toponaming-ElementMapVersion-code-from-LS3
[Toponaming] Import code releted to _ElementMapVersion from LS3
2025-02-14 10:54:38 -06:00
Kacper Donat
736fbee539 App: Fix GeoFeature::getGlobalPlacement when rootObj is Link
This fixes a case when in case of rootObj being Link placement was not
calculated correctly due to not changing of the document. While for
original use it was fine as this was mostly used in case where there was
defined non-link root for general case Links can be root objects of the
document.
2025-01-04 16:32:52 +01:00
Kacper Donat
1df3b5be6c Gui: Rework TaskCSysDragger into new Transform Dialog
This commit refactor ViewProviderDragger and TaskCSysDragger to be more
modern and to support selecting TransformOrigin.
2025-01-04 16:32:52 +01:00
Zheng, Lei
89ec079fbf Toponaming: import code related to ElementMapVersion from LS3
*Imported original code
2025-01-03 14:15:19 +01:00
PaddleStroke
deb6ebd276 TaskAttacher: Fix the string maker such that it does not show TNP string. 2024-12-13 18:04:10 +01:00
PaddleStroke
5eb09c8e45 Core: GetGlobalPlacement: empty subname should not return. 2024-11-26 10:59:48 -05:00
wmayer
5771c94523 App: Apply clang format (part 2) 2024-11-21 21:17:42 +01:00
bgbsww
a715a4d161 Support macros and console logs in Assembly 2024-09-23 14:10:55 -05:00
bgbsww
8fdef156f0 Correct error in resolveElement 2024-09-21 10:36:20 -05:00
Bas Ruigrok
cb98abcc42 Move isLink and isLinkGroup from AssemblyObject to DocumentObject 2024-09-08 11:56:14 +02:00
Bas Ruigrok
8db7191084 App: Return root object placement if target and root object are the same in getGlobalPlacement 2024-09-07 13:27:59 +02:00
Bas Ruigrok
e9fc6fb89a Move getGlobalPlacement from AssemblyObject to GeoFeature 2024-09-07 13:27:59 +02:00
bgbsww
ecf7e51ab3 Toponaming: Remove all FC_USE_TNP_FIX protected old code 2024-08-26 11:12:48 -05:00
bgbsww
b29abf7ffe Cleanup, format 2024-07-24 16:41:15 -04:00
Zheng, Lei
a7bdbaa662 Toponaming: Transfer in getHigherElement 2024-07-24 15:10:42 -04:00
bgbsww
0bddc51805 Refactor all element name pairs into clearer struct names - renames 2024-07-20 16:32:12 -04:00
bgbsww
77fc1de6c3 Toponaming: remove unused method with compile warnings 2024-06-02 18:55:13 -05:00
wmayer
91aac05021 Fixes #14349: GeoFeature::getElementTypes causes undefined behaviour 2024-05-31 11:42:01 +02:00
Bas Ruigrok
4c39b2f2bd App: Add getCameraAlignmentDirection() to GeoFeature 2024-05-13 19:01:38 +02:00
bgbsww
71892a1d72 Toponaming: bring in missing code fragments in App 2024-05-12 17:21:49 -04:00
bgbsww
d861b81c51 Merge branch 'main' into bgbsww-toponamingMissingAppMethods 2024-05-02 22:43:36 -04:00
bgbsww
f9b65e563d Test for changed Sketches avoiding TNP 2024-05-01 20:29:26 -04:00
Zheng, Lei
47635c0507 Methods to support Toponaming element maps 2024-05-01 18:02:04 -04:00
CalligaroV
6779c912bf App/Toponaming: GeoFeature - fixes #13009 - fixes #13248
* Restored previous logic of GeoFeature::getElementName()
 * Added precompiler directive to use the old logic if FC_USE_TNP_FIX isn't defined, otherwise use the new logic
 * Reworked SketchObjectTest::getElementName() as a consequence of the previous points

Signed-off-by: CalligaroV <vincenzo.calligaro@gmail.com>
2024-04-04 22:09:12 -05:00
David Carter
495a96a0f5 Material: Material appearance
Uses new material system for appearance

Each feature object now has a property called ShapeMaterial that
describes its physical properties. If it has a shape, it has a
material.

The ShapeColor attribute is replaced by a ShapeAppearance attribute.
This is a material list that describes all appearance properties, not
just diffuse color. As a list in can be used for all elements of a
shape, such as edges and faces.

A new widget is provided to allow the user to select materials in a
consistent fashion. It can also launch the material editor with its
more advanced capabilities.
2024-04-04 07:39:58 -05:00
Chris Hennes
a4efcf0533 Toponaming/Part: Clang-format cleanup 2024-02-28 19:18:45 -06:00
bgbsww
7d0afaec54 Toposhape/Part: cleanup and test getElementName 2024-02-28 17:07:36 -05:00
Zheng, Lei
59b563ca69 Toponaming/Part: trasnfer in getElementName 2024-02-28 17:06:09 -05:00
André Caldas
560898907b 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
Pesc0
4a8d3853ba [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
berniev
1cc6329eab App: use empty 2022-08-06 19:29:59 +02:00
berniev
65a356835b App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
berniev
b40de7a509 remove redundant void 2022-07-31 10:27:44 +02:00
Chris Hennes
132a1d7e55 App: PR6497 move return statement to new line 2022-03-29 12:33:37 -05:00
wmayer
749361d2f3 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
wmayer
4977e55e51 App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
Uwe
8bedc25344 [App] Feature: remove unused includes 2022-02-27 16:37:29 +01:00
luz.paz
4f308dc03c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
Zheng, Lei
29eb1a4299 App: GeoFeature/ComplexGeoData API changes
These are the bare minimum set of APIs for future new topogical naming
feature (see [here](https://git.io/fj6hy) for a overview of the new
APIs).

These APIs are added early to avoid too much code change for the new
features introduced in the current patch set.
2019-08-17 14:52:10 +02:00
wmayer
6186a310d7 Add a new PropertyType enum Prop_NoRecompute to reduce possible inconsistencies between touched and recomputed features.
At the moment many feature classes lack of the mustExecute() method and thus can cause a touched feature not to be recomputed and causes the feature to be in a broken state.
Now this new enum value virtually makes the mustExecute() superfluous and thus guarantees to recompute a feature if a modified property has not set the Prop_NoRecompute flag.

On the other hand there are properties that should only touch a feature but not enforce a recompute. This guarantees a better performance and avoids unnecessary recomputes.
For example this is useful for placements where a change can be applied on-the-fly and the feature is up-to-date. Other features that depend on the touched feature will still be recomputed.
2018-11-08 10:20:50 +01:00
wmayer
3a6afac8b2 improve whitespaces 2018-10-18 23:31:55 +02:00