Pfandanzeige
git-svn-id: http://svn.lsim.tuxzone.org/trunk@12 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
#include <QGraphicsRectItem>
|
||||
#include <QKeyEvent>
|
||||
#include <QGraphicsItemGroup>
|
||||
|
||||
#include <QPainterPath>
|
||||
#include <QGraphicsPathItem>
|
||||
|
||||
|
||||
SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) {
|
||||
@@ -49,6 +50,10 @@ SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) {
|
||||
currHomoBfieldEditItem = 0;
|
||||
|
||||
createResizeRects();
|
||||
|
||||
//path Item Erstellen
|
||||
pathItem1 = addPath(QPainterPath());
|
||||
|
||||
|
||||
addLine(0,-298,0,298,QPen(Qt::green, 1, Qt::SolidLine) )->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
addLine(-398,0,398,0,QPen(Qt::green, 1, Qt::SolidLine) )->setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
@@ -90,15 +95,15 @@ SimulScene::SimulScene ( QObject* parent ) : QGraphicsScene ( parent ) {
|
||||
ani->setItem(ellipse1);
|
||||
ani->setTimeLine(timer);
|
||||
|
||||
|
||||
}
|
||||
|
||||
void SimulScene::startTimer() {
|
||||
timer->setCurrentTime(0);
|
||||
ani->clear();
|
||||
for (int i=0; i<getSteps(); ++i) {
|
||||
int currSteps = ellipse1->getCurrProbePath()->count();
|
||||
for (int i=0; i<currSteps; ++i) {
|
||||
//ani->setPosAt(i/200.0, QPointF(x , 0.5 * ay * pow(( (x/1000) /vx),2) *1000 ));
|
||||
ani->setPosAt(i/(double)getSteps(), ellipse1->getCurrProbePath()->at(i) );
|
||||
ani->setPosAt(i/(double)currSteps, ellipse1->getCurrProbePath()->at(i) );
|
||||
//qDebug()<< getSteps();
|
||||
}
|
||||
timer->start();
|
||||
@@ -582,7 +587,8 @@ void SimulScene::setTimePerStep(double time) {
|
||||
\fn SimulScene::startCalculation()
|
||||
*/
|
||||
void SimulScene::startCalculation() {
|
||||
ellipse1->calculateProbePath(ellipse1->pos());
|
||||
ellipse1->calculateProbePath(ellipse1->pos());
|
||||
pathItem1->setPath(ellipse1->getFlightPath());
|
||||
}
|
||||
|
||||
|
||||
@@ -667,3 +673,8 @@ void SimulScene::setMeterPerPx ( double theValue ) {
|
||||
QWidget* SimulScene::getProbeDockWidget() const {
|
||||
return ellipse1->getDockWidget();
|
||||
}
|
||||
|
||||
void SimulScene::setFlightPathVisible(bool visible) {
|
||||
pathItem1->setVisible(visible);
|
||||
emit flightPathVisibilityChanged(visible);
|
||||
}
|
||||
Reference in New Issue
Block a user