[d238e7] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
[0aa122] | 4 | * Copyright (C) 2010-2012 University of Bonn. All rights reserved.
|
---|
[5aaa43] | 5 | * Copyright (C) 2013 Frederik Heber. All rights reserved.
|
---|
[94d5ac6] | 6 | *
|
---|
| 7 | *
|
---|
| 8 | * This file is part of MoleCuilder.
|
---|
| 9 | *
|
---|
| 10 | * MoleCuilder is free software: you can redistribute it and/or modify
|
---|
| 11 | * it under the terms of the GNU General Public License as published by
|
---|
| 12 | * the Free Software Foundation, either version 2 of the License, or
|
---|
| 13 | * (at your option) any later version.
|
---|
| 14 | *
|
---|
| 15 | * MoleCuilder is distributed in the hope that it will be useful,
|
---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | * GNU General Public License for more details.
|
---|
| 19 | *
|
---|
| 20 | * You should have received a copy of the GNU General Public License
|
---|
| 21 | * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
|
---|
[d238e7] | 22 | */
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | * GLWorldView.cpp
|
---|
| 26 | *
|
---|
| 27 | * Created on: Aug 1, 2010
|
---|
| 28 | * Author: heber
|
---|
| 29 | */
|
---|
| 30 |
|
---|
| 31 | // include config.h
|
---|
| 32 | #ifdef HAVE_CONFIG_H
|
---|
| 33 | #include <config.h>
|
---|
| 34 | #endif
|
---|
| 35 |
|
---|
| 36 | #include "GLWorldView.hpp"
|
---|
| 37 |
|
---|
| 38 | #include <Qt/qevent.h>
|
---|
[0e5d14] | 39 | #include <Qt/qaction.h>
|
---|
[8e7dd9] | 40 | #include <QtGui/QMenu>
|
---|
[0e5d14] | 41 | #include <QtGui/QToolBar>
|
---|
[8e7dd9] | 42 | #include <QtGui/QToolButton>
|
---|
[585f78] | 43 | #include <Qt/qtimer.h>
|
---|
[c7e000] | 44 | #include <Qt/qsettings.h>
|
---|
[26ed25] | 45 | #include <Qt3D/qglbuilder.h>
|
---|
| 46 | #include <Qt3D/qglscenenode.h>
|
---|
| 47 | #include <Qt3D/qglsphere.h>
|
---|
| 48 | #include <Qt3D/qglcylinder.h>
|
---|
[02b2d3] | 49 | #include <Qt3D/qglcube.h>
|
---|
[d238e7] | 50 |
|
---|
[907636] | 51 | #include "GLWorldScene.hpp"
|
---|
[d238e7] | 52 |
|
---|
| 53 | #include "CodePatterns/MemDebug.hpp"
|
---|
| 54 |
|
---|
[53059e] | 55 | #include "Atom/AtomObserver.hpp"
|
---|
| 56 | #include "Atom/atom_observable.hpp"
|
---|
[1d02c2d] | 57 | #include "Box.hpp"
|
---|
[7188b1] | 58 | #include "CodePatterns/Log.hpp"
|
---|
[02ce36] | 59 | #include "CodePatterns/Observer/Notification.hpp"
|
---|
[856d05] | 60 | #include "CodePatterns/Observer/ObserverLog.hpp"
|
---|
[1d02c2d] | 61 | #include "molecule.hpp"
|
---|
[284551] | 62 | #include "Shapes/ShapeRegistry.hpp"
|
---|
[7188b1] | 63 | #include "World.hpp"
|
---|
[89b992] | 64 | #include "WorldTime.hpp"
|
---|
[7188b1] | 65 |
|
---|
[d238e7] | 66 | GLWorldView::GLWorldView(QWidget *parent)
|
---|
[585f78] | 67 | : QGLView(parent), Observer("GLWorldView"), worldscene(NULL), changesPresent(false), needsRedraw(false)
|
---|
[d238e7] | 68 | {
|
---|
[65487f] | 69 | worldscene = new GLWorldScene(this);
|
---|
[d238e7] | 70 |
|
---|
[65487f] | 71 | setOption(QGLView::ObjectPicking, true);
|
---|
[8880c9] | 72 | setOption(QGLView::CameraNavigation, false);
|
---|
| 73 | setCameraControlMode(Rotate);
|
---|
[8e7dd9] | 74 | defaultEyeSeparation = 4.0;
|
---|
[d238e7] | 75 |
|
---|
[26ed25] | 76 | createDomainBox();
|
---|
| 77 | createDreiBein();
|
---|
[e8c636] | 78 | //changeMaterials(false);
|
---|
| 79 |
|
---|
[c48ac12] | 80 | qRegisterMetaType<atomicNumber_t>("atomicNumber_t");
|
---|
| 81 |
|
---|
[8481f5] | 82 | connect(this, SIGNAL(ShapeAdded()), worldscene, SLOT(addShape()));
|
---|
| 83 | connect(this, SIGNAL(ShapeRemoved()), worldscene, SLOT(removeShape()));
|
---|
[65487f] | 84 | connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled()));
|
---|
| 85 | connect(worldscene, SIGNAL(changed()), this, SIGNAL(changed()));
|
---|
[407638e] | 86 | connect(worldscene, SIGNAL(hoverChanged(const atom *)), this, SLOT(sceneHoverSignalled(const atom *)));
|
---|
[beadd0] | 87 | connect(this, SIGNAL(atomInserted(const atomicNumber_t)), worldscene, SLOT(atomInserted(const atomicNumber_t)));
|
---|
[c48ac12] | 88 | connect(this, SIGNAL(atomRemoved(const atomicNumber_t)), worldscene, SLOT(atomRemoved(const atomicNumber_t)));
|
---|
[3927ef] | 89 | connect(this, SIGNAL(worldSelectionChanged()), worldscene, SLOT(worldSelectionChanged()));
|
---|
[c67518] | 90 | connect(this, SIGNAL(moleculeRemoved(const molecule *)), worldscene, SLOT(moleculeRemoved(const molecule *)));
|
---|
[30cd0d] | 91 | //connect(this, SIGNAL(moleculeInserted(const molecule *)), worldscene, SLOT(moleculeInserted(const molecule *)));
|
---|
[585f78] | 92 | //connect(this, SIGNAL(changed()), this, SLOT(updateGL()));
|
---|
| 93 | connect(this, SIGNAL(changed()), this, SLOT(sceneChangeSignalled()));
|
---|
[7188b1] | 94 |
|
---|
[65487f] | 95 | // sign on to changes in the world
|
---|
| 96 | World::getInstance().signOn(this);
|
---|
[02ce36] | 97 | World::getInstance().signOn(this, World::AtomInserted);
|
---|
| 98 | World::getInstance().signOn(this, World::AtomRemoved);
|
---|
[53059e] | 99 | World::getInstance().signOn(this, World::MoleculeInserted);
|
---|
[c67518] | 100 | World::getInstance().signOn(this, World::MoleculeRemoved);
|
---|
[3927ef] | 101 | World::getInstance().signOn(this, World::SelectionChanged);
|
---|
[89b992] | 102 | WorldTime::getInstance().signOn(this, WorldTime::TimeChanged);
|
---|
[53059e] | 103 | AtomObserver::getInstance().signOn(this, AtomObservable::PositionChanged);
|
---|
[585f78] | 104 |
|
---|
[284551] | 105 | ShapeRegistry::getInstance().signOn(this);
|
---|
[85c36d] | 106 | ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeInserted);
|
---|
[284551] | 107 | ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeRemoved);
|
---|
| 108 | ShapeRegistry::getInstance().signOn(this, ShapeRegistry::SelectionChanged);
|
---|
| 109 |
|
---|
[585f78] | 110 | redrawTimer = new QTimer(this);
|
---|
[d238e7] | 111 | }
|
---|
| 112 |
|
---|
[04f017] | 113 | GLWorldView::~GLWorldView()
|
---|
| 114 | {
|
---|
[592d42] | 115 | QSettings settings;
|
---|
| 116 | settings.beginGroup("WorldView");
|
---|
| 117 | settings.setValue("domainBoxEnabled", (meshDomainBox->options() & QGLSceneNode::HideNode) == 0);
|
---|
| 118 | settings.setValue("dreiBeinEnabled", (meshDreiBein->options() & QGLSceneNode::HideNode) == 0);
|
---|
| 119 | settings.endGroup();
|
---|
| 120 |
|
---|
| 121 |
|
---|
[9c18e4] | 122 | World::getInstance().signOff(this);
|
---|
[02ce36] | 123 | World::getInstance().signOff(this, World::AtomInserted);
|
---|
| 124 | World::getInstance().signOff(this, World::AtomRemoved);
|
---|
[53059e] | 125 | World::getInstance().signOff(this, World::MoleculeInserted);
|
---|
[c67518] | 126 | World::getInstance().signOff(this, World::MoleculeRemoved);
|
---|
[3927ef] | 127 | World::getInstance().signOff(this, World::SelectionChanged);
|
---|
[89b992] | 128 | WorldTime::getInstance().signOff(this, WorldTime::TimeChanged);
|
---|
[53059e] | 129 | AtomObserver::getInstance().signOff(this, AtomObservable::PositionChanged);
|
---|
[284551] | 130 | ShapeRegistry::getInstance().signOff(this);
|
---|
[85c36d] | 131 | ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeInserted);
|
---|
[284551] | 132 | ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeRemoved);
|
---|
| 133 | ShapeRegistry::getInstance().signOff(this, ShapeRegistry::SelectionChanged);
|
---|
[04f017] | 134 | delete worldscene;
|
---|
[e8c636] | 135 |
|
---|
| 136 | delete(domainBoxMaterial);
|
---|
| 137 | for (int i=0;i<3;i++)
|
---|
| 138 | delete(dreiBeinMaterial[i]);
|
---|
[04f017] | 139 | }
|
---|
| 140 |
|
---|
[0e5d14] | 141 |
|
---|
| 142 | /**
|
---|
| 143 | * Add some widget specific actions to the toolbar:
|
---|
| 144 | * - camera rotation/translation mode
|
---|
| 145 | * - camera fit to domain
|
---|
| 146 | */
|
---|
| 147 | void GLWorldView::addToolBarActions(QToolBar *toolbar)
|
---|
| 148 | {
|
---|
[f31b34] | 149 | // camera control mode
|
---|
[0e5d14] | 150 | toolbar->addSeparator();
|
---|
| 151 | QAction *transAction = new QAction(QIcon::fromTheme("forward"), tr("camera translation mode"), this);
|
---|
| 152 | connect(transAction, SIGNAL(triggered()), this, SLOT(setCameraControlModeTranslation()));
|
---|
| 153 | toolbar->addAction(transAction);
|
---|
| 154 | QAction *rotAction = new QAction(QIcon::fromTheme("object-rotate-left"), tr("camera rotation mode"), this);
|
---|
| 155 | connect(rotAction, SIGNAL(triggered()), this, SLOT(setCameraControlModeRotation()));
|
---|
| 156 | toolbar->addAction(rotAction);
|
---|
| 157 | QAction *fitAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("camera fit to domain"), this);
|
---|
| 158 | connect(fitAction, SIGNAL(triggered()), this, SLOT(fitCameraToDomain()));
|
---|
| 159 | toolbar->addAction(fitAction);
|
---|
[8e7dd9] | 160 |
|
---|
[f31b34] | 161 | // stereo mode
|
---|
[8e7dd9] | 162 | QToolButton *stereoButton = new QToolButton(toolbar);
|
---|
| 163 | QMenu *stereoMenu = new QMenu();
|
---|
[a8fc70] | 164 | QAction *stereoDisableAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("disable"), this);
|
---|
| 165 | connect(stereoDisableAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeDisable()));
|
---|
| 166 | stereoMenu->addAction(stereoDisableAction);
|
---|
[8e7dd9] | 167 | QAction *stereoHardwareAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("hardware"), this);
|
---|
| 168 | connect(stereoHardwareAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeHardware()));
|
---|
| 169 | stereoMenu->addAction(stereoHardwareAction);
|
---|
| 170 | QAction *stereoLeftRightAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("left right"), this);
|
---|
| 171 | connect(stereoLeftRightAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeLeftRight()));
|
---|
| 172 | stereoMenu->addAction(stereoLeftRightAction);
|
---|
| 173 | QAction *stereoRightLeftAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("right left"), this);
|
---|
| 174 | connect(stereoRightLeftAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeRightLeft()));
|
---|
| 175 | stereoMenu->addAction(stereoRightLeftAction);
|
---|
| 176 | QAction *stereoTopBottomAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("top bottom"), this);
|
---|
| 177 | connect(stereoTopBottomAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeTopBottom()));
|
---|
| 178 | stereoMenu->addAction(stereoTopBottomAction);
|
---|
| 179 | QAction *stereoBottomTopAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("bottom top"), this);
|
---|
| 180 | connect(stereoBottomTopAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeBottomTop()));
|
---|
| 181 | stereoMenu->addAction(stereoBottomTopAction);
|
---|
| 182 | QAction *stereoAnaglyphAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("anaglyph"), this);
|
---|
| 183 | connect(stereoAnaglyphAction, SIGNAL(triggered()), this, SLOT(setCameraStereoModeAnaglyph()));
|
---|
| 184 | stereoMenu->addAction(stereoAnaglyphAction);
|
---|
| 185 | stereoButton->setMenu(stereoMenu);
|
---|
[5b991a] | 186 | stereoButton->setIcon(QIcon(QPixmap(":/icon_view_stereo.png")));
|
---|
[8e7dd9] | 187 | stereoButton->setPopupMode(QToolButton::InstantPopup);
|
---|
| 188 | toolbar->addWidget(stereoButton);
|
---|
[f31b34] | 189 |
|
---|
| 190 | // selection mode
|
---|
| 191 | toolbar->addSeparator();
|
---|
[5b991a] | 192 | QAction *selAtomAction = new QAction(QIcon(QPixmap(":/icon_select_atom.png")), tr("select atom by clicking"), this);
|
---|
[f31b34] | 193 | connect(selAtomAction, SIGNAL(triggered()), worldscene, SLOT(setSelectionModeAtom()));
|
---|
| 194 | toolbar->addAction(selAtomAction);
|
---|
[5b991a] | 195 | QAction *selMolAction = new QAction(QIcon(QPixmap(":/icon_select_molecule.png")), tr("select molecule by clicking"), this);
|
---|
[f31b34] | 196 | connect(selMolAction, SIGNAL(triggered()), worldscene, SLOT(setSelectionModeMolecule()));
|
---|
| 197 | toolbar->addAction(selMolAction);
|
---|
[592d42] | 198 |
|
---|
| 199 | // dreiBein/domain enabler
|
---|
| 200 | toolbar->addSeparator();
|
---|
| 201 | QAction *seldreiBein = new QAction(QIcon(QPixmap(":/icon_dreiBein.png")), tr("enable/disable dreiBein"), this);
|
---|
| 202 | connect(seldreiBein, SIGNAL(triggered()), this, SLOT(changeDreiBein()));
|
---|
| 203 | toolbar->addAction(seldreiBein);
|
---|
| 204 | QAction *seldomain = new QAction(QIcon(QPixmap(":/icon_domain.png")), tr("enable/disable domain box"), this);
|
---|
| 205 | connect(seldomain, SIGNAL(triggered()), this, SLOT(changeDomain()));
|
---|
| 206 | toolbar->addAction(seldomain);
|
---|
[0e5d14] | 207 | }
|
---|
| 208 |
|
---|
[26ed25] | 209 | void GLWorldView::createDomainBox()
|
---|
| 210 | {
|
---|
[c7e000] | 211 | QSettings settings;
|
---|
| 212 | settings.beginGroup("WorldView");
|
---|
| 213 | QColor colorFrame = settings.value("domainBoxColorFrame", QColor(150,160,200,255)).value<QColor>();
|
---|
| 214 | QColor colorAmbient = settings.value("domainBoxColorAmbient", QColor(50,60,100,255)).value<QColor>();
|
---|
| 215 | QColor colorDiffuse = settings.value("domainBoxColorDiffuse", QColor(150,160,200,180)).value<QColor>();
|
---|
| 216 | settings.setValue("domainBoxColorFrame", colorFrame);
|
---|
| 217 | settings.setValue("domainBoxColorAmbient", colorAmbient);
|
---|
| 218 | settings.setValue("domainBoxColorDiffuse", colorDiffuse);
|
---|
[592d42] | 219 | const bool status = settings.value("domainBoxEnabled").toBool();
|
---|
[c7e000] | 220 | settings.endGroup();
|
---|
| 221 |
|
---|
[02b2d3] | 222 | domainBoxMaterial = new QGLMaterial;
|
---|
| 223 | domainBoxMaterial->setAmbientColor(QColor(0,0,0,255));
|
---|
| 224 | domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255));
|
---|
[c7e000] | 225 | domainBoxMaterial->setEmittedLight(colorFrame);
|
---|
[02b2d3] | 226 |
|
---|
[26ed25] | 227 |
|
---|
[02b2d3] | 228 | QGLMaterial *material = new QGLMaterial;
|
---|
[c7e000] | 229 | material->setAmbientColor(colorAmbient);
|
---|
| 230 | material->setDiffuseColor(colorDiffuse);
|
---|
[02b2d3] | 231 |
|
---|
| 232 | QGLBuilder builder;
|
---|
| 233 | builder << QGL::Faceted;
|
---|
| 234 | builder << QGLCube(-1.0); // "inverted" => inside faces are used as front.
|
---|
| 235 | meshDomainBox = builder.finalizedSceneNode();
|
---|
| 236 | QMatrix4x4 mat;
|
---|
| 237 | mat.translate(0.5f, 0.5f, 0.5f);
|
---|
| 238 | meshDomainBox->setLocalTransform(mat);
|
---|
| 239 | meshDomainBox->setMaterial(material);
|
---|
[592d42] | 240 |
|
---|
| 241 | setDomainStatus( status );
|
---|
[26ed25] | 242 | }
|
---|
| 243 |
|
---|
| 244 | void GLWorldView::createDreiBein()
|
---|
| 245 | {
|
---|
[c7e000] | 246 | QSettings settings;
|
---|
| 247 | settings.beginGroup("WorldView");
|
---|
| 248 | QColor colorX = settings.value("dreiBeinColorX", QColor(255,50,50,255)).value<QColor>();
|
---|
| 249 | QColor colorY = settings.value("dreiBeinColorY", QColor(50,255,50,255)).value<QColor>();
|
---|
| 250 | QColor colorZ = settings.value("dreiBeinColorZ", QColor(50,50,255,255)).value<QColor>();
|
---|
| 251 | settings.setValue("dreiBeinColorX", colorX);
|
---|
| 252 | settings.setValue("dreiBeinColorY", colorY);
|
---|
| 253 | settings.setValue("dreiBeinColorZ", colorZ);
|
---|
[592d42] | 254 | const bool status = settings.value("dreiBeinEnabled").toBool();
|
---|
[c7e000] | 255 | settings.endGroup();
|
---|
| 256 |
|
---|
[02b2d3] | 257 | // Create 3 color for the 3 axes.
|
---|
[26ed25] | 258 | dreiBeinMaterial[0] = new QGLMaterial;
|
---|
[c7e000] | 259 | dreiBeinMaterial[0]->setColor(colorX);
|
---|
[26ed25] | 260 | dreiBeinMaterial[1] = new QGLMaterial;
|
---|
[c7e000] | 261 | dreiBeinMaterial[1]->setColor(colorY);
|
---|
[26ed25] | 262 | dreiBeinMaterial[2] = new QGLMaterial;
|
---|
[c7e000] | 263 | dreiBeinMaterial[2]->setColor(colorZ);
|
---|
[26ed25] | 264 |
|
---|
[02b2d3] | 265 | // Create the basic meshes (cylinder and cone).
|
---|
[26ed25] | 266 | QGLBuilder builderCyl;
|
---|
[37e910] | 267 | builderCyl << QGLCylinder(.15,.15,1.6,16);
|
---|
[26ed25] | 268 | QGLSceneNode *cyl = builderCyl.finalizedSceneNode();
|
---|
| 269 |
|
---|
| 270 | QGLBuilder builderCone;
|
---|
| 271 | builderCone << QGLCylinder(0,.4,0.4,16);
|
---|
| 272 | QGLSceneNode *cone = builderCone.finalizedSceneNode();
|
---|
| 273 | {
|
---|
| 274 | QMatrix4x4 mat;
|
---|
| 275 | mat.translate(0.0f, 0.0f, 1.0f);
|
---|
| 276 | cone->setLocalTransform(mat);
|
---|
| 277 | }
|
---|
| 278 |
|
---|
[02b2d3] | 279 | // Create a scene node from the 3 axes.
|
---|
[26ed25] | 280 | meshDreiBein = new QGLSceneNode(this);
|
---|
| 281 |
|
---|
| 282 | // X-direction
|
---|
| 283 | QGLSceneNode *node = new QGLSceneNode(meshDreiBein);
|
---|
| 284 | node->setMaterial(dreiBeinMaterial[0]);
|
---|
| 285 | node->addNode(cyl);
|
---|
[37e910] | 286 | node->setPosition(QVector3D(.8f, 0.f, 0.f));
|
---|
[26ed25] | 287 | node->addNode(cone);
|
---|
| 288 | {
|
---|
| 289 | QMatrix4x4 mat;
|
---|
| 290 | mat.rotate(90, 0.0f, 1.0f, 0.0f);
|
---|
| 291 | node->setLocalTransform(mat);
|
---|
| 292 | }
|
---|
| 293 |
|
---|
| 294 | // Y-direction
|
---|
| 295 | node = new QGLSceneNode(meshDreiBein);
|
---|
| 296 | node->setMaterial(dreiBeinMaterial[1]);
|
---|
| 297 | node->addNode(cyl);
|
---|
| 298 | node->addNode(cone);
|
---|
| 299 | {
|
---|
| 300 | QMatrix4x4 mat;
|
---|
| 301 | mat.rotate(-90, 1.0f, 0.0f, 0.0f);
|
---|
| 302 | node->setLocalTransform(mat);
|
---|
| 303 | }
|
---|
[37e910] | 304 | node->setPosition(QVector3D(0.f, .8f, 0.f));
|
---|
[26ed25] | 305 |
|
---|
| 306 | // Z-direction
|
---|
| 307 | node = new QGLSceneNode(meshDreiBein);
|
---|
| 308 | node->setMaterial(dreiBeinMaterial[2]);
|
---|
| 309 | node->addNode(cyl);
|
---|
| 310 | node->addNode(cone);
|
---|
[37e910] | 311 | node->setPosition(QVector3D(0.f, 0.f, .8f));
|
---|
[592d42] | 312 |
|
---|
| 313 | setdreiBeinStatus( status );
|
---|
[26ed25] | 314 | }
|
---|
| 315 |
|
---|
[7188b1] | 316 | /**
|
---|
| 317 | * Update operation which can be invoked by the observable (which should be the
|
---|
| 318 | * change tracker here).
|
---|
| 319 | */
|
---|
| 320 | void GLWorldView::update(Observable *publisher)
|
---|
| 321 | {
|
---|
| 322 | emit changed();
|
---|
| 323 | }
|
---|
| 324 |
|
---|
| 325 | /**
|
---|
| 326 | * The observable can tell when it dies.
|
---|
| 327 | */
|
---|
| 328 | void GLWorldView::subjectKilled(Observable *publisher) {}
|
---|
| 329 |
|
---|
| 330 | /** Listen to specific changes to the world.
|
---|
| 331 | *
|
---|
| 332 | * @param publisher ref to observable.
|
---|
| 333 | * @param notification type of notification
|
---|
| 334 | */
|
---|
| 335 | void GLWorldView::recieveNotification(Observable *publisher, Notification_ptr notification)
|
---|
| 336 | {
|
---|
[53059e] | 337 | if (static_cast<World *>(publisher) == World::getPointer()) {
|
---|
| 338 | switch (notification->getChannelNo()) {
|
---|
| 339 | case World::AtomInserted:
|
---|
| 340 | {
|
---|
[beadd0] | 341 | const atomicNumber_t _id = World::getInstance().lastChanged<atom>()->getId();
|
---|
[53059e] | 342 | #ifdef LOG_OBSERVER
|
---|
[beadd0] | 343 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_id)+" has been inserted.";
|
---|
[53059e] | 344 | #endif
|
---|
[beadd0] | 345 | emit atomInserted(_id);
|
---|
[53059e] | 346 | break;
|
---|
| 347 | }
|
---|
| 348 | case World::AtomRemoved:
|
---|
| 349 | {
|
---|
[c48ac12] | 350 | const atomicNumber_t _id = World::getInstance().lastChanged<atom>()->getId();
|
---|
[53059e] | 351 | #ifdef LOG_OBSERVER
|
---|
[beadd0] | 352 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_id)+" has been removed.";
|
---|
[53059e] | 353 | #endif
|
---|
[c48ac12] | 354 | emit atomRemoved(_id);
|
---|
[53059e] | 355 | break;
|
---|
| 356 | }
|
---|
| 357 | case World::SelectionChanged:
|
---|
| 358 | {
|
---|
| 359 | #ifdef LOG_OBSERVER
|
---|
[708277] | 360 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that selection has changed.";
|
---|
[53059e] | 361 | #endif
|
---|
| 362 | emit worldSelectionChanged();
|
---|
| 363 | break;
|
---|
| 364 | }
|
---|
| 365 | case World::MoleculeInserted:
|
---|
| 366 | {
|
---|
| 367 | const molecule *_molecule = World::getInstance().lastChanged<molecule>();
|
---|
| 368 | #ifdef LOG_OBSERVER
|
---|
[708277] | 369 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that molecule "+toString(_molecule->getId())+" has been removed.";
|
---|
[53059e] | 370 | #endif
|
---|
| 371 | emit moleculeInserted(_molecule);
|
---|
| 372 | break;
|
---|
| 373 | }
|
---|
| 374 | case World::MoleculeRemoved:
|
---|
| 375 | {
|
---|
| 376 | const molecule *_molecule = World::getInstance().lastChanged<molecule>();
|
---|
| 377 | #ifdef LOG_OBSERVER
|
---|
[708277] | 378 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that molecule "+toString(_molecule->getId())+" has been removed.";
|
---|
[53059e] | 379 | #endif
|
---|
| 380 | emit moleculeRemoved(_molecule);
|
---|
| 381 | break;
|
---|
| 382 | }
|
---|
| 383 | default:
|
---|
[89b992] | 384 | ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here for World.");
|
---|
[53059e] | 385 | break;
|
---|
[7188b1] | 386 | }
|
---|
[89b992] | 387 | } else if (static_cast<WorldTime *>(publisher) == WorldTime::getPointer()) {
|
---|
| 388 | switch (notification->getChannelNo()) {
|
---|
| 389 | case WorldTime::TimeChanged:
|
---|
| 390 | {
|
---|
| 391 | #ifdef LOG_OBSERVER
|
---|
| 392 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that WorldTime's time has changed.";
|
---|
| 393 | #endif
|
---|
| 394 | emit changed();
|
---|
| 395 | break;
|
---|
| 396 | }
|
---|
| 397 | default:
|
---|
| 398 | ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here for WorldTime.");
|
---|
| 399 | break;
|
---|
| 400 | }
|
---|
| 401 | } else if (dynamic_cast<AtomObservable *>(publisher) != NULL) {
|
---|
[53059e] | 402 | switch (notification->getChannelNo()) {
|
---|
| 403 | case AtomObservable::PositionChanged:
|
---|
| 404 | {
|
---|
| 405 | #ifdef LOG_OBSERVER
|
---|
[89b992] | 406 | const atom *_atom = dynamic_cast<const atom *>(publisher);
|
---|
[708277] | 407 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_atom->getId())+" has changed its position.";
|
---|
[53059e] | 408 | #endif
|
---|
| 409 | emit changed();
|
---|
| 410 | break;
|
---|
| 411 | }
|
---|
| 412 | default:
|
---|
[89b992] | 413 | ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here for AtomObservable.");
|
---|
[53059e] | 414 | break;
|
---|
[7188b1] | 415 | }
|
---|
[284551] | 416 | } else if (static_cast<ShapeRegistry*>(publisher) == ShapeRegistry::getPointer()) {
|
---|
| 417 | switch (notification->getChannelNo()) {
|
---|
[85c36d] | 418 | case ShapeRegistry::ShapeInserted:
|
---|
| 419 | {
|
---|
[4d6662] | 420 | emit ShapeAdded();
|
---|
[85c36d] | 421 | break;
|
---|
| 422 | }
|
---|
[284551] | 423 | case ShapeRegistry::ShapeRemoved:
|
---|
| 424 | {
|
---|
[4d6662] | 425 | emit ShapeRemoved();
|
---|
[284551] | 426 | break;
|
---|
| 427 | }
|
---|
| 428 | case ShapeRegistry::SelectionChanged:
|
---|
| 429 | {
|
---|
[85c36d] | 430 | worldscene->updateSelectedShapes();
|
---|
[284551] | 431 | break;
|
---|
| 432 | }
|
---|
| 433 | default:
|
---|
[89b992] | 434 | ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here for ShapeRegistry.");
|
---|
[284551] | 435 | break;
|
---|
| 436 | }
|
---|
[53059e] | 437 | } else
|
---|
| 438 | ASSERT(0, "GLWorldView::recieveNotification() - received notification from unknown source.");
|
---|
[7188b1] | 439 | }
|
---|
[04f017] | 440 |
|
---|
[585f78] | 441 | void GLWorldView::checkChanges()
|
---|
| 442 | {
|
---|
| 443 | updateGL();
|
---|
| 444 | needsRedraw = false;
|
---|
| 445 | }
|
---|
| 446 |
|
---|
[592d42] | 447 | void GLWorldView::changeDreiBein()
|
---|
| 448 | {
|
---|
| 449 | // invert to new status
|
---|
| 450 | const bool status = ((meshDreiBein->options() & QGLSceneNode::HideNode) == 0);
|
---|
| 451 | setdreiBeinStatus(!status);
|
---|
| 452 | // realize
|
---|
| 453 | updateGL();
|
---|
| 454 | needsRedraw = true;
|
---|
| 455 | }
|
---|
| 456 |
|
---|
| 457 | void GLWorldView::setdreiBeinStatus(const bool status)
|
---|
| 458 | {
|
---|
| 459 | if (status)
|
---|
| 460 | meshDreiBein->setOptions( meshDreiBein->options() & (255-QGLSceneNode::HideNode) );
|
---|
| 461 | else
|
---|
| 462 | meshDreiBein->setOptions( meshDreiBein->options() | QGLSceneNode::HideNode );
|
---|
| 463 | }
|
---|
| 464 |
|
---|
| 465 | void GLWorldView::changeDomain()
|
---|
| 466 | {
|
---|
| 467 | // invert to new status
|
---|
| 468 | const bool status = ((meshDomainBox->options() & QGLSceneNode::HideNode) == 0);
|
---|
| 469 | setDomainStatus(!status);
|
---|
| 470 | // realize
|
---|
| 471 | updateGL();
|
---|
| 472 | needsRedraw = true;
|
---|
| 473 | }
|
---|
| 474 |
|
---|
| 475 | void GLWorldView::setDomainStatus(const bool status)
|
---|
| 476 | {
|
---|
| 477 | if (status)
|
---|
| 478 | meshDomainBox->setOptions( meshDomainBox->options() & (255-QGLSceneNode::HideNode) );
|
---|
| 479 | else
|
---|
| 480 | meshDomainBox->setOptions( meshDomainBox->options() | QGLSceneNode::HideNode );
|
---|
| 481 | }
|
---|
| 482 |
|
---|
[585f78] | 483 | void GLWorldView::sceneChangeSignalled()
|
---|
| 484 | {
|
---|
| 485 | if (!needsRedraw){
|
---|
| 486 | redrawTimer->singleShot(0, this, SLOT(checkChanges()));
|
---|
| 487 | needsRedraw = true;
|
---|
| 488 | redrawTimer->start();
|
---|
| 489 | }
|
---|
| 490 | }
|
---|
| 491 |
|
---|
[d238e7] | 492 | void GLWorldView::initializeGL(QGLPainter *painter)
|
---|
| 493 | {
|
---|
[65487f] | 494 | worldscene->initialize(this, painter);
|
---|
| 495 | changesPresent = false;
|
---|
[d238e7] | 496 | }
|
---|
| 497 |
|
---|
| 498 | void GLWorldView::paintGL(QGLPainter *painter)
|
---|
| 499 | {
|
---|
[65487f] | 500 | if (changesPresent) {
|
---|
| 501 | initializeGL(painter);
|
---|
| 502 | changesPresent = false;
|
---|
| 503 | }
|
---|
[72a4c1] | 504 |
|
---|
| 505 | QVector3D cameraDir = camera()->center() - camera()->eye();
|
---|
| 506 | cameraDir.normalize();
|
---|
| 507 | QVector4D cameraPlane(cameraDir, QVector3D::dotProduct(cameraDir, camera()->eye()));
|
---|
| 508 | worldscene->draw(painter, cameraPlane);
|
---|
[e8c636] | 509 |
|
---|
| 510 | drawDreiBein(painter);
|
---|
[02b2d3] | 511 |
|
---|
| 512 | // Domain box has to be last because of its transparency.
|
---|
| 513 | drawDomainBox(painter);
|
---|
[907636] | 514 | }
|
---|
[d238e7] | 515 |
|
---|
[907636] | 516 | void GLWorldView::keyPressEvent(QKeyEvent *e)
|
---|
| 517 | {
|
---|
[65487f] | 518 | if (e->key() == Qt::Key_Tab) {
|
---|
| 519 | // The Tab key turns the ShowPicking option on and off,
|
---|
| 520 | // which helps show what the pick buffer looks like.
|
---|
| 521 | setOption(QGLView::ShowPicking, ((options() & QGLView::ShowPicking) == 0));
|
---|
| 522 | updateGL();
|
---|
| 523 | }
|
---|
| 524 | QGLView::keyPressEvent(e);
|
---|
| 525 | }
|
---|
| 526 |
|
---|
| 527 | void GLWorldView::changeSignalled()
|
---|
| 528 | {
|
---|
| 529 | changesPresent = true;
|
---|
[d238e7] | 530 | }
|
---|
| 531 |
|
---|
| 532 |
|
---|
[0e5d14] | 533 | /**
|
---|
| 534 | * Set the current camera control mode.
|
---|
| 535 | */
|
---|
[e13b34] | 536 | void GLWorldView::setCameraControlMode(GLWorldView::CameraControlModeType mode)
|
---|
| 537 | {
|
---|
| 538 | cameraControlMode = mode;
|
---|
| 539 | }
|
---|
| 540 |
|
---|
| 541 | void GLWorldView::setCameraControlModeRotation()
|
---|
| 542 | {
|
---|
| 543 | setCameraControlMode(Rotate);
|
---|
| 544 | }
|
---|
| 545 |
|
---|
| 546 | void GLWorldView::setCameraControlModeTranslation()
|
---|
| 547 | {
|
---|
| 548 | setCameraControlMode(Translate);
|
---|
| 549 | }
|
---|
| 550 |
|
---|
[0e5d14] | 551 | /**
|
---|
| 552 | * Returns the current camera control mode.
|
---|
| 553 | * This needs to be invertable (rotation - translation), if the shift key is pressed.
|
---|
| 554 | */
|
---|
[e13b34] | 555 | GLWorldView::CameraControlModeType GLWorldView::getCameraControlMode(bool inverted)
|
---|
| 556 | {
|
---|
| 557 | if (inverted){
|
---|
| 558 | if (cameraControlMode == Rotate)
|
---|
| 559 | return Translate;
|
---|
| 560 | if (cameraControlMode == Translate)
|
---|
| 561 | return Rotate;
|
---|
| 562 | return Rotate;
|
---|
| 563 | }else
|
---|
| 564 | return cameraControlMode;
|
---|
| 565 | }
|
---|
| 566 |
|
---|
[8880c9] | 567 | /**
|
---|
| 568 | * Set the camera so it can oversee the whole domain.
|
---|
| 569 | */
|
---|
[e13b34] | 570 | void GLWorldView::fitCameraToDomain()
|
---|
| 571 | {
|
---|
[8880c9] | 572 | // Move the camera focus point to the center of the domain box.
|
---|
[3f48c2] | 573 | Vector v = World::getInstance().getDomain().translateIn(Vector(0.5, 0.5, 0.5));
|
---|
| 574 | camera()->setCenter(QVector3D(v[0], v[1], v[2]));
|
---|
| 575 |
|
---|
[8880c9] | 576 | // Guess some eye distance.
|
---|
[3f48c2] | 577 | double dist = v.Norm() * 3;
|
---|
| 578 | camera()->setEye(QVector3D(v[0], v[1], v[2] + dist));
|
---|
| 579 | camera()->setUpVector(QVector3D(0, 1, 0));
|
---|
[e13b34] | 580 | }
|
---|
| 581 |
|
---|
[8e7dd9] | 582 | void GLWorldView::setCameraStereoModeDisable()
|
---|
| 583 | {
|
---|
| 584 | setStereoType(QGLView::Hardware);
|
---|
| 585 | camera()->setEyeSeparation(0.0);
|
---|
| 586 | updateGL();
|
---|
| 587 | }
|
---|
| 588 |
|
---|
| 589 | void GLWorldView::setCameraStereoModeHardware()
|
---|
| 590 | {
|
---|
| 591 | setStereoType(QGLView::Hardware);
|
---|
| 592 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 593 | updateGL();
|
---|
| 594 | }
|
---|
| 595 |
|
---|
| 596 | void GLWorldView::setCameraStereoModeLeftRight()
|
---|
| 597 | {
|
---|
| 598 | setStereoType(QGLView::LeftRight);
|
---|
| 599 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 600 | updateGL();
|
---|
| 601 | }
|
---|
| 602 |
|
---|
| 603 | void GLWorldView::setCameraStereoModeRightLeft()
|
---|
| 604 | {
|
---|
| 605 | setStereoType(QGLView::RightLeft);
|
---|
| 606 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 607 | updateGL();
|
---|
| 608 | }
|
---|
| 609 |
|
---|
| 610 | void GLWorldView::setCameraStereoModeTopBottom()
|
---|
| 611 | {
|
---|
| 612 | setStereoType(QGLView::TopBottom);
|
---|
| 613 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 614 | updateGL();
|
---|
| 615 | }
|
---|
| 616 |
|
---|
| 617 | void GLWorldView::setCameraStereoModeBottomTop()
|
---|
| 618 | {
|
---|
| 619 | setStereoType(QGLView::BottomTop);
|
---|
| 620 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 621 | updateGL();
|
---|
| 622 | }
|
---|
| 623 |
|
---|
| 624 | void GLWorldView::setCameraStereoModeAnaglyph()
|
---|
| 625 | {
|
---|
| 626 | setStereoType(QGLView::RedCyanAnaglyph);
|
---|
| 627 | camera()->setEyeSeparation(defaultEyeSeparation);
|
---|
| 628 | updateGL();
|
---|
| 629 | }
|
---|
| 630 |
|
---|
[8880c9] | 631 | void GLWorldView::mousePressEvent(QMouseEvent *event)
|
---|
| 632 | {
|
---|
| 633 | QGLView::mousePressEvent(event);
|
---|
| 634 |
|
---|
| 635 | // Reset the saved mouse position.
|
---|
| 636 | lastMousePos = event->posF();
|
---|
| 637 | }
|
---|
| 638 |
|
---|
| 639 | /**
|
---|
| 640 | * Handle a mouse move event.
|
---|
| 641 | * This is used to control the camera (rotation and translation) when the left button is being pressed.
|
---|
| 642 | */
|
---|
| 643 | void GLWorldView::mouseMoveEvent(QMouseEvent *event)
|
---|
| 644 | {
|
---|
| 645 | if (event->buttons() & Qt::LeftButton){
|
---|
| 646 | // Find the mouse distance since the last event.
|
---|
| 647 | QPointF d = event->posF() - lastMousePos;
|
---|
| 648 | lastMousePos = event->posF();
|
---|
| 649 |
|
---|
| 650 | // Rotate or translate? (inverted by shift key)
|
---|
| 651 | CameraControlModeType mode = getCameraControlMode(event->modifiers() & Qt::ShiftModifier);
|
---|
| 652 |
|
---|
| 653 | if (mode == Rotate){
|
---|
| 654 | // Rotate the camera.
|
---|
| 655 | d *= 0.3;
|
---|
| 656 | camera()->tiltPanRollCenter(- d.y(), - d.x(), 0);
|
---|
| 657 | }else if (mode == Translate){
|
---|
| 658 | // Translate the camera.
|
---|
| 659 | d *= 0.02;
|
---|
| 660 | camera()->translateCenter(- d.x(), d.y(), 0);
|
---|
| 661 | camera()->translateEye(- d.x(), d.y(), 0);
|
---|
| 662 | }
|
---|
| 663 | }else{
|
---|
| 664 | // Without this Qt would not test for hover events (i.e. mouse over an atom).
|
---|
| 665 | QGLView::mouseMoveEvent(event);
|
---|
| 666 | }
|
---|
| 667 | }
|
---|
| 668 |
|
---|
| 669 | /**
|
---|
| 670 | * When the mouse wheel is used, zoom in or out.
|
---|
| 671 | */
|
---|
| 672 | void GLWorldView::wheelEvent(QWheelEvent *event)
|
---|
| 673 | {
|
---|
| 674 | // Find the distance between the eye and focus point.
|
---|
| 675 | QVector3D d = camera()->eye() - camera()->center();
|
---|
| 676 |
|
---|
| 677 | // Scale the distance.
|
---|
| 678 | if (event->delta() < 0)
|
---|
| 679 | d *= 1.2;
|
---|
| 680 | else if (event->delta() > 0)
|
---|
| 681 | d /= 1.2;
|
---|
| 682 |
|
---|
| 683 | // Set new eye position.
|
---|
| 684 | camera()->setEye(camera()->center() + d);
|
---|
| 685 | }
|
---|
| 686 |
|
---|
[02b2d3] | 687 | /**
|
---|
| 688 | * Draw a transparent cube representing the domain.
|
---|
| 689 | */
|
---|
[e8c636] | 690 | void GLWorldView::drawDomainBox(QGLPainter *painter) const
|
---|
| 691 | {
|
---|
[02b2d3] | 692 | // Apply the domain matrix.
|
---|
[e8c636] | 693 | RealSpaceMatrix m = World::getInstance().getDomain().getM();
|
---|
| 694 | painter->modelViewMatrix().push();
|
---|
| 695 | painter->modelViewMatrix() *= QMatrix4x4(m.at(0,0), m.at(0,1), m.at(0,2), 0.0,
|
---|
| 696 | m.at(1,0), m.at(1,1), m.at(1,2), 0.0,
|
---|
| 697 | m.at(2,0), m.at(2,1), m.at(2,2), 0.0,
|
---|
| 698 | 0.0, 0.0, 0.0, 1.0);
|
---|
| 699 |
|
---|
[02b2d3] | 700 | // Draw the transparent cube.
|
---|
[073a2ff] | 701 | painter->setStandardEffect(QGL::LitMaterial);
|
---|
[02b2d3] | 702 | glCullFace(GL_BACK);
|
---|
| 703 | glEnable(GL_CULL_FACE);
|
---|
| 704 | glEnable(GL_BLEND);
|
---|
| 705 | glDepthMask(0);
|
---|
| 706 | //glDisable(GL_DEPTH_TEST);
|
---|
| 707 | meshDomainBox->draw(painter);
|
---|
| 708 | //glEnable(GL_DEPTH_TEST);
|
---|
| 709 | glDepthMask(1);
|
---|
| 710 | glDisable(GL_BLEND);
|
---|
| 711 | glDisable(GL_CULL_FACE);
|
---|
| 712 |
|
---|
[592d42] | 713 | // Draw the outlines (if we have drawn the box itself)
|
---|
| 714 | if ((meshDomainBox->options() & QGLSceneNode::HideNode) == 0) {
|
---|
| 715 | painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial);
|
---|
| 716 | //glEnable(GL_LINE_SMOOTH);
|
---|
| 717 | QVector3DArray array;
|
---|
| 718 | array.append(0, 0, 0); array.append(1, 0, 0);
|
---|
| 719 | array.append(1, 0, 0); array.append(1, 1, 0);
|
---|
| 720 | array.append(1, 1, 0); array.append(0, 1, 0);
|
---|
| 721 | array.append(0, 1, 0); array.append(0, 0, 0);
|
---|
| 722 |
|
---|
| 723 | array.append(0, 0, 1); array.append(1, 0, 1);
|
---|
| 724 | array.append(1, 0, 1); array.append(1, 1, 1);
|
---|
| 725 | array.append(1, 1, 1); array.append(0, 1, 1);
|
---|
| 726 | array.append(0, 1, 1); array.append(0, 0, 1);
|
---|
| 727 |
|
---|
| 728 | array.append(0, 0, 0); array.append(0, 0, 1);
|
---|
| 729 | array.append(1, 0, 0); array.append(1, 0, 1);
|
---|
| 730 | array.append(0, 1, 0); array.append(0, 1, 1);
|
---|
| 731 | array.append(1, 1, 0); array.append(1, 1, 1);
|
---|
| 732 | painter->clearAttributes();
|
---|
| 733 | painter->setVertexAttribute(QGL::Position, array);
|
---|
| 734 | painter->draw(QGL::Lines, 24);
|
---|
| 735 | }
|
---|
[02b2d3] | 736 |
|
---|
[e8c636] | 737 | painter->modelViewMatrix().pop();
|
---|
| 738 | }
|
---|
| 739 |
|
---|
| 740 | void GLWorldView::drawDreiBein(QGLPainter *painter)
|
---|
| 741 | {
|
---|
| 742 | painter->modelViewMatrix().push();
|
---|
| 743 | painter->modelViewMatrix().translate(camera()->center());
|
---|
[073a2ff] | 744 | painter->setStandardEffect(QGL::LitMaterial);
|
---|
[02b2d3] | 745 | painter->setFaceMaterial(QGL::FrontFaces, NULL);
|
---|
[26ed25] | 746 | meshDreiBein->draw(painter);
|
---|
[e8c636] | 747 | painter->modelViewMatrix().pop();
|
---|
| 748 | }
|
---|
| 749 |
|
---|
[407638e] | 750 | void GLWorldView::sceneHoverSignalled(const atom *_atom)
|
---|
| 751 | {
|
---|
| 752 | emit hoverChanged(_atom);
|
---|
| 753 | }
|
---|