Commit Graph

52 Commits

Author SHA1 Message Date
David Carter
ba20441935 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
wmayer
d2163579b2 Part: refactor SectionCut 2023-11-02 08:17:06 +01:00
wmayer
fd307e6e37 Part: fix crash in SectionCut 2023-11-02 08:17:06 +01:00
wmayer
554543df01 Part: refactor SectionCut::startCutting() 2023-11-01 16:58:35 +01:00
wmayer
e21a477522 Part: refactor SectionCut::collectObjects() 2023-11-01 16:58:35 +01:00
wmayer
864c5260b1 Part: fix manual formatting of SectionCut::setupConnections() 2023-11-01 16:58:35 +01:00
wmayer
e3fe4cad87 Part: refactor constructor of SectionCut 2023-10-30 14:36:18 +01:00
wmayer
2495a29db3 Part: refactor onFlipXclicked, onFlipYclicked and onFlipZclicked of SectionCut 2023-10-30 14:36:18 +01:00
wmayer
0f5c28c09b Part: Fix Move enum to class with static members, fix & suppress some other lint warnnigs 2023-10-30 14:36:18 +01:00
wmayer
fc328c271b Part: Fix many lint warnings in SectionCut 2023-10-30 14:36:18 +01:00
wmayer
1b1b9173c3 Part: fix check with wrong pointer 2023-10-30 14:36:18 +01:00
wmayer
d305f306df Core: Revert superfluous changes made with PR #9521 2023-10-09 15:06:45 +02:00
AgCaliva
b360b43ebe Fixing DOMDocument redefinition 2023-09-16 00:38:41 -03:00
wmayer
15c41e81d1 fixes #10063: Part_SectionCut does not work if the view is in perspective 2023-08-10 00:48:21 +02:00
Chris Hennes
46131a3696 Part: SectionCutting cutTransparency initialization
Addresses Coverity CID 356563: Uninitialized scalar.
2023-02-26 05:40:32 +01:00
Uwe
f7df219b7b [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
756bbe9085 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
a19980ba31 modernize a for loop 2023-01-25 17:48:08 -07:00
Uwe
050708e564 [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
ce8aea5dd2 [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
2f1ff7928b Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
Uwe
fa21e3129f [Part] SectionCutting: cut long lines
- following our latest Clang coding style
2022-11-05 20:40:18 +01:00
berniev
47ac049e14 Mod: use emplace_back 2022-08-05 10:36:16 +02:00
Uwe
922f6b83d6 [Part] [skip CI] SectionCutting: silence MSVC compiler warning
- also fix a typo
2022-07-30 00:20:30 +02:00
wmayer
fc72a7979b Part: [skip ci] fix typo 2022-07-29 18:50:35 +02:00
Uwe
b95995f23c [Part] SectionCutting.cpp: attempt to fix CI compiler error 2022-07-04 10:13:36 +02:00
Uwe
e20cc5a017 [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
196010dd10 [Part] SectionCutting: remove unused include
- also uniform line endings 8automatically done by MSVC)
2022-07-03 18:52:04 +02:00
luz paz
a526451afd Fix various typos 2022-06-01 18:03:40 -04:00
Uwe
8a8fe98454 fix some occurrences where size() is misused as Boolean
- as suggested by @wwmayer: 70714eedc9 (r69648152)
2022-03-27 21:38:15 +02:00
Uwe
2ef424bda8 [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
b6f985c861 [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
4b3735e4d9 [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
15ee1fdd4e 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
7de25e8c37 [Part] Section Cut: fix cut object naming issue 2022-03-09 03:04:13 +01:00
Uwe
d1fae66f55 [Part] Section Cut: fix for tooltip handling 2022-03-09 01:52:16 +01:00
Uwe
9f73e0b3eb [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
8f786ea6ef Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
a8bae676ce [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
c533286d00 [Part] fix a comment on SectionCut 2022-02-24 04:49:29 +01:00
Uwe
701609f004 [Part] remove unused precompiled headers 2022-02-15 05:57:27 +01:00
Uwe
3d25e8fc10 [Part] try to fix compilation error without precompiled headers 2022-02-15 05:46:40 +01:00
Uwe
285218ecbe [Part] more simplification of SectionCut code 2022-02-15 05:06:14 +01:00
Uwe
e6f91e9f5d [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
e0fdd4394f [Part] improve SectionCut code
- get rid of potentially unsafe static_casts
- fix logic mistake
2022-02-15 04:30:08 +01:00
Uwe
1197ef7fc9 [Part] simplify a but the SectionCut code 2022-02-15 02:49:05 +01:00
Uwe
942618ce72 [Part] improve SectionCutting code
all changes as suggested in 05a9c88ab2
2022-02-14 14:09:53 +01:00
wmayer
b0d8ed1bf2 Part: section cut window is not bound to 3d viewer widget 2022-02-13 19:33:19 +01:00
0penBrain
73f2c1434a Modernize signal/slot connection for real :) 2022-02-08 17:51:36 +01:00
Uwe
eecc2eacae [Part] SectionCutting: remove another unused variable
strangely MSVC did not report me these, the CI does
2022-02-05 14:45:34 +01:00