Commit Graph

66 Commits

Author SHA1 Message Date
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
wmayer
664cf65d26 fix -Wextra in PartDesign 2016-09-22 18:34:56 +02:00
wmayer
5ce8a94c53 + consistent context-menu to double-click event for ViewProviderBody 2016-05-22 18:47:13 +02:00
DeepSOIC
739509aadc PartDesign: deactivate a container on double-click if already active
Before, it was impossible to deactivate a container (Part, Body) via gui
(or it wasn't obvious).
2016-05-21 01:31:06 +03:00
wmayer
099ceebec1 + issue #0002504: Crash in pad function after undoing some operations 2016-04-16 15:16:00 +02:00
Stefan Tröger
036d0691dd Fix Windows build errors 2016-04-12 18:12:23 +02:00
Stefan Tröger
666a5968cb Override mode works with non-toplevel viewprovider
And adopt the part design body to handle the override mode correctly
2016-04-12 18:12:23 +02:00
Stefan Tröger
048c374080 PartDesign: body is responsible for visuals
-Hide all visual properties of features when they are part of a body
-Propagate all body visual changes to features
-Separate display mode from body mode to enable setting display mode for both "tip" and "through" modes
-Use default visuals for body shape and only make "through" a new display mask mode for the children
2016-04-12 18:12:23 +02:00
Stefan Tröger
3b27def228 PartDesign: prevent crash on delete and add body 2016-04-12 18:12:23 +02:00
Stefan Tröger
28965457aa Active view may not be 3d viewer
When for example the spreadsheet is open and an recompute is issued, the active view is not the 3d viewer which leads to crash if used for scene graph calculations.
2016-04-12 18:12:21 +02:00
Alexander Golubev
0cfc0cd424 Fix warnings introduced in new PartDesign
Mostly unused wariables and compare of signed & unsigned
2016-04-12 18:12:21 +02:00
Alexander Golubev
ba57a843ad PartDesign/ViewProviderBody: reduce number of recalculations in the body 2016-04-12 18:12:19 +02:00
Alexander Golubev
d4c67c0366 GeoFeaturertDesign/Gui: Add recompute sizes and datums to the body vp 2016-04-12 18:12:19 +02:00
Alexander Golubev
26fb01b429 PartDesign/Gui: add origin sizing and rework datums sizing 2016-04-12 18:12:18 +02:00
Alexander Golubev
1a26f7551f PartDesign: add Origin to the Body and unstrap the module from the Parts 2016-04-12 18:12:18 +02:00
Alexander Golubev
5016054a8b PartDesign/Body: move deletion of subobjects to view provider 2016-04-12 18:12:17 +02:00
Alexander Golubev
c782a11aab PartDesign/Gui: Move various utility stuff from Workbench to a separate file
Also do some header cleanup.
2016-04-12 18:12:17 +02:00
Alexander Golubev
8c5d514b18 PartDesign: Body rework - add BaseFeature property and make Tip always point to solid 2016-04-12 18:12:16 +02:00
Stefan Tröger
7f80e711f6 better active part and document tip handling 2016-04-12 18:12:10 +02:00
Stefan Tröger
8fdde38e75 add coordinate system datum 2016-04-12 18:12:07 +02:00
blobfish
10a7f15c37 Part Design: adding const char PDBODYKEY and using. No functional change. 2016-04-12 18:12:04 +02:00
blobfish
6877cbbd51 updating to setActiveObject call 2016-04-12 18:12:03 +02:00
jriegel
45f7c99c1c Changing active object handling in PartDesign 2016-04-12 18:12:03 +02:00
jriegel
dc4fdc2c53 Assembly: Rename to setActiveBody and make link indeipendant Part initialization 2016-04-12 18:12:02 +02:00
jmaustpc
0f1ae0d95b Add new icons to Assembly work bench
Including new body icons for the treeview and
PartDesign create new body command.
Move all Assembly constrains icons into their
own sub directory of the icons directory
add "STEP, IGES or BREP" to the tool tip
of Assembly add existing Component command
2016-04-12 18:12:00 +02:00
jrheinlaender
e993480ca0 Made Body::claimChildren() stabler against NULL items 2016-04-12 18:11:55 +02:00
jrheinlaender
a4ad9a6a55 ViewProviderBody::claimChildren() : Claim all children not claimed by another object 2016-04-12 18:11:55 +02:00