Commit Graph

44 Commits

Author SHA1 Message Date
PhoneDroid
842c5f53e1 [ App ]: Update SPDX License Identifiers 2025-12-25 11:55:37 -06:00
Kacper Donat
77e40b9747 Base: Use explicit pointer syntax for freecad_cast (#20694)
* Base: Use explicit pointer syntax for freecad_cast

This aligns our custom cast with other casts

* All: Use explicit pointer syntax for freecad_cast
2025-04-11 14:11:33 +00:00
Kacper Donat
9d97d1c895 Base: Rename Base::freecad_dynamic_cast into freecad_cast
This is to make it shorter and easier to use. QT does the same thing
with their qobject_cast.
2025-04-07 10:32:28 -05:00
Pieter Hijma
c740b7a027 [Doc] Make naming groups consistent in App
The identifier for groups/topics such as "Document" that have a class
with the samen name are suffixed with "Group", so the identifier becomes
"DocumentGroup".  For groups/topics with no ambiguity the identifier
matches the topic name closely, for example "ExpressionFramework" for
topic "Expression Framework".
2025-03-29 15:11:01 -05:00
Pieter Hijma
8ea31acbd2 [Doc] Add links between topics and relevant items
The documentation has topics, for example topic App which contains
namespace App or topic Document that contains class Document.  This
commit makes sure that the topic has a link to the relevant class or
namespace, whereas the relevant class or namespace refers back to the
topic for a more high-level overview.
2025-03-29 15:11:01 -05:00
wmayer
4e4bcd5ce7 App: Apply clang format (part 3) 2024-11-29 07:14:32 +01:00
Chris Hennes
950507a498 Revert "Resolve #11825 - no automatic quantity conversion: App::anyToQuantity"
This reverts commit c1ef15fbdf5db5aaf2ec86cb44bff237d1966238.
2024-02-12 15:29:15 -06:00
Andrei Pozolotin
71a61cf423 Resolve #11825 - no automatic quantity conversion: App::anyToQuantity 2024-01-11 11:32:18 -06:00
wmayer
1cf1a90a17 App: modernize C++: use default member init 2023-08-23 19:51:44 +02:00
wmayer
656890be38 App: modernize C++: replace 'typedef' with 'using' 2022-08-29 12:58:39 +02:00
wmayer
8328264690 App: [skip ci] whitespace improvements 2022-08-24 10:43:56 +02:00
berniev
d2babf0eb5 App: Single arg ctors must be explicit 2022-08-24 07:20:57 +02:00
wmayer
a7172cd730 App: improve whitespaces 2022-08-01 01:29:47 +02:00
wmayer
1a457d0fb9 App: fix -Winconsistent-missing-override 2022-08-01 01:14:19 +02:00
berniev
b6cae3bfdf App: Modernise ctors dtors defs etc 2022-08-01 00:34:46 +02:00
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
wmayer
f1f68db55b App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
Uwe
a8c912d6f8 [App] Expression and Extension: remove unused includes 2022-02-25 18:06:57 +01:00
Zheng, Lei
0c2c334f87 Spreadsheet: support cell binding
Cell binding allows one to bind a range of cells of one sheet to another
range of cells of an arbitary sheet, including any empty cells in the
range.

The binding is implemented with PropertyExpressionEngine and
PropertySheet::setPathValue(), which binds a special path of
PropertySheet, such as

    .cells.Bind.A1.D1

to an expression, such as

     tuple(.cells, <<A2>>, <<A5>>)

The A1 and D1 in the example above specifies the binding start and end
cell address. And <<A2>> and <<A5>> are the range of cells to bind to.
Note that you can use any expression that evalutes to string for the
binding destination, e.g. <<A%d>> % B1, which uses the value inside B1
to construct the binding destination. The '.cells' in the tuple shown
above is an example to bind cells of the same PropertySheet. It can be
change to to reference to any other spreadsheet, even those outside the
current document, e.g. Document#Spreadsheet001.cells
2021-12-21 21:41:02 -07:00
Zheng, Lei
fdae470c1b App: add hiddenref() expression built-in function
Any object reference inside this function is treated as hidden to
exclude it from dependency calculation. This function allows some form
of cyclic depdenency.

Merger note: renamed from "HREF" to "HIDDENREF" to avoid confusion with
the standard "hypertext reference" use of HREF.
2021-11-14 20:45:09 -06:00
Benjamin Nauck
358cb01a9c [App] Switch from boost::tuple to std::tuple
It's better to use the standard lib when possible
2021-03-06 19:31:06 +01: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
Zheng, Lei
36f7098257 App: extend Expression syntax
* Support sub-object reference syntax using the following syntax,
    Part.<<Box.>>.Placement
  or, with sub-object label referencing
    Part.<<$Cube.>>.Placement

* Extend indexing support, including range based indexing, e.g.
    A1[B2+1][C3][D4:-1]

* Add new constants, None, True, true, False, false.
2019-09-28 15:31:24 +02:00
Zheng, Lei
38c47d6e95 Expression: split Expression.h to ExpressionParser.h
Split Expression details into a separate header to reduce recompilation
time on changes.
2019-09-28 15:30:41 +02:00
Zheng, Lei
8cbdc3ad5d App: use Python number protocol in Expression
This adds support to do mul/div with matrix and vector, as well as
Python formated string with operator %.
2019-09-28 15:30:34 +02:00
wmayer
53e597a5d6 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
b6834155cf Expression: fix python object evaluation 2019-08-17 15:32:48 +02:00
Zheng, Lei
ced27a69c6 PropertyExpressionEngine: convert to link type property
PropertyExpressionEngine is changed to derived from a new class
PropertyExpressionContainer, which is in turn derives from
PropertyXLinkContainer. This makes PropertyExpressionEngine a link type
property that is capable of external linking. It now uses the unified
link property APIs for dependency management and tracking of object
life time, re-labeling, etc.

ObjectIdentifier is modified to support sub-object reference, but is
not exposed to end-user, because expression syntax is kept mostly
unchanged, which will be submitted in future PR. There is, however,
one small change in expression syntax (ExpressionParser.y) to introduce
local property reference to avoid ambiguity mentioned in
FreeCAD/FreeCAD#1619

Modified Expression/ExpressionModifier interface to support various link
property API for link modification.
2019-08-17 14:52:09 +02:00
wmayer
98e13aa048 PVS: V730 Not all members of a class are initialized inside the constructor 2019-02-17 11:49:51 +01:00
Eivind Kvedalen
653da7efb7 Fixed issue #2877: Added hypot() and catet() functions to expression framework. 2017-07-20 18:57:31 +02:00
Eivind Kvedalen
2714dd82c8 Spreadsheet: Fixed issue #2894: Unit strings could be used as aliases. 2017-03-07 13:45:53 -03:00
wmayer
c636974ec8 fix -Wextra in FreeCADApp 2016-09-21 16:05:36 +02:00
wmayer
fb892d35de fix Coverity issues 2016-09-03 14:51:28 +02:00
Eivind Kvedalen
4f7470c5e8 Expressions: Simpified parser, fixed precedence (parentheses) 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
97aa0a1c6d Expressions: Fixed parsing of unit expressions similar to 1/unit. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
8f511322bc Expressions: Moved Expression::priority to cpp file. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
b5e44436f1 Expressions: Added support for aggregate functions and ranges. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
4eb3af633f Expressions: ints should be 64 bit. 2016-03-08 16:09:28 +01:00
Eivind Kvedalen
778abe9072 Expressions: Added App::BooleanExpression class. 2016-03-08 16:09:27 +01:00
Eivind Kvedalen
452650440b PropertyExpressionEngine: Refactored and moved visitor code to separate file. 2016-02-18 16:54:41 +01:00
Eivind Kvedalen
fa8b7bfb45 Expression: Added ExpressionModifier class, used as base class for visitors that may modify its expressions. 2016-02-18 16:54:41 +01:00
Eivind Kvedalen
ca0c9de886 Expression/ObjectIdentifier: changed return type of renameDocumentObject and renameDocument,
to be able to signal that a rename actually took place.
2015-12-21 14:11:12 +01:00
Eivind Kvedalen
5fa6bc714e App: Removed VariableExpression::setName(), and replace call by setPath(); it's use caused a crash (#2352). 2015-12-09 12:15:12 +01:00
Eivind Kvedalen
ae388d26ea Added Expression classes to App directory. Added Expression interface to Property base class. 2015-09-21 14:51:02 +02:00