-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChestModel.qml
91 lines (77 loc) · 2.89 KB
/
ChestModel.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
import QtQuick 2.6
import Qt3D.Core 2.0
import Qt3D.Render 2.0
import Qt3D.Input 2.0
import Qt3D.Extras 2.0
import PectusProcessor 1.1
Entity {
id: root
property string scanSource
property color modelColor
property Camera mainCamera
RenderSettings {
id: renderSettings
activeFrameGraph: ForwardRenderer {
id: renderer
camera: root.mainCamera
}
pickingSettings.pickMethod: PickingSettings.TrianglePicking
pickingSettings.faceOrientationPickingMode: PickingSettings.FrontAndBackFace
}
InputSettings {
id: inputSettings
}
components: [renderSettings, inputSettings]
Entity {
id: chestObject
property Material material: PhongMaterial {
ambient: root.modelColor
diffuse: Qt.rgba( 0.6, 0.6, 0.6, 1.0 )
}
ObjectPicker {
id: chestPicker
onPressed: {
if(boundsModeButton.checked){
if(myProcessor.getFirstClickPressed()){
myProcessor.setFirstClickPressed(false)
myProcessor.selectBounds(pick.localIntersection.y)
myProcessor.setLastOperation(PectusProcessor.BoundsMode)
if (myProcessor.runAllIndexes){
myProcessor.calculateHallerIndex();
myProcessor.asymmetricIndex();
myProcessor.volumeDefectIndex();
}
}
else{
myProcessor.setFirstClickLocation(pick.localIntersection.y)
myProcessor.setFirstClickPressed(true)
}
}
else{
myProcessor.calculateIntersection(pick.localIntersection.y)
myProcessor.drawLineSegments()
myProcessor.setLastOperation(PectusProcessor.SliceMode)
if (myProcessor.runAllIndexes){
myProcessor.calculateHallerIndex();
myProcessor.asymmetricIndex();
myProcessor.volumeDefectIndex();
}
}
}
}
Transform {
id: chestTransform
rotation: fromEulerAngles( viewerContainer.yRot,
viewerContainer.xRot,
0 )
translation: Qt.vector3d( -1 *(viewerContainer.xCamera / 100),
viewerContainer.yCamera / 100,
0)
}
components: [ mesh, chestObject.material, chestTransform, chestPicker]
Mesh {
id: mesh
source: root.scanSource
}
}
}