Commit Graph

92 Commits

Author SHA1 Message Date
David Carter
8b5a3b1124 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
André Althaus
458d53c027 Use Body toolbar icon for the tree 2024-05-19 12:17:16 +02:00
Max Wilfinger
aac3003dcf use checkbox in menu item to display current object state and refactor the code 2023-12-28 11:30:49 +01:00
Max Wilfinger
72821eb513 Change the description of the default 'Toggle active object' command in the right click menu based on the current state of the selected object. 2023-12-27 09:10:30 +01:00
wmayer
a28b2dcf37 PD: fixes #11197: If bounding box of Body is activated it will be done for each sub-feature 2023-11-08 10:38:42 +01:00
Florian Foinant-Willig
6adc675a12 PartDesign: modernize type checking 2023-10-23 18:08:16 +02: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
d150fa7164 modernize C++: avoid bind
In many cases std::bind() is kept because the code is much simpler
2023-08-08 21:10:16 +02:00
wmayer
68d22d864b modernize C++: move from boost::bind to std::bind 2023-08-08 17:36:13 +02:00
luz paz
c726b69d7e PD: remove trailing whitespace 2022-11-10 10:32:04 +01:00
berniev
da9ebc572f Mod: redundant void 2 2022-08-08 10:27:50 +02:00
wmayer
88accdb421 PD: [skip ci] Fix several clazy issues:
* Maybe you meant to call base method instead [-Wclazy-skipped-base-method]
* Missing reference in range-for with non trivial type [-Wclazy-range-loop-reference]
* Mixing iterators with const_iterators [-Wclazy-strict-iterators]
* Unused QByteArray [-Wclazy-unused-non-trivial-variable]
* C++11 range-loop might detach Qt container (QList) [-Wclazy-range-loop-detach]
2022-07-25 13:40:19 +02:00
Uwe
697e88aed6 [PD] remove more superfluous nullptr checks 2022-07-18 01:33:28 +02:00
Uwe
35f75064a0 [PD] remove superfluous nullptr checks 2022-07-17 18:12:41 +02:00
wmayer
9b2b0e0acf modernize C++: replace boost::function with std::function 2022-06-30 20:31:55 +02:00
wmayer
d492ac3083 PD: fixes #6451: Face color of PartDesign Body not exported to STEP 2022-05-24 16:42:27 +02:00
wmayer
3608ee7f51 PD: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
1ca7429705 Gui: Optimize includes to reduce compile time 2022-03-07 20:29:18 +01:00
Uwe
c7e48869b6 [PD] Body and utils: remove unused includes 2022-02-20 21:23:05 +01:00
Uwe
9f8d54d804 [PD] ViewProviderBody: add missing include 2022-02-18 04:25:20 +01:00
Uwe
f306199091 [PD] ViewProviderBody: remove unused includes
- also sot the includes
2022-02-18 04:01:02 +01:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
0penBrain
2756d46a2a PartDesign : make possible to prevent auto-switching to PartDesign WB when a Body is activated
* Use a boolean parameter located at BaseApp/Preferences/Mod/PartDesign/SwitchToWB
   * resolves #2703
2019-09-11 21:32:41 +02:00
Zheng, Lei
e64b1a7826 PartDesign: fix ViewProviderBody tip icon update 2019-09-07 16:59:55 +02:00
Zheng, Lei
7bf451fc67 Gui/PartDesign: fix setActiveObject() for Part and Body 2019-08-30 15:02:48 +02:00
Zheng, Lei
11a93a0578 PartDesign changes
* Mostly for supporting in-place editing

* Add new SubShapeBinder that support cross coordinate system,
  external, and sub-object binding
2019-08-17 15:15:47 +02:00
wmayer
6e44433b8b activate/create 3d view when setting or getting active objects 2019-07-05 18:53:35 +02:00
luz.paz
0238906d38 Misc. typo and whitespace fixes
Found via `codespell`
2019-04-30 10:15:59 -03:00
wmayer
7acdb56d92 Replace Base::Exception with appropriate subclass 2018-11-14 19:28:00 +01:00
wmayer
77512c0266 improve exception handling in ViewProviderBody::dropObject 2018-04-04 17:14:21 +02:00
wmayer
d5c890c50e in ViewProviderBody::updateData make sure a view provider exists 2018-02-09 22:14:44 +01:00
Abdullah Tahiri
758745f0be PartDesign: Highlight body tip
==============================

