Commit Graph

62 Commits

Author SHA1 Message Date
wmayer
6c020f554d + fix Enumeration::contains: the current index is irrelevant when searching for an entry in the enumeration
+ only print a warning if the enumeration is not empty but the restored index is < 0
2020-05-19 08:45:02 +02:00
wmayer
939419fb29 App: [skip ci] remove duplicate check 2020-05-09 16:44:08 +02:00
Zheng, Lei
8030d56397 App: fix some property's setPathValue() 2020-05-09 16:36:33 +02:00
wmayer
70a51373a3 App: [skip ci] handle types long and unsigned long in PropertyFloat::setPathValue() 2020-04-27 12:44:54 +02:00
Zheng, Lei
b2eef61a0b App: fix PropertyBool::setPathValue() 2020-04-01 13:28:05 +02:00
luz.paz
019f73852c 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
wmayer
9fa56345cf core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
wmayer
994578d8af encode keys of PropertyMap when saving as XML 2019-09-05 18:51:35 +02:00
Zheng, Lei
3c242e05f6 App: ignore unit in PropertyBool/Float/Integer
In other word, those property now accept expression result with a unit,
by ignoring it.
2019-08-30 15:50:26 +02:00
Zheng, Lei
00166c2346 DocumentObject: add allowDuplicateLabel/onBeforeChangeLabel()
These two APIs allow an object to control its own labeling rules.
The previous auto re-labeling for uniqueness logic is moved from
ObjectLabelObserver (resides in Application.cpp) to PropertyString.

DocumentObject::allowDuplicateLabel() is used to inform PropertyString
that the object allows duplicate label regardless of application
setting. onBeforeChangeLabel() is called before actual label change to
give object a chance to override the new label.
2019-08-17 14:52:09 +02:00
Zheng, Lei
be6ec3fdfc 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
4c04933fd7 fix bug when checking for str type in PropertyEnumeration::setPyObject 2019-04-07 12:16:18 +02:00
wmayer
9bdd92989e PVS: V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. 2019-03-08 18:56:16 +01:00
wmayer
f004858fe5 implement a direct way to set single or double precision when writing/reading properties using floating point numbers 2018-10-23 19:38:03 +02:00
luz.paz
424cd49398 Typos and whitespace fixes 2018-08-07 11:13:31 -04:00
wmayer
4ec1c8c29f fix exception raised on project load for invalid enums 2018-08-07 15:23:56 +02:00
wmayer
21ec6f0b86 Some fixes for PropertyEnumeration:
+ when reading an enumeration ignore negative indexes and print a warning
+ raise an exception when trying to get the current value of an invalid enumeration
2018-06-09 20:00:28 +02:00
looooo
59e06142dc Arch: Survey: fix py3 unicode problems 2018-06-04 19:23:42 +02:00
luz.paz
d31f2e25b0 Misc. comment typos
[skip ci]
2018-01-20 14:04:22 +01:00
Peter Lama
9187919bb8 Attacher UX enhancements
- New editor for MapMode with button to open attacher dialog
- Hide attachment properties when they are not applicable
- Disable super placement ui in attacher dialog when object is not attached
- Always select used mode in mode list
2017-09-20 19:24:35 +02:00
wmayer
a1ca7309fb allow to set constraints via Python 2017-07-16 11:09:48 +02:00
looooo
e6202f46e9 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
wmayer
fb7094bf31 use specialized exception classes 2017-04-28 18:49:11 +02:00
wmayer
5ba030d12f Extend Py interface of PropertyStringList to accept all sequence types 2017-04-24 11:12:12 +02:00
Zheng, Lei
18a7e73bf6 Added App::PropertyPrecision
The purpose of this property and the associated property item is to
properly display floating value of many decimal points, such as
Precision::Confusion()
2017-03-15 10:46:32 -03:00
wmayer
365a50603b improve unicode support for enumeration properties 2016-11-14 15:22:21 +01:00
wmayer
c636974ec8 fix -Wextra in FreeCADApp 2016-09-21 16:05:36 +02:00
wmayer
61aa0fcafe + implement PropertyMaterialListItem 2016-05-08 19:28:02 +02:00
wmayer
926e5e127d + editor for PropertyMaterial 2016-05-07 22:11:37 +02:00
wmayer
e9a46f658e + implement PropertyMaterialList 2016-05-07 14:41:24 +02:00
Yorik van Havre
8315fc8727 Made PropertyFloatList accept ints too - fixes #2444 2016-02-09 16:01:10 -02:00
wmayer
2acb38daa7 + fix clang warning: -Woverloaded-virtual 2015-10-02 20:42:16 +02:00
Mateusz Skowroński
05f95c0506 Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
e0bdf24c95 + fix build problems with MSVC and libpack 2015-09-21 14:51:12 +02:00
Eivind Kvedalen
a45a663655 Added setValue/getValue/canonicalPath/getPaths/verifyPath methods to various Property classes. 2015-09-21 14:51:03 +02:00
wmayer
c1f96b20b1 + fix strict-aliasing warnings 2015-08-29 19:48:08 +02:00
wmayer
7c7cfc60b3 + preserve current index when setting enumeration 2015-04-26 22:10:40 +02:00
Ian Rees
a01bb06f49 Now with more Property properties! 2015-04-25 23:43:15 +12:00
Ian Rees
1b57b8d78a Refactored PropertyEnumeration 2015-04-24 23:33:33 +02:00
wmayer
48e7e61b6d + fix bug in mesh bounding box, fix clang warning 2014-11-23 10:55:36 +01:00
wmayer
9fb670ae16 + fixes #0001794: new defined as a macro sometimes conflicts with boost 2014-10-22 12:39:43 +02:00
wmayer
bbdbf10304 + fixes #0001039: Add the property PropertyBoolList 2014-03-09 17:10:11 +01:00
wmayer
f0d8650c3c + Fix broken unit tests 2014-02-25 15:24:10 +01:00
wmayer
ae29ab3ceb + allow to set constraints of properties via Python 2014-02-15 14:10:17 +01:00
jriegel
ec0a5ccb0c Merge branch 'refs/heads/double-precision-werner'
Conflicts:
	src/App/Document.cpp
	src/App/PropertyGeo.cpp
	src/App/PropertyStandard.cpp
	src/Base/Reader.cpp
	src/Base/Reader.h
	src/Gui/propertyeditor/PropertyItem.cpp
	src/Mod/Fem/Gui/ViewProviderFemMesh.cpp
	src/Mod/Inspection/Gui/ViewProviderInspection.cpp
	src/Mod/Mesh/App/MeshProperties.cpp
	src/Mod/Part/App/TopoShapeFacePyImp.cpp
	src/Mod/PartDesign/App/FeatureRevolution.cpp
2013-09-26 00:05:05 +02:00
jriegel
abf1623f07 Add SchemaVersion to RestoreDocFile to distinquish double from float binary 2013-09-24 11:01:09 +02:00
jriegel
00ea24e07e Integrate Werners & Jans double branch
Move from float to double
Further suggestions for float -> double move
Moved Tools2D from float to double
More suggestions for float->double move from Gui subdirectory
Changes to FEM constraint visuals for float->double move
Suggested changes for float -> double move
Suggestions for Part module moving float -> double
2013-09-24 11:00:57 +02:00
jriegel
3f3f3b0bd5 Fix sequence issue by new object for Isostatic nodes 2013-08-16 16:46:49 +02:00
wmayer
609072f140 + in setPyObject() only use classes derived from Base::Exception 2013-07-05 15:29:04 +02:00
wmayer
f355b5aa9a Fix XML reading in property class 2013-05-05 01:24:28 +02:00