diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/ElementRenderer.cc | 2 | ||||
-rw-r--r-- | src/gui/Main.cc | 12 | ||||
-rw-r--r-- | src/gui/ParticleRenderer.cc | 3 | ||||
-rw-r--r-- | src/gui/Stage.cc | 2 | ||||
-rw-r--r-- | src/gui/util.cc | 2 |
5 files changed, 13 insertions, 8 deletions
diff --git a/src/gui/ElementRenderer.cc b/src/gui/ElementRenderer.cc index 5f99491..a547851 100644 --- a/src/gui/ElementRenderer.cc +++ b/src/gui/ElementRenderer.cc @@ -60,7 +60,7 @@ void ElementRenderer::visit(const Quadrupole* quadrupole) const { void ElementRenderer::visit(const Dipole* dipole) const { - glColor4d(0.2, 0, 0.4, 0.9); + glColor4d(0.8, 0.4, 0, 0.9); glPushMatrix(); glTranslated(dipole->getCurvatureCenter().getX(), dipole->getCurvatureCenter().getY(), dipole->getCurvatureCenter().getZ()); Vector3D d = dipole->getExitPosition() - dipole->getCurvatureCenter(); diff --git a/src/gui/Main.cc b/src/gui/Main.cc index 03ba472..09465c2 100644 --- a/src/gui/Main.cc +++ b/src/gui/Main.cc @@ -9,6 +9,7 @@ #include <QApplication> #include <QWidget> #include <cmath> +#include "exceptions.h" #include "Stage.h" #include "Accelerator.h" #include "StraightElement.h" @@ -112,14 +113,16 @@ Accelerator* singleDipole() { int main(int argc, char *argv[]) { + try { + QApplication app(argc, argv); vhc::Stage window; - Accelerator* acc = singleDipole(); + Accelerator* acc = linear(); window.accelerator = acc; - window.showFullScreen(); + //window.showFullScreen(); - //window.resize(QSize(500, 500)); + window.resize(QSize(500, 500)); window.setWindowTitle("Virtual Hadron Collider"); window.show(); @@ -127,4 +130,7 @@ int main(int argc, char *argv[]) delete acc; acc = NULL; + } catch (Exception& ex){ + std::cerr << ex.toString() << "\n"; + } } diff --git a/src/gui/ParticleRenderer.cc b/src/gui/ParticleRenderer.cc index 38736c7..3c8fe86 100644 --- a/src/gui/ParticleRenderer.cc +++ b/src/gui/ParticleRenderer.cc @@ -12,12 +12,11 @@ namespace vhc { ParticleRenderer::ParticleRenderer() { - //Auto-generated constructor stub } ParticleRenderer::~ParticleRenderer() { - //Auto-generated destructor stub + } void ParticleRenderer::render(const Particle& particle) const { diff --git a/src/gui/Stage.cc b/src/gui/Stage.cc index 6928b29..6dec091 100644 --- a/src/gui/Stage.cc +++ b/src/gui/Stage.cc @@ -137,7 +137,7 @@ void Stage::mouseMoveEvent(QMouseEvent* event) { int dpitch = -event->y() + center.y(); camera.addHeading(1.0 * dheading * frameTime / 4000); camera.addPitch(1.0 * dpitch * frameTime / 4000); - QCursor::setPos(center); + QCursor::setPos(QWidget::mapToGlobal(center)); update(); } diff --git a/src/gui/util.cc b/src/gui/util.cc index e460e36..5f026bf 100644 --- a/src/gui/util.cc +++ b/src/gui/util.cc @@ -24,7 +24,7 @@ void torus(double R, double r, double fraction, int slices, int stacks) { x = (R+r*cos(s*twopi/slices))*cos(t*twopi/stacks); y = (R+r*cos(s*twopi/slices))*sin(t*twopi/stacks); z = r * sin(s * twopi / slices); - glColor3d(0, 1 - 1.0 * j / (stacks * fraction), 1.0 * j / (stacks * fraction)); + // glColor3d(0, 1 - 1.0 * j / (stacks * fraction), 1.0 * j / (stacks * fraction)); glVertex3d(x, y, z); } } |