Surface3DSpecifics.qml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  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("Surface3D")
  14. SectionLayout {
  15. Label {
  16. text: qsTr("renderingMode")
  17. tooltip: qsTr("Rendering Mode")
  18. Layout.fillWidth: true
  19. }
  20. SecondColumnLayout {
  21. ComboBox {
  22. backendValue: backendValues.renderingMode
  23. model: ["RenderIndirect", "RenderDirectToBackground",
  24. "RenderDirectToBackground_NoClear"]
  25. Layout.fillWidth: true
  26. scope: "AbstractGraph3D"
  27. }
  28. }
  29. Label {
  30. text: qsTr("msaaSamples")
  31. tooltip: qsTr("MSAA Sample Count")
  32. Layout.fillWidth: true
  33. }
  34. SpinBox {
  35. suffix: " x MSAA"
  36. backendValue: backendValues.msaaSamples
  37. minimumValue: 0
  38. maximumValue: 16
  39. Layout.fillWidth: true
  40. }
  41. Label {
  42. text: qsTr("shadowQuality")
  43. tooltip: qsTr("Shadow Quality")
  44. Layout.fillWidth: true
  45. }
  46. SecondColumnLayout {
  47. ComboBox {
  48. backendValue: backendValues.shadowQuality
  49. model: ["ShadowQualityNone", "ShadowQualityLow", "ShadowQualityMedium",
  50. "ShadowQualityHigh", "ShadowQualitySoftLow", "ShadowQualitySoftMedium",
  51. "ShadowQualitySoftHigh"]
  52. Layout.fillWidth: true
  53. scope: "AbstractGraph3D"
  54. }
  55. }
  56. Label {
  57. text: qsTr("selectionMode")
  58. tooltip: qsTr("Selection Mode")
  59. Layout.fillWidth: true
  60. }
  61. SecondColumnLayout {
  62. id: selectionLayout
  63. property bool isInModel: backendValue.isInModel;
  64. property bool isInSubState: backendValue.isInSubState;
  65. property bool selectionChangedFlag: selectionChanged
  66. property variant backendValue: backendValues.selectionMode
  67. property variant valueFromBackend: backendValue.value
  68. property string enumScope: "AbstractGraph3D"
  69. property string enumSeparator: " | "
  70. property int checkedCount: 0
  71. property bool selectionItem: false
  72. property bool selectionRow: false
  73. property bool selectionColumn: false
  74. property bool selectionSlice: false
  75. property bool selectionMulti: false
  76. function checkValue(checkedVariable, variableText, expressionBase) {
  77. var expressionStr = expressionBase
  78. if (checkedVariable) {
  79. if (expressionStr !== "") {
  80. expressionStr += enumSeparator
  81. }
  82. expressionStr += enumScope
  83. expressionStr += "."
  84. expressionStr += variableText
  85. checkedCount++
  86. }
  87. return expressionStr
  88. }
  89. function composeSelectionMode() {
  90. var expressionStr = ""
  91. checkedCount = 0
  92. expressionStr = checkValue(selectionItem, "SelectionItem", expressionStr)
  93. expressionStr = checkValue(selectionRow, "SelectionRow", expressionStr)
  94. expressionStr = checkValue(selectionColumn, "SelectionColumn", expressionStr)
  95. expressionStr = checkValue(selectionSlice, "SelectionSlice", expressionStr)
  96. expressionStr = checkValue(selectionMulti, "SelectionMultiSeries", expressionStr)
  97. if (checkedCount === 0)
  98. backendValue.expression = enumScope + ".SelectionNone"
  99. else
  100. backendValue.expression = expressionStr
  101. }
  102. function evaluate() {
  103. if (backendValue.value === undefined)
  104. return
  105. selectionItem = (backendValue.expression.indexOf("SelectionItem") !== -1)
  106. selectionRow = (backendValue.expression.indexOf("SelectionRow") !== -1)
  107. selectionColumn = (backendValue.expression.indexOf("SelectionColumn") !== -1)
  108. selectionSlice = (backendValue.expression.indexOf("SelectionSlice") !== -1)
  109. selectionMulti = (backendValue.expression.indexOf("SelectionMultiSeries") !== -1)
  110. selectionItemBox.checked = selectionItem
  111. selectionRowBox.checked = selectionRow
  112. selectionColumnBox.checked = selectionColumn
  113. selectionSliceBox.checked = selectionSlice
  114. selectionMultiSeriesBox.checked = selectionMulti
  115. }
  116. onSelectionChangedFlagChanged: evaluate()
  117. onIsInModelChanged: evaluate()
  118. onIsInSubStateChanged: evaluate()
  119. onBackendValueChanged: evaluate()
  120. onValueFromBackendChanged: evaluate()
  121. ColumnLayout {
  122. anchors.fill: parent
  123. Controls.CheckBox {
  124. id: selectionItemBox
  125. style: checkBox.style
  126. text: "SelectionItem"
  127. Layout.fillWidth: true
  128. onClicked: {
  129. selectionLayout.selectionItem = checked
  130. selectionLayout.composeSelectionMode()
  131. }
  132. }
  133. Controls.CheckBox {
  134. id: selectionRowBox
  135. style: checkBox.style
  136. text: "SelectionRow"
  137. Layout.fillWidth: true
  138. onClicked: {
  139. selectionLayout.selectionRow = checked
  140. selectionLayout.composeSelectionMode()
  141. }
  142. }
  143. Controls.CheckBox {
  144. id: selectionColumnBox
  145. style: checkBox.style
  146. text: "SelectionColumn"
  147. Layout.fillWidth: true
  148. onClicked: {
  149. selectionLayout.selectionColumn = checked
  150. selectionLayout.composeSelectionMode()
  151. }
  152. }
  153. Controls.CheckBox {
  154. id: selectionSliceBox
  155. style: checkBox.style
  156. text: "SelectionSlice"
  157. Layout.fillWidth: true
  158. onClicked: {
  159. selectionLayout.selectionSlice = checked
  160. selectionLayout.composeSelectionMode()
  161. }
  162. }
  163. Controls.CheckBox {
  164. id: selectionMultiSeriesBox
  165. style: checkBox.style
  166. text: "SelectionMultiSeries"
  167. Layout.fillWidth: true
  168. onClicked: {
  169. selectionLayout.selectionMulti = checked
  170. selectionLayout.composeSelectionMode()
  171. }
  172. }
  173. }
  174. }
  175. Label {
  176. text: qsTr("measureFps")
  177. tooltip: qsTr("Measure Frames Per Second")
  178. Layout.fillWidth: true
  179. }
  180. SecondColumnLayout {
  181. CheckBox {
  182. backendValue: backendValues.measureFps
  183. Layout.fillWidth: true
  184. }
  185. }
  186. Label {
  187. text: qsTr("orthoProjection")
  188. tooltip: qsTr("Use Orthographic Projection")
  189. Layout.fillWidth: true
  190. }
  191. SecondColumnLayout {
  192. CheckBox {
  193. backendValue: backendValues.orthoProjection
  194. Layout.fillWidth: true
  195. }
  196. }
  197. Label {
  198. text: qsTr("aspectRatio")
  199. tooltip: qsTr("Horizontal to Vertical Aspect Ratio")
  200. Layout.fillWidth: true
  201. }
  202. SecondColumnLayout {
  203. SpinBox {
  204. backendValue: backendValues.aspectRatio
  205. minimumValue: 0.1
  206. maximumValue: 10.0
  207. stepSize: 0.1
  208. decimals: 1
  209. Layout.fillWidth: true
  210. }
  211. }
  212. Label {
  213. text: qsTr("flipHorizontalGrid")
  214. tooltip: qsTr("Flip Horizontal Grid")
  215. Layout.fillWidth: true
  216. }
  217. SecondColumnLayout {
  218. CheckBox {
  219. backendValue: backendValues.flipHorizontalGrid
  220. Layout.fillWidth: true
  221. }
  222. }
  223. Label {
  224. text: qsTr("polar")
  225. tooltip: qsTr("Use Polar Coordinates")
  226. Layout.fillWidth: true
  227. }
  228. SecondColumnLayout {
  229. CheckBox {
  230. id: polarCheckbox
  231. backendValue: backendValues.polar
  232. Layout.fillWidth: true
  233. }
  234. }
  235. Label {
  236. text: qsTr("radialLabelOffset")
  237. tooltip: qsTr("Radial Label Offset")
  238. Layout.fillWidth: true
  239. visible: polarCheckbox.checked
  240. }
  241. SecondColumnLayout {
  242. visible: polarCheckbox.checked
  243. SpinBox {
  244. backendValue: backendValues.radialLabelOffset
  245. minimumValue: 0.0
  246. maximumValue: 1.0
  247. stepSize: 0.01
  248. decimals: 2
  249. Layout.fillWidth: true
  250. }
  251. }
  252. Label {
  253. text: qsTr("horizontalAspectRatio")
  254. tooltip: qsTr("Horizontal Aspect Ratio")
  255. Layout.fillWidth: true
  256. }
  257. SecondColumnLayout {
  258. SpinBox {
  259. backendValue: backendValues.horizontalAspectRatio
  260. minimumValue: 0.0
  261. maximumValue: 100.0
  262. stepSize: 0.01
  263. decimals: 2
  264. Layout.fillWidth: true
  265. }
  266. }
  267. Label {
  268. text: qsTr("margin")
  269. tooltip: qsTr("Graph Margin")
  270. Layout.fillWidth: true
  271. }
  272. SecondColumnLayout {
  273. SpinBox {
  274. backendValue: backendValues.margin
  275. minimumValue: -1.0
  276. maximumValue: 100.0
  277. stepSize: 0.1
  278. decimals: 1
  279. Layout.fillWidth: true
  280. }
  281. }
  282. // Kept for debugging
  283. Label { }
  284. SecondColumnLayout {
  285. TextEdit {
  286. id: debugLabel
  287. Layout.fillWidth: true
  288. wrapMode: TextEdit.WordWrap
  289. textFormat: TextEdit.RichText
  290. width: 400
  291. visible: false
  292. }
  293. }
  294. Controls.CheckBox {
  295. property color textColor: colorLogic.textColor
  296. id: checkBox
  297. style: CustomCheckBoxStyle {}
  298. visible: false
  299. ColorLogic {
  300. id: colorLogic
  301. backendValue: backendValues.selectionMode
  302. }
  303. }
  304. }
  305. }
  306. }