summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorJakob Odersky <jodersky@gmail.com>2011-04-19 15:49:14 +0000
committerJakob Odersky <jodersky@gmail.com>2011-04-19 15:49:14 +0000
commit8f85e6c82e573402c2d34f709e868c4ae55510a7 (patch)
treecf32de50c6f41c1c62e3882889aa460836868451 /src/gui
parent12a5fafab92e4a6803c56af5a934ba21f84ee762 (diff)
downloadvhc-8f85e6c82e573402c2d34f709e868c4ae55510a7.tar.gz
vhc-8f85e6c82e573402c2d34f709e868c4ae55510a7.tar.bz2
vhc-8f85e6c82e573402c2d34f709e868c4ae55510a7.zip
Resolution de quelques bugs mineures.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/ElementRenderer.cc2
-rw-r--r--src/gui/Main.cc10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/gui/ElementRenderer.cc b/src/gui/ElementRenderer.cc
index f4012ea..5f99491 100644
--- a/src/gui/ElementRenderer.cc
+++ b/src/gui/ElementRenderer.cc
@@ -51,7 +51,7 @@ void ElementRenderer::visit(const StraightElement* straight) const {
}
void ElementRenderer::visit(const Quadrupole* quadrupole) const {
- if (quadrupole->getFocalizingCoefficient() > 1)
+ if (quadrupole->getFocalizingCoefficient() > 0)
glColor4d(0.4, 0, 0, 0.9);
else
glColor4d(0.4, 0.2, 0.2, 0.9);
diff --git a/src/gui/Main.cc b/src/gui/Main.cc
index cfef31e..6b60310 100644
--- a/src/gui/Main.cc
+++ b/src/gui/Main.cc
@@ -66,10 +66,10 @@ Accelerator* standardAccelerator() {
}
Accelerator* linear() {
- FODO element = FODO(Vector3D(0, 0, 0), Vector3D(4, 0, 0), 0.2, 1.0, 5E9);
+ FODO element = FODO(Vector3D(0, 0, 0), Vector3D(4, 0, 0), 0.2, 1.2, 0.1);
Accelerator* acc = new Accelerator();
Element* celement = acc->add(element);
- Particle e(Vector3D(0, 0.05, 0.01), constants::ELECTRON_MASS, constants::E, 14E9 * constants::E, Vector3D::i);
+ Particle e(Vector3D(0, 0.15, 0.01), constants::ELECTRON_MASS, constants::E, 14E9 * constants::E, Vector3D::i);
Particle* ce = acc->add(e);
ce->setElement(celement);
@@ -85,12 +85,12 @@ Accelerator* singleDipole() {
double mass = constants::ELECTRON_MASS;
double charge = constants::E;
- double energy = 14 * 1E9 * constants::E;
+ double energy = 1 * 1E9 * constants::E;
Particle particle = Particle(entry, mass, charge, energy, direction);
double Bz = particle.getGamma() * particle.getMass() * curvature * particle.getVelocity().norm() / particle.getCharge();
- std::cout << Bz << std::endl;
+ std::cout << "|B:|" << Bz << std::endl;
Dipole element = Dipole(entry, exit, sectionRadius, curvature, Vector3D::k * Bz);
Accelerator* acc = new Accelerator();
@@ -115,7 +115,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
vhc::Stage window;
- Accelerator* acc = singleDipole();
+ Accelerator* acc = linear();
window.accelerator = acc;
window.showFullScreen();