Commit Graph

30 Commits

Author SHA1 Message Date
wmayer
5240a30431 App: modernize C++: replace 'typedef' with 'using' 2022-08-29 12:58:39 +02:00
wmayer
949b43aabb App: [skip ci] whitespace improvements 2022-08-24 10:43:56 +02:00
berniev
d66df602ad App: Single arg ctors must be explicit 2022-08-24 07:20:57 +02:00
berniev
1cc6329eab App: use empty 2022-08-06 19:29:59 +02:00
berniev
65a356835b App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
berniev
b40de7a509 remove redundant void 2022-07-31 10:27:44 +02:00
wmayer
2b04b01edc cppcoreguidelines-special-member-functions
* disable move constructor and move assignment for several core classes
2022-06-25 17:46:48 +02:00
wmayer
749361d2f3 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
wmayer
9955c64752 Mod: add string header to dxf.h 2022-03-01 17:18:29 +01:00
Uwe
8bedc25344 [App] Feature: remove unused includes 2022-02-27 16:37:29 +01:00
luz.paz
4f308dc03c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
Zheng, Lei
6663d625a9 Gui: add new API ViewProviderDocumentObject::allowOverride()
This API is used to delcare if a view provider can be used as an
override for a give object.

Conflicts:
	src/App/DocumentObject.h
2019-10-06 17:22:57 +02:00
wmayer
1a2370cd91 do not use an int but an enum to handle different modes 2019-09-27 22:00:25 +02:00
Zheng, Lei
0f29155502 App/Gui: unify NotImplementedError handling in python features
Recognize NotImplementedError as an indication to call the C++
implementation.
2019-09-27 18:01:54 +02:00
wmayer
503f987cf6 Add virtual method allowOverrideViewProviderName to DocumentObject to indicate if a DocumentObject's view provider type can be overriden.
For most object types this is not allowed to avoid to create incompatible combinations via Python or manipulated project files and possibly provoke crashes.

For more details see also: https://forum.freecadweb.org/viewtopic.php?f=10&t=38970&p=333951#p333951
2019-09-14 00:52:09 +02:00
wmayer
3e6ae0d027 Fix clang compiler warnings:
+ fix -Winconsistent-missing-override
+ fix -Wunused-private-field
+ suppress -Woverloaded-virtual but fix later
2019-08-17 19:51:51 +02:00
Zheng, Lei
08f0511b1f Python feature/observer related changes
* Add new API and signal handler in document observer

* Pre initialize python handler function to improve performance. In
  case Python code use dynamic patching, i.e. add class method at
  runtime (which is rare and should be discouraged), the python feature
  can be re-initialized by simply assign proeprty Proxy again.

* Add property tracking in DocumentObjectT

* WidgetFactory adds support for accepting python QIcon, which is used
  by ViewProviderPythonFeature
2019-08-17 15:08:34 +02:00
Zheng, Lei
f4205130ae App: Property related API changes
Property:

* Extended property status bitset. Mirror most of PropertyType and
  allow dynamic change property type.

* Cache property name and type to improve performance

* Centralize property status change signalling

* Change aboutToSetValue()/hasSetValue() to virtual

* Add new API getFullName() to obtain full quanlified name of the property

AtomicPropertyChangeInterface:

* Allow calling aboutToSetValue()/hasSetValue() when actually changed

PropertyLists:

* Refactor implementation by an abstract class PropertyListBase and a
  template class PropertyListsT, to allow better code reuse.
  PropertyListT is derived from AtomicPropertyChangeInterface to allow
  more efficient change on individual elements.

* All list type property now accept setting python value as a dictionary
  with index as key to set individual element of a list.

* Add touch list for more efficient handling of value changes. The list
  contains the index of changed value. And empty touch list should be
  treated as the entire list is changed. PropertyContainerPy expose this
  functionality with getPropertyTouchList().

PropertyPersistentObject:

* New property to allow dynamic creation of any FreeCAD object derived
  from Base::Persistence, and use it as a property.

DynamicProperty:

* Use boost multi_index_container for efficient property lookup while
  keeping order.

* Modify to be allowed to use in PropertyContainer directly

PropertyContainer:

* Use boost multi_index_container for efficient property lookup while
  keeping order.

* Allow adding/removing dynamic property on all property container

* Modify Save/Restore() to persist property status, and better handle
  transient property which can now be dynamically enabled/disabled per
  object.

* Add new API getFullName() to obtain full quanlified name of the property.
  Implemented by Document, DocumentObject, and also
  ViewProviderDocumentObject if future patch

DocumentObject and FeaturePython are modified to accommondate the
dynamic property changes.

Removed get/setCustomAttribute() implementation from DocumentObjectPy,
and rely on PropertyContainerPy for the implementation, because of the
additional dynamic property support in property container.

Gui::ViewProviderDocumentObject, which is derived from
PropertyContainer, is also modified accordingly
2019-08-17 14:52:09 +02:00
wmayer
1f5059b5b2 fix crash when removing from document and accessing Python based feature 2019-01-13 17:50:48 +01:00
wmayer
fbcecfb139 add missing header files 2018-09-07 11:46:32 +02:00
wmayer
a5bc70cca0 remove properties from transactions when being deleted 2017-08-28 21:20:17 +02:00
wmayer
061c67cbf8 + expose onDocumentRestored to Python feature classes 2016-01-05 19:05:48 +01:00
wmayer
53d323b5e0 + make isReadOnly & isHidden of PropertyContainer non-virtual 2015-11-14 02:07:57 +01:00
wmayer
e7a3dc48e8 + support of Python feature classes without an execute() method
+ if execute() method of Python feature is missing or if it returns false call the execute() method of the C++ feature
+ fix SketchObjectPython
2015-10-21 00:22:40 +02:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
73859191f3 + exposing onBeforeChange to Python 2014-12-01 10:58:25 +01:00
wmayer
cc775f9254 + fix -Wnull-conversion, -Woverloaded-virtual, -Wlogical-not-parentheses, -Wsometimes-uninitialized 2014-08-26 19:14:13 +02:00
wmayer
ce0e6e5cef Make FeaturePython Python binding a template class to avoid code duplication 2013-03-22 00:34:18 +01:00
wmayer
77144681ef Allow to remove user-defined properties 2012-11-04 13:24:22 +01: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