From af385c2bb80308474063ab9cfb0aef90cfddaa4f Mon Sep 17 00:00:00 2001 From: Mike Molinari Date: Sun, 26 Sep 2021 01:11:38 +0000 Subject: [PATCH] made primities use legacy icons --- .../modeler/features/fillet_tool/index.ts | 16 +- .../modeler/features/hole_tool/icon.svg | 902 +++++++++++++++++- .../modeler/features/hole_tool/index.ts | 26 +- .../modeler/features/primitive_box/icon.svg | 10 - .../modeler/features/primitive_box/index.ts | 16 +- .../modeler/features/primitive_cone/icon.svg | 10 - .../features/primitive_cylinder/icon.svg | 10 - .../features/primitive_cylinder/index.ts | 16 +- .../features/primitive_sphere/icon.svg | 10 - .../features/primitive_sphere/index.ts | 16 +- .../modeler/features/primitive_torus/icon.svg | 10 - .../features/primitive_torus/icon32.png | Bin 0 -> 1224 bytes .../{old.icon.png => icon96.png} | Bin .../modeler/features/primitive_torus/index.ts | 16 +- 14 files changed, 985 insertions(+), 73 deletions(-) delete mode 100644 modules/workbenches/modeler/features/primitive_box/icon.svg delete mode 100644 modules/workbenches/modeler/features/primitive_cone/icon.svg delete mode 100644 modules/workbenches/modeler/features/primitive_cylinder/icon.svg delete mode 100644 modules/workbenches/modeler/features/primitive_sphere/icon.svg delete mode 100644 modules/workbenches/modeler/features/primitive_torus/icon.svg create mode 100644 modules/workbenches/modeler/features/primitive_torus/icon32.png rename modules/workbenches/modeler/features/primitive_torus/{old.icon.png => icon96.png} (100%) diff --git a/modules/workbenches/modeler/features/fillet_tool/index.ts b/modules/workbenches/modeler/features/fillet_tool/index.ts index 17c928d1..76bc0419 100644 --- a/modules/workbenches/modeler/features/fillet_tool/index.ts +++ b/modules/workbenches/modeler/features/fillet_tool/index.ts @@ -2,12 +2,24 @@ import { ApplicationContext } from 'context'; import { MBrepShell } from 'cad/model/mshell'; import { roundValueForPresentation as r } from 'cad/craft/operationHelper'; import { occ2brep } from 'cad/occ/occ2models'; -import icon from './icon.svg'; +import icon32 from './icon32.png'; +import icon96 from './icon96.png'; export default { id: 'fillet_tool', label: 'fillet_tool', - icon, + icon: { + iconSet: { + medium: { + iconType: 'image', + iconContent: icon32 + }, + large: { + iconType: 'image', + iconContent: icon96 + } + }, + }, info: 'fillet_tool', mutualExclusiveFields: [], paramsInfo: ({ sizeA, }) => `(${r(sizeA)} })`, diff --git a/modules/workbenches/modeler/features/hole_tool/icon.svg b/modules/workbenches/modeler/features/hole_tool/icon.svg index 78b99920..d543c7e1 100644 --- a/modules/workbenches/modeler/features/hole_tool/icon.svg +++ b/modules/workbenches/modeler/features/hole_tool/icon.svg @@ -1,10 +1,898 @@ - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + [jmaustpc] + + + PartDesign_Hole + 2013-03-17 + http://www.freecadweb.org/wiki/index.php?title=Artwork + + + FreeCAD + + + FreeCAD/src/Mod/PartDesign/Gui/Resources/icons/PartDesign_Hole.svg + + + FreeCAD LGPL2+ + + + https://www.gnu.org/copyleft/lesser.html + + + [agryson] Alexander Gryson + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/workbenches/modeler/features/hole_tool/index.ts b/modules/workbenches/modeler/features/hole_tool/index.ts index 6c995352..75c3f9de 100644 --- a/modules/workbenches/modeler/features/hole_tool/index.ts +++ b/modules/workbenches/modeler/features/hole_tool/index.ts @@ -7,19 +7,31 @@ import icon from './icon.svg'; export default { id: 'hole_tool', label: 'hole_tool', - icon, + icon: { + iconType: 'svg', + iconContent: icon + }, info: 'hole_tool', mutualExclusiveFields: [], paramsInfo: ({ diameter, depth, counterBoreDiameter, counterBoreDepth, countersinkDiameter, countersinkAngle, holeType, }) => `(${r(depth)} ${r(counterBoreDiameter)}) ${r(counterBoreDepth)})`, schema: { holeType: { - type: 'TextField', + type: 'enum', defaultValue: "counterbore", label: 'HoleType', - children: [ - "counterbore", - "countersink", - "normal", + options: [ + { + label: 'Counterbore', + value: 'counterbore' + }, + { + label: 'Countersink', + value: 'countersink' + }, + { + label: 'Normal', + value: 'normal' + }, ], }, @@ -82,6 +94,8 @@ export default { let myBody = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, diameter / 2, depth,); + alert(JSON.stringify(holeType)); + if (holeType.toUpperCase() == "COUNTERBORE") { let counterboreItem = new oc.BRepPrimAPI_MakeCylinder_3(cylinderOrientationAndLocation, counterBoreDiameter, counterBoreDepth,); diff --git a/modules/workbenches/modeler/features/primitive_box/icon.svg b/modules/workbenches/modeler/features/primitive_box/icon.svg deleted file mode 100644 index 78b99920..00000000 --- a/modules/workbenches/modeler/features/primitive_box/icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/workbenches/modeler/features/primitive_box/index.ts b/modules/workbenches/modeler/features/primitive_box/index.ts index c2a01dcd..5f670c9e 100644 --- a/modules/workbenches/modeler/features/primitive_box/index.ts +++ b/modules/workbenches/modeler/features/primitive_box/index.ts @@ -2,12 +2,24 @@ import { ApplicationContext } from 'context'; import { MBrepShell } from 'cad/model/mshell'; import { roundValueForPresentation as r } from 'cad/craft/operationHelper'; import { occ2brep } from 'cad/occ/occ2models'; -import icon from './icon.svg'; +import icon32 from './icon32.png'; +import icon96 from './icon96.png'; export default { id: 'primitive_box', label: 'primitive_box', - icon, + icon: { + iconSet: { + medium: { + iconType: 'image', + iconContent: icon32 + }, + large: { + iconType: 'image', + iconContent: icon96 + } + }, + }, info: 'primitive_box', mutualExclusiveFields: [], paramsInfo: ({ boxX, boxY, boxZ }) => `(${r(boxX)} ${r(boxY)}) ${r(boxZ)})`, diff --git a/modules/workbenches/modeler/features/primitive_cone/icon.svg b/modules/workbenches/modeler/features/primitive_cone/icon.svg deleted file mode 100644 index 78b99920..00000000 --- a/modules/workbenches/modeler/features/primitive_cone/icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/workbenches/modeler/features/primitive_cylinder/icon.svg b/modules/workbenches/modeler/features/primitive_cylinder/icon.svg deleted file mode 100644 index 78b99920..00000000 --- a/modules/workbenches/modeler/features/primitive_cylinder/icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/workbenches/modeler/features/primitive_cylinder/index.ts b/modules/workbenches/modeler/features/primitive_cylinder/index.ts index e91375c5..368b273a 100644 --- a/modules/workbenches/modeler/features/primitive_cylinder/index.ts +++ b/modules/workbenches/modeler/features/primitive_cylinder/index.ts @@ -2,12 +2,24 @@ import { ApplicationContext } from 'context'; import { MBrepShell } from 'cad/model/mshell'; import { roundValueForPresentation as r } from 'cad/craft/operationHelper'; import { occ2brep } from 'cad/occ/occ2models'; -import icon from './icon.svg'; +import icon32 from './icon32.png'; +import icon96 from './icon96.png'; export default { id: 'primitive_cylinder', label: 'primitive_cylinder', - icon, + icon: { + iconSet: { + medium: { + iconType: 'image', + iconContent: icon32 + }, + large: { + iconType: 'image', + iconContent: icon96 + } + }, + }, info: 'primitive_cylinder', mutualExclusiveFields: [], paramsInfo: ({ diameter, height }) => `(${r(diameter)} ${r(height)})`, diff --git a/modules/workbenches/modeler/features/primitive_sphere/icon.svg b/modules/workbenches/modeler/features/primitive_sphere/icon.svg deleted file mode 100644 index 78b99920..00000000 --- a/modules/workbenches/modeler/features/primitive_sphere/icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/workbenches/modeler/features/primitive_sphere/index.ts b/modules/workbenches/modeler/features/primitive_sphere/index.ts index 38c88c47..6d4b8098 100644 --- a/modules/workbenches/modeler/features/primitive_sphere/index.ts +++ b/modules/workbenches/modeler/features/primitive_sphere/index.ts @@ -2,12 +2,24 @@ import { ApplicationContext } from 'context'; import { MBrepShell } from 'cad/model/mshell'; import { roundValueForPresentation as r } from 'cad/craft/operationHelper'; import { occ2brep } from 'cad/occ/occ2models'; -import icon from './icon.svg'; +import icon32 from './icon32.png'; +import icon96 from './icon96.png'; export default { id: 'primitive_sphere', label: 'primitive_sphere', - icon, + icon: { + iconSet: { + medium: { + iconType: 'image', + iconContent: icon32 + }, + large: { + iconType: 'image', + iconContent: icon96 + } + }, + }, info: 'primitive_sphere', mutualExclusiveFields: [], paramsInfo: ({ diameter }) => `(${r(diameter)} )`, diff --git a/modules/workbenches/modeler/features/primitive_torus/icon.svg b/modules/workbenches/modeler/features/primitive_torus/icon.svg deleted file mode 100644 index 78b99920..00000000 --- a/modules/workbenches/modeler/features/primitive_torus/icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/modules/workbenches/modeler/features/primitive_torus/icon32.png b/modules/workbenches/modeler/features/primitive_torus/icon32.png new file mode 100644 index 0000000000000000000000000000000000000000..8c7438e05ef0f4a37a7d30b07782320971544c22 GIT binary patch literal 1224 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC}>mS z8d2hwnUl((A6lGRRIFc?T9jB^l3%8uo>`)wRh*q#lAMuRqzB|>lqTutW)>&wr&g2{ zm8PWXCFP{%rQ}}TWC1is0%VR$Vo554k%6J5zJZaxk&%Ldft9hjm7#f(;mInX8Uc`+ zkj&gv2A~888Cw||)up_=4wT~nyQ3%(C~0Bx;o5ePnYRz&y^8fq}W-)5S3)g7fW^^WGtWBFEp) zHs3Gv{Np#}c4xufpdQU!33*Y9^d7$;sf`DLc!Q80| zE%vir1)uiJmI!vAEpK&hz4`gu-=j{Qd7yDiEkkckW%;}6=X2iwy;H2GxO1ZN1mzF= zg&&+_Y#k&KJdi&B{P%TBmmaO1wO|cX zTYLN3)YR0sOP4P7b#-;U-s84-)?0Q%hfM}-Q(lu*Qcc&YgfK)F#9aa zkI2~qWjzYzs>Tjdj4IrZ?rFtdHCUX4^HGI@jeJyQxTce^jLYpkFPF_aqGYDJ)0Koc*$E~LW@FEgXauR*^3HD22 z8T4<-*2Gg*lCrXUJMPssP1}>bG2+aQ2{&FJmj1BAyYuLwzX~TO%y=O7<&avy4d%IX z=dND4G5C2Tt4!UK606)7ufs&bl(lxrB=y*w7eDco>+1Z|?kQ3RxL#67?&|(-+4oAB9Grh6x>J5U`S*WjS7{0pB!xu3z))z4*}Q$iB} `(${r(radius)} ${r(tubeRadius)} )`,