1. latex checkin, ein paar sachen

git-svn-id: http://svn.lsim.tuxzone.org/trunk@35 4bec179b-ab65-46ed-a5f8-55b8b5c735d0
This commit is contained in:
catdog2
2008-12-28 22:36:23 +00:00
parent 1219d2b9f0
commit 69fb43bb4f
11 changed files with 1251 additions and 174 deletions

Binary file not shown.

View File

@@ -1,12 +1,12 @@
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="8" >
<DocsAndViews NumberOfDocuments="19" >
<Doc0 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsellipseitem.cpp" >
<View0 Encoding="" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.cpp" >
<View0 Encoding="" line="818" Type="Source" />
<View0 Encoding="" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/main.cpp" >
<View0 Encoding="" Type="Source" />
@@ -24,8 +24,41 @@
<View0 Encoding="" Type="Source" />
</Doc6>
<Doc7 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/graphicsview.h" >
<View0 Encoding="" line="40" Type="Source" />
<View0 Encoding="" Type="Source" />
</Doc7>
<Doc8 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/simulscene.h" >
<View0 Encoding="" Type="Source" />
</Doc8>
<Doc9 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/fielditem.h" >
<View0 Encoding="" Type="Source" />
</Doc9>
<Doc10 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfielditem.h" >
<View0 Encoding="" Type="Source" />
</Doc10>
<Doc11 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homobfielditem.cpp" >
<View0 Encoding="" Type="Source" />
</Doc11>
<Doc12 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.h" >
<View0 Encoding="" Type="Source" />
</Doc12>
<Doc13 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/homoefielditem.cpp" >
<View0 Encoding="" Type="Source" />
</Doc13>
<Doc14 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/stopperitem.h" >
<View0 Encoding="" Type="Source" />
</Doc14>
<Doc15 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/stopperitem.cpp" >
<View0 Encoding="" Type="Source" />
</Doc15>
<Doc16 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/application.qrc" >
<View0 Encoding="" Type="Source" />
</Doc16>
<Doc17 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/constants.h" >
<View0 Encoding="" Type="Source" />
</Doc17>
<Doc18 NumberOfViews="1" URL="file:///mnt/sdb1/c%2B%2B/lsim/src/fielditem.cpp" >
<View0 Encoding="" line="166" Type="Source" />
</Doc18>
</DocsAndViews>
<pluginList>
<kdevdebugger>

1284
lsim.tag

File diff suppressed because it is too large Load Diff

View File

@@ -27,4 +27,4 @@
const double PI = acos( -1.0 );
const double SPEED_OF_LIGHT = 299792458.0;
const qint32 FILEVERSION=1;
const qint32 FILEMAGIC=52224242425254;
const qint32 FILEMAGIC=522245254;

View File

