Commit Graph

53 Commits

Author SHA1 Message Date
wmayer
3923438307 add 2d features to body for drag and drop 2017-11-05 12:37:46 +01:00
wmayer
3ea4ee8a67 when inside the body has been created then hide the linked base feature 2017-09-22 17:57:37 +02:00
wmayer
17ffe48f96 implement drag and drop for body view provider 2017-09-22 13:12:20 +02:00
wmayer
f351220183 add transform command to body 2017-09-21 17:32:22 +02:00
Stefan Tröger
5e079d331b Improve GeoFeatureGroup claim children algorithm and remove special Body impelmentation 2017-09-21 13:02:16 +02:00
Stefan Tröger
6ae8b6482e 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
b4e942c08b 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
9410e751e9 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
Stefan Tröger
22c26d043a PartDesign: Adopt python interface to body group 2017-01-04 16:01:58 +01:00
Stefan Tröger
8bd07747ae PartDesign: Change body viewprovider to group 2017-01-04 16:01:58 +01:00
Stefan Tröger
526d895a5d PartDesign: Port body to be a origin group 2017-01-04 16:01:58 +01:00
wmayer
dd7c91ddcf fix -Wextra in PartDesign 2016-09-22 18:34:56 +02:00
wmayer
d6ffe12db1 + consistent context-menu to double-click event for ViewProviderBody 2016-05-22 18:47:13 +02:00
DeepSOIC
218c81b7cc 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
dac8dfa317 + issue #0002504: Crash in pad function after undoing some operations 2016-04-16 15:16:00 +02:00
Stefan Tröger
ced37e29c1 Fix Windows build errors 2016-04-12 18:12:23 +02:00
Stefan Tröger
6fa3b94ff1 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
48b2bb86ab 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
9ab137f3c9 PartDesign: prevent crash on delete and add body 2016-04-12 18:12:23 +02:00
Stefan Tröger
252865d43f 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
27667cf5e6 Fix warnings introduced in new PartDesign
Mostly unused wariables and compare of signed & unsigned
2016-04-12 18:12:21 +02:00
Alexander Golubev
3bbbb941d1 PartDesign/ViewProviderBody: reduce number of recalculations in the body 2016-04-12 18:12:19 +02:00
Alexander Golubev
a8fcda3523 GeoFeaturertDesign/Gui: Add recompute sizes and datums to the body vp 2016-04-12 18:12:19 +02:00
Alexander Golubev
68c78de00d PartDesign/Gui: add origin sizing and rework datums sizing 2016-04-12 18:12:18 +02:00
Alexander Golubev
3ed51ac4bd PartDesign: add Origin to the Body and unstrap the module from the Parts 2016-04-12 18:12:18 +02:00
Alexander Golubev
9db890015c PartDesign/Body: move deletion of subobjects to view provider 2016-04-12 18:12:17 +02:00
Alexander Golubev
9347f66a9e 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
f6b0ed3a47 PartDesign: Body rework - add BaseFeature property and make Tip always point to solid 2016-04-12 18:12:16 +02:00
Stefan Tröger
b733d38064 better active part and document tip handling 2016-04-12 18:12:10 +02:00
Stefan Tröger
07099e1163 add coordinate system datum 2016-04-12 18:12:07 +02:00
blobfish
9b9d79d2fe Part Design: adding const char PDBODYKEY and using. No functional change. 2016-04-12 18:12:04 +02:00
blobfish
b7735098ba updating to setActiveObject call 2016-04-12 18:12:03 +02:00
jriegel
d7c932d714 Changing active object handling in PartDesign 2016-04-12 18:12:03 +02:00
jriegel
d87d0e8376 Assembly: Rename to setActiveBody and make link indeipendant Part initialization 2016-04-12 18:12:02 +02:00
jmaustpc
81e2e4714d 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
7e7697f9eb Made Body::claimChildren() stabler against NULL items 2016-04-12 18:11:55 +02:00
jrheinlaender
bfaf7f1e3f ViewProviderBody::claimChildren() : Claim all children not claimed by another object 2016-04-12 18:11:55 +02:00
jrheinlaender
87aa6fbc77 Fixed bug that prevented proper switching to PartDesign workbench 2016-04-12 18:11:54 +02:00
jrheinlaender
e3d45ed61d PartDesign Body migration: Fix migration of MultiTransform sub-features 2016-04-12 18:11:53 +02:00
jrheinlaender
8dabdf2eaf Miscellaneous fixes 2016-04-12 18:11:52 +02:00
jrheinlaender
c7d4ab22b9 Simplified datum features by making use of the placement property 2016-04-12 18:11:50 +02:00
jrheinlaender
e3d2eea982 Automatically adjust datum line/plane size to Body bounding box 2016-04-12 18:11:49 +02:00
jrheinlaender
d4898e51b7 Miscellaneous fixes 2016-04-12 18:11:49 +02:00
jrheinlaender
ae7dd86b4d Honour the ordering of the children returned by claimChildren() in the TreeWidget 2016-04-12 18:11:49 +02:00
jrheinlaender
0cd8fc816b Bug fixes for Body feature insert/remove functionality 2016-04-12 18:11:48 +02:00
jrheinlaender
0701b237ac More work on highlighting and hiding/showing 2016-04-12 18:11:48 +02:00
jrheinlaender
9fc73e6abe Feature tree: Insert mode for SketchBased features 2016-04-12 18:11:47 +02:00
jrheinlaender
d9ad63ba06 Integrated PartDesign::Pad into Body feature workflow 2016-04-12 18:11:47 +02:00
jriegel
39d6d914a8 Some fixes in Body visualls (ongoing) 2016-04-12 18:11:46 +02:00
jriegel
96f2a734ae 3D subgrouping for Body 2016-04-12 18:11:46 +02:00