Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace pose for TransformControl with GzPose #1642

Open
wants to merge 7 commits into
base: ign-gazebo3
Choose a base branch
from
183 changes: 36 additions & 147 deletions src/gui/plugins/transform_control/TransformControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ ToolBar {
}

function updateSnapValues() {
xEntry.value = TransformControl.xSnap();
yEntry.value = TransformControl.ySnap();
zEntry.value = TransformControl.zSnap();
rollEntry.value = TransformControl.rollSnap();
pitchEntry.value = TransformControl.pitchSnap();
yawEntry.value = TransformControl.yawSnap();
gzPoseInstance.xValue = TransformControl.xSnap();
gzPoseInstance.yValue = TransformControl.ySnap();
gzPoseInstance.zValue = TransformControl.zSnap();
gzPoseInstance.rollValue = TransformControl.rollSnap();
gzPoseInstance.pitchValue = TransformControl.pitchSnap();
gzPoseInstance.yawValue = TransformControl.yawSnap();
// TODO(anyone) enable scale button when support is added in ign-physics
// xScaleEntry.value = TransformControl.xScaleSnap()
// yScaleEntry.value = TransformControl.yScaleSnap()
Expand Down Expand Up @@ -322,170 +322,59 @@ ToolBar {
parent: transformControl.Window.window ? transformControl.Window.window.contentItem : transformControl
x: (windowWidth() - width) / 2
y: (windowHeight() - height) / 2
width: 360
height: 250
width: 400
height: 290
modal: true
focus: true
title: "Snap values"
GridLayout {
columns: 6
columnSpacing: 30
columnSpacing: 100
Text {
text: "Translation (m)"
text: "Translation"
color: snapTitle
font.weight: Font.Bold
Layout.columnSpan: 2
Layout.row: 0
Layout.column: 0
bottomPadding: 10
}

Text {
text: "X"
color: snapItem
Layout.row: 1
Layout.column: 0
}
IgnSpinBox {
id: xEntry
minimumValue: 0.01
maximumValue: 100.0
decimals: 2
stepSize: 0.01
value: 1
Layout.row: 1
Layout.column: 1
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
}
}
Text {
text: "Y"
color: snapItem
Layout.row: 2
Layout.column: 0
}
IgnSpinBox {
id: yEntry
minimumValue: 0.01
maximumValue: 100.0
decimals: 2
stepSize: 0.01
value: 1
Layout.row: 2
Layout.column: 1
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
}
}
Text {
text: "Z"
color: snapItem
Layout.row: 3
Layout.column: 0
}
IgnSpinBox {
id: zEntry
minimumValue: 0.01
maximumValue: 100.0
decimals: 2
stepSize: 0.01
value: 1
Layout.row: 3
Layout.column: 1
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
}
}
Text {
text: "Rotation (deg)"
text: "Rotation"
font.weight: Font.Bold
color: snapTitle
Layout.columnSpan: 2
Layout.row: 0
Layout.column: 2
bottomPadding: 10
}
Text {
text: "Roll"
color: snapItem
Layout.row: 1
Layout.column: 2
}
IgnSpinBox {
id: rollEntry
minimumValue: 0.01
maximumValue: 180.0
decimals: 2
stepSize: 0.01
value: 45

GzPose {
id: gzPoseInstance
width: parent.width
Layout.columnSpan: 6
Layout.row: 1
Layout.column: 3
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
}
}
Text {
text: "Pitch"
color: snapItem
Layout.row: 2
Layout.column: 2
}
IgnSpinBox {
id: pitchEntry
minimumValue: 0.01
maximumValue: 180.0
decimals: 2
stepSize: 0.01
value: 45
Layout.row: 2
Layout.column: 3
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
}
}
Text {
text: "Yaw"
color: snapItem
Layout.row: 3
Layout.column: 2
}
IgnSpinBox {
id: yawEntry
minimumValue: 0.01
maximumValue: 180.0
decimals: 2
stepSize: 0.01
value: 45
Layout.row: 3
Layout.column: 3
onEditingFinished: {
TransformControl.OnSnapUpdate(
xEntry.value, yEntry.value, zEntry.value,
rollEntry.value, pitchEntry.value, yawEntry.value,
0, 0, 0
)
Layout.fillWidth: true
readOnly: false
spinMax: 180

xValue: 1.0
yValue: 1.0
zValue: 1.0
useRadian: false
rollValue: 45
pitchValue: 45
yawValue: 45
AzulRadio marked this conversation as resolved.
Show resolved Hide resolved

expand: true

onGzPoseSet: {
// _x, _y, _z, _roll, _pitch, _yaw are parameters of signal gzPoseSet
// from gz-gui GzPose.qml
TransformControl.OnSnapUpdate(_x, _y, _z,_roll, _pitch, _yaw, 0, 0, 0)
}
}
} // gzPoseInstance ends
}
}
}
Expand Down