mirror of
https://github.com/ConjureETS/LOG750-LAB2.git
synced 2026-03-24 03:21:19 +00:00
Animation Controls
This commit is contained in:
parent
1a04dd8db3
commit
dfaf752d73
@ -30,7 +30,7 @@
|
|||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="1">
|
||||||
<widget class="QFrame" name="frame">
|
<widget class="QFrame" name="frame">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||||
@ -56,9 +56,10 @@
|
|||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Raised</enum>
|
||||||
</property>
|
</property>
|
||||||
|
<zorder>speedSlider</zorder>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="4">
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<property name="horizontalSpacing">
|
<property name="horizontalSpacing">
|
||||||
<number>6</number>
|
<number>6</number>
|
||||||
@ -212,6 +213,45 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSlider" name="speedSlider">
|
||||||
|
<property name="minimum">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>100</number>
|
||||||
|
</property>
|
||||||
|
<property name="singleStep">
|
||||||
|
<number>1</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="tickPosition">
|
||||||
|
<enum>QSlider::TicksBelow</enum>
|
||||||
|
</property>
|
||||||
|
<property name="tickInterval">
|
||||||
|
<number>10</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="4">
|
||||||
|
<widget class="QPushButton" name="play_button">
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string> ⏯</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenuBar" name="menuBar">
|
<widget class="QMenuBar" name="menuBar">
|
||||||
|
|||||||
@ -888,10 +888,6 @@ void Viewer::animate(){
|
|||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Viewer::startAniumation(){}
|
|
||||||
|
|
||||||
void Viewer::stopAnimation(){}
|
|
||||||
|
|
||||||
void Viewer::rotateSelectedObjXCCW() {
|
void Viewer::rotateSelectedObjXCCW() {
|
||||||
rotateSelected(RotateDirection::X_CCW);
|
rotateSelected(RotateDirection::X_CCW);
|
||||||
}
|
}
|
||||||
@ -911,6 +907,10 @@ void Viewer::rotateSelectedObjZCW() {
|
|||||||
rotateSelected(RotateDirection::Z_CW);
|
rotateSelected(RotateDirection::Z_CW);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Viewer::animationSpeedChange(int val) {
|
||||||
|
frame_mult = fmax(double(val) / 10, 0.05);
|
||||||
|
}
|
||||||
|
|
||||||
void Viewer::rotateSelected(RotateDirection dir) {
|
void Viewer::rotateSelected(RotateDirection dir) {
|
||||||
if(selectedObj.shape == nullptr || selectedObj.shape->getParent() == nullptr) return;
|
if(selectedObj.shape == nullptr || selectedObj.shape->getParent() == nullptr) return;
|
||||||
|
|
||||||
|
|||||||
@ -81,6 +81,7 @@ public slots:
|
|||||||
void rotateSelectedObjYCW();
|
void rotateSelectedObjYCW();
|
||||||
void rotateSelectedObjZCCW();
|
void rotateSelectedObjZCCW();
|
||||||
void rotateSelectedObjZCW();
|
void rotateSelectedObjZCW();
|
||||||
|
void animationSpeedChange(int);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
int shapeSelected(int);
|
int shapeSelected(int);
|
||||||
@ -107,8 +108,8 @@ private:
|
|||||||
PickedGeom pickGeom(int, int);
|
PickedGeom pickGeom(int, int);
|
||||||
|
|
||||||
void animate();
|
void animate();
|
||||||
void startAniumation();
|
// void startAnimation();
|
||||||
void stopAnimation();
|
// void stopAnimation();
|
||||||
|
|
||||||
void drawUi();
|
void drawUi();
|
||||||
|
|
||||||
|
|||||||
@ -75,6 +75,10 @@ void MainWindow::addViewer(Viewer* viewer)
|
|||||||
connect(ui->cw_y, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjYCW()));
|
connect(ui->cw_y, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjYCW()));
|
||||||
connect(ui->ccw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCCW()));
|
connect(ui->ccw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCCW()));
|
||||||
connect(ui->cw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCW()));
|
connect(ui->cw_z, SIGNAL(clicked(bool)), viewer, SLOT(rotateSelectedObjZCW()));
|
||||||
|
|
||||||
|
connect(ui->speedSlider, SIGNAL(valueChanged(int)), viewer, SLOT(animationSpeedChange(int)));
|
||||||
|
connect(ui->play_button, SIGNAL(clicked(bool)), viewer, SLOT(toggleAnimation()));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onColorPickerActivate(){
|
void MainWindow::onColorPickerActivate(){
|
||||||
|
|||||||
@ -23,6 +23,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onColorPickerActivate();
|
void onColorPickerActivate();
|
||||||
|
// void onToggleAnimationText();
|
||||||
//void onTextureToggle();
|
//void onTextureToggle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user