viel zeugs usw.
git-svn-id: http://svn.lsim.tuxzone.org/trunk@11 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
@@ -33,9 +33,10 @@ GraphicsEllipseItem::GraphicsEllipseItem() {
|
||||
setFlag(ItemIsFocusable);
|
||||
//setCacheMode(QGraphicsItem::DeviceCoordinateCache);
|
||||
//startTimer(100);
|
||||
myProbeChargeWidget = new ProbeChargeWidget(0,0,this);
|
||||
setMasse(9.10938188e-31);
|
||||
setCharge(-1.6e-19);
|
||||
myProbeChargeWidget = new ProbeChargeWidget(0,0,this);
|
||||
|
||||
currProbePath = new QList<QPointF>;
|
||||
speedListX = new QList<double>;
|
||||
speedListY = new QList<double>;
|
||||
@@ -54,12 +55,23 @@ void GraphicsEllipseItem::mousePressEvent ( QGraphicsSceneMouseEvent *event ) {
|
||||
//QGraphicsEllipseItem::mousePressEvent(event);
|
||||
}
|
||||
|
||||
void GraphicsEllipseItem::handleSceneChange(const QList<QRectF> & /*region*/) {
|
||||
if (myScenePos != scenePos()) {
|
||||
myScenePos = scenePos();
|
||||
emit ScenePosChanged(myScenePos);
|
||||
emit ScenePosXChanged(myScenePos.x());
|
||||
emit ScenePosYChanged(myScenePos.y());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\fn GraphicsEllipseItem::calculateProbePath()
|
||||
*/
|
||||
void GraphicsEllipseItem::calculateProbePath(QPointF startPoint, double startSpeedX , double startSpeedY) {
|
||||
void GraphicsEllipseItem::calculateProbePath(QPointF startPoint) {
|
||||
double startSpeedX = getStartSpeedX();
|
||||
double startSpeedY = getStartSpeedY();
|
||||
SimulScene* myScene = dynamic_cast<SimulScene*>(scene());
|
||||
//wenn noch zu keiner scene gehoerend abbruch
|
||||
if (myScene == 0) return;
|
||||
@@ -137,7 +149,7 @@ double GraphicsEllipseItem::getCharge() const {
|
||||
}
|
||||
|
||||
|
||||
void GraphicsEllipseItem::setCharge ( const long double& theValue ) {
|
||||
void GraphicsEllipseItem::setCharge ( const double& theValue ) {
|
||||
if (charge == theValue) return;
|
||||
charge = theValue;
|
||||
emit chargeChanged(theValue);
|
||||
@@ -174,3 +186,21 @@ void GraphicsEllipseItem::setStartSpeedY ( double theValue ) {
|
||||
startSpeedY = theValue;
|
||||
emit startSpeedYChanged(theValue);
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\fn GraphicsEllipseItem::setScenePosY(double posY)
|
||||
*/
|
||||
void GraphicsEllipseItem::setScenePosY(double newPosY)
|
||||
{
|
||||
moveBy(0, newPosY - scenePos().y());
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\fn GraphicsEllipseItem::setScenePosX(double posX)
|
||||
*/
|
||||
void GraphicsEllipseItem::setScenePosX(double newPosX)
|
||||
{
|
||||
moveBy(newPosX - scenePos().x(),0 );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user