Skip to content

Commit

Permalink
Improved Rendering tab.
Browse files Browse the repository at this point in the history
  • Loading branch information
andeplane committed Jul 29, 2017
1 parent 075d22e commit 93154f5
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 86 deletions.
3 changes: 0 additions & 3 deletions src/LammpsWrappers/modifiers/periodicimages.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class PeriodicImages : public Modifier

public:
PeriodicImages();

// Modifier interface
public:
virtual void apply(class AtomData &atomData) override;
int numberOfCopiesX() const;
int numberOfCopiesY() const;
Expand Down
89 changes: 89 additions & 0 deletions src/qml/desktop/RightBar/PeriodicImagesControl.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import QtQuick 2.7
import QtQuick.Controls 2.1
import QtQuick.Controls 1.5 as QQC1
import QtQuick.Dialogs 1.2
import Atomify 1.0
import Qt.labs.settings 1.0
import "../../visualization"

GroupBox {
id: periodicImagesRoot
property PeriodicImages periodicImages
height: periodicImages.enabled ? undefined : label.height
label: CheckBox {
id: checkBox
checked: false
onCheckedChanged: periodicImages.enabled = checked
text: qsTr("Periodic images")
}
Column {
width: parent.width
visible: periodicImagesRoot.periodicImages.enabled
spacing: 10
Row {
width: parent.width
height: periodicXSlider.height
Label {
width: parent.width*0.4
text: "X: "+periodicXSlider.value
}
QQC1.Slider {
id: periodicXSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: periodicImages.numberOfCopiesX
Binding {
target: periodicImages
property: "numberOfCopiesX"
value: periodicXSlider.value
}
}
}

Row {
width: parent.width
height: periodicYSlider.height
Label {
width: parent.width*0.4
text: "Y: "+periodicYSlider.value
}
QQC1.Slider {
id: periodicYSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: periodicImages.numberOfCopiesY
Binding {
target: visualizer.periodicImages
property: "numberOfCopiesY"
value: periodicYSlider.value
}
}
}

Row {
width: parent.width
height: periodicZSlider.height
Label {
width: parent.width*0.4
text: "Z: "+periodicZSlider.value
}
QQC1.Slider {
id: periodicZSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: periodicImages.numberOfCopiesZ
Binding {
target: visualizer.periodicImages
property: "numberOfCopiesZ"
value: periodicZSlider.value
}
}
}
}
}
90 changes: 11 additions & 79 deletions src/qml/desktop/RightBar/Rendering.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,19 @@ Pane {
right: parent.right
margins: 10
}

spacing: 10

SliceControl {
id: sliceControl
width: parent.width
slice: visualizer.sliceModifier
}
PeriodicImagesControl {
id: periodicCopiesControl
width: parent.width
periodicImages: visualizer.periodicImages
}

GroupBox {
anchors {
left: parent.left
Expand Down Expand Up @@ -77,84 +87,6 @@ Pane {
}
}

SliceControl {
id: sliceControl
width: parent.width
slice: visualizer.sliceModifier
}
GroupBox {
width: parent.width
title: "Periodic images"
Column {
width: parent.width
Row {
width: parent.width
height: periodicXSlider.height
Label {
width: parent.width*0.4
text: "X: "+periodicXSlider.value
}
QQC1.Slider {
id: periodicXSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: visualizer.periodicImages.numberOfCopiesX
Binding {
target: visualizer.periodicImages
property: "numberOfCopiesX"
value: periodicXSlider.value
}
}
}

Row {
width: parent.width
height: periodicYSlider.height
Label {
width: parent.width*0.4
text: "Y: "+periodicYSlider.value
}
QQC1.Slider {
id: periodicYSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: visualizer.periodicImages.numberOfCopiesY
Binding {
target: visualizer.periodicImages
property: "numberOfCopiesY"
value: periodicYSlider.value
}
}
}

Row {
width: parent.width
height: periodicZSlider.height
Label {
width: parent.width*0.4
text: "Z: "+periodicZSlider.value
}
QQC1.Slider {
id: periodicZSlider
width: parent.width*0.6
minimumValue: 1
maximumValue: 5.0
stepSize: 1
value: visualizer.periodicImages.numberOfCopiesZ
Binding {
target: visualizer.periodicImages
property: "numberOfCopiesZ"
value: periodicZSlider.value
}
}
}
}
}

GroupBox {
width: parent.width
title: "Rendering mode"
Expand Down
6 changes: 3 additions & 3 deletions src/qml/desktop/RightBar/SliceControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ GroupBox {
onCheckedChanged: slice.enabled = checked
text: qsTr("Slice")
}
ColumnLayout {
Column {
id: columnLayout
width: parent.width
visible: slice.enabled
visible: sliceRoot.slice.enabled
spacing: 10

Label {
Expand Down Expand Up @@ -94,7 +94,7 @@ GroupBox {
}

CheckBox {
text: "Reversed: "
text: "Reversed"
checked: slice.reversed
onCheckedChanged: slice.reversed = checked
}
Expand Down
1 change: 1 addition & 0 deletions src/qml/qml.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,6 @@
<file>events/EventMenuItem.qml</file>
<file>events/EventCatcher.qml</file>
<file>desktop/items/ScrollableNumberField.qml</file>
<file>desktop/RightBar/PeriodicImagesControl.qml</file>
</qresource>
</RCC>
1 change: 0 additions & 1 deletion src/qml/visualization/AtomifyVisualizer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ Scene3D {

PeriodicImages {
id: periodicImages
enabled: true
numberOfCopiesX: 1
numberOfCopiesY: 1
numberOfCopiesZ: 1
Expand Down

0 comments on commit 93154f5

Please sign in to comment.