Commit Graph

45 Commits

Author SHA1 Message Date
wmayer
85f45c9956 Part: refactor onFlipXclicked, onFlipYclicked and onFlipZclicked of SectionCut 2023-10-30 14:36:18 +01:00
wmayer
c3cd1a1191 Part: Fix Move enum to class with static members, fix & suppress some other lint warnnigs 2023-10-30 14:36:18 +01:00
wmayer
b5bbf5433f Part: Fix many lint warnings in SectionCut 2023-10-30 14:36:18 +01:00
wmayer
4ade6fbfd5 Part: fix check with wrong pointer 2023-10-30 14:36:18 +01:00
wmayer
56820718c5 Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
AgCaliva
280e5e3987 Fixing DOMDocument redefinition 2023-09-16 00:38:41 -03:00
wmayer
a8a730bf6d fixes #10063: Part_SectionCut does not work if the view is in perspective 2023-08-10 00:48:21 +02:00
Chris Hennes
aa788af4bd Part: SectionCutting cutTransparency initialization
Addresses Coverity CID 356563: Uninitialized scalar.
2023-02-26 05:40:32 +01:00
Uwe
4382bd199a [Part] extend SectionCutting feature for intersecting objects
- it is a well-known and often feed-backed missing feature that SectionCuttings fails for intersecting objects.
To resolve this, the objects must be put int a BooleanFragments object.
- this PR adds this functionality as option.
- since a BooleanFragments objects has a specific color, the different colors of the objects cannot be preserved. Because of this disadvantage, the BooleanFragments option will not be the default.

- this PR also modernize all for loops
2023-02-13 00:46:37 +01:00
wmayer
db6d44b1da Part: fix crash in SectionCutting dialog
It segfauls when executing the script below:
doc = App.ActiveDocument
box = doc.addObject("Part::Box", "SectionCutBoxX")
comp = doc.addObject("Part::Compound", "SectionCutCompound")
comp.Links = box
grp = doc.addObject("App::DocumentObjectGroup", "SectionCutX")
grp.addObject(comp)
doc.recompute()
2023-01-26 09:29:01 -07:00
Uwe
64caea2073 modernize a for loop 2023-01-25 17:48:08 -07:00
Uwe
5f91493d49 [Part] SectionCutting: avoid to recompute all cuts on color change
- it is not necessary and speeds up the workflow for large assemblies
2023-01-25 17:48:08 -07:00
Uwe
1f6c1fcd0f [Part] fixes for the section cutting feature
- a typical use-case is to open a document with an existing cut and only this cut is visible. When now opening the section cutting tool, the user got the fault message that there were no visible objects to be cut.
- the transparency for the cut was not explicitly set. Therefore the default transparency for new objects was used instead of the transparency of the objects to be cut.
- workaround for a graphics issue: when cutting objects intersection each other (only then), the transparency setting might be ignored. The fix is simply to change the default color slightly (By the way, this issue is independent on the color that is set in the Part preferences as color for new objects, seems to be a graphics driver or OCC issue.)

- besides this, avoid code duplication by using a lambda function
2023-01-25 17:48:08 -07:00
luz paz
6e542b6fad Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
Uwe
04fc0deb06 [Part] SectionCutting: cut long lines
- following our latest Clang coding style
2022-11-05 20:40:18 +01:00
berniev
2d4c5a4cfb Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
6ea36b25ae [Part] [skip CI] SectionCutting: silence MSVC compiler warning
- also fix a typo
2022-07-30 00:20:30 +02:00
wmayer
54076efb64 Part: [skip ci] fix typo 2022-07-29 18:50:35 +02:00
Uwe
e790566fd4 [Part] SectionCutting.cpp: attempt to fix CI compiler error 2022-07-04 10:13:36 +02:00
Uwe
3aa4955e94 [Part] fix MSVC compiler warning
about redefinition of content of basic.h, see https://forum.freecadweb.org/viewtopic.php?f=10&t=69988
2022-07-04 02:14:27 +02:00
Uwe
01b4352693 [Part] SectionCutting: remove unused include
- also uniform line endings 8automatically done by MSVC)
2022-07-03 18:52:04 +02:00
luz paz
a0c0b2616c Fix various typos 2022-06-01 18:03:40 -04:00
Uwe
66e4c37a25 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 4d51d1d0b1 (r69648152)
2022-03-27 21:38:15 +02:00
Uwe
66a5cd1a49 [Part] Section cut: add missing color handling for the cut faces
- the color was not handled at all and thus was often criticized
2022-03-18 17:05:47 +01:00
Uwe
b98ada4c07 [Part] Section Cut: add missing handling of valueChanged
- when the user changed the value without moving the slider (e.g. by clicking), nothing happened
2022-03-18 06:26:12 +01:00
Uwe
4d08cefe0e [Part] Section Cut: respect App::Part placement
if object to be cut are within an App::Part container the container placement needs to be respected

