Commit Graph

713 Commits

Author SHA1 Message Date
wmayer
c1070e5e8e NULL is defined as nullptr on FreeBSD and causes a build failure
For more information see: https://forum.freecadweb.org/viewtopic.php?f=4&t=22897&p=177660#p177660
2017-06-11 18:48:23 +02:00
Yorik van Havre
6e0f060e96 Fixed typo errors 2017-06-07 16:01:22 -03:00
Abdullah Tahiri
4b042536f8 Notification to the user that a body is not active when inserting a datum entity - fixes #2511 2017-05-31 02:41:29 +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
Yorik van Havre
2a2ab3c4ef Updated translations 2017-05-25 10:04:05 -03:00
asiersarasua
ea3d86b735 Fix typos 2017-04-20 09:49:19 +02:00
wmayer
6b26fa6ca7 fix segmentation fault in TaskFeaturePick::makeCopy 2017-04-17 11:07:54 +02:00
wmayer
9a3b2a976e when removing faces in thickness tool via context menu then remove selection gate 2017-04-15 13:29:19 +02:00
wmayer
eb02efa004 do not use translated text for icon names 2017-04-15 12:58:35 +02:00
wmayer
004324bbc5 fix scan coverity issues: uncaught exception 2017-04-11 14:03:08 +02:00
Abdullah Tahiri
09dfcf6bd7 Part Design: Keep body transparency when adding a new feature
=============================================================

Prior this commit, if a body has transparency (let's say 55%) and a new feature is added, the transparency is lost until you update it again in the body.

This prevents to actually see through while editing the feature (e.g. while setting the length of a pad) and is very annoying as the user
is required to go back to the body properties, where the old value (e.g. 55%) would still be there and change it to another value (56%) to effect it.
2017-04-11 10:41:27 +02:00
wmayer
1d336fe72e avoid possibly crash when trying to add objects to the wrong document 2017-04-07 15:32:22 +02:00
wmayer
52c3b4580e properly close task dialog when document is getting closed 2017-04-07 15:16:04 +02:00
wmayer
bf542266c4 close sketch selection task panel on undo 2017-04-07 13:07:52 +02:00
wmayer
394ea471c6 perform auto view fit when creating body object on sketch creation 2017-04-07 10:22:40 +02:00
Ian Rees
ac2f9f8902 Make Body object on creation of Sketch/Primitive 2017-04-06 19:26:19 +02:00
Ian Rees
e2b73e5bb1 Add abort method to PartDesign TaskDlgFeaturePick 2017-04-06 19:26:19 +02:00
Ian Rees
05b5b48af8 Refactor PartDesign create primitive commands 2017-04-06 19:26:19 +02:00
Sergo
86cb37b3d0 issue #2808 2017-03-20 21:39:53 +01:00
AjinkyaDahale
c4fdc924bc fixes #2964, #2968
0002964: PartDesign Datum geometry invisible in 3D view if no geometry
present in Body
0002968: Datum items invisible on opening saved files
2017-03-19 18:09:15 -03:00
usakhelo
d23e603b4e fix groove 2017-03-18 19:09:16 +01:00
Sergo
bd3fef03a7 set referenceaxis properly and fix getaxis 2017-03-18 19:09:16 +01:00
Sergo
934f473b13 fix revolve and groove when no sketches in selection or when no sketches in active body 2017-03-18 19:09:16 +01:00
Sergo
e5f0de83b3 stop revolve if no sketches in selection 2017-03-18 19:09:16 +01:00
Kurt Kremitzki
c80f680cbd Remove unused sketcher commands in PDN 2017-03-15 10:35:52 -03:00
DeepSOIC
0d81472fa8 PartDesign: fix non-selectable datum features 2017-03-15 10:32:43 -03:00
Sergo
256791d42e stop profile based and primitives if file is in undetermined workflow 2017-03-07 13:51:42 -03:00
Sergo
fdc3772c25 stop dressup features when applied to non-acitve body 2017-03-07 13:51:42 -03:00
Sergo
1d8ef64925 fixing transformed features and guessworkflow 2017-03-07 13:51:42 -03:00
Sergo
6cbb76b667 fixing dressup features 2017-03-07 13:51:42 -03:00
Sergo
f8e836221c fix pd tools from running when no active parts 2017-03-07 13:51:42 -03:00
Yorik van Havre
6b66a38ee3 Updated translations with latest files from crowdin 2017-03-06 11:53:09 -03:00
DeepSOIC
1ee6dcf75e PartPesign: Py: expose some methods of ViewProvider
* setBodyMode(bool)
* makeTemporaryVisible(bool)
2017-03-04 19:16:39 -03:00
DeepSOIC
0160478242 PartDesign: add ViewProviderPython
+ bind PartDesign::Feature to PartDesign::ViewProvider, and adjust
viewprovider of PartDesign::FeaturePython accordingly.
2017-03-04 19:16:39 -03:00
Kunda
99c99006b8 source typo fixes pt4 (only on py3 merged code) 2017-03-02 13:47:21 +01:00
wmayer
cd1f010fe7 revert commit 1255ac62c and fix original code 2017-03-01 22:54:14 +01:00
wmayer
381419c267 py3: ported PartDesign to python3 2017-03-01 17:19:33 +01:00
hgutsche
0e3db30311 fiel --> file 2017-02-28 18:52:04 +01:00
hgutsche
de8f66f857 Some fixes for doygen syntax errors and some configuration to make it run smoother under Windows 2017-02-28 18:52:04 +01:00
Wolfgang E. Sanyer
1255ac62c2 Fixed typo. 2017-02-27 10:26:00 +01:00
Alexander Gryson
cd7e49f6ae Updates based on forum feedback 2017-02-21 14:13:23 +01:00
Alexander Gryson
4cd58223e1 Update metadata 2017-02-21 14:13:23 +01:00
Alexander Gryson
d18655d390 Align PartDesign Workbench icons to guidelines 2017-02-21 14:13:23 +01:00
wmayer
1a8d535263 handle Coin3d version older than 4.0 2017-02-11 22:35:04 +01:00
wmayer
40abcf5dcc fix OSX build failure due to outdated Coin3d version 2017-02-10 22:09:53 +01:00
wmayer
798a57e2b7 issue #0002503: Invisible pad object 2017-02-10 17:19:01 +01:00
Ajinkya Dahale
7a9fecbbf0 Minor bug in PartDesignGui::ViewProviderPipe
Assert excludes any "Edge1"
2017-02-01 09:08:05 +05:30
wmayer
bebda4c6ad fix crash when pressing cancel on pipe task panel 2017-01-24 15:00:41 +01:00
wmayer
294b2308d6 fix crash when cancelling revolution task panel 2017-01-23 23:24:40 +01:00
wmayer
8a100bf627 issue #0002836: Crash in sketcher 2017-01-23 22:48:02 +01:00