Commit Graph

23 Commits

Author SHA1 Message Date
Zheng, Lei
31273bc1c6 App: more sanity check in PropertyContainerPy 2019-08-30 15:46:47 +02:00
Zheng, Lei
0cb599a31c App: do not return null Shape in PropertyContainerPy 2019-08-30 15:45:58 +02:00
Zheng, Lei
673d035bb3 PropertyContainerPy: modified getPropertyByName()
Add 'checkOwner' argument to allow caller distinguish linked property
2019-08-17 15:32:48 +02:00
Zheng, Lei
6da72b9859 Part: changes to Part Module
* Added Part::Feature::getTopoShape/getShape() function that can obtain
  shape from any object with proper implementation of getSubObject(). It
  can even construct compound from group object with proper implementation
  of getSubObjects().

* Modified ViewProviderExt to work on any object, because it now obtain
  the shape using Part::Feature::getShape()

* Modified various Part features to obtain base/tool shapes using
  Part::getShape(), which allows them to be any type of object,
  including Link and groups.

* Modified various Part command to relax type requirement on selected
  objects.

* Add support of link and group to dimension, and add dimension refresh
  command

* Support link and group in simple command command, and add a few more
  copy command variations.

* Add special handling of 'Shape' attribute in PropertyContainerPy and
  use Part::Feature::getShape() to return shape for any object without
  Shape property. This allows many python feature work with any object
  without modification.

* GeometrySurface/CurvePy, add convenience attribute 'Rotation'

* TopoShapePy:

    * Extended support of sub shape attribute, e.g. Compound1, Solid2,
      SubShape3 ('SubShape' is used to access child shape of a compound)

    * makeWires(), new API to sort and return wires given a list of edges.

    * transformed/translated/rotated/scaled(), return a new shape with
      some transformation.

    * findPlane(), find the plane of a planar shape

    * isCoplanar(), check if two shape are coplanar
2019-08-17 15:08:35 +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
6186a310d7 Add a new PropertyType enum Prop_NoRecompute to reduce possible inconsistencies between touched and recomputed features.
At the moment many feature classes lack of the mustExecute() method and thus can cause a touched feature not to be recomputed and causes the feature to be in a broken state.
Now this new enum value virtually makes the mustExecute() superfluous and thus guarantees to recompute a feature if a modified property has not set the Prop_NoRecompute flag.

On the other hand there are properties that should only touch a feature but not enforce a recompute. This guarantees a better performance and avoids unnecessary recomputes.
For example this is useful for placements where a change can be applied on-the-fly and the feature is up-to-date. Other features that depend on the touched feature will still be recomputed.
2018-11-08 10:20:50 +01:00
wmayer
3b1e1f8859 remove trailing whitespaces 2018-10-27 18:12:36 +02:00
ickby
b262cf6e9f Persistence: Incorporate review feedback 2018-10-27 16:15:39 +02:00
ickby
c60364772a Persistence: Test cases for content dump
It turned our that the document could not be dumped as the xml specifier was used as first element. As the dumping added the <content> element around it was invalid. However, content is required to read properties. Hence the xml element generation was moved.
2018-10-27 16:15:30 +02:00
ickby
4a7d49f8b6 Persistence: Enable binary dumps of properties 2018-10-27 16:15:09 +02:00
Stefan Tröger
0487b66738 Links ensure uncyclic graph and correct groups 2017-06-19 15:37:09 +02:00
looooo
ca3e58e2f3 py3: App: files D-Z ported to python3
issue 0000995
diff to py3-branch will remain in the following files in src/App:
- ExtensionContainer.cpp
- FeaturePythonPyImp.h +.inl
most likely these files depend on Tools and Base
2017-05-11 19:19:17 +02:00
Stefan Tröger
558e128b39 Extensions: Revert few changes after restructuring 2016-10-08 12:48:34 +02:00
Stefan Tröger
4c42181e34 Extensions: Show up in the python interface 2016-10-08 12:48:34 +02:00
wmayer
948ccac021 + dynamically hide/show and enable/disable item in property editor 2016-03-05 13:13:23 +01:00
wmayer
50d7793442 + introduce proper enum for property status to replace plain integers 2016-01-01 15:36:24 +01:00
wmayer
53d323b5e0 + make isReadOnly & isHidden of PropertyContainer non-virtual 2015-11-14 02:07:57 +01:00
Mateusz Skowroński
43a4a5938c Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
c54311123b + Add method getEditorMode() to see if a property is hidden or read-only in the property editor 2014-07-29 11:36:42 +02:00
wmayer
4699856799 + Add method to get typeid of property via Python 2014-03-05 15:10:37 +01:00
wmayer
05b6123bb2 0000535: request for python editible Properties panels
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5273 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-12-12 12:40:08 +00:00
wmayer
3a4bb6ec4f 0000535: request for python editible Properties panels
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5271 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
2011-12-11 21:20:00 +00: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