- also fix a performance issue
2022-03-14 03:32:09 +01:00
wmayer
edd346cc3d Part: Fix several coverity issues:
* CID 350581: Structurally dead code
* CID 350620: Structurally dead code
* CID 350563: Big parameter passed by value
* CID 350552: Uncaught exception
* CID 305193: Uncaught exception
* CID 350556: Uninitialized scalar field
* CID 350579: Uninitialized pointer read
2022-03-13 16:06:40 +01:00
Uwe
907ef395f4 [Part] Section Cut: fix cut object naming issue 2022-03-09 03:04:13 +01:00
Uwe
e3e455cd5c [Part] Section Cut: fix for tooltip handling 2022-03-09 01:52:16 +01:00
Uwe
068f02c4b7 [Part] Section Cut: also handle normal Link objects
Link objects within App::Part containers were already handled but not Link objects outside
2022-03-08 06:25:35 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
f602fc872b [Part] Section cutting: fix read of cut state of existing cuts
- it is now also possible to determine the Flip state correctly
2022-03-07 02:45:36 +01:00
Uwe
e583eec264 [Part] fix a comment on SectionCut 2022-02-24 04:49:29 +01:00
Uwe
ccbc0863a9 [Part] remove unused precompiled headers 2022-02-15 05:57:27 +01:00
Uwe
f0f30b47f6 [Part] try to fix compilation error without precompiled headers 2022-02-15 05:46:40 +01:00
Uwe
ab6ac65455 [Part] more simplification of SectionCut code 2022-02-15 05:06:14 +01:00
Uwe
217af3d0e0 [Part] fix signal blocking in SectionCut code
- add missing signal blockSignals
- assure the desired UI objects get blocked
2022-02-15 04:47:47 +01:00
Uwe
8e1cf21208 [Part] improve SectionCut code
- get rid of potentially unsafe static_casts
- fix logic mistake
2022-02-15 04:30:08 +01:00
Uwe
098b773208 [Part] simplify a but the SectionCut code 2022-02-15 02:49:05 +01:00
Uwe
7250097f39 [Part] improve SectionCutting code
all changes as suggested in 05a9c88ab2
2022-02-14 14:09:53 +01:00
wmayer
5cb2c315a2 Part: section cut window is not bound to 3d viewer widget 2022-02-13 19:33:19 +01:00
0penBrain
aed8864cd9 Modernize signal/slot connection for real :) 2022-02-08 17:51:36 +01:00
Uwe
d938733eaf [Part] SectionCutting: remove another unused variable
strangely MSVC did not report me these, the CI does
2022-02-05 14:45:34 +01:00
Uwe
819f89941b [Part] SectionCutting: remove unused variable 2022-02-05 14:09:13 +01:00
Uwe
bb204842f2 [Part] feature to make persistent section cut views (#4118)
* [Part] feature to make persistent section cut views

* one aim is to have a feature to make real cuts, not hollow ones like with clipping
* the second one is to have a persistent view, so an object in the tree that can be further exported, meshed etc.

For a detailed description with examples see https://forum.freecadweb.org/viewtopic.php?f=17&t=52441
2022-02-05 01:57:57 +01:00