@@ -133,7 +133,7 @@ void FieldItem::wheelEvent(QGraphicsSceneWheelEvent * event) {
setRotation(getRotation()+( (event->delta()/abs(event->delta()))) );
}
else if (event->modifiers() == Qt::ControlModifier) {
setRotation(getRotation()+( (event->delta()/abs(event->delta()))*5 ));
setRotation(getRotation()+( (event->delta()/abs(event->delta()))*6 ));
}
}
void FieldItem::contextMenuEvent ( QGraphicsSceneContextMenuEvent * event ){
@@ -163,4 +163,4 @@ void FieldItem::deleteMe() {
void FieldItem::toggleSelection() {
setSelected(!isSelected());
}
}

View File

@@ -27,7 +27,7 @@
HomoBFieldItem::HomoBFieldItem(QRectF sizeRect): FieldItem() {
setRectF(sizeRect);
setFieldLineDistance(10);
setFieldLineDistance(15);
setFlag(ItemIsMovable);
setFlag(ItemIsSelectable);
setFlag(ItemIsFocusable);
@@ -43,7 +43,7 @@ HomoBFieldItem::~HomoBFieldItem() {
QList<QVariant> HomoBFieldItem::getSaveDataList() {
QList<QVariant> list;
list << type();
list << scenePos();
list << pos();
list << getRectF();
list << zValue();
list << getIsDirectionIntoPlane();

View File

@@ -30,7 +30,7 @@ HomoEFieldItem::HomoEFieldItem(QRectF sizeRect)
setRectF(sizeRect);
dockWidget = new HomoEFieldWidget(0,0,this);
setFieldPower(10);
setFieldLineDistance(12);
setFieldLineDistance(14);
setFlag(ItemIsMovable);
setFlag(ItemIsSelectable);
setFlag(ItemIsFocusable);
@@ -48,7 +48,7 @@ HomoEFieldItem::HomoEFieldItem(QRectF sizeRect)
QList<QVariant> HomoEFieldItem::getSaveDataList() {
QList<QVariant> list;
list << type();
list << scenePos();
list << pos();
list << getRectF();
list << zValue();
list << getRotation();

View File

@@ -58,6 +58,7 @@ lsim::lsim() {
void lsim::saveFileAs() {
clearAnyFocus();
simulscene->stopTimer();
QFile file(QFileDialog::getSaveFileName(this, tr("Speichern unter..."),
QString(), tr("lsim Dateien (*.lsm);;Alle Dateien (*)")));
if (file.fileName() == "") return; //wenn keine datei gewaehlt
@@ -128,41 +129,16 @@ void lsim::openFile() {
in >> fieldItemSaveList;
FieldItem* currItem;
if (fieldItemSaveList.first() == HomoEFieldItem::Type) {
HomoEFieldItem* currHomoEfieldInsertItem = new HomoEFieldItem(QRectF(0,0,0,0));
//die resize items aus und einblenden bei rotation
connect( currHomoEfieldInsertItem, SIGNAL(rotationChanged()), simulscene, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currHomoEfieldInsertItem, SIGNAL(heightChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currHomoEfieldInsertItem, SIGNAL(widthChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currHomoEfieldInsertItem, SIGNAL(ScenePosChanged(QPointF)), simulscene, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(simulscene,SIGNAL(changed(QList<QRectF>)),currHomoEfieldInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
currItem = currHomoEfieldInsertItem;
currItem = new HomoEFieldItem(QRectF(0,0,0,0));
} else if (fieldItemSaveList.first() == HomoBFieldItem::Type) {
HomoBFieldItem* currHomoBfieldInsertItem = new HomoBFieldItem(QRectF(0,0,0,0));
//die resize items aus und einblenden bei rotation
connect( currHomoBfieldInsertItem, SIGNAL(rotationChanged()), simulscene, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currHomoBfieldInsertItem, SIGNAL(heightChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currHomoBfieldInsertItem, SIGNAL(widthChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currHomoBfieldInsertItem, SIGNAL(ScenePosChanged(QPointF)), simulscene, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(simulscene,SIGNAL(changed(QList<QRectF>)),currHomoBfieldInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
currItem = currHomoBfieldInsertItem;
currItem = new HomoBFieldItem(QRectF(0,0,0,0));
} else if (fieldItemSaveList.first() == StopperItem::Type) {
StopperItem* currStopperInsertItem = new StopperItem(QPointF(0,0),QPointF(0,0));
//die resize items aus und einblenden bei rotation
connect( currStopperInsertItem, SIGNAL(rotationChanged()), simulscene, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currStopperInsertItem, SIGNAL(heightChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currStopperInsertItem, SIGNAL(widthChanged(double)), simulscene, SLOT(moveResizeRects()));
connect( currStopperInsertItem, SIGNAL(ScenePosChanged(QPointF)), simulscene, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(simulscene,SIGNAL(changed(QList<QRectF>)),currStopperInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
currItem = currStopperInsertItem;
currItem = new StopperItem(QPointF(0,0),QPointF(0,0));
} else {
continue;
}
simulscene->connectNewFieldItem(currItem);
simulscene->addItem(currItem);
currItem->setSaveDataList(fieldItemSaveList);
}
@@ -171,8 +147,8 @@ void lsim::openFile() {
}
void lsim::displayOpenFailedBox() {
QMessageBox::warning ( this, tr("\326ffnen. Fehlgeschlagen"),
tr("Die Datei konnte leider nicht ge\366fnet werden"));
QMessageBox::warning ( this, tr("\326ffnen Fehlgeschlagen"),
tr("Die Datei konnte leider nicht ge\366ffnet werden"));
}
void lsim::closeEvent (QCloseEvent *event) {
@@ -911,4 +887,4 @@ void lsim::goToFullscreen(bool yesno) {
setWindowState(windowState() ^ Qt::WindowFullScreen);
//qDebug()<< (windowState() == Qt::WindowFullScreen);
emit fullScreenModeChanged(windowState() == Qt::WindowFullScreen);
}
}

View File

@@ -394,15 +394,7 @@ void SimulScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) {
//das neue item auswaehlen
clearSelection();
currHomoEfieldInsertItem->setSelected(true);
//die resize items aus und einblenden bei rotation
connect( currHomoEfieldInsertItem, SIGNAL(rotationChanged()), this, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currHomoEfieldInsertItem, SIGNAL(heightChanged(double)), this, SLOT(moveResizeRects()));
connect( currHomoEfieldInsertItem, SIGNAL(widthChanged(double)), this, SLOT(moveResizeRects()));
connect( currHomoEfieldInsertItem, SIGNAL(ScenePosChanged(QPointF)), this, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(this,SIGNAL(changed(QList<QRectF>)),currHomoEfieldInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
connectNewFieldItem(currHomoEfieldInsertItem);
}
update(); //moegliche darstellungsprobleme beseitigen
@@ -431,15 +423,7 @@ void SimulScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) {
//das neue item auswaehlen
clearSelection();
currHomoBfieldInsertItem->setSelected(true);
//die resize items aus und einblenden bei rotation
connect( currHomoBfieldInsertItem, SIGNAL(rotationChanged()), this, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currHomoBfieldInsertItem, SIGNAL(heightChanged(double)), this, SLOT(moveResizeRects()));
connect( currHomoBfieldInsertItem, SIGNAL(widthChanged(double)), this, SLOT(moveResizeRects()));
connect( currHomoBfieldInsertItem, SIGNAL(ScenePosChanged(QPointF)), this, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(this,SIGNAL(changed(QList<QRectF>)),currHomoBfieldInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
connectNewFieldItem(currHomoBfieldInsertItem);
}
update(); //moegliche darstellungsprobleme beseitigen
QApplication::restoreOverrideCursor();
@@ -466,15 +450,7 @@ void SimulScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) {
//das neue item auswaehlen
clearSelection();
currStopperInsertItem->setSelected(true);
//die resize items aus und einblenden bei rotation
connect( currStopperInsertItem, SIGNAL(rotationChanged()), this, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( currStopperInsertItem, SIGNAL(heightChanged(double)), this, SLOT(moveResizeRects()));
connect( currStopperInsertItem, SIGNAL(widthChanged(double)), this, SLOT(moveResizeRects()));
connect( currStopperInsertItem, SIGNAL(ScenePosChanged(QPointF)), this, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(this,SIGNAL(changed(QList<QRectF>)),currStopperInsertItem,SLOT(handleSceneChange(QList<QRectF>)));
connectNewFieldItem(currStopperInsertItem);
}
update(); //moegliche darstellungsprobleme beseitigen
QApplication::restoreOverrideCursor();
@@ -506,6 +482,17 @@ void SimulScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent) {
QGraphicsScene::mouseReleaseEvent(mouseEvent);
}
void SimulScene::connectNewFieldItem(FieldItem* item) {
//die resize items aus und einblenden bei rotation
connect( item, SIGNAL(rotationChanged()), this, SLOT(displayResizeRects()));
//bei groesenanderung und verschieben resizerects mitverschieben
connect( item, SIGNAL(heightChanged(double)), this, SLOT(moveResizeRects()));
connect( item, SIGNAL(widthChanged(double)), this, SLOT(moveResizeRects()));
connect( item, SIGNAL(ScenePosChanged(QPointF)), this, SLOT(moveResizeRects()));
//item ueber sceneChange informieren
connect(this,SIGNAL(changed(QList<QRectF>)),item,SLOT(handleSceneChange(QList<QRectF>)));
}
void SimulScene::keyPressEvent (QKeyEvent *keyevent) {
if(keyevent->matches(QKeySequence::Delete)) {
deleteSelectedFieldItems();
@@ -1154,4 +1141,4 @@ void SimulScene::resetScene() {
setupVars();
ellipse1->resetProbe();
}
}

View File

@@ -86,6 +86,7 @@ class SimulScene : public QGraphicsScene {
QList<QVariant> getSaveDataList();
void setSaveDataList(QList<QVariant> list);
void connectNewFieldItem(FieldItem* item);
public slots:
void setSceneMode(SceneMode mode);

View File

@@ -38,7 +38,7 @@ StopperItem::StopperItem(QPointF start, QPointF end): FieldItem() {
QList<QVariant> StopperItem::getSaveDataList() {
QList<QVariant> list;
list << type();
list << scenePos();
list << pos();
list << getRectF();
list << zValue();
list << getRotation();