Compare commits
338 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25c3ba7338 | |||
| eafd18dac0 | |||
| b70b31226b | |||
| 28a5bcdf8e | |||
| ec2a41b86b | |||
| 5556821e7e | |||
| 44c73fdd5b | |||
| 80080d9fde | |||
| 280addd21c | |||
| 483d0ef6fe | |||
| 0ff0359524 | |||
| b038f4130c | |||
| 2d83e86f07 | |||
| 871ab6df64 | |||
| df7ee72171 | |||
| 2e37667371 | |||
| b5b00f7aff | |||
| f7908335e5 | |||
| f43c6906ff | |||
| 3071cc847c | |||
| 5c464e0746 | |||
| 484c724ac6 | |||
| 6bed2e663e | |||
| ffea3da872 | |||
| ee34d09f7a | |||
| 948f284472 | |||
| b92b54de0e | |||
| 50d22e2bb7 | |||
| 071e7f3dfa | |||
| ce0a3dd526 | |||
| 9e7b5f6444 | |||
| ca5d22ebca | |||
| 3d0db63193 | |||
| 924dfe29c8 | |||
| d95f56b39b | |||
| a479197f0b | |||
| c828c5d1d1 | |||
| be93298afd | |||
| 06131ce8b5 | |||
| 66600f9f1f | |||
| 3ae8f3d57a | |||
| af41a9dcef | |||
| 7ecdb0236b | |||
| 6c7187b54f | |||
| 011b6cdfbf | |||
| 857190a20a | |||
| 37af704998 | |||
| f2d60d7abe | |||
| 54948b441d | |||
| 28d5539fc7 | |||
| bde82f19cb | |||
| 123aee6b1b | |||
| 4e9fe02b9a | |||
| cb108249f2 | |||
| a8ce12f2b4 | |||
| 8ddecd21a1 | |||
| 520dd7b2b7 | |||
| 5afe1e64f8 | |||
| 2d5bb51734 | |||
| 44bb16cae7 | |||
| 2d2684cc3d | |||
| af014a1bb4 | |||
| 75151b2987 | |||
| 736ffd0140 | |||
| acb3f4a8f9 | |||
| 54d25bcabc | |||
| f0e70e68e0 | |||
| 0df300cee6 | |||
| df142c35aa | |||
| 00887c4f3a | |||
| a26610b315 | |||
| 5400e01651 | |||
| c783f818a8 | |||
| 5ea8399ada | |||
| 0bc707ad34 | |||
| 22309af65c | |||
| 2c7e0f044b | |||
| cd5209f264 | |||
| 098f19f706 | |||
| 08e4191e5a | |||
| 79412d205b | |||
| 27f6c9081c | |||
| cdb990e810 | |||
| 489e429b5c | |||
| d80cd13d41 | |||
| 41395f2051 | |||
| 08cf89d1c9 | |||
| 90a4f9ecb0 | |||
| 53ba534677 | |||
| 8504bc8988 | |||
| 69674d706f | |||
| ca1a25d6d6 | |||
| 46909c6fb8 | |||
| 6a1929a6d6 | |||
| 5b872b59a1 | |||
| fe4a734a9d | |||
| 4d201c8f0e | |||
| c8eefab345 | |||
| aeb83b3c05 | |||
| 45ca23d074 | |||
| e4f36afcb3 | |||
| 0b2268a921 | |||
| 36d432e2cc | |||
| c5489e0f0a | |||
| ad2e866332 | |||
| ced9c0dd4f | |||
| 1f78dac7b5 | |||
| e2a141785f | |||
| 97ca7d9818 | |||
| 48d91d6dd8 | |||
| 0b1b7ccc62 | |||
| 0d75ff1542 | |||
| 3b83367c4a | |||
| 9b2e4b4975 | |||
| 7106c697d0 | |||
| 1844fdd443 | |||
| 0257c40bc4 | |||
| f413a569b3 | |||
| ba99bc5da4 | |||
| 05b7ad0e9c | |||
| f7689115ae | |||
| c270a8ac66 | |||
| c93db04d9e | |||
| 4227a6d11b | |||
| 428340a974 | |||
| c7e74a68a7 | |||
| 6c583d82f2 | |||
| 243b42f4cb | |||
| 275ece0bb2 | |||
| d018b3f8fb | |||
| 5e42f6a48d | |||
| 6ab89664c6 | |||
| 5379378626 | |||
| 5b2987bd07 | |||
| 67cdd23918 | |||
| 11fecb1558 | |||
| c2bd7d3543 | |||
| f8de1c60b4 | |||
| 0a2362dd57 | |||
| 25e3cb0144 | |||
| f507ee449b | |||
| c72a707fca | |||
| 2709d2a595 | |||
| 478f8a0c76 | |||
| cf9bb8bb16 | |||
| 6eafca89e3 | |||
| 676a3c3d0d | |||
| 3a5b565bd8 | |||
| 478292b9ec | |||
| 9cf380810a | |||
| 1111f8da7c | |||
| 87d21a643d | |||
| 9a12579cb9 | |||
| ee512ebc00 | |||
| 8fe33581e6 | |||
| 909d581265 | |||
| 09f3e6738c | |||
| 9e6e2f474f | |||
| 9a81201b24 | |||
| 3084c48c8e | |||
| 5409b12e6e | |||
| e95d3cbdc9 | |||
| 4718c46170 | |||
| b65451c2b4 | |||
| 501c6273a3 | |||
| 5aa00ca0ad | |||
| 0cfa5ba5fe | |||
| b433350aff | |||
| 01777cb320 | |||
| e221cfd47a | |||
| 34eafe127e | |||
| 4daf8d3b38 | |||
| 99dee32e84 | |||
| e366824b74 | |||
| 9e58650477 | |||
| 4ef209cabe | |||
| f6f919d229 | |||
| 503ef79cea | |||
| c7c068be6e | |||
| 06e0fb4c19 | |||
| 4b0259b57f | |||
| 70be188426 | |||
| fce385dd73 | |||
| 3ea894029f | |||
| 70a7480601 | |||
| 873fa449ce | |||
| 498968b89c | |||
| 1683f271c6 | |||
| f8662d75eb | |||
| f1c7d91a74 | |||
| 2096d0bd86 | |||
| 529aae0238 | |||
| d97c7cc95c | |||
| 3a6c75f5bd | |||
| 93f1cf717b | |||
| 58d319511a | |||
| 6a597a9277 | |||
| 5686d0a713 | |||
| 5e63985fa7 | |||
| 88d21ce70e | |||
| 55d0e2b3ac | |||
| 6fd6558040 | |||
| 7f6c39c358 | |||
| 06c46bd352 | |||
| 5ba4feac59 | |||
| fa67c65da9 | |||
| 0334c145d0 | |||
| 50d1dec4e0 | |||
| e806592d92 | |||
| 129d64dd87 | |||
| adb327d98e | |||
| 7023e83843 | |||
| a09de19764 | |||
| 08aeb5d65b | |||
| 4b1ce402ff | |||
| 31ed7d2b67 | |||
| 0e7460496e | |||
| c9fffa6789 | |||
| e8aeffc096 | |||
| 54535e072e | |||
| 2386ff1abc | |||
| 98c9bca45a | |||
| 02d31f0457 | |||
| f4bfbb47fa | |||
| d08a7f1c0d | |||
| 529c624afc | |||
| 5abf4da75e | |||
| 2172e82f23 | |||
| d7b735ff95 | |||
| fd2e4b1397 | |||
| b8c6d59ab6 | |||
| 06a9c56656 | |||
| 777726f093 | |||
| c5ff1b4550 | |||
| fdd7dac561 | |||
| d5f9059199 | |||
| a431ccc156 | |||
| 2796296a24 | |||
| ac21faf35e | |||
| 68084b64c9 | |||
| a94382dd07 | |||
| 4ff8998198 | |||
| e28f54f598 | |||
| 879c083abf | |||
| 36b263a906 | |||
| bbea8ace72 | |||
| 171389d9d3 | |||
| 65d166f356 | |||
| 909cd46a9f | |||
| f3186f4dc0 | |||
| e3874a1973 | |||
| 8df09d92c0 | |||
| b72f83136c | |||
| 7bb4bacc11 | |||
| 855d76bb40 | |||
| e4b6b32f11 | |||
| ae0946ac9d | |||
| da4832fb50 | |||
| 0e6d4aa1d7 | |||
| e278d22d42 | |||
| 5e75a3ece9 | |||
| 8496d25279 | |||
| a89c7eedcf | |||
| bdb817a6a1 | |||
| 0bfc4ac41e | |||
| aef287cbb6 | |||
| 906edf7078 | |||
| 50e4864efb | |||
| 87f88bba30 | |||
| c995a331b6 | |||
| 41ce37233d | |||
| 2b90740855 | |||
| 96b76b4e41 | |||
| 3f918a5d35 | |||
| 7595a83f36 | |||
| d9cf2b65b5 | |||
| 2a56489feb | |||
| 325dd3b701 | |||
| 7bc525f885 | |||
| 667b841de1 | |||
| 8275916601 | |||
| 9462c7bfb3 | |||
| 981daca351 | |||
| 1e56392c5c | |||
| 6e090a2dad | |||
| d0c7b427ff | |||
| 9fad915d0e | |||
| b82505e86c | |||
| 546a43b8b8 | |||
| 558659d117 | |||
| 62c222c211 | |||
| 45401513b4 | |||
| f4fe303829 | |||
| f7b4372108 | |||
| b23d580941 | |||
| 51b5870953 | |||
| 33aeb38f0c | |||
| 4b2131f501 | |||
| 806e3e9eb0 | |||
| 8d3a2e93fd | |||
| f17c46f8ec | |||
| 7d811f2ab2 | |||
| e89fcf29f7 | |||
| 911d82f99b | |||
| 557f45587f | |||
| 90f9996fdb | |||
| 8f3d9d9cdf | |||
| 98d64f9939 | |||
| 084003e361 | |||
| cab1261a42 | |||
| b460e85abe | |||
| ca8bfc6180 | |||
| 331e51cdfc | |||
| 02df83e19d | |||
| 9a09e8e321 | |||
| 6af8e0b380 | |||
| f3c043195f | |||
| e2e75f1039 | |||
| 78f29138bc | |||
| b5b9913293 | |||
| 78447d9800 | |||
| 23297f5045 | |||
| 1b16eeeeb9 | |||
| 46f4014647 | |||
| 17c8da0244 | |||
| 4323840e8e | |||
| 8912dfd7e1 | |||
| 661bdd999a | |||
| 372959ddee | |||
| ca4a8cd200 | |||
| c78b483dd5 | |||
| d33b4b38f7 | |||
| 5467173e01 | |||
| 94fb19d9be | |||
| eb58e2e343 | |||
| 415fa0a415 | |||
| a8d8d59f2e | |||
| e86fbd0689 |
+76
-49
@@ -1,22 +1,22 @@
|
||||
# Generated from CLion C/C++ Code Style settings
|
||||
# --- Based on Qt Coding Style ---
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
# --- Bracket and Indentation Behavior ---
|
||||
IndentWidth: 4
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
TabWidth: 4
|
||||
ColumnLimit: 100
|
||||
UseTab: Never
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: None
|
||||
AlignOperands: DontAlign
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
|
||||
AlignAfterOpenBracket: BlockIndent
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
AllowShortBlocksOnASingleLine: Empty
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLambdasOnASingleLine: Empty
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BinPackArguments: false
|
||||
BreakBeforeBraces: Custom
|
||||
BreakTemplateDeclarations: Yes
|
||||
BreakBeforeBinaryOperators: All
|
||||
BraceWrapping:
|
||||
AfterCaseLabel: false
|
||||
AfterClass: true
|
||||
@@ -31,41 +31,68 @@ BraceWrapping:
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: false
|
||||
SplitEmptyRecord: true
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakInheritanceList: BeforeColon
|
||||
ColumnLimit: 100
|
||||
CompactNamespaces: false
|
||||
ContinuationIndentWidth: 4
|
||||
IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
InsertBraces: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
MaxEmptyLinesToKeep: 2
|
||||
NamespaceIndentation: None
|
||||
ObjCSpaceAfterProperty: false
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
PackConstructorInitializers: Never
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: Never
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterLogicalNot: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: false
|
||||
|
||||
# --- Special: Lambdas and Short Things ---
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortBlocksOnASingleLine: Never
|
||||
AllowShortEnumsOnASingleLine: false
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLambdasOnASingleLine: Inline
|
||||
AllowAllArgumentsOnNextLine: false
|
||||
|
||||
# --- Spaces ---
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceAfterCStyleCast: false
|
||||
Cpp11BracedListStyle: true
|
||||
SpaceBeforeCpp11BracedList: true
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 2
|
||||
SpacesInAngles: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeInheritanceColon: false
|
||||
|
||||
# --- Alignment & Formatting Tweaks ---
|
||||
AlignConsecutiveAssignments:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignConsecutiveDeclarations:
|
||||
Enabled: false
|
||||
AcrossEmptyLines: false
|
||||
AcrossComments: false
|
||||
AlignCompound: false
|
||||
AlignFunctionPointers: false
|
||||
PadOperators: true
|
||||
AlignOperands: DontAlign
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
PointerAlignment: Left
|
||||
ReferenceAlignment: Left
|
||||
|
||||
# --- Comment Style ---
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
|
||||
# --- Namespace handling ---
|
||||
NamespaceIndentation: None
|
||||
|
||||
# --- Others ---
|
||||
SortIncludes: Never
|
||||
IncludeBlocks: Preserve
|
||||
MaxEmptyLinesToKeep: 2
|
||||
IndentCaseLabels: true
|
||||
InsertBraces: true
|
||||
AlignEscapedNewlines: DontAlign
|
||||
PPIndentWidth: 1
|
||||
IndentPPDirectives: AfterHash
|
||||
ReflowComments: true
|
||||
|
||||
# --- Penalties (Fine-tuning when to break lines) ---
|
||||
PenaltyBreakAssignment: 80
|
||||
PenaltyBreakBeforeFirstCallParameter: 1
|
||||
PenaltyBreakComment: 60
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakOpenParenthesis: 5
|
||||
PenaltyExcessCharacter: 10
|
||||
PenaltyReturnTypeOnItsOwnLine: 600
|
||||
|
||||
@@ -102,4 +102,6 @@ c5c2ea3498f402c0c89916c46ddb071e22756622 # Assembly: Final application of pre-co
|
||||
d472927bba7b2d8d151c99fb29cf1d8dd099ea7d # Correct PartDesign Helix feature negative angles (#11399)
|
||||
b93c02e07da4990482b9d927506901e6f5d624e1 # Black updated to 24.3.0
|
||||
cbea6b60942f8327e6105b12e8c1d5db4647984c # FEM: Apply pre-commit to FEM files
|
||||
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
|
||||
f9d66096878c7d89c273522b9ca57bdb14fee3bc # Rearranged CommandCreateGeo.cpp
|
||||
b23d5809414d63ea90bcc744212c126645051438 # BIM: add to pre-commit and apply Black formatting
|
||||
50e4864efb06faf3e2126e8cb9ff9058a08a54b2 # Draft: add to pre-commit and apply Black formatting
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: FreeCAD
|
||||
liberapay: FreeCAD
|
||||
open_collective: freecad
|
||||
patreon: # Replace with a single Patreon username
|
||||
ko_fi: # Replace with a single Ko-fi username
|
||||
|
||||
@@ -6,8 +6,7 @@
|
||||
"owner": "msvc-problem-matcher",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp":
|
||||
"^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),?(\\d+)?(?:,\\d+,\\d+)?\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
logdir: /tmp/log/
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
done
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ github.job }}-Logs
|
||||
path: |
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
sarif_file: sarif-results/cpp.sarif
|
||||
|
||||
- name: Upload loc as a Build Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
uses: actions/upload-artifact@v5
|
||||
with:
|
||||
name: sarif-results
|
||||
path: sarif-results
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
name: Fedora Daily Build
|
||||
permissions:
|
||||
contents: read
|
||||
on:
|
||||
schedule:
|
||||
- cron: "00 00 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
trigger-copr-build:
|
||||
env:
|
||||
copr_token: ${{ secrets.COPR_TOKEN }}
|
||||
runs-on: ubuntu-latest
|
||||
container: quay.io/packit/packit
|
||||
steps:
|
||||
- name: setup copr token
|
||||
run: |
|
||||
mkdir -p ~/.config
|
||||
echo "$copr_token" > ~/.config/copr
|
||||
- name: checkout sources
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
fetch-depth: 500
|
||||
fetch-tags: true
|
||||
- name: Setup safe Git directory
|
||||
run: git config --global --add safe.directory $GITHUB_WORKSPACE
|
||||
- name: trigger copr build
|
||||
run: |
|
||||
packit build in-copr --project freecad
|
||||
@@ -10,12 +10,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Qt ≥ 6.8
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
version: "6.8.3"
|
||||
@@ -24,9 +24,9 @@ jobs:
|
||||
arch: "linux_gcc_64"
|
||||
|
||||
- name: Setup Python & dependencies
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
|
||||
with:
|
||||
python-version: "3.x"
|
||||
python-version: "3.13"
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
@@ -47,7 +47,7 @@ jobs:
|
||||
run: |
|
||||
git config --global user.name "github-actions"
|
||||
git config --global user.email "github-actions@github.com"
|
||||
git add -A
|
||||
git add src
|
||||
git commit -m "Update translations from Crowdin" || echo "No changes to commit"
|
||||
|
||||
- name: Push changes to a new branch
|
||||
@@ -56,9 +56,12 @@ jobs:
|
||||
git push origin update-crowdin-translations --force
|
||||
|
||||
- name: Create Pull Request
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e
|
||||
with:
|
||||
branch: update-crowdin-translations
|
||||
title: "Update translations from Crowdin"
|
||||
body: "Automatic Crowdin update."
|
||||
labels: "translations, automated"
|
||||
delete-branch: true
|
||||
add-paths: |
|
||||
src
|
||||
|
||||
@@ -17,7 +17,7 @@ jobs:
|
||||
steps:
|
||||
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
echo "last_month=$first_day..$last_day" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Run issue-metrics tool
|
||||
uses: github/issue-metrics@45a6cb314ddaa4c12eed570eb2739435d712d480 # v3.24.0
|
||||
uses: github/issue-metrics@637a24e71b78bc10881e61972b19ea9ff736e14a # v3.25.2
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SEARCH_QUERY: 'repo:FreeCAD/FreeCAD is:issue created:${{ env.last_month }}'
|
||||
|
||||
@@ -21,7 +21,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -10,12 +10,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Qt ≥ 6.8
|
||||
uses: jurplel/install-qt-action@v3
|
||||
uses: jurplel/install-qt-action@d325aaf2a8baeeda41ad0b5d39f84a6af9bcf005
|
||||
with:
|
||||
aqtversion: "==3.1.*"
|
||||
version: "6.8.3"
|
||||
@@ -24,9 +24,9 @@ jobs:
|
||||
arch: "linux_gcc_64"
|
||||
|
||||
- name: Setup Python & dependencies
|
||||
uses: actions/setup-python@v4
|
||||
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
|
||||
with:
|
||||
python-version: "3.x"
|
||||
python-version: "3.13"
|
||||
- name: Install Python packages
|
||||
run: |
|
||||
python3 -m pip install --upgrade pip
|
||||
|
||||
@@ -36,7 +36,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -116,9 +116,9 @@ jobs:
|
||||
mkdir -p ${{ env.reportdir }}
|
||||
echo "reportFile=${{ env.reportfilename }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
|
||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
||||
with:
|
||||
pixi-version: v0.48.1
|
||||
pixi-version: v0.59.0
|
||||
cache: false
|
||||
|
||||
- name: Restore Compiler Cache
|
||||
@@ -216,7 +216,7 @@ jobs:
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-${{ matrix.os }}-Logs
|
||||
path: |
|
||||
@@ -225,7 +225,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -77,7 +77,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -223,7 +223,7 @@ jobs:
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
@@ -232,7 +232,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -164,7 +164,7 @@ jobs:
|
||||
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
|
||||
@@ -198,7 +198,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -355,7 +355,7 @@ jobs:
|
||||
|
||||
- name: Upload logs and fixes
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
@@ -364,7 +364,7 @@ jobs:
|
||||
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -81,7 +81,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -180,14 +180,14 @@ jobs:
|
||||
echo "" >> $GITHUB_OUTPUT
|
||||
- name: Upload logs
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ inputs.artifactBasename }}-Logs
|
||||
path: |
|
||||
${{ env.logdir }}
|
||||
- name: Upload report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
||||
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
|
||||
with:
|
||||
name: ${{ env.reportfilename }}
|
||||
path: |
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
build_tag: ${{ steps.tag_build.outputs.build_tag }}
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
environment: weekly-build
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
@@ -104,9 +104,9 @@ jobs:
|
||||
fetch-tags: true
|
||||
submodules: 'recursive'
|
||||
|
||||
- uses: prefix-dev/setup-pixi@194d461b21b6c5717c722ffc597fa91ed2ff29fa # v0.9.1
|
||||
- uses: prefix-dev/setup-pixi@82d477f15f3a381dbcc8adc1206ce643fe110fb7 # v0.9.3
|
||||
with:
|
||||
pixi-version: v0.48.1
|
||||
pixi-version: v0.59.0
|
||||
cache: false
|
||||
|
||||
- name: Install the Apple certificate and provisioning profile
|
||||
|
||||
@@ -54,7 +54,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Harden the runner (Audit all outbound calls)
|
||||
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
|
||||
uses: step-security/harden-runner@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2
|
||||
with:
|
||||
egress-policy: audit
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# file types to ignore
|
||||
.*
|
||||
!/.packit.yaml
|
||||
!/.clang-format
|
||||
!/.clang-tidy
|
||||
!/.git-blame-ignore-revs
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
specfile_path: package/fedora/freecad.spec
|
||||
files_to_sync:
|
||||
- .packit.yaml
|
||||
actions:
|
||||
post-upstream-clone:
|
||||
- bash -c 'BUILD_TAG=dev /usr/bin/python3 package/rattler-build/scripts/make_version_file.py freecad_version.txt'
|
||||
- rm -f freecad-sources.tar.gz
|
||||
changelog-entry:
|
||||
- bash -c 'git log --no-merges --pretty="format:- %s (%an)" $(git describe --tags --abbrev=0 )..HEAD -- |sed 's/%/%%/g''
|
||||
create-archive:
|
||||
- git submodule update --init
|
||||
- bash -c 'git ls-files --recurse-submodules | tar -caf freecad-sources.tar.gz -T-'
|
||||
- echo -n 'freecad-sources.tar.gz'
|
||||
downstream_package_name: freecad
|
||||
additional_packages:
|
||||
- python3
|
||||
|
||||
jobs:
|
||||
- job: copr_build
|
||||
identifier: pull_request
|
||||
trigger: pull_request
|
||||
notifications:
|
||||
pull_request:
|
||||
successful_build: True
|
||||
branch: main
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
manual_trigger: true
|
||||
targets:
|
||||
fedora-stable:
|
||||
without_opts:
|
||||
- debug_info
|
||||
fedora-development:
|
||||
without_opts:
|
||||
- debug_info
|
||||
|
||||
- job: tests
|
||||
identifier: pull_request
|
||||
trigger: pull_request
|
||||
branch: main
|
||||
manual_trigger: true
|
||||
targets:
|
||||
fedora-latest-stable:
|
||||
without_opts:
|
||||
- debug_info
|
||||
fmf_path: package/fedora/tests
|
||||
|
||||
- job: copr_build
|
||||
identifier: main
|
||||
trigger: commit
|
||||
manual_trigger: true
|
||||
branch: main
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
owner: freecad
|
||||
project: nightly
|
||||
|
||||
- job: copr_build
|
||||
identifier: release
|
||||
trigger: release
|
||||
owner: freecad
|
||||
project: freecad
|
||||
additional_repos:
|
||||
- copr://bpostle/IfcOpenShell
|
||||
targets:
|
||||
fedora-all:
|
||||
without_opts:
|
||||
- tests
|
||||
+13
-6
@@ -6,20 +6,24 @@ files: |
|
||||
(?x)^(
|
||||
.github|
|
||||
src/Base|
|
||||
src/Gui|
|
||||
src/Main|
|
||||
src/Tools|
|
||||
tests/src|
|
||||
src/Mod/Assembly|
|
||||
src/Mod/BIM|
|
||||
src/Mod/CAM|
|
||||
src/Mod/Cloud|
|
||||
src/Mod/Draft|
|
||||
src/Mod/Fem|
|
||||
src/Mod/Help|
|
||||
src/Mod/Import|
|
||||
src/Mod/Inspection|
|
||||
src/Mod/JtReader|
|
||||
src/Mod/Measure|
|
||||
src/Mod/Mesh|
|
||||
src/Mod/MeshPart|
|
||||
src/Mod/Mesh|
|
||||
src/Mod/PartDesign|
|
||||
src/Mod/Part|
|
||||
src/Mod/Plot|
|
||||
src/Mod/Points|
|
||||
src/Mod/ReverseEngineering|
|
||||
@@ -31,7 +35,8 @@ files: |
|
||||
src/Mod/Surface|
|
||||
src/Mod/Test|
|
||||
src/Mod/Tux|
|
||||
src/Mod/Web
|
||||
src/Mod/Web|
|
||||
tests/src
|
||||
)
|
||||
exclude: |
|
||||
(?x)^(
|
||||
@@ -50,7 +55,9 @@ exclude: |
|
||||
src/Mod/Mesh/App/TestData|
|
||||
src/Mod/Mesh/App/WildMagic4|
|
||||
src/Mod/Robot/App/kdl_cp|
|
||||
src/Mod/Robot/Lib
|
||||
src/Mod/Robot/Lib|
|
||||
.*\.ts$|
|
||||
.*\.brep$
|
||||
)
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
@@ -62,11 +69,11 @@ repos:
|
||||
- id: check-added-large-files
|
||||
- id: mixed-line-ending
|
||||
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||
rev: fe95161893684893d68b1225356702ca71f8d388 # frozen: 25.9.0
|
||||
rev: 2892f1f81088477370d4fbc56545c05d33d2493f # frozen: 25.11.0
|
||||
hooks:
|
||||
- id: black
|
||||
args: ['--line-length', '100']
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: 719856d56a62953b8d2839fb9e851f25c3cfeef8 # frozen: v21.1.2
|
||||
rev: 317810f3c6a0ad3572367dc86cb6e41863e16e08 # frozen: v21.1.5
|
||||
hooks:
|
||||
- id: clang-format
|
||||
|
||||
+139
-1
@@ -307,6 +307,144 @@
|
||||
"value": "OFF"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "rpm",
|
||||
"description": "Settings like rpm build",
|
||||
"displayName": "rpm",
|
||||
"generator": "Ninja",
|
||||
"binaryDir": "${sourceDir}/build/rpm",
|
||||
"cacheVariables": {
|
||||
"CMAKE_INSTALL_DATAROOTDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share"
|
||||
},
|
||||
"CMAKE_C_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_CXX_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_Fortran_FLAGS_RELEASE": {
|
||||
"type": "STRING",
|
||||
"value": "-DNDEBUG"
|
||||
},
|
||||
"CMAKE_VERBOSE_MAKEFILE": {
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_INSTALL_DO_STRIP": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
},
|
||||
"CMAKE_INSTALL_PREFIX": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/lib64/freecad"
|
||||
},
|
||||
"CMAKE_INSTALL_FULL_SBINDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/bin"
|
||||
},
|
||||
"CMAKE_INSTALL_SBINDIR": {
|
||||
"type": "PATH",
|
||||
"value": "bin"
|
||||
},
|
||||
"INCLUDE_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"LIB_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/lib64"
|
||||
},
|
||||
"SYSCONF_INSTALL_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/etc"
|
||||
},
|
||||
"SHARE_INSTALL_PREFIX": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share"
|
||||
},
|
||||
"LIB_SUFFIX": {
|
||||
"type": "STRING",
|
||||
"value": "64"
|
||||
},
|
||||
"BUILD_SHARED_LIBS": {
|
||||
"type": "BOOL",
|
||||
"value": "ON"
|
||||
},
|
||||
"CMAKE_INSTALL_DOCDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share/doc/freecad"
|
||||
},
|
||||
"CMAKE_INSTALL_INCLUDEDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"RESOURCEDIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/share/freecad"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_PIVY": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_FMT": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_PCL": {
|
||||
"type": "BOOL",
|
||||
"value": "OFF"
|
||||
},
|
||||
"FREECAD_QT_VERSION": {
|
||||
"type": "STRING",
|
||||
"value": "6"
|
||||
},
|
||||
"OpenGL_GL_PREFERENCE": {
|
||||
"type": "STRING",
|
||||
"value": "GLVND"
|
||||
},
|
||||
"USE_OCC": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"PYCXX_INCLUDE_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/include"
|
||||
},
|
||||
"PYCXX_SOURCE_DIR": {
|
||||
"type": "PATH",
|
||||
"value": "/usr/src/CXX"
|
||||
},
|
||||
"ENABLE_DEVELOPER_TESTS": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"FREECAD_USE_EXTERNAL_GTEST": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"ONDSELSOLVER_BUILD_EXE": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
},
|
||||
"BUILD_GUI": {
|
||||
"type": "BOOL",
|
||||
"value": "TRUE"
|
||||
}
|
||||
},
|
||||
"environment": {
|
||||
"CC": "gcc",
|
||||
"CXX": "g++",
|
||||
"LT_SYS_LIBRARY_PATH": "/usr/lib64:",
|
||||
"CCACHE_PROGRAM": "/usr/bin/ccache",
|
||||
"CFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
|
||||
"CXXFLAGS": "-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -mtls-dialect=gnu2 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer",
|
||||
"LDFLAGS": "-Wl,--as-needed -Wl,--no-undefined"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ The FreeCAD Contribution Process is expressed here with the following specific g
|
||||
9. A PR MUST compile cleanly and pass project self-tests on all target platforms.
|
||||
10. Changes that break python API used by extensions SHALL be avoided. If it is not possible to avoid breaking changes, the amount of them MUST be minimized and PR MUST clearly describe all breaking changes with clear description on how to replace no longer working solution with newer one. Contributor SHOULD search for addons that will be broken and list them in the PR.
|
||||
11. Each commit message in a PR MUST succinctly explain what the commit achieves. The commit message SHALL follow the suggestions in the `git commit --help` documentation, section DISCUSSION.
|
||||
12. The PR message MUST consist of a single short line, the PR Title, summarizing the problem being solved, followed by a blank line and then the proposed solution in the Body. If a PR consists of more than one commit, the PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
|
||||
12. The PR Title MUST succinctly explain what the PR achieves. The Body MAY be as detailed as needed. If a PR changes the user interface (UI), the body of the text MUST include a presentation of these UI changes, preferably with screenshots of the previous and revised state.
|
||||
13. If a PR contains the work of another author (for example, if it is cherry-picked from a fork by someone other than the PR-submitter):
|
||||
1. the PR description MUST contain proper attribution as the first line, for example: "This is work of XYZ cherry-picked from <link>";
|
||||
2. all commits MUST have proper authorship, i.e. be authored by the original author and committed by the author of the PR;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
[Blog](https://blog.freecad.org)
|
||||
|
||||
|
||||
[](https://github.com/freecad/freecad/releases/latest) [](https://crowdin.com/project/freecad) [](https://liberapay.com/FreeCAD)
|
||||
[](https://github.com/freecad/freecad/releases/latest) [](https://crowdin.com/project/freecad)
|
||||
|
||||
<img src="/.github/images/partdesign.png" width="800"/>
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ macro(CheckInterModuleDependencies)
|
||||
REQUIRES_MODS(BUILD_DRAFT BUILD_SKETCHER BUILD_TECHDRAW)
|
||||
REQUIRES_MODS(BUILD_DRAWING BUILD_PART BUILD_SPREADSHEET)
|
||||
REQUIRES_MODS(BUILD_FEM BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_IMPORT BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_IMPORT BUILD_PART BUILD_PART_DESIGN)
|
||||
REQUIRES_MODS(BUILD_INSPECTION BUILD_MESH BUILD_POINTS BUILD_PART)
|
||||
REQUIRES_MODS(BUILD_JTREADER BUILD_MESH)
|
||||
REQUIRES_MODS(BUILD_MESH_PART BUILD_PART BUILD_MESH)
|
||||
|
||||
@@ -24,11 +24,7 @@ macro(InitializeFreeCADBuildOptions)
|
||||
option(INSTALL_TO_SITEPACKAGES "If ON the freecad root namespace (python) is installed into python's site-packages" ON)
|
||||
option(INSTALL_PREFER_SYMLINKS "If ON then fc_copy_sources macro will create symlinks instead of copying files" OFF)
|
||||
option(OCCT_CMAKE_FALLBACK "disable usage of occt-config files" OFF)
|
||||
if (WIN32 OR APPLE)
|
||||
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." OFF)
|
||||
else()
|
||||
option(FREECAD_USE_QT_FILEDIALOG "Use Qt's file dialog instead of the native one." ON)
|
||||
endif()
|
||||
option(FREECAD_USE_QT_DIALOGS "Use Qt's dialogs instead of the native one." OFF)
|
||||
|
||||
# == Win32 is default behaviour use the LibPack copied in Source tree ==========
|
||||
if(MSVC)
|
||||
|
||||
Binary file not shown.
@@ -8,9 +8,9 @@ SET(Examples_Files
|
||||
FEMExample.FCStd
|
||||
AssemblyExample.FCStd
|
||||
ArchDetail.FCStd
|
||||
draft_test_objects_files/FCPAT.pat
|
||||
draft_test_objects_files/osifont.license
|
||||
draft_test_objects_files/osifont-lgpl3fe.ttf
|
||||
FCPAT.pat
|
||||
osifont.license
|
||||
osifont-lgpl3fe.ttf
|
||||
)
|
||||
|
||||
ADD_CUSTOM_TARGET(Example_data ALL
|
||||
|
||||
Binary file not shown.
+239
-282
@@ -1,109 +1,67 @@
|
||||
# This package depends on automagic byte compilation
|
||||
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_3
|
||||
%global py_bytecompile 1
|
||||
# Some configuration options for other environments
|
||||
# rpmbuild --without=bundled_zipios: don't use bundled version of zipios++
|
||||
%bcond_without bundled_zipios
|
||||
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
|
||||
%bcond_with bundled_pycxx
|
||||
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
|
||||
%bcond_without bundled_smesh
|
||||
# rpmbuild --without=bundled_gtest: don't use bundled version of gtest and gmock
|
||||
%bcond_with bundled_gtest
|
||||
|
||||
# rpmbuild --without=tests exclude tests in %%check
|
||||
%bcond_without tests
|
||||
# rpmbuild --without=debug_info don't generate package with debug info
|
||||
%bcond_without debug_info
|
||||
|
||||
|
||||
Name: freecad
|
||||
Epoch: 1
|
||||
Version: 1.1.0~dev
|
||||
Release: 1%{?dist}
|
||||
|
||||
Summary: A general purpose 3D CAD modeler
|
||||
Group: Applications/Engineering
|
||||
License: LGPL-2.0-or-later
|
||||
URL: https://www.freecad.org/
|
||||
|
||||
Source0: freecad-sources.tar.gz
|
||||
|
||||
# Setup python target for shiboken so the right cmake file is imported.
|
||||
%global py_suffix %(%{__python3} -c "import sysconfig; print(sysconfig.get_config_var('SOABI'))")
|
||||
|
||||
# Maintainers: keep this list of plugins up to date
|
||||
# List plugins in %%{_libdir}/%{name}/lib, less '.so' and 'Gui.so', here
|
||||
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libOndselSolver libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
|
||||
# List plugins in %%{_libdir}/%%{name}/lib, less '.so' and 'Gui.so', here
|
||||
%global plugins AssemblyApp AssemblyGui CAMSimulator DraftUtils Fem FreeCAD Import Inspection MatGui Materials Measure Mesh MeshPart Part PartDesignGui Path PathApp PathSimulator Points QtUnitGui ReverseEngineering Robot Sketcher Spreadsheet Start Surface TechDraw Web _PartDesign area flatmesh libDriver libDriverDAT libDriverSTL libDriverUNV libE57Format libMEFISTO2 libSMDS libSMESH libSMESHDS libStdMeshers libarea-native
|
||||
|
||||
# Some configuration options for other environments
|
||||
# rpmbuild --with=bundled_zipios: use bundled version of zipios++
|
||||
%global bundled_zipios %{?_with_bundled_zipios: 1} %{?!_with_bundled_zipios: 1}
|
||||
# rpmbuild --with=bundled_pycxx: use bundled version of pycxx
|
||||
%global bundled_pycxx %{?_with_bundled_pycxx: 1} %{?!_with_bundled_pycxx: 0}
|
||||
# rpmbuild --without=bundled_smesh: don't use bundled version of Salome's Mesh
|
||||
%global bundled_smesh %{?_without_bundled_smesh: 0} %{?!_without_bundled_smesh: 1}
|
||||
|
||||
# Prevent RPM from doing its magical 'build' directory for now
|
||||
%global __cmake_in_source_build 0
|
||||
%global exported_libs libOndselSolver
|
||||
|
||||
|
||||
# See FreeCAD-main/src/3rdParty/salomesmesh/CMakeLists.txt to find this out.
|
||||
%global bundled_smesh_version 7.7.1.0
|
||||
|
||||
# Some plugins go in the Mod folder instead of lib. Deal with those here:
|
||||
%global mod_plugins Mod/PartDesign
|
||||
%define name freecad
|
||||
%define github_name FreeCAD
|
||||
%define branch main
|
||||
|
||||
Name: %{name}
|
||||
Epoch: 1
|
||||
Version: 1.1.0
|
||||
Release: pre_{{{git_commit_no}}}%{?dist}
|
||||
Summary: A general purpose 3D CAD modeler
|
||||
Group: Applications/Engineering
|
||||
|
||||
License: LGPLv2+
|
||||
URL: https://www.freecad.org/
|
||||
Source0: {{{ git_repo_pack }}}
|
||||
#add all submodule as source
|
||||
Source1: {{{ git_pack path=$GIT_ROOT/src/3rdParty/OndselSolver/ dir_name="OndselSolver" }}}
|
||||
Source2: {{{ git_pack path=$GIT_ROOT/src/3rdParty/GSL/ dir_name="GSL" }}}
|
||||
Source3: {{{ git_pack path=$GIT_ROOT/src/Mod/AddonManager/ dir_name="AddonManager" }}}
|
||||
|
||||
# See /src/3rdParty/PyCXX/CXX/Version.h to find this out.
|
||||
%global bundled_pycxx_version 7.1.9
|
||||
# See /src/3rdParty/OndselSolver/CMakeLists.txt to find this out.
|
||||
%global bundled_ondsel_solver_version 1.0.1
|
||||
|
||||
# Utilities
|
||||
BuildRequires: cmake gcc-c++ gettext
|
||||
BuildRequires: doxygen swig graphviz
|
||||
BuildRequires: gcc-gfortran
|
||||
BuildRequires: desktop-file-utils
|
||||
BuildRequires: git
|
||||
|
||||
BuildRequires: tbb-devel
|
||||
BuildRequires: cmake gcc-c++ gettext doxygen swig graphviz gcc-gfortran desktop-file-utils tbb-devel ninja-build strace
|
||||
%if %{with tests}
|
||||
BuildRequires: xorg-x11-server-Xvfb python3-typing-extensions
|
||||
%if %{without bundled_gtest}
|
||||
BuildRequires: gtest-devel gmock-devel
|
||||
%endif
|
||||
%endif
|
||||
|
||||
# Development Libraries
|
||||
BuildRequires: freeimage-devel
|
||||
BuildRequires: libXmu-devel
|
||||
BuildRequires: mesa-libEGL-devel
|
||||
BuildRequires: mesa-libGLU-devel
|
||||
BuildRequires: opencascade-devel
|
||||
BuildRequires: Coin4-devel
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-matplotlib
|
||||
BuildRequires: python3-pivy
|
||||
BuildRequires: boost-devel
|
||||
BuildRequires: eigen3-devel
|
||||
BuildRequires: qt6-qtsvg-devel
|
||||
BuildRequires: qt6-qttools-static
|
||||
|
||||
BuildRequires: fmt-devel
|
||||
|
||||
BuildRequires: xerces-c
|
||||
BuildRequires: xerces-c-devel
|
||||
BuildRequires: libspnav-devel
|
||||
|
||||
BuildRequires: python3-shiboken6-devel
|
||||
BuildRequires: python3-pyside6-devel
|
||||
BuildRequires: pyside6-tools
|
||||
%if ! %{bundled_smesh}
|
||||
BuildRequires:boost-devel Coin4-devel eigen3-devel freeimage-devel fmt-devel libglvnd-devel libicu-devel libspnav-devel libXmu-devel med-devel mesa-libEGL-devel mesa-libGLU-devel netgen-mesher-devel netgen-mesher-devel-private opencascade-devel openmpi-devel python3 python3-devel python3-matplotlib python3-pivy python3-pybind11 python3-pyside6-devel python3-shiboken6-devel pyside6-tools qt6-qttools-static qt6-qtsvg-devel vtk-devel xerces-c-devel yaml-cpp-devel
|
||||
#pcl-devel
|
||||
%if %{without bundled_smesh}
|
||||
BuildRequires: smesh-devel
|
||||
%endif
|
||||
BuildRequires: netgen-mesher-devel
|
||||
BuildRequires: netgen-mesher-devel-private
|
||||
%if ! %{bundled_zipios}
|
||||
%if %{without bundled_zipios}
|
||||
BuildRequires: zipios++-devel
|
||||
%endif
|
||||
|
||||
%if ! %{bundled_pycxx}
|
||||
%if %{without bundled_pycxx}
|
||||
BuildRequires: python3-pycxx-devel
|
||||
%endif
|
||||
BuildRequires: python3-pybind11
|
||||
BuildRequires: libicu-devel
|
||||
BuildRequires: vtk-devel
|
||||
BuildRequires: openmpi-devel
|
||||
BuildRequires: med-devel
|
||||
BuildRequires: libkdtree++-devel
|
||||
|
||||
BuildRequires: pcl-devel
|
||||
BuildRequires: python3
|
||||
BuildRequires: libglvnd-devel
|
||||
BuildRequires: yaml-cpp-devel
|
||||
#BuildRequires: zlib-devel
|
||||
|
||||
# For appdata
|
||||
%if 0%{?fedora}
|
||||
BuildRequires: libappstream-glib
|
||||
@@ -115,39 +73,31 @@ Requires: %{name}-data = %{epoch}:%{version}-%{release}
|
||||
# Obsolete old doc package since it's required for functionality.
|
||||
Obsoletes: %{name}-doc < 0.22-1
|
||||
|
||||
Requires: hicolor-icon-theme
|
||||
Requires: hicolor-icon-theme fmt python3-matplotlib python3-pivy python3-collada python3-pyside6 qt6-assistant python3-typing-extensions python3-defusedxml
|
||||
|
||||
Requires: fmt
|
||||
|
||||
Requires: python3-defusedxml
|
||||
Requires: python3-pivy
|
||||
Requires: python3-matplotlib
|
||||
Requires: python3-collada
|
||||
Requires: python3-pyside6
|
||||
Requires: qt6-assistant
|
||||
|
||||
|
||||
%if %{bundled_smesh}
|
||||
%if %{with bundled_smesh}
|
||||
Provides: bundled(smesh) = %{bundled_smesh_version}
|
||||
%endif
|
||||
%if %{bundled_pycxx}
|
||||
Provides: bundled(python-pycxx)
|
||||
%if %{with bundled_pycxx}
|
||||
Provides: bundled(python-pycxx) = %{bundled_pycxx_version}
|
||||
%endif
|
||||
Recommends: python3-pysolar
|
||||
Provides: bundled(libondselsolver) = %{bundled_ondsel_solver_version}
|
||||
|
||||
Recommends: python3-pysolar IfcOpenShell-python3
|
||||
|
||||
|
||||
|
||||
# plugins and private shared libs in %%{_libdir}/freecad/lib are private;
|
||||
# prevent private capabilities being advertised in Provides/Requires
|
||||
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i\\\|$iGui"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
|
||||
%{?filter_setup:
|
||||
%filter_provides_in %{_libdir}/%{name}/lib
|
||||
%filter_from_requires %{plugin_regexp}
|
||||
%filter_from_provides %{plugin_regexp}
|
||||
%filter_provides_in %{_libdir}/%{name}/Mod
|
||||
%filter_requires_in %{_libdir}/%{name}/Mod
|
||||
%filter_setup
|
||||
}
|
||||
%global plugin_exclude %( for i in %{plugins}; do echo -n "\|$i\(Gui\)\?"; done )
|
||||
# prevent declaring Requires for internal FreeCAD libraries
|
||||
%global lib_exclude %( for i in %{exported_libs}; do echo -n "\|$i"; done )
|
||||
%global __requires_exclude_from ^%{_libdir}/%{name}/(lib|Mod)/.*
|
||||
%global __provides_exclude_from ^%{_libdir}/%{name}/Mod/.*
|
||||
%global __provides_exclude ^(libFreeCAD.*%{plugin_exclude})\.so.*
|
||||
%global __requires_exclude ^(libFreeCAD.*%{plugin_exclude}%{lib_exclude})\.so.*
|
||||
|
||||
|
||||
|
||||
%description
|
||||
FreeCAD is a general purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler, aimed
|
||||
@@ -166,204 +116,211 @@ Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
%description data
|
||||
Data files for FreeCAD
|
||||
|
||||
%package libondselsolver-devel
|
||||
Summary: Development file for OndselSolver
|
||||
BuildArch: noarch
|
||||
Requires: %{name} = %{epoch}:%{version}-%{release}
|
||||
|
||||
%description libondselsolver-devel
|
||||
Development file for OndselSolver
|
||||
|
||||
|
||||
#path that contain main FreeCAD sources for cmake
|
||||
%global tests_resultdir %{_datadir}/%{name}/tests_result/%{_arch}
|
||||
|
||||
%if %{without debug_info}
|
||||
%global debug_package %{nil}
|
||||
%global _enable_debug_packages 0
|
||||
%endif
|
||||
|
||||
%prep
|
||||
rm -rf %{github_name}
|
||||
# extract submodule archive and move in correct path
|
||||
%setup -T -a 1 -c -q -D -n %{github_name}/src/3rdParty/ #OndselSolver
|
||||
%setup -T -a 2 -c -q -D -n %{github_name}/src/3rdParty/ #GSL
|
||||
%setup -T -a 3 -c -q -D -n %{github_name}/src/Mod/ #AddonManager
|
||||
|
||||
%setup -T -b 0 -q -D -n %{github_name}
|
||||
|
||||
|
||||
# Remove bundled pycxx if we're not using it
|
||||
%if ! %{bundled_pycxx}
|
||||
rm -rf src/CXX
|
||||
%endif
|
||||
|
||||
%if ! %{bundled_zipios}
|
||||
rm -rf src/zipios++
|
||||
#sed -i "s/zipios-config.h/zipios-config.hpp/g" \
|
||||
# src/Base/Reader.cpp src/Base/Writer.h
|
||||
%endif
|
||||
|
||||
# Removed bundled libraries
|
||||
%setup -T -a 0 -q -c -n FreeCAD-1.0.2
|
||||
|
||||
%build
|
||||
rm -rf build && mkdir build && cd build
|
||||
# Deal with cmake projects that tend to link excessively.
|
||||
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
|
||||
|
||||
# Deal with cmake projects that tend to link excessively.
|
||||
CXXFLAGS='-Wno-error=cast-function-type'; export CXXFLAGS
|
||||
LDFLAGS='-Wl,--as-needed -Wl,--no-undefined'; export LDFLAGS
|
||||
# -DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
|
||||
# -DCMAKE_INSTALL_DATAROOTDIR=%{_datadir} \
|
||||
|
||||
%define MEDFILE_INCLUDE_DIRS %{_includedir}/med/
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
|
||||
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
|
||||
-DRESOURCEDIR=%{_datadir}/%{name} \
|
||||
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
|
||||
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
|
||||
-DFREECAD_USE_PCL:BOOL=OFF \
|
||||
-DFREECAD_QT_VERSION:STRING=6 \
|
||||
-DOpenGL_GL_PREFERENCE=GLVND \
|
||||
-DUSE_OCC=TRUE \
|
||||
%if %{without bundled_pycxx}
|
||||
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
|
||||
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
|
||||
%endif
|
||||
%if %{without bundled_smesh}
|
||||
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
|
||||
%endif
|
||||
%if %{without bundled_zipios}
|
||||
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
|
||||
%endif
|
||||
%if %{with tests}
|
||||
-DENABLE_DEVELOPER_TESTS=TRUE \
|
||||
%if %{without bundled_gtest}
|
||||
-DFREECAD_USE_EXTERNAL_GTEST=TRUE \
|
||||
%else
|
||||
-DINSTALL_GTEST=OFF \
|
||||
-DINSTALL_GMOCK=OFF \
|
||||
%endif
|
||||
%else
|
||||
-DENABLE_DEVELOPER_TESTS=FALSE \
|
||||
%endif
|
||||
-DONDSELSOLVER_BUILD_EXE=TRUE \
|
||||
-DBUILD_GUI=TRUE \
|
||||
-G Ninja
|
||||
|
||||
%cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{_libdir}/%{name} \
|
||||
-DCMAKE_INSTALL_DATADIR=%{_datadir}/%{name} \
|
||||
-DCMAKE_INSTALL_DOCDIR=%{_docdir}/%{name} \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=%{_includedir} \
|
||||
-DRESOURCEDIR=%{_datadir}/%{name} \
|
||||
-DFREECAD_USE_EXTERNAL_PIVY=TRUE \
|
||||
-DFREECAD_USE_EXTERNAL_FMT=TRUE \
|
||||
-DFREECAD_USE_PCL:BOOL=OFF \
|
||||
-DFREECAD_QT_VERSION:STRING=6 \
|
||||
-DSHIBOKEN_INCLUDE_DIR=%{_includedir}/shiboken6 \
|
||||
-DSHIBOKEN_LIBRARY=-lshiboken6.%{py_suffix} \
|
||||
-DPYTHON_SUFFIX=.%{py_suffix} \
|
||||
-DPYSIDE_INCLUDE_DIR=/usr/include/PySide6 \
|
||||
-DPYSIDE_LIBRARY=-lpyside6.%{py_suffix} \
|
||||
-DPython3_EXECUTABLE:FILEPATH=/usr/bin/python3 \
|
||||
-DMEDFILE_INCLUDE_DIRS=%{MEDFILE_INCLUDE_DIRS} \
|
||||
-DOpenGL_GL_PREFERENCE=GLVND \
|
||||
-DCOIN3D_INCLUDE_DIR=%{_includedir}/Coin4 \
|
||||
-DCOIN3D_DOC_PATH=%{_datadir}/Coin4/Coin \
|
||||
-DUSE_OCC=TRUE \
|
||||
%if ! %{bundled_smesh}
|
||||
-DFREECAD_USE_EXTERNAL_SMESH=TRUE \
|
||||
-DSMESH_FOUND=TRUE \
|
||||
-DSMESH_INCLUDE_DIR=%{_includedir}/smesh \
|
||||
-DSMESH_DIR=`pwd`/../cMake \
|
||||
%endif
|
||||
%if ! %{bundled_zipios}
|
||||
-DFREECAD_USE_EXTERNAL_ZIPIOS=TRUE \
|
||||
%endif
|
||||
%if ! %{bundled_pycxx}
|
||||
-DPYCXX_INCLUDE_DIR=$(pkg-config --variable=includedir PyCXX) \
|
||||
-DPYCXX_SOURCE_DIR=$(pkg-config --variable=srcdir PyCXX) \
|
||||
%endif
|
||||
-DPACKAGE_WCREF="%{release} (Git)" \
|
||||
-DPACKAGE_WCURL="git://github.com/%{github_name}/FreeCAD.git main" \
|
||||
-DENABLE_DEVELOPER_TESTS=FALSE \
|
||||
-DBUILD_GUI=TRUE \
|
||||
../
|
||||
%cmake_build
|
||||
|
||||
make fc_version
|
||||
for I in src/Build/Version.h src/Build/Version.h.out; do
|
||||
sed -i 's,FCRevision \"Unknown\",FCRevision \"%{release} (Git)\",' $I
|
||||
sed -i 's,FCRepositoryURL \"Unknown\",FCRepositoryURL \"git://github.com/FreeCAD/FreeCAD.git main\",' $I
|
||||
done
|
||||
|
||||
%{make_build}
|
||||
|
||||
%install
|
||||
cd build
|
||||
%make_install
|
||||
%cmake_install
|
||||
|
||||
# Symlink binaries to /usr/bin
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
|
||||
# Symlink binaries to /usr/bin
|
||||
mkdir -p %{buildroot}%{_bindir}
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCAD %{buildroot}%{_bindir}/FreeCAD
|
||||
ln -s ../%{_lib}/%{name}/bin/FreeCADCmd %{buildroot}%{_bindir}/FreeCADCmd
|
||||
|
||||
mkdir %{buildroot}%{_metainfodir}/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/metainfo/* %{buildroot}%{_metainfodir}/
|
||||
# Remove header from external library that's erroneously installed
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/include/E57Format
|
||||
rm -rf %{buildroot}%{_includedir}/gmock
|
||||
rm -rf %{buildroot}%{_includedir}/gtest
|
||||
|
||||
mkdir %{buildroot}%{_datadir}/applications/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/applications/* %{buildroot}%{_datadir}/applications/
|
||||
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/thumbnailers/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/thumbnailers/* %{buildroot}%{_datadir}/thumbnailers/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/icons/hicolor/scalable/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/icons/hicolor/scalable/* %{buildroot}%{_datadir}/icons/hicolor/scalable/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/pixmaps/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/pixmaps/* %{buildroot}%{_datadir}/pixmaps/
|
||||
|
||||
mkdir -p %{buildroot}%{_datadir}/mime/packages/
|
||||
mv %{buildroot}%{_libdir}/%{name}/share/mime/packages/* %{buildroot}%{_datadir}/mime/packages/
|
||||
|
||||
pushd %{buildroot}%{_libdir}/%{name}/share/
|
||||
rmdir metainfo/
|
||||
rmdir applications/
|
||||
rm -rf mime
|
||||
rm -rf icons
|
||||
popd
|
||||
|
||||
# Remove obsolete Start_Page.html
|
||||
rm -f %{buildroot}%{_docdir}/%{name}/Start_Page.html
|
||||
|
||||
# Remove header from external library that's erroneously installed
|
||||
rm -f %{buildroot}%{_libdir}/%{name}/include/E57Format/E57Export.h
|
||||
|
||||
rm -rf %{buildroot}%{_includedir}/OndselSolver/*
|
||||
rm -f %{buildroot}%{_libdir}/%{name}/share/pkgconfig/OndselSolver.pc
|
||||
|
||||
# Bug maintainers to keep %%{plugins} macro up to date.
|
||||
#
|
||||
# Make sure there are no plugins that need to be added to plugins macro
|
||||
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}'`
|
||||
if [ -n "$new_plugins" ]; then
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nPlugins not caught by regexp: " $new_plugins \
|
||||
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
|
||||
"\nspecfile %%{plugins} macro. Please add these to" \
|
||||
"\n%%{plugins} macro at top of specfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# Make sure there are no entries in the plugins macro that don't match plugins
|
||||
for p in %{plugins}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
|
||||
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Bytecompile Python modules
|
||||
%py_byte_compile %{__python3} %{buildroot}%{_libdir}/%{name}
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/cmake
|
||||
rm -rf %{buildroot}%{_libdir}/%{name}/%{_lib}/pkgconfig
|
||||
|
||||
#Move files using `-DCMAKE_INSTALL_DATAROOTDIR=%%{_datadir}` break ctest
|
||||
mkdir -p %{buildroot}%{_datadir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/applications %{buildroot}%{_datadir}/
|
||||
mkdir -p %{buildroot}%{_metainfodir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/metainfo/* %{buildroot}%{_metainfodir}/
|
||||
mkdir -p %{buildroot}%{_datadir}
|
||||
mv %{buildroot}%{_libdir}/freecad/share/icons %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/pixmaps %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/mime %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/thumbnailers %{buildroot}%{_datadir}/
|
||||
mv %{buildroot}%{_libdir}/freecad/share/pkgconfig %{buildroot}%{_datadir}/
|
||||
|
||||
%check
|
||||
desktop-file-validate \
|
||||
%{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
|
||||
%{?fedora:appstream-util validate-relax --nonet \
|
||||
%{buildroot}%{_metainfodir}/*.metainfo.xml}
|
||||
|
||||
|
||||
%if %{with tests}
|
||||
mkdir -p %{buildroot}%tests_resultdir
|
||||
if %ctest -E '^QuantitySpinBox_Tests_run$' &> %{buildroot}%tests_resultdir/ctest.result ; then
|
||||
echo "ctest OK"
|
||||
else
|
||||
echo "**** Failed ctest ****"
|
||||
touch %{buildroot}%tests_resultdir/ctest.failed
|
||||
fi
|
||||
|
||||
if xvfb-run \%ctest -R '^QuantitySpinBox_Tests_run$' &>> %{buildroot}%tests_resultdir/ctest_gui.result ; then
|
||||
echo "ctest gui OK"
|
||||
else
|
||||
echo "**** Failed ctest gui ****"
|
||||
touch %{buildroot}%tests_resultdir/ctest_gui.failed
|
||||
fi
|
||||
%endif
|
||||
|
||||
desktop-file-validate %{buildroot}%{_datadir}/applications/org.freecad.FreeCAD.desktop
|
||||
%{?fedora:appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/*.metainfo.xml}
|
||||
|
||||
# Bug maintainers to keep %%{plugins} macro up to date.
|
||||
#
|
||||
# Make sure there are no plugins that need to be added to plugins macro
|
||||
%define plugin_regexp /^\\\(libFreeCAD.*%(for i in %{plugins}; do echo -n "\\\|$i"; done)\\\)\\\(\\\|Gui\\\)\\.so/d
|
||||
%define exported_libs_regexp /^\\\(%(for i in %{exported_libs}; do echo -n "\\\|$i"; done)\\\)\\.so/d
|
||||
|
||||
new_plugins=`ls %{buildroot}%{_libdir}/%{name}/%{_lib} | sed -e '%{plugin_regexp}' -e '%exported_libs_regexp'`
|
||||
if [ -n "$new_plugins" ]; then
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nPlugins not caught by regexps:" \
|
||||
"\n" $new_plugins \
|
||||
"\n\nPlugins in %{_libdir}/%{name}/lib do not exist in" \
|
||||
"\nspecfile %%{plugins} or %%{exported_libs_regexp} macro." \
|
||||
"\nPlease add these to %%{plugins} or %%{exported_libs}" \
|
||||
"\nmacro at top of specfile" \
|
||||
"\nand rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
# Make sure there are no entries in the plugins macro that don't match plugins
|
||||
for p in %{plugins}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$p*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{plugins} macro with no matching plugin:" \
|
||||
"'$p'.\n\nPlease remove from %%{plugins} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
# Make sure there are no entries in the exported_libs_regexp macro that don't match plugins
|
||||
for d in %{exported_libs}; do
|
||||
if [ -z "`ls %{buildroot}%{_libdir}/%{name}/%{_lib}/$d*.so`" ]; then
|
||||
set +x
|
||||
echo -e "\n\n\n**** ERROR:\n" \
|
||||
"\nExtra entry in %%{exported_libs} macro with no matching lib:" \
|
||||
"'$d'.\n\nPlease remove from %%{exported_libs} macro at top of" \
|
||||
"\nspecfile and rebuild.\n****\n" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
%post
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
|
||||
|
||||
%postun
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
fi
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
if [ $1 -eq 0 ] ; then
|
||||
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
|
||||
fi
|
||||
/usr/bin/update-desktop-database &> /dev/null || :
|
||||
/usr/bin/update-mime-database %{_datadir}/mime &> /dev/null || :
|
||||
|
||||
|
||||
%posttrans
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
|
||||
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor/scalable/apps &>/dev/null || :
|
||||
|
||||
|
||||
%files
|
||||
%{_bindir}/*
|
||||
%{_metainfodir}/*
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/bin/
|
||||
%{_libdir}/%{name}/%{_lib}/
|
||||
%{_libdir}/%{name}/Ext/
|
||||
%{_libdir}/%{name}/Mod/
|
||||
%{_libdir}/%{name}/share/
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/icons/hicolor/*
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/mime/packages/*
|
||||
%{_datadir}/thumbnailers/*
|
||||
#find a way to configure in cmake with %%name to avoid conflict with different package name
|
||||
%{python3_sitelib}/freecad/*
|
||||
%if %{with tests}
|
||||
%tests_resultdir/*
|
||||
%endif
|
||||
|
||||
%{_bindir}/*
|
||||
%{_metainfodir}/*
|
||||
%dir %{_libdir}/%{name}
|
||||
%{_libdir}/%{name}/bin/
|
||||
%{_libdir}/%{name}/%{_lib}/
|
||||
%{_libdir}/%{name}/Ext/
|
||||
%{_libdir}/%{name}/Mod/
|
||||
%{_datadir}/applications/*
|
||||
%{_datadir}/icons/hicolor/scalable/*
|
||||
%{_datadir}/pixmaps/*
|
||||
%{_datadir}/mime/packages/*
|
||||
%{_datadir}/thumbnailers/*
|
||||
%{_libdir}/../lib/python*/site-packages/%{name}/*
|
||||
|
||||
%files data
|
||||
%{_datadir}/%{name}/
|
||||
%{_docdir}/%{name}/LICENSE.html
|
||||
%{_docdir}/%{name}/ThirdPartyLibraries.html
|
||||
%{_datadir}/%{name}/
|
||||
%{_docdir}/%{name}/LICENSE.html
|
||||
%{_docdir}/%{name}/ThirdPartyLibraries.html
|
||||
|
||||
%files libondselsolver-devel
|
||||
%{_datadir}/pkgconfig/OndselSolver.pc
|
||||
%{_includedir}/OndselSolver/*
|
||||
|
||||
%changelog
|
||||
* Mon Mar 10 2025 Leif-Jöran Olsson <info@friprogramvarusyndikatet.se> - 1.1.0-1
|
||||
- Adding support for building with Qt6 and PySide6 for Fedora 40+
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
[rpkg]
|
||||
auto_pack = False
|
||||
user_macros = "${git_props:root}/rpkg.macros"
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1 @@
|
||||
!/.fmf/
|
||||
@@ -0,0 +1,12 @@
|
||||
/ctest :
|
||||
test: |
|
||||
cat /usr/share/freecad/tests_result/`uname -m`/ctest.result
|
||||
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest.failed ]; then
|
||||
exit 1
|
||||
fi
|
||||
/ctest_gui :
|
||||
test: |
|
||||
cat /usr/share/freecad/tests_result/`uname -m`/ctest_gui.result
|
||||
if [ -f /usr/share/freecad/tests_result/`uname -m`/ctest_gui.failed ]; then
|
||||
exit 1
|
||||
fi
|
||||
@@ -0,0 +1,42 @@
|
||||
/tests:
|
||||
/TestAssemblyWorkbench :
|
||||
test: /usr/bin/FreeCADCmd -t TestAssemblyWorkbench
|
||||
/TestArch :
|
||||
test: /usr/bin/FreeCADCmd -t TestArch
|
||||
/TestCAMApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestCAMApp
|
||||
/TestDraft :
|
||||
test: /usr/bin/FreeCADCmd -t TestDraft
|
||||
/TestFemApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestFemApp
|
||||
/TestMaterialsApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestMaterialsApp
|
||||
/MeshTestsApp :
|
||||
test: /usr/bin/FreeCADCmd -t MeshTestsApp
|
||||
/TestPartApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestPartApp
|
||||
/TestPartDesignApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestPartDesignApp
|
||||
/TestSketcherApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestSketcherApp
|
||||
/TestSpreadsheet :
|
||||
test: /usr/bin/FreeCADCmd -t TestSpreadsheet
|
||||
/TestSurfaceApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestSurfaceApp
|
||||
/TestTechDrawApp :
|
||||
test: /usr/bin/FreeCADCmd -t TestTechDrawApp
|
||||
/BaseTests :
|
||||
test: /usr/bin/FreeCADCmd -t BaseTests
|
||||
/UnitTests :
|
||||
test: /usr/bin/FreeCADCmd -t UnitTests
|
||||
/Document :
|
||||
test: /usr/bin/FreeCADCmd -t Document
|
||||
/Metadata :
|
||||
test: /usr/bin/FreeCADCmd -t Metadata
|
||||
/StringHasher :
|
||||
test: /usr/bin/FreeCADCmd -t StringHasher
|
||||
/UnicodeTests :
|
||||
test: /usr/bin/FreeCADCmd -t UnicodeTests
|
||||
/TestPythonSyntax :
|
||||
test: /usr/bin/FreeCADCmd -t TestPythonSyntax
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
/tests:
|
||||
/TestAssemblyWorkbench :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestAssemblyWorkbench
|
||||
/TestArch :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestArch
|
||||
/TestCAMApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestCAMApp
|
||||
/TestDraft :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestDraft
|
||||
/TestFemApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestFemApp
|
||||
/TestMaterialsApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsApp
|
||||
/MeshTestsApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t MeshTestsApp
|
||||
/TestPartApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartApp
|
||||
/TestPartDesignApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignApp
|
||||
/TestSketcherApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherApp
|
||||
/TestSpreadsheet :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSpreadsheet
|
||||
/TestSurfaceApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSurfaceApp
|
||||
/TestTechDrawApp :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawApp
|
||||
/BaseTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t BaseTests
|
||||
/UnitTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t UnitTests
|
||||
/Document :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Document
|
||||
/Metadata :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Metadata
|
||||
/StringHasher :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t StringHasher
|
||||
/UnicodeTests :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t UnicodeTests
|
||||
/TestPythonSyntax :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPythonSyntax
|
||||
/TestArchGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestArchGui
|
||||
/TestCAMGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestCAMGui
|
||||
/TestDraftGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestDraftGui
|
||||
/TestFemGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestFemGui
|
||||
/TestImportGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestImportGui
|
||||
/TestMaterialsGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestMaterialsGui
|
||||
/TestOpenSCADGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestOpenSCADGui
|
||||
/TestPartGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartGui
|
||||
/TestPartDesignGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestPartDesignGui
|
||||
/TestSketcherGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestSketcherGui
|
||||
/TestTechDrawGui :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t TestTechDrawGui
|
||||
/Workbench :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Workbench
|
||||
/Menu :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu
|
||||
/Menu.MenuDeleteCases :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuDeleteCases
|
||||
/Menu.MenuCreateCases :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t Menu.MenuCreateCases
|
||||
/GuiDocument :
|
||||
test: xvfb-run /usr/bin/FreeCAD -t GuiDocument
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
summary:
|
||||
Run All FreeCAD python tests
|
||||
prepare:
|
||||
how: install
|
||||
package:
|
||||
- xorg-x11-server-Xvfb
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
@@ -0,0 +1,4 @@
|
||||
summary: Run All FreeCADCmd python tests
|
||||
test: /usr/bin/FreeCADCmd -v
|
||||
require: /usr/bin/FreeCADCmd
|
||||
duration: 1m
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
set -x
|
||||
set -x
|
||||
|
||||
conda_env="fc_env"
|
||||
|
||||
@@ -46,6 +46,8 @@ cp -a ${conda_env}/Library/data ${copy_dir}/data
|
||||
cp -a ${conda_env}/Library/Ext ${copy_dir}/Ext
|
||||
cp -a ${conda_env}/Library/lib ${copy_dir}/lib
|
||||
cp -a ${conda_env}/Library/Mod ${copy_dir}/Mod
|
||||
mkdir -p ${copy_dir}/doc
|
||||
cp -a ${conda_env}/Library/doc/{ThirdPartyLibraries.html,LICENSE.html} ${copy_dir}/doc
|
||||
rm -rf ${conda_env}/bin_tmp
|
||||
|
||||
# Apply Patches
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
function git_commit_no {
|
||||
commits=$(curl -s 'https://api.github.com/repos/FreeCAD/FreeCAD/compare/120ca87015...main' | grep "\"ahead_by\":" | sed -s 's/ //g' | sed -s 's/"ahead_by"://' | sed -s 's/,//')
|
||||
echo -n $((commits + 1))
|
||||
}
|
||||
Vendored
+1
-1
Submodule src/3rdParty/GSL updated: 2828399820...543d0dd3fe
Vendored
+1
-1
Submodule src/3rdParty/OndselSolver updated: bacb65f9c0...30e9b64e8b
+10
-10
@@ -153,7 +153,7 @@ MEFISTO2D_EXPORT
|
||||
#endif
|
||||
|
||||
|
||||
extern "C" { void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -294,7 +294,7 @@ extern "C" {void
|
||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||
|
||||
//initialisation du tableau letree et ajout dans letree des sommets 1 a nbsomm
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -306,7 +306,7 @@ extern "C" {void
|
||||
Z & ierr );
|
||||
}
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -321,7 +321,7 @@ extern "C" {void
|
||||
// homogeneisation de l'arbre des te a un saut de taille au plus
|
||||
// prise en compte des tailles d'aretes souhaitees autour des sommets initiaux
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -337,7 +337,7 @@ extern "C" {void
|
||||
// trianguler les triangles equilateraux feuilles a partir de leurs 3 sommets
|
||||
// et des points de la frontiere, des points internes imposes interieurs
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -348,7 +348,7 @@ extern "C" {void
|
||||
}
|
||||
// formation du chainage 6 des aretes internes a echanger eventuellement
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -362,7 +362,7 @@ extern "C" {void
|
||||
// boucle sur les aretes internes (non sur une ligne de la frontiere)
|
||||
// avec echange des 2 diagonales afin de rendre la triangulation delaunay
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -379,7 +379,7 @@ extern "C" {void
|
||||
// detection des aretes frontalieres initiales perdues
|
||||
// triangulation frontale pour les restaurer
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -394,7 +394,7 @@ extern "C" {void
|
||||
}
|
||||
// suppression des triangles externes a la surface
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -427,7 +427,7 @@ extern "C" {void
|
||||
}
|
||||
//retrouver les numero des 3 sommets du triangle nt
|
||||
|
||||
extern "C" {void
|
||||
extern "C" { int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
|
||||
+2
-2
@@ -754,7 +754,7 @@ void aptrte( Z nutysu, R aretmx,
|
||||
goto NETTOYAGE;
|
||||
}
|
||||
}
|
||||
void
|
||||
int
|
||||
#ifdef WIN32
|
||||
#ifdef F2C_BUILD
|
||||
#else
|
||||
@@ -868,5 +868,5 @@ void
|
||||
MESSAGE( "ATTENTION: "<< nbtrianeg << " TRIANGLES d'AIRE NEGATIVE" );
|
||||
|
||||
MESSAGE(" ");
|
||||
return;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -3221,6 +3221,10 @@ bool Document::containsObject(const DocumentObject* pcObject) const
|
||||
void Document::removeObject(const char* sName)
|
||||
{
|
||||
auto pos = d->objectMap.find(sName);
|
||||
if (pos == d->objectMap.end()){
|
||||
FC_MSG("Object " << sName << " already deleted in document " << getName());
|
||||
return;
|
||||
}
|
||||
|
||||
if (pos->second->testStatus(ObjectStatus::PendingRecompute)) {
|
||||
// TODO: shall we allow removal if there is active undo transaction?
|
||||
|
||||
@@ -824,12 +824,11 @@ DocumentObject::onProposedLabelChange(std::string& newLabel)
|
||||
}
|
||||
if (doc && !newLabel.empty() && !_hPGrp->GetBool("DuplicateLabels") && !allowDuplicateLabel()
|
||||
&& doc->containsLabel(newLabel)) {
|
||||
// We must ensure the Label is unique in the document (well, sort of...).
|
||||
// The label already exists but settings are such that duplicate labels should not be assigned.
|
||||
std::string objName = getNameInDocument();
|
||||
if (doc->haveSameBaseName(objName, newLabel)) {
|
||||
// The base name of the proposed label equals the base name of the object Name, so we
|
||||
// use the object Name, which could actually be identical to another object's Label, but
|
||||
// probably isn't.
|
||||
if (!doc->containsLabel(objName) && doc->haveSameBaseName(objName, newLabel)) {
|
||||
// The object name is not already a Label and the base name of the proposed label
|
||||
// equals the base name of the object Name, so we use the object Name as the replacement Label.
|
||||
newLabel = objName;
|
||||
}
|
||||
else {
|
||||
|
||||
+22
-2
@@ -247,10 +247,28 @@ void Property::destroy(Property* p)
|
||||
}
|
||||
}
|
||||
|
||||
bool Property::enableNotify(bool enable)
|
||||
{
|
||||
bool isNotify = isNotifyEnabled();
|
||||
|
||||
if (enable) {
|
||||
StatusBits.reset(DisableNotify);
|
||||
}
|
||||
else {
|
||||
StatusBits.set(DisableNotify);
|
||||
}
|
||||
return isNotify;
|
||||
}
|
||||
|
||||
bool Property::isNotifyEnabled() const
|
||||
{
|
||||
return !StatusBits.test(DisableNotify);
|
||||
}
|
||||
|
||||
void Property::touch()
|
||||
{
|
||||
PropertyCleaner guard(this);
|
||||
if (father) {
|
||||
if (father && isNotifyEnabled()) {
|
||||
father->onEarlyChange(this);
|
||||
father->onChanged(this);
|
||||
}
|
||||
@@ -266,7 +284,9 @@ void Property::hasSetValue()
|
||||
{
|
||||
PropertyCleaner guard(this);
|
||||
if (father) {
|
||||
father->onChanged(this);
|
||||
if (isNotifyEnabled()) {
|
||||
father->onChanged(this);
|
||||
}
|
||||
if (!testStatus(Busy)) {
|
||||
Base::BitsetLocker<decltype(StatusBits)> guard(StatusBits, Busy);
|
||||
signalChanged(*this);
|
||||
|
||||
+11
-4
@@ -108,6 +108,8 @@ public:
|
||||
CopyOnChange = 16,
|
||||
/// Whether the property editor should create a button for user defined editing.
|
||||
UserEdit = 17,
|
||||
/// Do not propagate changes of the property to its container
|
||||
DisableNotify = 18,
|
||||
|
||||
// The following bits are corresponding to PropertyType set when the
|
||||
// property added. These types are meant to be static, and cannot be
|
||||
@@ -354,11 +356,16 @@ public:
|
||||
*/
|
||||
virtual void onContainerRestored() {}
|
||||
|
||||
/** @name Property status handling
|
||||
* @{
|
||||
/** Property status handling
|
||||
*/
|
||||
|
||||
/// Set the property touched.
|
||||
//@{
|
||||
/// This method sets whether notification will be propagated on changing
|
||||
/// the value of the property. The old value of the setting is returned.
|
||||
bool enableNotify(bool on);
|
||||
/// This method returns whether notification of changes to the property value
|
||||
/// are propagated to the container.
|
||||
bool isNotifyEnabled() const;
|
||||
/// Set the property touched
|
||||
void touch();
|
||||
|
||||
/**
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <boost/iostreams/device/array.hpp>
|
||||
#include <boost/iostreams/stream.hpp>
|
||||
|
||||
#include "PropertyUnits.h"
|
||||
|
||||
// inclusion of the generated files (generated out of PropertyContainerPy.xml)
|
||||
#include "PropertyContainerPy.h"
|
||||
#include "PropertyContainerPy.cpp"
|
||||
@@ -272,6 +274,12 @@ PyObject* PropertyContainerPy::setPropertyStatus(PyObject* args)
|
||||
continue;
|
||||
}
|
||||
|
||||
auto lengthProp = freecad_cast<App::PropertyLength*>(prop);
|
||||
if (lengthProp && v == "AllowNegativeValues") {
|
||||
lengthProp->enableNegative(value);
|
||||
continue;
|
||||
}
|
||||
|
||||
PyErr_Format(PyExc_ValueError, "Unknown property status '%s'", v.c_str());
|
||||
return nullptr;
|
||||
}
|
||||
@@ -721,3 +729,4 @@ PyObject* PropertyContainerPy::renameProperty(PyObject* args) const
|
||||
}
|
||||
PY_CATCH
|
||||
}
|
||||
|
||||
|
||||
@@ -518,7 +518,12 @@ TYPESYSTEM_SOURCE(App::PropertyLength, App::PropertyQuantityConstraint)
|
||||
PropertyLength::PropertyLength()
|
||||
{
|
||||
setUnit(Base::Unit::Length);
|
||||
setConstraints(&LengthStandard);
|
||||
enableNegative(false);
|
||||
}
|
||||
|
||||
void PropertyLength::enableNegative(bool on)
|
||||
{
|
||||
setConstraints(on ? nullptr : &LengthStandard);
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
@@ -863,3 +868,4 @@ PropertyYoungsModulus::PropertyYoungsModulus()
|
||||
{
|
||||
setUnit(Base::Unit::YoungsModulus);
|
||||
}
|
||||
|
||||
|
||||
@@ -515,6 +515,8 @@ class AppExport PropertyLength: public PropertyQuantityConstraint
|
||||
public:
|
||||
PropertyLength();
|
||||
~PropertyLength() override = default;
|
||||
|
||||
void enableNegative(bool on);
|
||||
};
|
||||
|
||||
/** LuminousIntensity property
|
||||
@@ -923,3 +925,4 @@ public:
|
||||
} // namespace App
|
||||
|
||||
#endif // APP_PROPERTYUNITS_H
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ It is recommended that the user right-click the root of the document and select
|
||||
The user should then click the Refresh button in the main toolbar.
|
||||
</source>
|
||||
<translation>
|
||||
Es recomana que l'usuari faci clic amb el botó dret a l'arrel del document i seleccioneu Marca per tornar a calcular.
|
||||
Es recomana que l'usuari faci clic amb el botó dret a l'arrel del document i seleccioni Marca per tornar a calcular.
|
||||
L'usuari hauria de fer clic al botó Actualitza a la barra d'eines principal.
|
||||
</translation>
|
||||
</message>
|
||||
@@ -45,32 +45,32 @@ L'usuari hauria de fer clic al botó Actualitza a la barra d'eines principal.
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="260"/>
|
||||
<source>X-axis</source>
|
||||
<translation>Eix-X</translation>
|
||||
<translation>Eix X</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="261"/>
|
||||
<source>Y-axis</source>
|
||||
<translation>Eix-Y</translation>
|
||||
<translation>Eix Y</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="262"/>
|
||||
<source>Z-axis</source>
|
||||
<translation>Eix-Z</translation>
|
||||
<translation>Eix Z</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="263"/>
|
||||
<source>XY-plane</source>
|
||||
<translation>Pla-XY</translation>
|
||||
<translation>Pla XY</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="264"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation>Pla-XZ</translation>
|
||||
<translation>Pla XZ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="265"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation>Pla-YZ</translation>
|
||||
<translation>Pla YZ</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="266"/>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<context>
|
||||
<name>LinkParams</name>
|
||||
<message>
|
||||
<location filename="../../Link.cpp" line="135"/>
|
||||
<location filename="../../Link.cpp" line="131"/>
|
||||
<source>Stores the last user choice of whether to apply CopyOnChange setup to all links
|
||||
that reference the same configurable object</source>
|
||||
<translation>Gemmer det sidste brugervalg om, hvorvidt CopyOnChange opsætning skal anvendes på alle links, der refererer til det samme konfigurerbare objekt</translation>
|
||||
@@ -13,7 +13,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>QObject</name>
|
||||
<message>
|
||||
<location filename="../../Application.cpp" line="457"/>
|
||||
<location filename="../../Application.cpp" line="458"/>
|
||||
<source>Unnamed</source>
|
||||
<translation>Unavngivet</translation>
|
||||
</message>
|
||||
@@ -21,7 +21,7 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>App::OriginGroupExtension</name>
|
||||
<message>
|
||||
<location filename="../../OriginGroupExtension.cpp" line="162"/>
|
||||
<location filename="../../OriginGroupExtension.cpp" line="161"/>
|
||||
<source>Origin</source>
|
||||
<translation>Origo</translation>
|
||||
</message>
|
||||
@@ -29,51 +29,51 @@ that reference the same configurable object</source>
|
||||
<context>
|
||||
<name>Notifications</name>
|
||||
<message>
|
||||
<location filename="../../Document.cpp" line="1095"/>
|
||||
<location filename="../../Document.cpp" line="1110"/>
|
||||
<source>
|
||||
It is recommended that the user right-click the root of the document and select Mark to recompute.
|
||||
The user should then click the Refresh button in the main toolbar.
|
||||
</source>
|
||||
<translation type="unfinished">
|
||||
It is recommended that the user right-click the root of the document and select Mark to recompute.
|
||||
The user should then click the Refresh button in the main toolbar.
|
||||
<translation>
|
||||
Det anbefales, at højreklikke på roden af dokumentet og vælge Mark for at genberegne.
|
||||
Man bør derefter klikke på Opdater knappen i hovedværktøjslinjen.
|
||||
</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>App::LocalCoordinateSystem</name>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="250"/>
|
||||
<location filename="../../Datums.cpp" line="260"/>
|
||||
<source>X-axis</source>
|
||||
<translation type="unfinished">X-axis</translation>
|
||||
<translation>X-akse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="251"/>
|
||||
<location filename="../../Datums.cpp" line="261"/>
|
||||
<source>Y-axis</source>
|
||||
<translation type="unfinished">Y-axis</translation>
|
||||
<translation>Y-akse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="252"/>
|
||||
<location filename="../../Datums.cpp" line="262"/>
|
||||
<source>Z-axis</source>
|
||||
<translation type="unfinished">Z-axis</translation>
|
||||
<translation>Z-akse</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="253"/>
|
||||
<location filename="../../Datums.cpp" line="263"/>
|
||||
<source>XY-plane</source>
|
||||
<translation type="unfinished">XY-plane</translation>
|
||||
<translation>XY-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="254"/>
|
||||
<location filename="../../Datums.cpp" line="264"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation type="unfinished">XZ-plane</translation>
|
||||
<translation>XZ-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="255"/>
|
||||
<location filename="../../Datums.cpp" line="265"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation type="unfinished">YZ-plane</translation>
|
||||
<translation>YZ-plan</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="256"/>
|
||||
<location filename="../../Datums.cpp" line="266"/>
|
||||
<source>Origin</source>
|
||||
<translation>Origo</translation>
|
||||
</message>
|
||||
|
||||
@@ -34,10 +34,8 @@ that reference the same configurable object</source>
|
||||
It is recommended that the user right-click the root of the document and select Mark to recompute.
|
||||
The user should then click the Refresh button in the main toolbar.
|
||||
</source>
|
||||
<translation type="unfinished">
|
||||
It is recommended that the user right-click the root of the document and select Mark to recompute.
|
||||
The user should then click the Refresh button in the main toolbar.
|
||||
</translation>
|
||||
<translation>Gomendagarria da erabiltzaileak dokumentuaren erroan eskumako botoiarekin klikatu eta Mark to recompute sakatzea.
|
||||
Erabiltzaileak orduan, Refresh button sakatu beharko du tresna-barra nagusian.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -45,32 +43,32 @@ The user should then click the Refresh button in the main toolbar.
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="260"/>
|
||||
<source>X-axis</source>
|
||||
<translation type="unfinished">X-axis</translation>
|
||||
<translation>X ardatza</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="261"/>
|
||||
<source>Y-axis</source>
|
||||
<translation type="unfinished">Y-axis</translation>
|
||||
<translation>Y ardatza</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="262"/>
|
||||
<source>Z-axis</source>
|
||||
<translation type="unfinished">Z-axis</translation>
|
||||
<translation>Z ardatza</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="263"/>
|
||||
<source>XY-plane</source>
|
||||
<translation type="unfinished">XY-plane</translation>
|
||||
<translation>XY planoa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="264"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation type="unfinished">XZ-plane</translation>
|
||||
<translation>XZ planoa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="265"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation type="unfinished">YZ-plane</translation>
|
||||
<translation>YZ planoa</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="266"/>
|
||||
|
||||
@@ -44,37 +44,37 @@ L'utente dovrebbe quindi cliccare il pulsante Aggiorna nella barra degli strumen
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="260"/>
|
||||
<source>X-axis</source>
|
||||
<translation>Asse X</translation>
|
||||
<translation>X</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="261"/>
|
||||
<source>Y-axis</source>
|
||||
<translation>Asse Y</translation>
|
||||
<translation>Y</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="262"/>
|
||||
<source>Z-axis</source>
|
||||
<translation>Asse Z</translation>
|
||||
<translation>Z</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="263"/>
|
||||
<source>XY-plane</source>
|
||||
<translation>Piano XY</translation>
|
||||
<translation>Superiore</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="264"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation>Piano XZ</translation>
|
||||
<translation>Frontale</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="265"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation>Piano YZ</translation>
|
||||
<translation>Destro</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="266"/>
|
||||
<source>Origin</source>
|
||||
<translation>Origine</translation>
|
||||
<translation>O</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
||||
@@ -45,32 +45,32 @@ The user should then click the Refresh button in the main toolbar.
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="260"/>
|
||||
<source>X-axis</source>
|
||||
<translation>X-축</translation>
|
||||
<translation>X축</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="261"/>
|
||||
<source>Y-axis</source>
|
||||
<translation>Y-축</translation>
|
||||
<translation>Y축</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="262"/>
|
||||
<source>Z-axis</source>
|
||||
<translation>Z-축</translation>
|
||||
<translation>Z축</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="263"/>
|
||||
<source>XY-plane</source>
|
||||
<translation>XY-평면</translation>
|
||||
<translation>XY평면</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="264"/>
|
||||
<source>XZ-plane</source>
|
||||
<translation>XZ-평면</translation>
|
||||
<translation>XZ평면</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="265"/>
|
||||
<source>YZ-plane</source>
|
||||
<translation>YZ-평면</translation>
|
||||
<translation>YZ평면</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../Datums.cpp" line="266"/>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from Metadata import export
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Vector import Vector
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -70,8 +72,7 @@ int AxisPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
PyObject* d {};
|
||||
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &o, &(VectorPy::Type), &d)) {
|
||||
// NOTE: The first parameter defines the base (origin) and the second the direction.
|
||||
*getAxisPtr() =
|
||||
Axis(static_cast<VectorPy*>(o)->value(), static_cast<VectorPy*>(d)->value());
|
||||
*getAxisPtr() = Axis(static_cast<VectorPy*>(o)->value(), static_cast<VectorPy*>(d)->value());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+3
-2
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: Zlib
|
||||
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
@@ -111,8 +113,7 @@ std::size_t Base::base64_encode(char* out, void const* in, std::size_t in_len)
|
||||
return ret - out;
|
||||
}
|
||||
|
||||
std::pair<std::size_t, std::size_t>
|
||||
Base::base64_decode(void* _out, char const* in, std::size_t in_len)
|
||||
std::pair<std::size_t, std::size_t> Base::base64_decode(void* _out, char const* in, std::size_t in_len)
|
||||
{
|
||||
auto* out = reinterpret_cast<unsigned char*>(_out); // NOLINT
|
||||
unsigned char* ret = out;
|
||||
|
||||
+3
-2
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: Zlib
|
||||
|
||||
/*
|
||||
base64.cpp and base64.h
|
||||
|
||||
@@ -83,8 +85,7 @@ BaseExport std::array<const signed char, base64DecodeTableSize> base64_decode_ta
|
||||
* @return Return a pair of output size and input read size. Compare the
|
||||
* read size to input size to check for error.
|
||||
*/
|
||||
BaseExport std::pair<std::size_t, std::size_t>
|
||||
base64_decode(void* out, char const*, std::size_t len);
|
||||
BaseExport std::pair<std::size_t, std::size_t> base64_decode(void* out, char const*, std::size_t len);
|
||||
|
||||
/** Encode input binary into base64 string
|
||||
* @param out: output string. Note that the string is not cleared before
|
||||
|
||||
+33
-23
@@ -1,4 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/****************************************************************************
|
||||
* *
|
||||
* Copyright (c) 2019 Zheng Lei (realthunder.dev@gmail.com) *
|
||||
@@ -58,9 +59,7 @@ struct base64_encoder
|
||||
{
|
||||
|
||||
using char_type = char;
|
||||
struct category: bio::multichar_output_filter_tag,
|
||||
bio::closable_tag,
|
||||
bio::optimally_buffered_tag
|
||||
struct category: bio::multichar_output_filter_tag, bio::closable_tag, bio::optimally_buffered_tag
|
||||
{
|
||||
};
|
||||
|
||||
@@ -76,7 +75,8 @@ struct base64_encoder
|
||||
{
|
||||
static constexpr int defaultBufferSize {1024};
|
||||
return static_cast<std::streamsize>(
|
||||
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize));
|
||||
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Device>
|
||||
@@ -173,7 +173,8 @@ struct base64_decoder
|
||||
{
|
||||
static constexpr int defaultBufferSize {1024};
|
||||
return static_cast<std::streamsize>(
|
||||
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize));
|
||||
base64_encode_size(line_size != 0U ? line_size : defaultBufferSize)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename Device>
|
||||
@@ -225,12 +226,15 @@ struct base64_decoder
|
||||
}
|
||||
if (pending_in == 4) {
|
||||
pending_out = pending_in = 0;
|
||||
char_array_3[0] =
|
||||
static_cast<char>((char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4));
|
||||
char_array_3[1] = static_cast<char>(((char_array_4[1] & 0xf) << 4)
|
||||
+ ((char_array_4[2] & 0x3c) >> 2));
|
||||
char_array_3[2] =
|
||||
static_cast<char>(((char_array_4[2] & 0x3) << 6) + char_array_4[3]);
|
||||
char_array_3[0] = static_cast<char>(
|
||||
(char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4)
|
||||
);
|
||||
char_array_3[1] = static_cast<char>(
|
||||
((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2)
|
||||
);
|
||||
char_array_3[2] = static_cast<char>(
|
||||
((char_array_4[2] & 0x3) << 6) + char_array_4[3]
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -255,8 +259,10 @@ struct base64_decoder
|
||||
* @return A unique pointer to an output stream that can transforms the
|
||||
* input binary data to base64 strings.
|
||||
*/
|
||||
inline std::unique_ptr<std::ostream>
|
||||
create_base64_encoder(std::ostream& out, std::size_t line_size = base64DefaultBufferSize)
|
||||
inline std::unique_ptr<std::ostream> create_base64_encoder(
|
||||
std::ostream& out,
|
||||
std::size_t line_size = base64DefaultBufferSize
|
||||
)
|
||||
{
|
||||
std::unique_ptr<std::ostream> res(new bio::filtering_ostream);
|
||||
auto* filteringStream = dynamic_cast<bio::filtering_ostream*>(res.get());
|
||||
@@ -273,8 +279,10 @@ create_base64_encoder(std::ostream& out, std::size_t line_size = base64DefaultBu
|
||||
* @return A unique pointer to an output stream that can transforms the
|
||||
* input binary data to base64 strings.
|
||||
*/
|
||||
inline std::unique_ptr<std::ostream>
|
||||
create_base64_encoder(const std::string& filepath, std::size_t line_size = base64DefaultBufferSize)
|
||||
inline std::unique_ptr<std::ostream> create_base64_encoder(
|
||||
const std::string& filepath,
|
||||
std::size_t line_size = base64DefaultBufferSize
|
||||
)
|
||||
{
|
||||
std::unique_ptr<std::ostream> res(new bio::filtering_ostream);
|
||||
auto* filteringStream = dynamic_cast<bio::filtering_ostream*>(res.get());
|
||||
@@ -293,10 +301,11 @@ create_base64_encoder(const std::string& filepath, std::size_t line_size = base6
|
||||
* @return A unique pointer to an input stream that read from the given
|
||||
* upstream and transform the read base64 strings into binary data.
|
||||
*/
|
||||
inline std::unique_ptr<std::istream>
|
||||
create_base64_decoder(std::istream& in,
|
||||
std::size_t line_size = base64DefaultBufferSize,
|
||||
Base64ErrorHandling errHandling = Base64ErrorHandling::silent)
|
||||
inline std::unique_ptr<std::istream> create_base64_decoder(
|
||||
std::istream& in,
|
||||
std::size_t line_size = base64DefaultBufferSize,
|
||||
Base64ErrorHandling errHandling = Base64ErrorHandling::silent
|
||||
)
|
||||
{
|
||||
std::unique_ptr<std::istream> res(new bio::filtering_istream);
|
||||
auto* filteringStream = dynamic_cast<bio::filtering_istream*>(res.get());
|
||||
@@ -319,10 +328,11 @@ create_base64_decoder(std::istream& in,
|
||||
* @return A unique pointer to an input stream that read from the given
|
||||
* file and transform the read base64 strings into binary data.
|
||||
*/
|
||||
inline std::unique_ptr<std::istream>
|
||||
create_base64_decoder(const std::string& filepath,
|
||||
std::size_t line_size = base64DefaultBufferSize,
|
||||
Base64ErrorHandling errHandling = Base64ErrorHandling::silent)
|
||||
inline std::unique_ptr<std::istream> create_base64_decoder(
|
||||
const std::string& filepath,
|
||||
std::size_t line_size = base64DefaultBufferSize,
|
||||
Base64ErrorHandling errHandling = Base64ErrorHandling::silent
|
||||
)
|
||||
{
|
||||
std::unique_ptr<std::istream> res(new bio::filtering_istream);
|
||||
auto* filteringStream = dynamic_cast<bio::filtering_istream*>(res.get());
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -72,10 +74,12 @@ Type BaseClass::getTypeId() const
|
||||
}
|
||||
|
||||
|
||||
void BaseClass::initSubclass(Base::Type& toInit,
|
||||
const char* ClassName,
|
||||
const char* ParentName,
|
||||
Type::instantiationMethod method)
|
||||
void BaseClass::initSubclass(
|
||||
Base::Type& toInit,
|
||||
const char* ClassName,
|
||||
const char* ParentName,
|
||||
Type::instantiationMethod method
|
||||
)
|
||||
{
|
||||
// don't init twice!
|
||||
assert(toInit.isBad());
|
||||
|
||||
+81
-77
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -32,103 +34,103 @@ using PyObject = struct _object;
|
||||
|
||||
// NOLINTBEGIN(cppcoreguidelines-macro-usage)
|
||||
/// define for subclassing Base::BaseClass
|
||||
#define TYPESYSTEM_HEADER() \
|
||||
public: \
|
||||
static Base::Type getClassTypeId(void); \
|
||||
virtual Base::Type getTypeId(void) const; \
|
||||
static void init(void); \
|
||||
static void* create(void); \
|
||||
\
|
||||
private: \
|
||||
#define TYPESYSTEM_HEADER() \
|
||||
public: \
|
||||
static Base::Type getClassTypeId(void); \
|
||||
virtual Base::Type getTypeId(void) const; \
|
||||
static void init(void); \
|
||||
static void* create(void); \
|
||||
\
|
||||
private: \
|
||||
static Base::Type classTypeId
|
||||
|
||||
|
||||
/// Like TYPESYSTEM_HEADER, but declare getTypeId as 'override'
|
||||
#define TYPESYSTEM_HEADER_WITH_OVERRIDE() \
|
||||
public: \
|
||||
static Base::Type getClassTypeId(void); \
|
||||
Base::Type getTypeId(void) const override; \
|
||||
static void init(void); \
|
||||
static void* create(void); \
|
||||
\
|
||||
private: \
|
||||
#define TYPESYSTEM_HEADER_WITH_OVERRIDE() \
|
||||
public: \
|
||||
static Base::Type getClassTypeId(void); \
|
||||
Base::Type getTypeId(void) const override; \
|
||||
static void init(void); \
|
||||
static void* create(void); \
|
||||
\
|
||||
private: \
|
||||
static Base::Type classTypeId
|
||||
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE_P(_class_) \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::classTypeId = Base::Type::BadType; \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return new _class_(); \
|
||||
#define TYPESYSTEM_SOURCE_P(_class_) \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::classTypeId = Base::Type::BadType; \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return new _class_(); \
|
||||
}
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
|
||||
template<> \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
template<> \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
template<> \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return new _class_(); \
|
||||
#define TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
|
||||
template<> \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
template<> \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
template<> \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return new _class_(); \
|
||||
}
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::classTypeId = Base::Type::BadType; \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return nullptr; \
|
||||
#define TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
|
||||
Base::Type _class_::getClassTypeId(void) \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::getTypeId(void) const \
|
||||
{ \
|
||||
return _class_::classTypeId; \
|
||||
} \
|
||||
Base::Type _class_::classTypeId = Base::Type::BadType; \
|
||||
void* _class_::create(void) \
|
||||
{ \
|
||||
return nullptr; \
|
||||
}
|
||||
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_P(_class_) \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
|
||||
#define TYPESYSTEM_SOURCE(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_P(_class_) \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
|
||||
}
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE_TEMPLATE_T(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
|
||||
template<> \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
|
||||
#define TYPESYSTEM_SOURCE_TEMPLATE_T(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_TEMPLATE_P(_class_) \
|
||||
template<> \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, &(_class_::create)); \
|
||||
}
|
||||
|
||||
/// define to implement a subclass of Base::BaseClass
|
||||
#define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, nullptr); \
|
||||
#define TYPESYSTEM_SOURCE_ABSTRACT(_class_, _parentclass_) \
|
||||
TYPESYSTEM_SOURCE_ABSTRACT_P(_class_) \
|
||||
void _class_::init(void) \
|
||||
{ \
|
||||
initSubclass(_class_::classTypeId, #_class_, #_parentclass_, nullptr); \
|
||||
}
|
||||
// NOLINTEND(cppcoreguidelines-macro-usage)
|
||||
|
||||
@@ -165,10 +167,12 @@ private:
|
||||
static Type classTypeId; // NOLINT
|
||||
|
||||
protected:
|
||||
static void initSubclass(Base::Type& toInit,
|
||||
const char* ClassName,
|
||||
const char* ParentName,
|
||||
Type::instantiationMethod method = nullptr);
|
||||
static void initSubclass(
|
||||
Base::Type& toInit,
|
||||
const char* ClassName,
|
||||
const char* ParentName,
|
||||
Type::instantiationMethod method = nullptr
|
||||
);
|
||||
|
||||
public:
|
||||
/// Construction
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from Metadata import constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from typing import List, Final
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2021 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
+122
-81
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2005 Imetric 3D GmbH *
|
||||
* *
|
||||
@@ -59,12 +61,14 @@ public:
|
||||
//@}
|
||||
|
||||
/** Builds box from pairs of x,y,z values. */
|
||||
inline explicit BoundBox3(Precision fMinX = std::numeric_limits<Precision>::max(),
|
||||
Precision fMinY = std::numeric_limits<Precision>::max(),
|
||||
Precision fMinZ = std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxX = -std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxY = -std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxZ = -std::numeric_limits<Precision>::max());
|
||||
inline explicit BoundBox3(
|
||||
Precision fMinX = std::numeric_limits<Precision>::max(),
|
||||
Precision fMinY = std::numeric_limits<Precision>::max(),
|
||||
Precision fMinZ = std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxX = -std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxY = -std::numeric_limits<Precision>::max(),
|
||||
Precision fMaxZ = -std::numeric_limits<Precision>::max()
|
||||
);
|
||||
BoundBox3(const BoundBox3<Precision>& rcBB) = default;
|
||||
BoundBox3(BoundBox3<Precision>&& rcBB) noexcept = default;
|
||||
/** Builds box from an array of points. */
|
||||
@@ -176,8 +180,7 @@ public:
|
||||
*/
|
||||
inline Vector3<Precision> CalcPoint(unsigned short usPoint) const;
|
||||
/** Returns the plane of the given side. */
|
||||
void
|
||||
CalcPlane(unsigned short usPlane, Vector3<Precision>& rBase, Vector3<Precision>& rNormal) const;
|
||||
void CalcPlane(unsigned short usPlane, Vector3<Precision>& rBase, Vector3<Precision>& rNormal) const;
|
||||
/** Calculates the two points of an edge.
|
||||
*/
|
||||
bool CalcEdge(unsigned short usEdge, Vector3<Precision>& rcP0, Vector3<Precision>& rcP1) const;
|
||||
@@ -185,36 +188,47 @@ public:
|
||||
* the base \a rcVct and the direction \a rcVctDir. \a rcVct must lie inside the
|
||||
* bounding box.
|
||||
*/
|
||||
bool IntersectionPoint(const Vector3<Precision>& rcVct,
|
||||
const Vector3<Precision>& rcVctDir,
|
||||
Vector3<Precision>& cVctRes,
|
||||
Precision epsilon) const;
|
||||
bool IntersectionPoint(
|
||||
const Vector3<Precision>& rcVct,
|
||||
const Vector3<Precision>& rcVctDir,
|
||||
Vector3<Precision>& cVctRes,
|
||||
Precision epsilon
|
||||
) const;
|
||||
/** Checks for intersection with line incl. search tolerance. */
|
||||
bool IsCutLine(const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Precision fTolerance = 0.0F) const;
|
||||
bool IsCutLine(
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Precision fTolerance = 0.0F
|
||||
) const;
|
||||
/** Checks if this plane specified by (point,normal) cuts this box.
|
||||
* @note It's up to the client programmer to make sure that this bounding box is valid.
|
||||
*/
|
||||
inline bool IsCutPlane(const Vector3<Precision>& rclBase,
|
||||
const Vector3<Precision>& rclNormal) const;
|
||||
inline bool IsCutPlane(const Vector3<Precision>& rclBase, const Vector3<Precision>& rclNormal) const;
|
||||
/** Computes the intersection points of line and bounding box. */
|
||||
bool IntersectWithLine(const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1) const;
|
||||
bool IntersectWithLine(
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1
|
||||
) const;
|
||||
/** Computes the intersection point of line and a plane of the bounding box. */
|
||||
bool IntersectPlaneWithLine(unsigned short usSide,
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0) const;
|
||||
bool IntersectPlaneWithLine(
|
||||
unsigned short usSide,
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0
|
||||
) const;
|
||||
/** Returns the side of the bounding box the ray exits. */
|
||||
typename BoundBox3<Precision>::SIDE GetSideFromRay(const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir) const;
|
||||
typename BoundBox3<Precision>::SIDE GetSideFromRay(
|
||||
const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir
|
||||
) const;
|
||||
/** Returns the side of the bounding box the ray exits. */
|
||||
typename BoundBox3<Precision>::SIDE GetSideFromRay(const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir,
|
||||
Vector3<Precision>& rcInt) const;
|
||||
typename BoundBox3<Precision>::SIDE GetSideFromRay(
|
||||
const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir,
|
||||
Vector3<Precision>& rcInt
|
||||
) const;
|
||||
|
||||
/**
|
||||
* Searches for the closest point of the bounding box.
|
||||
@@ -286,12 +300,14 @@ bool BoundBox3<Precision>::isOnRayS(Precision min, Precision max, Precision val)
|
||||
|
||||
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
|
||||
template<class Precision>
|
||||
inline BoundBox3<Precision>::BoundBox3(Precision fMinX,
|
||||
Precision fMinY,
|
||||
Precision fMinZ,
|
||||
Precision fMaxX,
|
||||
Precision fMaxY,
|
||||
Precision fMaxZ)
|
||||
inline BoundBox3<Precision>::BoundBox3(
|
||||
Precision fMinX,
|
||||
Precision fMinY,
|
||||
Precision fMinZ,
|
||||
Precision fMaxX,
|
||||
Precision fMaxY,
|
||||
Precision fMaxZ
|
||||
)
|
||||
: MinX(fMinX)
|
||||
, MinY(fMinY)
|
||||
, MinZ(fMinZ)
|
||||
@@ -375,8 +391,7 @@ inline bool BoundBox3<Precision>::operator&&(const BoundBox2d& rcBB) const
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline BoundBox3<Precision>
|
||||
BoundBox3<Precision>::Intersected(const BoundBox3<Precision>& rcBB) const
|
||||
inline BoundBox3<Precision> BoundBox3<Precision>::Intersected(const BoundBox3<Precision>& rcBB) const
|
||||
{
|
||||
BoundBox3<Precision> cBBRes;
|
||||
|
||||
@@ -476,8 +491,10 @@ inline bool BoundBox3<Precision>::IsValid() const
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::GetOctantFromVector(const Vector3<Precision>& rclVct,
|
||||
OCTANT& rclOctant) const
|
||||
inline bool BoundBox3<Precision>::GetOctantFromVector(
|
||||
const Vector3<Precision>& rclVct,
|
||||
OCTANT& rclOctant
|
||||
) const
|
||||
{
|
||||
if (!IsInBox(rclVct)) {
|
||||
return false;
|
||||
@@ -498,8 +515,9 @@ inline bool BoundBox3<Precision>::GetOctantFromVector(const Vector3<Precision>&
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline BoundBox3<Precision>
|
||||
BoundBox3<Precision>::CalcOctant(typename BoundBox3<Precision>::OCTANT Octant) const
|
||||
inline BoundBox3<Precision> BoundBox3<Precision>::CalcOctant(
|
||||
typename BoundBox3<Precision>::OCTANT Octant
|
||||
) const
|
||||
{
|
||||
BoundBox3<Precision> cOct(*this);
|
||||
|
||||
@@ -582,9 +600,11 @@ inline Vector3<Precision> BoundBox3<Precision>::CalcPoint(unsigned short usPoint
|
||||
|
||||
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
|
||||
template<class Precision>
|
||||
inline void BoundBox3<Precision>::CalcPlane(unsigned short usPlane,
|
||||
Vector3<Precision>& rBase,
|
||||
Vector3<Precision>& rNormal) const
|
||||
inline void BoundBox3<Precision>::CalcPlane(
|
||||
unsigned short usPlane,
|
||||
Vector3<Precision>& rBase,
|
||||
Vector3<Precision>& rNormal
|
||||
) const
|
||||
// NOLINTEND(bugprone-easily-swappable-parameters)
|
||||
{
|
||||
switch (usPlane) {
|
||||
@@ -623,9 +643,11 @@ inline void BoundBox3<Precision>::CalcPlane(unsigned short usPlane,
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::CalcEdge(unsigned short usEdge,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1) const
|
||||
inline bool BoundBox3<Precision>::CalcEdge(
|
||||
unsigned short usEdge,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1
|
||||
) const
|
||||
{
|
||||
switch (usEdge) {
|
||||
case TLB_TLF:
|
||||
@@ -684,10 +706,12 @@ inline bool BoundBox3<Precision>::CalcEdge(unsigned short usEdge,
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::IntersectionPoint(const Vector3<Precision>& rcVct,
|
||||
const Vector3<Precision>& rcVctDir,
|
||||
Vector3<Precision>& cVctRes,
|
||||
Precision epsilon) const
|
||||
inline bool BoundBox3<Precision>::IntersectionPoint(
|
||||
const Vector3<Precision>& rcVct,
|
||||
const Vector3<Precision>& rcVctDir,
|
||||
Vector3<Precision>& cVctRes,
|
||||
Precision epsilon
|
||||
) const
|
||||
{
|
||||
const unsigned short num = 6;
|
||||
bool rc = false;
|
||||
@@ -719,9 +743,11 @@ inline bool BoundBox3<Precision>::IntersectionPoint(const Vector3<Precision>& rc
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::IsCutLine(const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Precision fTolerance) const
|
||||
inline bool BoundBox3<Precision>::IsCutLine(
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Precision fTolerance
|
||||
) const
|
||||
{
|
||||
const unsigned short num = 6;
|
||||
Precision fDist;
|
||||
@@ -775,8 +801,10 @@ inline bool BoundBox3<Precision>::IsCutLine(const Vector3<Precision>& rcBase,
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::IsCutPlane(const Vector3<Precision>& rclBase,
|
||||
const Vector3<Precision>& rclNormal) const
|
||||
inline bool BoundBox3<Precision>::IsCutPlane(
|
||||
const Vector3<Precision>& rclBase,
|
||||
const Vector3<Precision>& rclNormal
|
||||
) const
|
||||
{
|
||||
const unsigned short num = 8;
|
||||
if (fabs(GetCenter().DistanceToPlane(rclBase, rclNormal)) < CalcDiagonalLength()) {
|
||||
@@ -792,10 +820,12 @@ inline bool BoundBox3<Precision>::IsCutPlane(const Vector3<Precision>& rclBase,
|
||||
|
||||
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1) const
|
||||
inline bool BoundBox3<Precision>::IntersectWithLine(
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0,
|
||||
Vector3<Precision>& rcP1
|
||||
) const
|
||||
// NOLINTEND(bugprone-easily-swappable-parameters)
|
||||
{
|
||||
const unsigned short num = 6;
|
||||
@@ -817,18 +847,24 @@ inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rc
|
||||
switch (i) {
|
||||
case LEFT: // left and right plane
|
||||
case RIGHT:
|
||||
checkIntersect(Vector3<Precision> {MinY, MaxY, clVectRes.y},
|
||||
Vector3<Precision> {MinZ, MaxZ, clVectRes.z});
|
||||
checkIntersect(
|
||||
Vector3<Precision> {MinY, MaxY, clVectRes.y},
|
||||
Vector3<Precision> {MinZ, MaxZ, clVectRes.z}
|
||||
);
|
||||
break;
|
||||
case TOP: // top and bottom plane
|
||||
case BOTTOM:
|
||||
checkIntersect(Vector3<Precision> {MinX, MaxX, clVectRes.x},
|
||||
Vector3<Precision> {MinZ, MaxZ, clVectRes.z});
|
||||
checkIntersect(
|
||||
Vector3<Precision> {MinX, MaxX, clVectRes.x},
|
||||
Vector3<Precision> {MinZ, MaxZ, clVectRes.z}
|
||||
);
|
||||
break;
|
||||
case FRONT: // front and back plane
|
||||
case BACK:
|
||||
checkIntersect(Vector3<Precision> {MinX, MaxX, clVectRes.x},
|
||||
Vector3<Precision> {MinY, MaxY, clVectRes.y});
|
||||
checkIntersect(
|
||||
Vector3<Precision> {MinX, MaxX, clVectRes.x},
|
||||
Vector3<Precision> {MinY, MaxY, clVectRes.y}
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -855,10 +891,12 @@ inline bool BoundBox3<Precision>::IntersectWithLine(const Vector3<Precision>& rc
|
||||
|
||||
// NOLINTBEGIN(bugprone-easily-swappable-parameters)
|
||||
template<class Precision>
|
||||
inline bool BoundBox3<Precision>::IntersectPlaneWithLine(unsigned short usSide,
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0) const
|
||||
inline bool BoundBox3<Precision>::IntersectPlaneWithLine(
|
||||
unsigned short usSide,
|
||||
const Vector3<Precision>& rcBase,
|
||||
const Vector3<Precision>& rcDir,
|
||||
Vector3<Precision>& rcP0
|
||||
) const
|
||||
// NOLINTEND(bugprone-easily-swappable-parameters)
|
||||
{
|
||||
Precision value;
|
||||
@@ -878,19 +916,21 @@ inline bool BoundBox3<Precision>::IntersectPlaneWithLine(unsigned short usSide,
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline typename BoundBox3<Precision>::SIDE
|
||||
BoundBox3<Precision>::GetSideFromRay(const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir) const
|
||||
inline typename BoundBox3<Precision>::SIDE BoundBox3<Precision>::GetSideFromRay(
|
||||
const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir
|
||||
) const
|
||||
{
|
||||
Vector3<Precision> cIntersection;
|
||||
return GetSideFromRay(rclPt, rclDir, cIntersection);
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
inline typename BoundBox3<Precision>::SIDE
|
||||
BoundBox3<Precision>::GetSideFromRay(const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir,
|
||||
Vector3<Precision>& rcInt) const
|
||||
inline typename BoundBox3<Precision>::SIDE BoundBox3<Precision>::GetSideFromRay(
|
||||
const Vector3<Precision>& rclPt,
|
||||
const Vector3<Precision>& rclDir,
|
||||
Vector3<Precision>& rcInt
|
||||
) const
|
||||
{
|
||||
Vector3<Precision> cP0;
|
||||
Vector3<Precision> cP1;
|
||||
@@ -1025,9 +1065,10 @@ inline Vector3<Precision> BoundBox3<Precision>::GetMaximum() const
|
||||
template<class Precision>
|
||||
inline Precision BoundBox3<Precision>::CalcDiagonalLength() const
|
||||
{
|
||||
return static_cast<Precision>(sqrt(((MaxX - MinX) * (MaxX - MinX))
|
||||
+ ((MaxY - MinY) * (MaxY - MinY))
|
||||
+ ((MaxZ - MinZ) * (MaxZ - MinZ))));
|
||||
return static_cast<Precision>(sqrt(
|
||||
((MaxX - MinX) * (MaxX - MinX)) + ((MaxY - MinY) * (MaxY - MinY))
|
||||
+ ((MaxZ - MinZ) * (MaxZ - MinZ))
|
||||
));
|
||||
}
|
||||
|
||||
template<class Precision>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from Metadata import export, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Vector import Vector
|
||||
|
||||
+56
-44
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2008 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
@@ -101,9 +103,11 @@ int BoundBoxPy::PyInit(PyObject* args, PyObject* /*kwd*/)
|
||||
return 0;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"Either six floats, two instances of "
|
||||
"Vector/Tuple or instance of BoundBox expected");
|
||||
PyErr_SetString(
|
||||
PyExc_TypeError,
|
||||
"Either six floats, two instances of "
|
||||
"Vector/Tuple or instance of BoundBox expected"
|
||||
);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -150,16 +154,20 @@ PyObject* BoundBoxPy::add(PyObject* args)
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args,
|
||||
"O!;Need a Vector, BoundBox or three floats as argument",
|
||||
&(BoundBoxPy::Type),
|
||||
&object)) {
|
||||
if (PyArg_ParseTuple(
|
||||
args,
|
||||
"O!;Need a Vector, BoundBox or three floats as argument",
|
||||
&(BoundBoxPy::Type),
|
||||
&object
|
||||
)) {
|
||||
getBoundBoxPtr()->Add(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyErr_SetString(PyExc_TypeError,
|
||||
"Either three floats, instance of Vector or instance of BoundBox expected");
|
||||
PyErr_SetString(
|
||||
PyExc_TypeError,
|
||||
"Either three floats, instance of Vector or instance of BoundBox expected"
|
||||
);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -246,15 +254,11 @@ PyObject* BoundBoxPy::intersect(PyObject* args)
|
||||
}
|
||||
|
||||
do {
|
||||
if (PyArg_ParseTuple(args,
|
||||
"O!O!",
|
||||
&(VectorPy::Type),
|
||||
&object1,
|
||||
&(VectorPy::Type),
|
||||
&object2)) {
|
||||
retVal =
|
||||
getBoundBoxPtr()->IsCutLine(*(static_cast<VectorPy*>(object1)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr()));
|
||||
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &object1, &(VectorPy::Type), &object2)) {
|
||||
retVal = getBoundBoxPtr()->IsCutLine(
|
||||
*(static_cast<VectorPy*>(object1)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr())
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -264,8 +268,9 @@ PyObject* BoundBoxPy::intersect(PyObject* args)
|
||||
PyErr_SetString(PyExc_FloatingPointError, "Invalid bounding box argument");
|
||||
return nullptr;
|
||||
}
|
||||
retVal =
|
||||
getBoundBoxPtr()->Intersect(*(static_cast<BoundBoxPy*>(object1)->getBoundBoxPtr()));
|
||||
retVal = getBoundBoxPtr()->Intersect(
|
||||
*(static_cast<BoundBoxPy*>(object1)->getBoundBoxPtr())
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -292,8 +297,9 @@ PyObject* BoundBoxPy::intersected(PyObject* args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
BoundBox3d bbox =
|
||||
getBoundBoxPtr()->Intersected(*static_cast<BoundBoxPy*>(object)->getBoundBoxPtr());
|
||||
BoundBox3d bbox = getBoundBoxPtr()->Intersected(
|
||||
*static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()
|
||||
);
|
||||
return new BoundBoxPy(new BoundBox3d(bbox));
|
||||
}
|
||||
|
||||
@@ -332,22 +338,25 @@ PyObject* BoundBoxPy::getIntersectionPoint(PyObject* args)
|
||||
PyObject* object1 {};
|
||||
PyObject* object2 {};
|
||||
double epsilon = 0.0001;
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"O!O!|d;Need base and direction vector",
|
||||
&(VectorPy::Type),
|
||||
&object1,
|
||||
&(VectorPy::Type),
|
||||
&object2,
|
||||
&epsilon)) {
|
||||
if (!PyArg_ParseTuple(
|
||||
args,
|
||||
"O!O!|d;Need base and direction vector",
|
||||
&(VectorPy::Type),
|
||||
&object1,
|
||||
&(VectorPy::Type),
|
||||
&object2,
|
||||
&epsilon
|
||||
)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Vector3d point;
|
||||
bool ok =
|
||||
getBoundBoxPtr()->IntersectionPoint(*(static_cast<VectorPy*>(object1)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr()),
|
||||
point,
|
||||
epsilon);
|
||||
bool ok = getBoundBoxPtr()->IntersectionPoint(
|
||||
*(static_cast<VectorPy*>(object1)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr()),
|
||||
point,
|
||||
epsilon
|
||||
);
|
||||
if (ok) {
|
||||
return new VectorPy(point);
|
||||
}
|
||||
@@ -458,17 +467,21 @@ PyObject* BoundBoxPy::isCutPlane(PyObject* args)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"O!O!;Need base and normal vector of a plane",
|
||||
&(VectorPy::Type),
|
||||
&object,
|
||||
&(VectorPy::Type),
|
||||
&object2)) {
|
||||
if (!PyArg_ParseTuple(
|
||||
args,
|
||||
"O!O!;Need base and normal vector of a plane",
|
||||
&(VectorPy::Type),
|
||||
&object,
|
||||
&(VectorPy::Type),
|
||||
&object2
|
||||
)) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
retVal = getBoundBoxPtr()->IsCutPlane(*(static_cast<VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr()));
|
||||
retVal = getBoundBoxPtr()->IsCutPlane(
|
||||
*(static_cast<VectorPy*>(object)->getVectorPtr()),
|
||||
*(static_cast<VectorPy*>(object2)->getVectorPtr())
|
||||
);
|
||||
|
||||
return Py::new_reference_to(retVal);
|
||||
}
|
||||
@@ -510,8 +523,7 @@ PyObject* BoundBoxPy::isInside(PyObject* args)
|
||||
PyErr_SetString(PyExc_FloatingPointError, "Invalid bounding box argument");
|
||||
return nullptr;
|
||||
}
|
||||
retVal =
|
||||
getBoundBoxPtr()->IsInBox(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
|
||||
retVal = getBoundBoxPtr()->IsInBox(*(static_cast<BoundBoxPy*>(object)->getBoundBoxPtr()));
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+29
-19
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -246,9 +248,11 @@ public:
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
void InventorFieldWriter::write(const char* fieldName,
|
||||
const std::vector<T>& fieldData,
|
||||
InventorOutput& out) const
|
||||
void InventorFieldWriter::write(
|
||||
const char* fieldName,
|
||||
const std::vector<T>& fieldData,
|
||||
InventorOutput& out
|
||||
) const
|
||||
{
|
||||
if (fieldData.empty()) {
|
||||
return;
|
||||
@@ -271,9 +275,11 @@ void InventorFieldWriter::write(const char* fieldName,
|
||||
}
|
||||
|
||||
template<>
|
||||
void InventorFieldWriter::write<int>(const char* fieldName,
|
||||
const std::vector<int>& fieldData,
|
||||
InventorOutput& out) const
|
||||
void InventorFieldWriter::write<int>(
|
||||
const char* fieldName,
|
||||
const std::vector<int>& fieldData,
|
||||
InventorOutput& out
|
||||
) const
|
||||
{
|
||||
if (fieldData.empty()) {
|
||||
return;
|
||||
@@ -470,10 +476,12 @@ void ArrowItem::write(InventorOutput& out) const
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
BoundingBoxItem::BoundingBoxItem(const Vector3f& pt1,
|
||||
const Vector3f& pt2,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb)
|
||||
BoundingBoxItem::BoundingBoxItem(
|
||||
const Vector3f& pt1,
|
||||
const Vector3f& pt2,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb
|
||||
)
|
||||
: pt1 {pt1}
|
||||
, pt2 {pt2}
|
||||
, drawStyle {drawStyle}
|
||||
@@ -869,8 +877,7 @@ void NurbsSurfaceItem::setControlPoints(int numU, int numV)
|
||||
numVControlPoints = numV;
|
||||
}
|
||||
|
||||
void NurbsSurfaceItem::setKnotVector(const std::vector<float>& uKnots,
|
||||
const std::vector<float>& vKnots)
|
||||
void NurbsSurfaceItem::setKnotVector(const std::vector<float>& uKnots, const std::vector<float>& vKnots)
|
||||
{
|
||||
uKnotVector = uKnots;
|
||||
vKnotVector = vKnots;
|
||||
@@ -1008,11 +1015,13 @@ void Builder3D::saveToLog()
|
||||
{
|
||||
ILogger* obs = Base::Console().get("StatusBar");
|
||||
if (obs) {
|
||||
obs->sendLog("Builder3D",
|
||||
result.str(),
|
||||
Base::LogStyle::Log,
|
||||
Base::IntendedRecipient::Developer,
|
||||
Base::ContentType::Untranslatable);
|
||||
obs->sendLog(
|
||||
"Builder3D",
|
||||
result.str(),
|
||||
Base::LogStyle::Log,
|
||||
Base::IntendedRecipient::Developer,
|
||||
Base::ContentType::Untranslatable
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1150,8 +1159,9 @@ std::vector<std::vector<int32_t>> InventorLoader::split(const std::vector<int32_
|
||||
return splitdata;
|
||||
}
|
||||
|
||||
std::vector<InventorLoader::Face>
|
||||
InventorLoader::convert(const std::vector<std::vector<int32_t>>& coordIndex) const
|
||||
std::vector<InventorLoader::Face> InventorLoader::convert(
|
||||
const std::vector<std::vector<int32_t>>& coordIndex
|
||||
) const
|
||||
{
|
||||
std::vector<Face> faces;
|
||||
faces.reserve(coordIndex.size());
|
||||
|
||||
+30
-20
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2011 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -31,7 +33,7 @@
|
||||
#include <cstdint>
|
||||
#include <Base/Tools3D.h>
|
||||
#ifndef FC_GLOBAL_H
|
||||
#include <FCGlobal.h>
|
||||
# include <FCGlobal.h>
|
||||
#endif
|
||||
|
||||
#include "Placement.h"
|
||||
@@ -165,9 +167,7 @@ public:
|
||||
class BaseExport Triangle
|
||||
{
|
||||
public:
|
||||
explicit Triangle(const Base::Vector3f& pt1,
|
||||
const Base::Vector3f& pt2,
|
||||
const Base::Vector3f& pt3)
|
||||
explicit Triangle(const Base::Vector3f& pt1, const Base::Vector3f& pt2, const Base::Vector3f& pt3)
|
||||
: pt1(pt1)
|
||||
, pt2(pt2)
|
||||
, pt3(pt3)
|
||||
@@ -295,9 +295,11 @@ private:
|
||||
class BaseExport PointItem: public NodeItem
|
||||
{
|
||||
public:
|
||||
explicit PointItem(const Base::Vector3f& point,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
|
||||
explicit PointItem(
|
||||
const Base::Vector3f& point,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
|
||||
);
|
||||
void write(InventorOutput& out) const override;
|
||||
|
||||
private:
|
||||
@@ -309,9 +311,11 @@ private:
|
||||
class BaseExport LineItem: public NodeItem
|
||||
{
|
||||
public:
|
||||
explicit LineItem(const Base::Line3f& line,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
|
||||
explicit LineItem(
|
||||
const Base::Line3f& line,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
|
||||
);
|
||||
void write(InventorOutput& out) const override;
|
||||
|
||||
private:
|
||||
@@ -325,9 +329,11 @@ class BaseExport MultiLineItem: public NodeItem
|
||||
public:
|
||||
/// add a line defined by a list of points whereat always a pair (i.e. a point and the following
|
||||
/// point) builds a line.
|
||||
explicit MultiLineItem(std::vector<Vector3f> points,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
|
||||
explicit MultiLineItem(
|
||||
std::vector<Vector3f> points,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
|
||||
);
|
||||
void write(InventorOutput& out) const override;
|
||||
|
||||
private:
|
||||
@@ -339,9 +345,11 @@ private:
|
||||
class BaseExport ArrowItem: public NodeItem
|
||||
{
|
||||
public:
|
||||
explicit ArrowItem(const Base::Line3f& line,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
|
||||
explicit ArrowItem(
|
||||
const Base::Line3f& line,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
|
||||
);
|
||||
void write(InventorOutput& out) const override;
|
||||
|
||||
private:
|
||||
@@ -353,10 +361,12 @@ private:
|
||||
class BaseExport BoundingBoxItem: public NodeItem
|
||||
{
|
||||
public:
|
||||
explicit BoundingBoxItem(const Vector3f& pt1,
|
||||
const Vector3f& pt2,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F});
|
||||
explicit BoundingBoxItem(
|
||||
const Vector3f& pt1,
|
||||
const Vector3f& pt2,
|
||||
DrawStyle drawStyle,
|
||||
const ColorRGB& rgb = ColorRGB {1.0F, 1.0F, 1.0F}
|
||||
);
|
||||
void write(InventorOutput& out) const override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
add_library(FreeCADBase SHARED)
|
||||
|
||||
if(WIN32)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2005 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
|
||||
+16
-12
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2005 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -25,7 +27,7 @@
|
||||
#define APP_COLOR_H
|
||||
|
||||
#ifdef __GNUC__
|
||||
#include <cstdint>
|
||||
# include <cstdint>
|
||||
#endif
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
@@ -163,10 +165,12 @@ public:
|
||||
template<typename T>
|
||||
static T fromPackedRGBA(uint32_t color)
|
||||
{
|
||||
return color_traits<T>::makeColor((color >> 24) & 0xff,
|
||||
(color >> 16) & 0xff,
|
||||
(color >> 8) & 0xff,
|
||||
(color & 0xff));
|
||||
return color_traits<T>::makeColor(
|
||||
(color >> 24) & 0xff,
|
||||
(color >> 16) & 0xff,
|
||||
(color >> 8) & 0xff,
|
||||
(color & 0xff)
|
||||
);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
@@ -179,9 +183,7 @@ public:
|
||||
template<typename T>
|
||||
static T fromPackedRGB(uint32_t color)
|
||||
{
|
||||
return color_traits<T>::makeColor((color >> 24) & 0xff,
|
||||
(color >> 16) & 0xff,
|
||||
(color >> 8) & 0xff);
|
||||
return color_traits<T>::makeColor((color >> 24) & 0xff, (color >> 16) & 0xff, (color >> 8) & 0xff);
|
||||
}
|
||||
/**
|
||||
* creates FC Color from template type, e.g. Qt QColor
|
||||
@@ -306,10 +308,12 @@ struct color_traits<Base::Color>
|
||||
}
|
||||
static color_type makeColor(int red, int green, int blue, int alpha = 255)
|
||||
{
|
||||
return color_type {static_cast<float>(red) / 255.0F,
|
||||
static_cast<float>(green) / 255.0F,
|
||||
static_cast<float>(blue) / 255.0F,
|
||||
static_cast<float>(alpha) / 255.0F};
|
||||
return color_type {
|
||||
static_cast<float>(red) / 255.0F,
|
||||
static_cast<float>(green) / 255.0F,
|
||||
static_cast<float>(blue) / 255.0F,
|
||||
static_cast<float>(alpha) / 255.0F
|
||||
};
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
+162
-115
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -24,9 +26,9 @@
|
||||
#include <FCConfig.h>
|
||||
|
||||
#if defined(FC_OS_WIN32)
|
||||
#include <windows.h>
|
||||
# include <windows.h>
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX)
|
||||
#include <unistd.h>
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <cstring>
|
||||
#include <functional>
|
||||
@@ -53,11 +55,13 @@ public:
|
||||
std::string notifier;
|
||||
std::string msg;
|
||||
|
||||
ConsoleEvent(const ConsoleSingleton::FreeCAD_ConsoleMsgType type,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifier,
|
||||
const std::string& msg)
|
||||
ConsoleEvent(
|
||||
const ConsoleSingleton::FreeCAD_ConsoleMsgType type,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifier,
|
||||
const std::string& msg
|
||||
)
|
||||
: QEvent(QEvent::User) // NOLINT
|
||||
, msgtype(type)
|
||||
, recipient(recipient)
|
||||
@@ -88,46 +92,58 @@ public:
|
||||
if (ev->type() == QEvent::User) {
|
||||
switch (const auto ce = static_cast<ConsoleEvent*>(ev); ce->msgtype) {
|
||||
case ConsoleSingleton::MsgType_Txt:
|
||||
Console().notifyPrivate(LogStyle::Message,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Message,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
case ConsoleSingleton::MsgType_Log:
|
||||
Console().notifyPrivate(LogStyle::Log,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Log,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
case ConsoleSingleton::MsgType_Wrn:
|
||||
Console().notifyPrivate(LogStyle::Warning,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Warning,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
case ConsoleSingleton::MsgType_Err:
|
||||
Console().notifyPrivate(LogStyle::Error,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Error,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
case ConsoleSingleton::MsgType_Critical:
|
||||
Console().notifyPrivate(LogStyle::Critical,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Critical,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
case ConsoleSingleton::MsgType_Notification:
|
||||
Console().notifyPrivate(LogStyle::Notification,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg);
|
||||
Console().notifyPrivate(
|
||||
LogStyle::Notification,
|
||||
ce->recipient,
|
||||
ce->content,
|
||||
ce->notifier,
|
||||
ce->msg
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -183,9 +199,11 @@ ConsoleSingleton::~ConsoleSingleton()
|
||||
* switches off warnings and error messages and restore the state before the modification.
|
||||
* If the observer \a sObs doesn't exist then nothing happens.
|
||||
*/
|
||||
ConsoleMsgFlags ConsoleSingleton::setEnabledMsgType(const char* sObs,
|
||||
const ConsoleMsgFlags type,
|
||||
const bool on) const
|
||||
ConsoleMsgFlags ConsoleSingleton::setEnabledMsgType(
|
||||
const char* sObs,
|
||||
const ConsoleMsgFlags type,
|
||||
const bool on
|
||||
) const
|
||||
{
|
||||
if (ILogger* pObs = get(sObs)) {
|
||||
ConsoleMsgFlags flags = 0;
|
||||
@@ -294,31 +312,39 @@ void ConsoleSingleton::detachObserver(ILogger* pcObserver)
|
||||
_aclObservers.erase(pcObserver);
|
||||
}
|
||||
|
||||
void ConsoleSingleton::notifyPrivate(const LogStyle category,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg) const
|
||||
void ConsoleSingleton::notifyPrivate(
|
||||
const LogStyle category,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg
|
||||
) const
|
||||
{
|
||||
for (ILogger* Iter : _aclObservers) {
|
||||
if (Iter->isActive(category)) {
|
||||
Iter->sendLog(notifiername,
|
||||
msg,
|
||||
category,
|
||||
recipient,
|
||||
content); // send string to the listener
|
||||
Iter->sendLog(
|
||||
notifiername,
|
||||
msg,
|
||||
category,
|
||||
recipient,
|
||||
content
|
||||
); // send string to the listener
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ConsoleSingleton::postEvent(const FreeCAD_ConsoleMsgType type,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg)
|
||||
void ConsoleSingleton::postEvent(
|
||||
const FreeCAD_ConsoleMsgType type,
|
||||
const IntendedRecipient recipient,
|
||||
const ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg
|
||||
)
|
||||
{
|
||||
QCoreApplication::postEvent(ConsoleOutput::getInstance(),
|
||||
new ConsoleEvent(type, recipient, content, notifiername, msg));
|
||||
QCoreApplication::postEvent(
|
||||
ConsoleOutput::getInstance(),
|
||||
new ConsoleEvent(type, recipient, content, notifiername, msg)
|
||||
);
|
||||
}
|
||||
|
||||
ILogger* ConsoleSingleton::get(const char* Name) const
|
||||
@@ -550,35 +576,36 @@ PyObject* ConsoleSingleton::sPyMessage(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Message, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyWarning(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance().warning(notifier, "%s", msg);
|
||||
},
|
||||
args);
|
||||
[](const std::string& notifier, const char* msg) { instance().warning(notifier, "%s", msg); },
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyDeveloperWarning(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyUserWarning(PyObject* /*self*/, PyObject* args)
|
||||
@@ -588,9 +615,11 @@ PyObject* ConsoleSingleton::sPyUserWarning(PyObject* /*self*/, PyObject* args)
|
||||
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyTranslatedUserWarning(PyObject* /*self*/, PyObject* args)
|
||||
@@ -600,9 +629,11 @@ PyObject* ConsoleSingleton::sPyTranslatedUserWarning(PyObject* /*self*/, PyObjec
|
||||
instance().send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyError(PyObject* /*self*/, PyObject* args)
|
||||
@@ -612,22 +643,25 @@ PyObject* ConsoleSingleton::sPyError(PyObject* /*self*/, PyObject* args)
|
||||
instance().send<LogStyle::Error, IntendedRecipient::All, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyDeveloperError(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyUserError(PyObject* /*self*/, PyObject* args)
|
||||
@@ -637,9 +671,11 @@ PyObject* ConsoleSingleton::sPyUserError(PyObject* /*self*/, PyObject* args)
|
||||
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyTranslatedUserError(PyObject* /*self*/, PyObject* args)
|
||||
@@ -649,22 +685,25 @@ PyObject* ConsoleSingleton::sPyTranslatedUserError(PyObject* /*self*/, PyObject*
|
||||
instance().send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyLog(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Log, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyCritical(PyObject* /*self*/, PyObject* args)
|
||||
@@ -674,35 +713,39 @@ PyObject* ConsoleSingleton::sPyCritical(PyObject* /*self*/, PyObject* args)
|
||||
instance().send<LogStyle::Critical, IntendedRecipient::All, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyNotification(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyTranslatedNotification(PyObject* /*self*/, PyObject* args)
|
||||
{
|
||||
return FC_PYCONSOLE_MSG(
|
||||
[](const std::string& notifier, const char* msg) {
|
||||
instance()
|
||||
.send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg);
|
||||
instance().send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
"%s",
|
||||
msg
|
||||
);
|
||||
},
|
||||
args);
|
||||
args
|
||||
);
|
||||
}
|
||||
|
||||
PyObject* ConsoleSingleton::sPyGetStatus(PyObject* /*self*/, PyObject* args)
|
||||
@@ -740,9 +783,11 @@ PyObject* ConsoleSingleton::sPyGetStatus(PyObject* /*self*/, PyObject* args)
|
||||
b = pObs->bNotification;
|
||||
}
|
||||
else {
|
||||
Py_Error(Base::PyExc_FC_GeneralError,
|
||||
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
|
||||
"'Notification')");
|
||||
Py_Error(
|
||||
Base::PyExc_FC_GeneralError,
|
||||
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
|
||||
"'Notification')"
|
||||
);
|
||||
}
|
||||
|
||||
return PyBool_FromLong(b ? 1 : 0);
|
||||
@@ -782,9 +827,11 @@ PyObject* ConsoleSingleton::sPySetStatus(PyObject* /*self*/, PyObject* args)
|
||||
pObs->bNotification = status;
|
||||
}
|
||||
else {
|
||||
Py_Error(Base::PyExc_FC_GeneralError,
|
||||
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
|
||||
"'Notification')");
|
||||
Py_Error(
|
||||
Base::PyExc_FC_GeneralError,
|
||||
"Unknown message type (use 'Log', 'Err', 'Wrn', 'Msg', 'Critical' or "
|
||||
"'Notification')"
|
||||
);
|
||||
}
|
||||
|
||||
Py_Return;
|
||||
|
||||
+100
-84
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -42,8 +44,8 @@ using PyMethodDef = struct PyMethodDef;
|
||||
|
||||
// FIXME: Even with parameter packs this is necessary for MSYS2
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
#endif
|
||||
|
||||
//**************************************************************************
|
||||
@@ -51,11 +53,11 @@ using PyMethodDef = struct PyMethodDef;
|
||||
|
||||
#ifdef FC_DEBUG
|
||||
/// switch on the logging of python object creation and destruction
|
||||
#undef FC_LOGPYOBJECTS
|
||||
# undef FC_LOGPYOBJECTS
|
||||
/// switch on the logging of Feature update and execution
|
||||
#define FC_LOGFEATUREUPDATE
|
||||
# define FC_LOGFEATUREUPDATE
|
||||
/// switch on the logging of the Update execution through Doc, App, GuiApp and GuiDoc
|
||||
#undef FC_LOGUPDATECHAIN
|
||||
# undef FC_LOGUPDATECHAIN
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -570,11 +572,13 @@ public:
|
||||
* translated (are untranslatable). Or conversely, may decide not to process already translated
|
||||
* notifications. It is up to the intended behaviour of the observer.
|
||||
*/
|
||||
virtual void sendLog(const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content) = 0;
|
||||
virtual void sendLog(
|
||||
const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content
|
||||
) = 0;
|
||||
|
||||
/**
|
||||
* Returns whether a LogStyle category is active or not
|
||||
@@ -711,10 +715,7 @@ public:
|
||||
|
||||
Notification can be direct or via queue.
|
||||
*/
|
||||
template<LogStyle,
|
||||
IntendedRecipient = IntendedRecipient::All,
|
||||
ContentType = ContentType::Untranslated,
|
||||
typename... Args>
|
||||
template<LogStyle, IntendedRecipient = IntendedRecipient::All, ContentType = ContentType::Untranslated, typename... Args>
|
||||
void send(const std::string& notifiername, const char* pMsg, Args&&... args);
|
||||
|
||||
/// Prints a Message
|
||||
@@ -779,9 +780,7 @@ public:
|
||||
void userTranslatedNotification(const std::string& notifier, const char* pMsg, Args&&... args);
|
||||
|
||||
// Notify a message directly to observers
|
||||
template<LogStyle,
|
||||
IntendedRecipient = IntendedRecipient::All,
|
||||
ContentType = ContentType::Untranslated>
|
||||
template<LogStyle, IntendedRecipient = IntendedRecipient::All, ContentType = ContentType::Untranslated>
|
||||
void notify(const std::string& notifiername, const std::string& msg);
|
||||
|
||||
/// Attaches an Observer to FCConsole
|
||||
@@ -875,16 +874,20 @@ public:
|
||||
ConsoleSingleton& operator=(ConsoleSingleton&&) = delete;
|
||||
|
||||
private:
|
||||
void postEvent(FreeCAD_ConsoleMsgType type,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg);
|
||||
void notifyPrivate(LogStyle category,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg) const;
|
||||
void postEvent(
|
||||
FreeCAD_ConsoleMsgType type,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg
|
||||
);
|
||||
void notifyPrivate(
|
||||
LogStyle category,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content,
|
||||
const std::string& notifiername,
|
||||
const std::string& msg
|
||||
) const;
|
||||
|
||||
// singleton
|
||||
static void Destruct();
|
||||
@@ -910,13 +913,15 @@ inline ConsoleSingleton& Console()
|
||||
|
||||
constexpr ConsoleSingleton::FreeCAD_ConsoleMsgType ConsoleSingleton::getConsoleMsg(LogStyle style)
|
||||
{
|
||||
constexpr std::array msgTypes {// In order of LogStyle
|
||||
MsgType_Wrn,
|
||||
MsgType_Txt,
|
||||
MsgType_Err,
|
||||
MsgType_Log,
|
||||
MsgType_Critical,
|
||||
MsgType_Notification};
|
||||
constexpr std::array msgTypes {
|
||||
// In order of LogStyle
|
||||
MsgType_Wrn,
|
||||
MsgType_Txt,
|
||||
MsgType_Err,
|
||||
MsgType_Log,
|
||||
MsgType_Critical,
|
||||
MsgType_Notification
|
||||
};
|
||||
|
||||
return msgTypes.at(static_cast<std::size_t>(style));
|
||||
}
|
||||
@@ -953,12 +958,14 @@ public:
|
||||
bool add_eol;
|
||||
bool refresh;
|
||||
|
||||
LogLevel(const char* tag,
|
||||
const bool print_tag = true,
|
||||
const int print_src = 0,
|
||||
const bool print_time = false,
|
||||
const bool add_eol = true,
|
||||
const bool refresh = false)
|
||||
LogLevel(
|
||||
const char* tag,
|
||||
const bool print_tag = true,
|
||||
const int print_src = 0,
|
||||
const bool print_time = false,
|
||||
const bool add_eol = true,
|
||||
const bool refresh = false
|
||||
)
|
||||
: tag(tag)
|
||||
, lvl(*Console().getLogLevel(tag))
|
||||
, print_tag(print_tag)
|
||||
@@ -1024,36 +1031,37 @@ void Base::ConsoleSingleton::warning(const std::string& notifier, const char* pM
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::developerWarning(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::developerWarning(const std::string& notifier, const char* pMsg, Args&&... args)
|
||||
{
|
||||
send<LogStyle::Warning, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::userWarning(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::userWarning(const std::string& notifier, const char* pMsg, Args&&... args)
|
||||
{
|
||||
send<LogStyle::Warning, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::translatedUserWarning(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::translatedUserWarning(
|
||||
const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args
|
||||
)
|
||||
{
|
||||
send<LogStyle::Warning, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@@ -1069,26 +1077,28 @@ void Base::ConsoleSingleton::error(const std::string& notifier, const char* pMsg
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::developerError(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::developerError(const std::string& notifier, const char* pMsg, Args&&... args)
|
||||
{
|
||||
send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::destructorError(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args) noexcept
|
||||
void Base::ConsoleSingleton::destructorError(
|
||||
const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args
|
||||
) noexcept
|
||||
{
|
||||
try {
|
||||
send<LogStyle::Error, IntendedRecipient::Developer, ContentType::Untranslatable>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
catch (...) {
|
||||
assert("An exception was thrown while attempting console output in a destructor" && false);
|
||||
@@ -1096,25 +1106,27 @@ void Base::ConsoleSingleton::destructorError(const std::string& notifier,
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::userError(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::userError(const std::string& notifier, const char* pMsg, Args&&... args)
|
||||
{
|
||||
send<LogStyle::Error, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::translatedUserError(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::translatedUserError(
|
||||
const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args
|
||||
)
|
||||
{
|
||||
send<LogStyle::Error, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@@ -1136,14 +1148,13 @@ void Base::ConsoleSingleton::userNotification(const char* pMsg, Args&&... args)
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::userNotification(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::userNotification(const std::string& notifier, const char* pMsg, Args&&... args)
|
||||
{
|
||||
send<LogStyle::Notification, IntendedRecipient::User, ContentType::Untranslated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@@ -1153,14 +1164,17 @@ void Base::ConsoleSingleton::userTranslatedNotification(const char* pMsg, Args&&
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
void Base::ConsoleSingleton::userTranslatedNotification(const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args)
|
||||
void Base::ConsoleSingleton::userTranslatedNotification(
|
||||
const std::string& notifier,
|
||||
const char* pMsg,
|
||||
Args&&... args
|
||||
)
|
||||
{
|
||||
send<LogStyle::Notification, IntendedRecipient::User, ContentType::Translated>(
|
||||
notifier,
|
||||
pMsg,
|
||||
std::forward<Args>(args)...);
|
||||
std::forward<Args>(args)...
|
||||
);
|
||||
}
|
||||
|
||||
template<typename... Args>
|
||||
@@ -1175,10 +1189,11 @@ void Base::ConsoleSingleton::log(const std::string& notifier, const char* pMsg,
|
||||
send<LogStyle::Log>(notifier, pMsg, std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template<Base::LogStyle category,
|
||||
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
|
||||
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/,
|
||||
typename... Args>
|
||||
template<
|
||||
Base::LogStyle category,
|
||||
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
|
||||
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/,
|
||||
typename... Args>
|
||||
void Base::ConsoleSingleton::send(const std::string& notifiername, const char* pMsg, Args&&... args)
|
||||
{
|
||||
std::string format;
|
||||
@@ -1204,16 +1219,17 @@ void Base::ConsoleSingleton::send(const std::string& notifiername, const char* p
|
||||
}
|
||||
}
|
||||
|
||||
template<Base::LogStyle category,
|
||||
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
|
||||
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/>
|
||||
template<
|
||||
Base::LogStyle category,
|
||||
Base::IntendedRecipient recipient /*= Base::IntendedRecipient::All*/,
|
||||
Base::ContentType contenttype /*= Base::ContentType::Untranslated*/>
|
||||
void Base::ConsoleSingleton::notify(const std::string& notifiername, const std::string& msg)
|
||||
{
|
||||
notifyPrivate(category, recipient, contenttype, notifiername, msg);
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
#endif // BASE_CONSOLE_H
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -24,7 +26,7 @@
|
||||
#include <FCConfig.h>
|
||||
|
||||
#ifdef FC_OS_WIN32
|
||||
#include <windows.h>
|
||||
# include <windows.h>
|
||||
#endif
|
||||
#include <cstring>
|
||||
#include <Python.h>
|
||||
@@ -58,11 +60,13 @@ ConsoleObserverFile::~ConsoleObserverFile()
|
||||
cFileStream.close();
|
||||
}
|
||||
|
||||
void ConsoleObserverFile::sendLog(const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content)
|
||||
void ConsoleObserverFile::sendLog(
|
||||
const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content
|
||||
)
|
||||
{
|
||||
(void)notifiername;
|
||||
|
||||
@@ -111,11 +115,13 @@ ConsoleObserverStd::ConsoleObserverStd()
|
||||
|
||||
ConsoleObserverStd::~ConsoleObserverStd() = default;
|
||||
|
||||
void ConsoleObserverStd::sendLog(const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content)
|
||||
void ConsoleObserverStd::sendLog(
|
||||
const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content
|
||||
)
|
||||
{
|
||||
(void)notifiername;
|
||||
|
||||
@@ -154,8 +160,7 @@ void ConsoleObserverStd::Warning(const char* sWarn)
|
||||
{
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[1;33m");
|
||||
#endif
|
||||
@@ -165,8 +170,10 @@ void ConsoleObserverStd::Warning(const char* sWarn)
|
||||
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(
|
||||
::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
|
||||
);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[0m");
|
||||
#endif
|
||||
@@ -177,8 +184,10 @@ void ConsoleObserverStd::Error(const char* sErr)
|
||||
{
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_INTENSITY);
|
||||
::SetConsoleTextAttribute(
|
||||
::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_INTENSITY
|
||||
);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[1;31m");
|
||||
#endif
|
||||
@@ -188,8 +197,10 @@ void ConsoleObserverStd::Error(const char* sErr)
|
||||
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(
|
||||
::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
|
||||
);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[0m");
|
||||
#endif
|
||||
@@ -200,8 +211,7 @@ void ConsoleObserverStd::Log(const char* sLog)
|
||||
{
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN);
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_RED | FOREGROUND_GREEN);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[1;36m");
|
||||
#endif
|
||||
@@ -211,8 +221,10 @@ void ConsoleObserverStd::Log(const char* sLog)
|
||||
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(
|
||||
::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
|
||||
);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[0m");
|
||||
#endif
|
||||
@@ -223,8 +235,7 @@ void ConsoleObserverStd::Critical(const char* sCritical)
|
||||
{
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE), FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[1;33m");
|
||||
#endif
|
||||
@@ -234,8 +245,10 @@ void ConsoleObserverStd::Critical(const char* sCritical)
|
||||
|
||||
if (useColorStderr) {
|
||||
#if defined(FC_OS_WIN32)
|
||||
::SetConsoleTextAttribute(::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE);
|
||||
::SetConsoleTextAttribute(
|
||||
::GetStdHandle(STD_ERROR_HANDLE),
|
||||
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
|
||||
);
|
||||
#elif defined(FC_OS_LINUX) || defined(FC_OS_MACOSX) || defined(FC_OS_BSD)
|
||||
fprintf(stderr, "\033[0m");
|
||||
#endif
|
||||
|
||||
+23
-19
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -43,11 +45,13 @@ public:
|
||||
explicit ConsoleObserverFile(const char* sFileName);
|
||||
~ConsoleObserverFile() override;
|
||||
|
||||
void sendLog(const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content) override;
|
||||
void sendLog(
|
||||
const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content
|
||||
) override;
|
||||
const char* name() override
|
||||
{
|
||||
return "File";
|
||||
@@ -70,11 +74,13 @@ class BaseExport ConsoleObserverStd: public ILogger
|
||||
public:
|
||||
ConsoleObserverStd();
|
||||
~ConsoleObserverStd() override;
|
||||
void sendLog(const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content) override;
|
||||
void sendLog(
|
||||
const std::string& notifiername,
|
||||
const std::string& msg,
|
||||
LogStyle level,
|
||||
IntendedRecipient recipient,
|
||||
ContentType content
|
||||
) override;
|
||||
const char* name() override
|
||||
{
|
||||
return "Console";
|
||||
@@ -103,13 +109,12 @@ class BaseExport ILoggerBlocker
|
||||
public:
|
||||
// Constructor that will block message types passed as parameter. By default, all types are
|
||||
// blocked.
|
||||
inline explicit ILoggerBlocker(const char* co,
|
||||
ConsoleMsgFlags msgTypes = ConsoleSingleton::MsgType_Txt
|
||||
| ConsoleSingleton::MsgType_Log
|
||||
| ConsoleSingleton::MsgType_Wrn
|
||||
| ConsoleSingleton::MsgType_Err
|
||||
| ConsoleSingleton::MsgType_Critical
|
||||
| ConsoleSingleton::MsgType_Notification);
|
||||
inline explicit ILoggerBlocker(
|
||||
const char* co,
|
||||
ConsoleMsgFlags msgTypes = ConsoleSingleton::MsgType_Txt | ConsoleSingleton::MsgType_Log
|
||||
| ConsoleSingleton::MsgType_Wrn | ConsoleSingleton::MsgType_Err
|
||||
| ConsoleSingleton::MsgType_Critical | ConsoleSingleton::MsgType_Notification
|
||||
);
|
||||
// Disable copy & move constructors
|
||||
ILoggerBlocker(ILoggerBlocker const&) = delete;
|
||||
ILoggerBlocker(ILoggerBlocker const&&) = delete;
|
||||
@@ -136,8 +141,7 @@ ILoggerBlocker::~ILoggerBlocker()
|
||||
#ifdef FC_DEBUG
|
||||
auto debug = Console().setEnabledMsgType(conObs, msgTypesBlocked, true);
|
||||
if (debug != msgTypesBlocked) {
|
||||
Console().warning(
|
||||
"Enabled message types have been changed while ILoggerBlocker was set\n");
|
||||
Console().warning("Enabled message types have been changed while ILoggerBlocker was set\n");
|
||||
}
|
||||
#else
|
||||
Console().setEnabledMsgType(conObs, msgTypesBlocked, true);
|
||||
|
||||
+13
-7
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2019 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
@@ -99,9 +101,11 @@ Vec make_vec(const std::tuple<float_type, float_type, float_type>&& ft)
|
||||
{
|
||||
using traits_type = vec_traits<Vec>;
|
||||
using float_traits_type = typename traits_type::float_type;
|
||||
return Vec(float_traits_type(std::get<0>(ft)),
|
||||
float_traits_type(std::get<1>(ft)),
|
||||
float_traits_type(std::get<2>(ft)));
|
||||
return Vec(
|
||||
float_traits_type(std::get<0>(ft)),
|
||||
float_traits_type(std::get<1>(ft)),
|
||||
float_traits_type(std::get<2>(ft))
|
||||
);
|
||||
}
|
||||
|
||||
// type with four floats
|
||||
@@ -110,10 +114,12 @@ Vec make_vec(const std::tuple<float_type, float_type, float_type, float_type>&&
|
||||
{
|
||||
using traits_type = vec_traits<Vec>;
|
||||
using float_traits_type = typename traits_type::float_type;
|
||||
return Vec(float_traits_type(std::get<0>(ft)),
|
||||
float_traits_type(std::get<1>(ft)),
|
||||
float_traits_type(std::get<2>(ft)),
|
||||
float_traits_type(std::get<3>(ft)));
|
||||
return Vec(
|
||||
float_traits_type(std::get<0>(ft)),
|
||||
float_traits_type(std::get<1>(ft)),
|
||||
float_traits_type(std::get<2>(ft)),
|
||||
float_traits_type(std::get<3>(ft))
|
||||
);
|
||||
}
|
||||
|
||||
template<class Vec1, class Vec2>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2014 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2014 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
from Metadata import export, constmethod
|
||||
from PyObjectBase import PyObjectBase
|
||||
from Axis import Axis as AxisPy
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2017 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
@@ -39,8 +41,7 @@ std::string CoordinateSystemPy::representation() const
|
||||
return {"<CoordinateSystem object>"};
|
||||
}
|
||||
|
||||
PyObject*
|
||||
CoordinateSystemPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/)
|
||||
PyObject* CoordinateSystemPy::PyMake(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/)
|
||||
{
|
||||
// create a new instance of CoordinateSystemPy and the Twin object
|
||||
return new CoordinateSystemPy(new CoordinateSystem);
|
||||
@@ -57,15 +58,19 @@ PyObject* CoordinateSystemPy::setAxes(PyObject* args)
|
||||
PyObject* axis {};
|
||||
PyObject* xdir {};
|
||||
if (PyArg_ParseTuple(args, "O!O!", &(AxisPy::Type), &axis, &(VectorPy::Type), &xdir)) {
|
||||
getCoordinateSystemPtr()->setAxes(*static_cast<AxisPy*>(axis)->getAxisPtr(),
|
||||
*static_cast<VectorPy*>(xdir)->getVectorPtr());
|
||||
getCoordinateSystemPtr()->setAxes(
|
||||
*static_cast<AxisPy*>(axis)->getAxisPtr(),
|
||||
*static_cast<VectorPy*>(xdir)->getVectorPtr()
|
||||
);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
PyErr_Clear();
|
||||
if (PyArg_ParseTuple(args, "O!O!", &(VectorPy::Type), &axis, &(VectorPy::Type), &xdir)) {
|
||||
getCoordinateSystemPtr()->setAxes(*static_cast<VectorPy*>(axis)->getVectorPtr(),
|
||||
*static_cast<VectorPy*>(xdir)->getVectorPtr());
|
||||
getCoordinateSystemPtr()->setAxes(
|
||||
*static_cast<VectorPy*>(axis)->getVectorPtr(),
|
||||
*static_cast<VectorPy*>(xdir)->getVectorPtr()
|
||||
);
|
||||
Py_Return;
|
||||
}
|
||||
|
||||
@@ -80,7 +85,8 @@ PyObject* CoordinateSystemPy::displacement(PyObject* args) const
|
||||
return nullptr;
|
||||
}
|
||||
Placement plm = getCoordinateSystemPtr()->displacement(
|
||||
*static_cast<CoordinateSystemPy*>(cs)->getCoordinateSystemPtr());
|
||||
*static_cast<CoordinateSystemPy*>(cs)->getCoordinateSystemPtr()
|
||||
);
|
||||
return new PlacementPy(new Placement(plm));
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
|
||||
+3
-1
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2012 Werner Mayer <wmayer[at]users.sourceforge.net> *
|
||||
* *
|
||||
@@ -27,7 +29,7 @@
|
||||
#include <QEventLoop>
|
||||
#include <QObject>
|
||||
#ifndef FC_GLOBAL_H
|
||||
#include <FCGlobal.h>
|
||||
# include <FCGlobal.h>
|
||||
#endif
|
||||
|
||||
namespace Base
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
|
||||
* *
|
||||
|
||||
+16
-10
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
|
||||
* *
|
||||
@@ -37,10 +39,12 @@ Base::DualQuat Base::operator-(Base::DualQuat a, Base::DualQuat b)
|
||||
|
||||
Base::DualQuat Base::operator*(Base::DualQuat a, Base::DualQuat b)
|
||||
{
|
||||
return {a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
|
||||
a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z,
|
||||
a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x,
|
||||
a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z};
|
||||
return {
|
||||
a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
|
||||
a.w * b.y + a.y * b.w + a.z * b.x - a.x * b.z,
|
||||
a.w * b.z + a.z * b.w + a.x * b.y - a.y * b.x,
|
||||
a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z
|
||||
};
|
||||
}
|
||||
|
||||
Base::DualQuat Base::operator*(Base::DualQuat a, double b)
|
||||
@@ -107,9 +111,9 @@ Base::DualQuat Base::DualQuat::pow(double t, bool shorten) const
|
||||
|
||||
DualQuat self = *this;
|
||||
if (shorten) {
|
||||
if (dot(self, identity())
|
||||
< -1e-12) { // using negative tolerance instead of zero, for stability in situations
|
||||
// the choice is ambiguous (180-degree rotations)
|
||||
if (dot(self, identity()) < -1e-12) { // using negative tolerance instead of zero, for
|
||||
// stability in situations the choice is ambiguous
|
||||
// (180-degree rotations)
|
||||
self = -self;
|
||||
}
|
||||
}
|
||||
@@ -126,8 +130,10 @@ Base::DualQuat Base::DualQuat::pow(double t, bool shorten) const
|
||||
pitch *= t;
|
||||
|
||||
// back to quaternion
|
||||
return {l * sin(theta / 2) + DualQuat(0, 0, 0, cos(theta / 2)),
|
||||
m * sin(theta / 2) + pitch / 2 * cos(theta / 2) * l
|
||||
+ DualQuat(0, 0, 0, -pitch / 2 * sin(theta / 2))};
|
||||
return {
|
||||
l * sin(theta / 2) + DualQuat(0, 0, 0, cos(theta / 2)),
|
||||
m * sin(theta / 2) + pitch / 2 * cos(theta / 2) * l
|
||||
+ DualQuat(0, 0, 0, -pitch / 2 * sin(theta / 2))
|
||||
};
|
||||
}
|
||||
// NOLINTEND(readability-identifier-length)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2019 Viktor Titov (DeepSOIC) <vv.titov@gmail.com> *
|
||||
* *
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
// SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2002 Jürgen Riegel <juergen.riegel@web.de> *
|
||||
* *
|
||||
@@ -588,9 +590,9 @@ PyObject* RestoreError::getPyExceptionType() const
|
||||
// ---------------------------------------------------------
|
||||
|
||||
#if defined(__GNUC__) && defined(FC_OS_LINUX)
|
||||
#include <stdexcept>
|
||||
#include <iostream>
|
||||
#include <csignal>
|
||||
# include <stdexcept>
|
||||
# include <iostream>
|
||||
# include <csignal>
|
||||
|
||||
SignalException::SignalException()
|
||||
{
|
||||
@@ -599,17 +601,17 @@ SignalException::SignalException()
|
||||
sigemptyset(&new_action.sa_mask);
|
||||
new_action.sa_flags = 0;
|
||||
ok = (sigaction(SIGSEGV, &new_action, &old_action) < 0);
|
||||
#ifdef _DEBUG
|
||||
# ifdef _DEBUG
|
||||
std::cout << "Set new signal handler" << std::endl;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
SignalException::~SignalException()
|
||||
{
|
||||
sigaction(SIGSEGV, &old_action, nullptr);
|
||||
#ifdef _DEBUG
|
||||
# ifdef _DEBUG
|
||||
std::cout << "Restore old signal handler" << std::endl;
|
||||
#endif
|
||||
# endif
|
||||
}
|
||||
|
||||
void SignalException::throw_signal(const int signum)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user