-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmodeling.cpp
49 lines (37 loc) · 1.53 KB
/
modeling.cpp
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
#include "modeling.h"
ModelingWidget::ModelingWidget() : QWidget(){
mainLayout = new QHBoxLayout();
controlsLayout = new QVBoxLayout();
QHBoxLayout *buttonLayout = new QHBoxLayout();
QVBoxLayout *beatyButtonLayout = new QVBoxLayout();
buttonLayout->addStretch(1);
buttonLayout->addLayout(beatyButtonLayout);
buttonLayout->addStretch(1);
projectionWidget = new QLineEdit(tr("xyz"));
replotButton = new QPushButton(tr("Установить проекцию"));
okButton = new QPushButton(tr("OK"));
beatyButtonLayout->addWidget(replotButton);
beatyButtonLayout->addWidget(okButton);
plotWidget = new Jenia();
mainLayout->addWidget(plotWidget, 1);
mainLayout->addLayout(controlsLayout);
controlsLayout->addWidget(projectionWidget);
controlsLayout->addLayout(buttonLayout);
controlsLayout->addStretch(1);
setLayout(mainLayout);
connect(okButton, SIGNAL(clicked()), this, SLOT(hide()));
connect(replotButton, SIGNAL(clicked()), this, SLOT(changeProjection()));
setWindowTitle(tr("Моделирование трактории движения"));
}
void ModelingWidget::plotLine(lines_t* line) {
this->line = line;
changeProjection();
}
void ModelingWidget::changeProjection() {
track = new Track(line, projectionWidget->text(), *plotWidget);
track->setMesh(100, 3);
track->setDomain(0.0, line->size() - 1, 0.0, 1.0);
track->create();
plotWidget->updateProjection(track->getX1(), track->getY1(), track->getZ1());
plotWidget->updateLine();
}