No longer add dynamic property for alias, simply rely on
get(Dynamic)PropertyByName() to check for aliases.
Add new API PropertyContainer::getPropertyNamedList() so that
ExpressionCompleter can discover properties with aliases.
Changes the way PropertyContainer handles existing property while
restoring. Previously it will first ask DynamicProperty to restore
if possible, then fallback to static property if else.
This patch looks up existing property first, and only fallback to
DynamicProperty if not found. This handles situation when an object
changes an originally dynamic property into a static one. With the
original code, it will add an auto renamed dynamic property that no
one knows its existence.
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml`
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
add a special XMLAttributeError class to indicate an error when accessing a missing attribute
in PropertyContainer::Restore make error handling more flexible
PropertyContainer uses a static member of type PropertyData to register
static properties. PropertyData uses a short variable to record the
offset of the property against its container.
Because of possible 'short' truncation, when searching of property that
in fact is from another container, we must check if the pointer within
boundary. Otherwise, truncation will result in effectively random
number, and possibly causing a false hit.
I'm still finding typos in the source code. I propose that you keep this PR open prior ro relaese and then merge so that if I find other typos in the meantime they will be part this release.
Due to problems onthe windows platform the virtual inheritance approach must be dropped. NExt to the already reimplemented proeprty interface the Type interface is reimplemented too. This change allows to revert some earlier changes.
FreeCADs property system utilises some pointer math to calculate the offset between
property and base class. Due to virtual inheritance of th ePropertyContainer the memory
layout has been changed to rather random, which has lead to crashes dependend on the
order of object initialisation.
The solution is to not make PropertyContaner virtual but a class below, Base::Persitance.
Then the memory layout is random for Persistance, but it is perfectly aligned for the
base class chains from PropertyContainer onwards as well as from Extension onwards.
Hence the proeprty system was changed to take the offset always from those two.