Commit Graph

52 Commits

Author SHA1 Message Date
tritao
2145b742eb Base: Standardize on Py::Long type for Python bindings. 2025-02-08 13:14:22 +00:00
Benjamin Nauck
6f535f19fb Prefer to use BaseClass's isDerivedFrom<T> over non template or Base::Type's
Regex based changes, manually verified
2025-01-27 16:08:18 +01:00
wmayer
fadfc7e270 App: Apply clang format (part 2) 2024-11-21 21:17:42 +01:00
marioalexis
fd5eb34d6a Base: Add PropertyError exception 2024-08-02 20:19:16 -03:00
wmayer
58988a7482 Core: Fix memory leaks with PySequence_GetItem 2024-05-08 23:40:27 +02:00
Chris Hennes
cfd41683a5 Core: Enable compiling with MSVC /permissive- (#11014)
* Base: Fixes for MSVC permissive-

* App: Fixes for MSVC permissive-

* Gui: Fixes for MSVC permissive-

* Main: Fixes for MSVC permissive-

* Fem: Fixes for MSVC permissive-

* Material: Fixes for MSVC permissive-

* Part: Fixes for MSVC permissive-

* Mesh: Fixes for MSVC permissive-

* Points: Fixes for MSVC permissive-

* Robot: Fixes for MSVC permissive-

* TechDraw: Fixes for MSVC permissive-

* Path: Fixes for MSVC permissive-

* Core; Changes per review comments

* TD: Revision from wandererfan

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-11-27 17:37:29 +01:00
Chris Hennes
393c1020f5 App: Wrap PyArg_ParseTupleAndKeywords 2023-08-25 15:34:20 -05:00
wmayer
af8c05c507 App: modernize C++: return braced init list 2023-08-18 00:36:24 +02:00
wmayer
4991475341 App: modernize C++: use range-based for loop 2023-08-14 16:40:25 +02:00
luz paz
57d561f683 Fix source comment typo 2022-10-23 09:14:44 -05:00
marioalexis
209c78d43e App: Replace C cast 2022-09-18 11:06:51 -05:00
wmayer
656890be38 App: modernize C++: replace 'typedef' with 'using' 2022-08-29 12:58:39 +02:00
berniev
85170b2879 remove redundant void 2022-07-31 10:27:44 +02:00
marioalexis
1ce36f6d1b App: Clean up code in PropertyContainerPyImp.cpp 2022-06-09 18:46:41 -04:00
wmayer
79578ea191 App: handle 'NoPersists' property type in PropertyContainerPy::getTypeOfProperty 2022-05-03 14:10:42 +02:00
0penBrain
5cb11cb562 Fix typo 2022-04-08 10:55:31 +02:00
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
wmayer
08b77bff08 Core/Mod: modernize C++11
* use nullptr
2022-03-09 21:55:31 +01:00
wmayer
739804b511 Mod: add string header to dxf.h 2022-03-01 17:18:29 +01:00
Uwe
d88397f3d6 [App] Placement and Property: remove unused includes 2022-02-24 01:09:00 +01:00
Zheng, Lei
3e68a27960 Minor code changes according to suggestions 2021-12-21 21:41:02 -07:00
Zheng, Lei
8bb8bf8644 App: expose some property status bits to PropertyContainerPy 2021-12-21 21:41:02 -07:00
Zheng, Lei
7e272d00f8 App/Gui: allow change dynamic property group and documentation
Exposed as PropertyContainerPy.setGroup/DocumentationOfProperty.

Added a menu action to property view for rename dynamic property group.
2021-11-14 20:45:09 -06:00
wmayer
5cc3dde57b App: [skip ci] replace plain C API with PyCXX to avoid memory leaks 2021-02-19 17:26:33 +01:00
Markus Lampert
5ba83fc393 Expose PropertyEnumeration values list to python. 2020-12-31 20:06:02 -08:00
luz paz
84553bf191 App: Fix header uniformity, trailing whitespace, and doxygen headers 2020-11-19 13:38:37 +01:00
Zheng, Lei
dc52336749 App: remove unncessary exception catch
This allows exception to propagate to generated C++ python extension
class code.
2020-02-11 15:40:27 -05: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
Zheng, Lei
a7a34ab983 App: more sanity check in PropertyContainerPy 2019-08-30 15:46:47 +02:00
Zheng, Lei
8d5f3c7e1d App: do not return null Shape in PropertyContainerPy 2019-08-30 15:45:58 +02:00
Zheng, Lei
7c87b0ab27 PropertyContainerPy: modified getPropertyByName()
Add 'checkOwner' argument to allow caller distinguish linked property
2019-08-17 15:32:48 +02:00
Zheng, Lei
f028ba42ff 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
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
a432bafbdb 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
0048778f80 remove trailing whitespaces 2018-10-27 18:12:36 +02:00
ickby
64d9f38d95 Persistence: Incorporate review feedback 2018-10-27 16:15:39 +02:00
ickby
d5cbee5543 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
59283c40b8 Persistence: Enable binary dumps of properties 2018-10-27 16:15:09 +02:00
Stefan Tröger
a1d9622eb5 Links ensure uncyclic graph and correct groups 2017-06-19 15:37:09 +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
Stefan Tröger
2420559431 Extensions: Revert few changes after restructuring 2016-10-08 12:48:34 +02:00
Stefan Tröger
552fe52774 Extensions: Show up in the python interface 2016-10-08 12:48:34 +02:00
wmayer
c15da7f463 + dynamically hide/show and enable/disable item in property editor 2016-03-05 13:13:23 +01:00
wmayer
750897c20e + introduce proper enum for property status to replace plain integers 2016-01-01 15:36:24 +01:00
wmayer
0cddf520d0 + make isReadOnly & isHidden of PropertyContainer non-virtual 2015-11-14 02:07:57 +01:00
Mateusz Skowroński
05f95c0506 Fix files encoding. Go from ISO8859-1 to UTF-8. 2015-09-21 19:50:49 -03:00
wmayer
70c60cae00 + 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
8ba282576d + 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