Skip to content

Commit

Permalink
Added UI for Projected Profile Directions
Browse files Browse the repository at this point in the history
  • Loading branch information
vpicaver committed Oct 21, 2020
1 parent bb6cddb commit 26b1b98
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
25 changes: 23 additions & 2 deletions qml/NoteTransformEditor.qml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,25 @@ is generally the best for <b>deep pits</b> where the profile is drawn on a singl
visible: upInputId.scrapType == Scrap.ProjectedProfile
LabelWithHelp {
id: azimuthLabelId
text: "Azimuth"
text: "Azimuth is"
helpArea: azimuthHelpAreaId
}

Controls.ComboBox {
id: directionComboBoxId
model: scrap.viewMatrix.directionTypes

Binding {
target: directionComboBoxId
property: "currentIndex"
value: scrap.viewMatrix.direction
}

onCurrentIndexChanged: {
scrap.viewMatrix.direction = currentIndex
}
}

ClickTextInput {
id: azimuthTextInputId
text: scrap.viewMatrix.azimuth
Expand All @@ -175,7 +190,13 @@ is generally the best for <b>deep pits</b> where the profile is drawn on a singl
HelpArea {
id: azimuthHelpAreaId
Layout.fillWidth: true
text: "Azimuth help"
text: "The projected profile azimuth direction. By default this uses <i>
looking at </i> which is as if you were looking through the page and is normal to the scrap plane.
Other options are parellel with the page:
<ul>
<li> <i>left → right </i> The azimuth going from the left side to the right side of the page</li>
<li> <i>left ← right </i> The azimuth going from the right side to the left side of the page</li>
</ul>"
}

ErrorHelpArea {
Expand Down
8 changes: 8 additions & 0 deletions src/cwProjectedProfileScrapViewMatrix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,11 @@ void cwProjectedProfileScrapViewMatrix::setDirection(cwProjectedProfileScrapView
emit matrixChanged();
}
}

QStringList cwProjectedProfileScrapViewMatrix::directionTypes() const {
return {
QString("looking at"),
QString("left → right"), //->
QString("left ← right") //<-
};
}
5 changes: 5 additions & 0 deletions src/cwProjectedProfileScrapViewMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class CAVEWHERE_LIB_EXPORT cwProjectedProfileScrapViewMatrix : public cwAbstract

Q_PROPERTY(double azimuth READ azimuth WRITE setAzimuth NOTIFY azimuthChanged)
Q_PROPERTY(AzimuthDirection direction READ direction WRITE setDirection NOTIFY directionChanged)
Q_PROPERTY(QStringList directionTypes READ directionTypes CONSTANT)

QStringList directionTypes() const;



public:
enum AzimuthDirection {
Expand Down

0 comments on commit 26b1b98

Please sign in to comment.