Commit Graph

32 Commits

Author SHA1 Message Date
Kacper Donat
954b729b56 Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace:

```
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/
s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/
```

To regenerate if needed.
2024-12-06 18:29:39 +01:00
wmayer
3fd2f64639 Fix several regressions:
+ improve PropertyMaterialList::readString
+ fix transparency handling in ViewProviderPartExt
+ do not register the private member '_diffuseColor' as property because it would be exposed to the
  public where it can be modified
+ fix ViewProviderPartExt::finishRestoring() to correctly restore old project files
+ fix ViewProviderPartExt::setHighlightedFaces() to correctly show face colours if VBO is enabled
+ fix ViewProviderBoolean::updateData()
  fix ViewProviderMultiFuse::updateData()
  fix ViewProviderMultiCommon::updateData()
  fix ViewProviderCompound::updateData()
  fix ViewProviderFillet::updateData()
  fix ViewProviderChamfer::updateData()
  that all set invalid transparency values
+ Filter ShapeAppearance in ViewProviderBody::unifyVisualProperty
  because body features usually have different number of faces than the body itself
+ manually fix some bad looking auto-formatted code
+ clean up code and remove duplicated code
2024-06-11 11:58:32 +02:00
David Carter
5feb963f9d Material: Appearance Updates 2
Improves the use of the ShapeAppearance property for the Part workbench.

    removes DiffuseColor property
        adds Python compatibility using custom attributes
        transitions DiffuseColor to ShapeAppearance on open
    Improved UI elements for setting object appearance, and appearance per face
    Lays the foundation for future texture support
2024-06-01 19:57:16 -05:00
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
Florian Foinant-Willig
02731c7816 Part: modernize type checking 2023-10-23 18:12:03 +02:00
wmayer
b9e9fe435a Part: modernize C++: use equals default 2023-08-22 15:14:03 +02:00
wmayer
c8abd4a6d4 Part: modernize C++: return braced init list 2023-08-19 11:35:41 +02:00
wmayer
7cb51a4980 Part: modernize C++: use range-based for loop 2023-08-16 21:56:32 -05:00
luz paz
2f1ff7928b Part: remove trailing whitespace 2022-11-15 14:19:30 -06:00
berniev
f4ffd15864 Mod: redundant void 2 2022-08-08 10:27:50 +02:00
Uwe
c5a7e13172 [Part] ViewProvider: 2 to M: remove unused includes 2022-07-31 15:36:20 +02:00
wmayer
7237fcfc14 Part: if boolean/compound object has set transparency then override the values of the input shape 2022-07-27 17:03:47 +02:00
Zheng, Lei
d9a5494462 Part: fix dangerous static_cast usage in view provider
Because Gui::ViewProviderLink can be used to override the view provider
of any object, it is not safe to assume view provider type without
explicit checking.
2020-09-09 13:16:46 +02:00
triplus
38ada85382 Icon themes Part viewproviders 2020-06-22 11:58:06 +02:00
Zheng, Lei
f028ba42ff Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +02:00
plgarcia
77232b2141 Drags and drop with groups 2018-11-29 21:25:28 +01:00
Stefan Tröger
9cda1b53bc Allow interchangable use of link properties and their derivatives 2017-09-09 16:47:07 +02:00
wmayer
35db0df253 always update colors after updating shape to get rid of previously set transparency 2017-08-11 10:26:54 +02:00
wmayer
f225f3e0cb fix possible crash in view provider of boolean algorithm features 2017-03-27 22:43:13 +02:00
Yorik van Havre
bc6b3914cb Part: Set per-face transparency in boolean ops - fixes #1029,#2806 2017-02-10 21:53:57 -02:00
wmayer
7a5771a0f7 fix drag and drop of boolean operations 2016-12-21 11:39:26 +01:00
wmayer
677ec6cd30 fix coverity issues 2016-10-08 17:43:30 +02:00
wmayer
fcdaf5405c fix Coverity issues 2016-08-20 15:41:33 +02:00
wwmayer
6bf065c097 + fix many minor warnings, activate -Wall for gcc 2015-08-02 22:32:18 +02:00
wmayer
33c0d5e8b5 + fixes #0001058: Add items to Fusion by dragging item onto it 2014-03-11 17:37:36 +01:00
wmayer
be1f3ea873 0000735: Feature request for better Fillet/Chamfer 2013-07-07 16:13:38 +02:00
wmayer
847c44e6bb 0000736: when object is deleted, auto show its parametric objects 2012-07-07 13:32:27 +02:00
wmayer
e820323177 Keep faces colors on boolean operations 2012-06-01 13:07:30 +02:00
wmayer
5875c1bd1c Keep faces colors on boolean operations 2012-06-01 13:07:30 +02:00
wmayer
09e7c897d0 Keep faces colors on boolean operations 2012-06-01 13:07:29 +02:00
wmayer
7fadf83ff5 Keep faces colors on boolean operations 2012-06-01 13:07:28 +02: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