It generates a small green icon on the treeview for those features being the tip of the body.
2018-02-01 19:15:48 +01:00
wmayer
865593b66a fixes #0002559: Body becomes visible upon changing DisplayModeBody 2018-01-30 15:58:32 +01:00
luz.paz
8690d870a5 Misc. typos
+ stepcode typo submitted upsream https://github.com/stepcode/stepcode/pull/372
2018-01-07 18:41:29 -02:00
wmayer
ac88edc3dc allow to move PD objects via drag and drop to a body 2018-01-04 00:11:28 +01:00
wmayer
70d094994a fix crash in ViewProviderBody::setVisualBodyMode due to missing view provider 2018-01-03 17:59:45 +01:00
luzpaz
c1152f2a2c PartDesign: typos 2017-12-25 11:04:43 +01:00
wmayer
71fbfa952f add 2d features to body for drag and drop 2017-11-05 12:37:46 +01:00
wmayer
f228c37676 when inside the body has been created then hide the linked base feature 2017-09-22 17:57:37 +02:00
wmayer
9cc8c722cb implement drag and drop for body view provider 2017-09-22 13:12:20 +02:00
wmayer
499cb18a00 add transform command to body 2017-09-21 17:32:22 +02:00
Stefan Tröger
94248a6c42 Improve GeoFeatureGroup claim children algorithm and remove special Body impelmentation 2017-09-21 13:02:16 +02:00
Stefan Tröger
de31528dda PartDesign: Make Base Feature compatible with GeoFeatureGroup. fixes #0003080
The Original BaseFeature implementation had some serious issues with scoped links. It failed completely for e.g. sketches on the BaseFeature as it made a local link to refere to a out of body object. The only solution to make this work correctly is to add a proxy object into the body which is alloed to exactly that, to link outside oof the body. Something like shapebinder.
2017-09-21 11:40:14 +02:00
Abdullah Tahiri
2686f51c57 Checking for Document Restoring when extension has a null property
==================================================================

The problem:

OriginGroupExtension::OriginGroupExtension () {

    initExtensionType(OriginGroupExtension::getExtensionClassTypeId());

    EXTENSION_ADD_PROPERTY_TYPE ( Origin, (0), 0, App::Prop_Hidden, "Origin linked to the group" );
}

initializes the Origin property to null.

Then Document::Restore => readObjects => addObject => slotNewObject => ViewProviderDocumentObject::updateView => ViewProviderBody::updateData => ViewProviderGeometryObject::updateData =>
ViewProviderDocumentObject::updateData => ViewProvider::updateData => ViewProviderOriginGroupExtension::extensionUpdateData => updateOriginSize() => OriginGroupExtension::getOrigin,

the latter throws an exception because the origin property is null.

Afterwards, the origin property is initialized during Document::Restore => readObjects => ExtensionContainer::Restore() => PropertyContainer::Restore() => App::PropertyLink::Restore()
=> App::PropertyLink::setValue() => Property::hasSetValue, which triggers an onChange: Body::onChanged => BodyBase::onChanged => Feature::onChanged => DocumentObject::onChanged =>
Document::onChangedProperty => Document::slotChangedObject => ViewProviderOriginGroupExtension::slotChangedObjectGui => ViewProviderOriginGroupExtension::updateOriginSize =>
OriginGroupExtension::getOrigin,

now, the latter that is the same that was throwing the exception and generating the error message above, does not throw anymore because Origin has been initialized.

When creating a new object, isNew==true; whereas when loading a file, isNew==false. Therefore, when loading a file setupObject is not executed. SetupObject, effectively initializes
the extension via: Body::setupObject => DocumentObject::setupObject => OriginGroupExtension::onExtendedSetupObject.

DocumentObject * Document::addObject(const char* sType, const char* pObjectName, bool isNew)
{
    [more code here]
    // Call the object-specific initialization
    if (!d->undoing && !d->rollback && isNew) {
        pcObject->setupObject ();
    }
    [more code here]

As DocumentObject code is generic for all objects (workbenches), by design it was chosen to initialize the object only if new. Therefore a object or an extension of a object being restored,
between the addition (addObject) and the restoring of the properties, must by design expect it not to be initialized.

The solution:

Making use of the Restore flag at document level (the one at object level is not sufficient), no exception regarding the null property is reported during document restoring.

Ticket:
https://freecadweb.org/tracker/view.php?id=2530

fixes #2530
2017-05-30 13:01:45 +02:00
Kunda
99c99006b8 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Stefan Tröger
d2764a3c7a PartDesign: Adopt python interface to body group 2017-01-04 16:01:58 +01:00
Stefan Tröger
b4a569e013 PartDesign: Change body viewprovider to group 2017-01-04 16:01:58 +01:00
Stefan Tröger
9a3b952fb9 PartDesign: Port body to be a origin group 2017-01-04 16:01:58 +01:00