Bars3DSpecifics.qml 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387
  1. // Copyright (C) 2016 The Qt Company Ltd.
  2. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
  3. import QtQuick 2.0
  4. import HelperWidgets 2.0
  5. import QtQuick.Layouts 1.0
  6. import QtQuick.Controls 1.1 as Controls
  7. Column {
  8. anchors.left: parent.left
  9. anchors.right: parent.right
  10. Section {
  11. anchors.left: parent.left
  12. anchors.right: parent.right
  13. caption: qsTr("Bars3D")
  14. SectionLayout {
  15. Label {
  16. text: qsTr("multiSeriesUniform")
  17. tooltip: qsTr("Multiseries Uniform")
  18. Layout.fillWidth: true
  19. }
  20. SecondColumnLayout {
  21. CheckBox {
  22. backendValue: backendValues.multiSeriesUniform
  23. Layout.fillWidth: true
  24. }
  25. }
  26. Label {
  27. text: qsTr("barThickness")
  28. tooltip: qsTr("Bar Thickness Ratio")
  29. Layout.fillWidth: true
  30. }
  31. SecondColumnLayout {
  32. SpinBox {
  33. backendValue: backendValues.barThickness
  34. minimumValue: 0.01
  35. maximumValue: 100.0
  36. stepSize: 0.01
  37. decimals: 2
  38. Layout.fillWidth: true
  39. }
  40. }
  41. Label {
  42. text: qsTr("barSpacing")
  43. tooltip: qsTr("Bar Spacing")
  44. Layout.fillWidth: true
  45. }
  46. SecondColumnLayout {
  47. SpinBox {
  48. prefix: "col: "
  49. backendValue: backendValues.barSpacing_width
  50. minimumValue: 0.0
  51. maximumValue: 10.0
  52. stepSize: 0.01
  53. decimals: 2
  54. Layout.fillWidth: true
  55. }
  56. SpinBox {
  57. prefix: "row: "
  58. backendValue: backendValues.barSpacing_height
  59. minimumValue: 0.0
  60. maximumValue: 10.0
  61. stepSize: 0.01
  62. decimals: 2
  63. Layout.fillWidth: true
  64. }
  65. }
  66. Label {
  67. text: qsTr("barSpacingRelative")
  68. tooltip: qsTr("Bar Spacing Relative")
  69. Layout.fillWidth: true
  70. }
  71. SecondColumnLayout {
  72. CheckBox {
  73. backendValue: backendValues.barSpacingRelative
  74. Layout.fillWidth: true
  75. }
  76. }
  77. Label {
  78. text: qsTr("renderingMode")
  79. tooltip: qsTr("Rendering Mode")
  80. Layout.fillWidth: true
  81. }
  82. SecondColumnLayout {
  83. ComboBox {
  84. backendValue: backendValues.renderingMode
  85. model: ["RenderIndirect", "RenderDirectToBackground",
  86. "RenderDirectToBackground_NoClear"]
  87. Layout.fillWidth: true
  88. scope: "AbstractGraph3D"
  89. }
  90. }
  91. Label {
  92. text: qsTr("msaaSamples")
  93. tooltip: qsTr("MSAA Sample Count")
  94. Layout.fillWidth: true
  95. }
  96. SpinBox {
  97. suffix: " x MSAA"
  98. backendValue: backendValues.msaaSamples
  99. minimumValue: 0
  100. maximumValue: 16
  101. Layout.fillWidth: true
  102. }
  103. Label {
  104. text: qsTr("shadowQuality")
  105. tooltip: qsTr("Shadow Quality")
  106. Layout.fillWidth: true
  107. }
  108. SecondColumnLayout {
  109. ComboBox {
  110. backendValue: backendValues.shadowQuality
  111. model: ["ShadowQualityNone", "ShadowQualityLow", "ShadowQualityMedium",
  112. "ShadowQualityHigh", "ShadowQualitySoftLow", "ShadowQualitySoftMedium",
  113. "ShadowQualitySoftHigh"]
  114. Layout.fillWidth: true
  115. scope: "AbstractGraph3D"
  116. }
  117. }
  118. Label {
  119. text: qsTr("selectionMode")
  120. tooltip: qsTr("Selection Mode")
  121. Layout.fillWidth: true
  122. }
  123. SecondColumnLayout {
  124. id: selectionLayout
  125. property bool isInModel: backendValue.isInModel;
  126. property bool isInSubState: backendValue.isInSubState;
  127. property bool selectionChangedFlag: selectionChanged
  128. property variant backendValue: backendValues.selectionMode
  129. property variant valueFromBackend: backendValue.value
  130. property string enumScope: "AbstractGraph3D"
  131. property string enumSeparator: " | "
  132. property int checkedCount: 0
  133. property bool selectionItem: false
  134. property bool selectionRow: false
  135. property bool selectionColumn: false
  136. property bool selectionSlice: false
  137. property bool selectionMulti: false
  138. function checkValue(checkedVariable, variableText, expressionBase) {
  139. var expressionStr = expressionBase
  140. if (checkedVariable) {
  141. if (expressionStr !== "") {
  142. expressionStr += enumSeparator
  143. }
  144. expressionStr += enumScope
  145. expressionStr += "."
  146. expressionStr += variableText
  147. checkedCount++
  148. }
  149. return expressionStr
  150. }
  151. function composeSelectionMode() {
  152. var expressionStr = ""
  153. checkedCount = 0
  154. expressionStr = checkValue(selectionItem, "SelectionItem", expressionStr)
  155. expressionStr = checkValue(selectionRow, "SelectionRow", expressionStr)
  156. expressionStr = checkValue(selectionColumn, "SelectionColumn", expressionStr)
  157. expressionStr = checkValue(selectionSlice, "SelectionSlice", expressionStr)
  158. expressionStr = checkValue(selectionMulti, "SelectionMultiSeries", expressionStr)
  159. if (checkedCount === 0)
  160. backendValue.expression = enumScope + ".SelectionNone"
  161. else
  162. backendValue.expression = expressionStr
  163. }
  164. function evaluate() {
  165. if (backendValue.value === undefined)
  166. return
  167. selectionItem = (backendValue.expression.indexOf("SelectionItem") !== -1)
  168. selectionRow = (backendValue.expression.indexOf("SelectionRow") !== -1)
  169. selectionColumn = (backendValue.expression.indexOf("SelectionColumn") !== -1)
  170. selectionSlice = (backendValue.expression.indexOf("SelectionSlice") !== -1)
  171. selectionMulti = (backendValue.expression.indexOf("SelectionMultiSeries") !== -1)
  172. selectionItemBox.checked = selectionItem
  173. selectionRowBox.checked = selectionRow
  174. selectionColumnBox.checked = selectionColumn
  175. selectionSliceBox.checked = selectionSlice
  176. selectionMultiSeriesBox.checked = selectionMulti
  177. }
  178. onSelectionChangedFlagChanged: evaluate()
  179. onIsInModelChanged: evaluate()
  180. onIsInSubStateChanged: evaluate()
  181. onBackendValueChanged: evaluate()
  182. onValueFromBackendChanged: evaluate()
  183. ColumnLayout {
  184. anchors.fill: parent
  185. Controls.CheckBox {
  186. id: selectionItemBox
  187. style: checkBox.style
  188. text: "SelectionItem"
  189. Layout.fillWidth: true
  190. onClicked: {
  191. selectionLayout.selectionItem = checked
  192. selectionLayout.composeSelectionMode()
  193. }
  194. }
  195. Controls.CheckBox {
  196. id: selectionRowBox
  197. style: checkBox.style
  198. text: "SelectionRow"
  199. Layout.fillWidth: true
  200. onClicked: {
  201. selectionLayout.selectionRow = checked
  202. selectionLayout.composeSelectionMode()
  203. }
  204. }
  205. Controls.CheckBox {
  206. id: selectionColumnBox
  207. style: checkBox.style
  208. text: "SelectionColumn"
  209. Layout.fillWidth: true
  210. onClicked: {
  211. selectionLayout.selectionColumn = checked
  212. selectionLayout.composeSelectionMode()
  213. }
  214. }
  215. Controls.CheckBox {
  216. id: selectionSliceBox
  217. style: checkBox.style
  218. text: "SelectionSlice"
  219. Layout.fillWidth: true
  220. onClicked: {
  221. selectionLayout.selectionSlice = checked
  222. selectionLayout.composeSelectionMode()
  223. }
  224. }
  225. Controls.CheckBox {
  226. id: selectionMultiSeriesBox
  227. style: checkBox.style
  228. text: "SelectionMultiSeries"
  229. Layout.fillWidth: true
  230. onClicked: {
  231. selectionLayout.selectionMulti = checked
  232. selectionLayout.composeSelectionMode()
  233. }
  234. }
  235. }
  236. }
  237. Label {
  238. text: qsTr("measureFps")
  239. tooltip: qsTr("Measure Frames Per Second")
  240. Layout.fillWidth: true
  241. }
  242. SecondColumnLayout {
  243. CheckBox {
  244. backendValue: backendValues.measureFps
  245. Layout.fillWidth: true
  246. }
  247. }
  248. Label {
  249. text: qsTr("orthoProjection")
  250. tooltip: qsTr("Use Orthographic Projection")
  251. Layout.fillWidth: true
  252. }
  253. SecondColumnLayout {
  254. CheckBox {
  255. backendValue: backendValues.orthoProjection
  256. Layout.fillWidth: true
  257. }
  258. }
  259. Label {
  260. text: qsTr("aspectRatio")
  261. tooltip: qsTr("Aspect Ratio")
  262. Layout.fillWidth: true
  263. }
  264. SecondColumnLayout {
  265. SpinBox {
  266. backendValue: backendValues.aspectRatio
  267. minimumValue: 0.01
  268. maximumValue: 100.0
  269. stepSize: 0.01
  270. decimals: 2
  271. Layout.fillWidth: true
  272. }
  273. }
  274. Label {
  275. text: qsTr("floorLevel")
  276. tooltip: qsTr("Floor Level")
  277. Layout.fillWidth: true
  278. }
  279. SecondColumnLayout {
  280. LineEdit {
  281. backendValue: backendValues.floorLevel
  282. inputMethodHints: Qt.ImhFormattedNumbersOnly
  283. Layout.fillWidth: true
  284. }
  285. }
  286. Label {
  287. text: qsTr("horizontalAspectRatio")
  288. tooltip: qsTr("Horizontal Aspect Ratio")
  289. Layout.fillWidth: true
  290. }
  291. SecondColumnLayout {
  292. SpinBox {
  293. backendValue: backendValues.horizontalAspectRatio
  294. minimumValue: 0.0
  295. maximumValue: 100.0
  296. stepSize: 0.01
  297. decimals: 2
  298. Layout.fillWidth: true
  299. }
  300. }
  301. Label {
  302. text: qsTr("reflection")
  303. tooltip: qsTr("Reflection")
  304. Layout.fillWidth: true
  305. }
  306. SecondColumnLayout {
  307. CheckBox {
  308. id: reflectionCheckbox
  309. backendValue: backendValues.reflection
  310. Layout.fillWidth: true
  311. }
  312. }
  313. Label {
  314. text: qsTr("reflectivity")
  315. tooltip: qsTr("Reflectivity")
  316. Layout.fillWidth: true
  317. visible: reflectionCheckbox.checked
  318. }
  319. SecondColumnLayout {
  320. visible: reflectionCheckbox.checked
  321. SpinBox {
  322. backendValue: backendValues.reflectivity
  323. minimumValue: 0.0
  324. maximumValue: 1.0
  325. stepSize: 0.01
  326. decimals: 1
  327. Layout.fillWidth: true
  328. }
  329. }
  330. Label {
  331. text: qsTr("margin")
  332. tooltip: qsTr("Graph Margin")
  333. Layout.fillWidth: true
  334. }
  335. SecondColumnLayout {
  336. SpinBox {
  337. backendValue: backendValues.margin
  338. minimumValue: -1.0
  339. maximumValue: 100.0
  340. stepSize: 0.1
  341. decimals: 1
  342. Layout.fillWidth: true
  343. }
  344. }
  345. // Kept for debugging
  346. Label { }
  347. SecondColumnLayout {
  348. TextEdit {
  349. id: debugLabel
  350. Layout.fillWidth: true
  351. wrapMode: TextEdit.WordWrap
  352. textFormat: TextEdit.RichText
  353. width: 400
  354. visible: false
  355. }
  356. }
  357. Controls.CheckBox {
  358. property color textColor: colorLogic.textColor
  359. id: checkBox
  360. style: CustomCheckBoxStyle {}
  361. visible: false
  362. ColorLogic {
  363. id: colorLogic
  364. backendValue: backendValues.selectionMode
  365. }
  366. }
  367. }
  368. }
  369. }