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