[907636] | 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/>.
|
---|
[907636] | 22 | */
|
---|
| 23 |
|
---|
| 24 | /*
|
---|
| 25 | * GLWorldScene.cpp
|
---|
| 26 | *
|
---|
| 27 | * This is based on the Qt3D example "teaservice", specifically parts of teaservice.cpp.
|
---|
| 28 | *
|
---|
| 29 | * Created on: Aug 17, 2011
|
---|
| 30 | * Author: heber
|
---|
| 31 | */
|
---|
| 32 |
|
---|
| 33 | // include config.h
|
---|
| 34 | #ifdef HAVE_CONFIG_H
|
---|
| 35 | #include <config.h>
|
---|
| 36 | #endif
|
---|
| 37 |
|
---|
| 38 | #include "GLWorldScene.hpp"
|
---|
[d1196d] | 39 | #include <Qt3D/qglview.h>
|
---|
[bca99d] | 40 | #include <Qt3D/qglbuilder.h>
|
---|
| 41 | #include <Qt3D/qglscenenode.h>
|
---|
| 42 | #include <Qt3D/qglsphere.h>
|
---|
| 43 | #include <Qt3D/qglcylinder.h>
|
---|
[907636] | 44 |
|
---|
[015f8c] | 45 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp"
|
---|
| 46 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp"
|
---|
| 47 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp"
|
---|
| 48 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp"
|
---|
| 49 | #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_shape.hpp"
|
---|
| 50 |
|
---|
[2f7988] | 51 | #include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp"
|
---|
[907636] | 52 |
|
---|
| 53 | #include "CodePatterns/MemDebug.hpp"
|
---|
| 54 |
|
---|
[7188b1] | 55 | #include "CodePatterns/Log.hpp"
|
---|
| 56 |
|
---|
[0e9ffe] | 57 | #include "Actions/SelectionAction/Atoms/AtomByIdAction.hpp"
|
---|
[89643d] | 58 | #include "Actions/SelectionAction/Atoms/NotAtomByIdAction.hpp"
|
---|
[6966b7] | 59 | #include "Actions/SelectionAction/Molecules/MoleculeByIdAction.hpp"
|
---|
| 60 | #include "Actions/SelectionAction/Molecules/NotMoleculeByIdAction.hpp"
|
---|
[6f0841] | 61 | #include "Atom/atom.hpp"
|
---|
[7188b1] | 62 | #include "Bond/bond.hpp"
|
---|
[89643d] | 63 | #include "Descriptors/AtomIdDescriptor.hpp"
|
---|
[8c001a] | 64 | #include "Descriptors/MoleculeIdDescriptor.hpp"
|
---|
[37b2575] | 65 | #include "Helpers/helpers.hpp"
|
---|
[85c36d] | 66 | #include "Shapes/ShapeRegistry.hpp"
|
---|
[907636] | 67 | #include "molecule.hpp"
|
---|
| 68 | #include "World.hpp"
|
---|
| 69 |
|
---|
[2ad1ec] | 70 | #include <iostream>
|
---|
| 71 |
|
---|
[ce7fdc] | 72 | using namespace MoleCuilder;
|
---|
[907636] | 73 |
|
---|
[15c8a9] | 74 | GLWorldScene::GLWorldScene(
|
---|
[2f7988] | 75 | QtObservedInstanceBoard * _board,
|
---|
[15c8a9] | 76 | QObject *parent) :
|
---|
| 77 | QObject(parent),
|
---|
| 78 | selectionMode(SelectAtom),
|
---|
| 79 | board(_board)
|
---|
[907636] | 80 | {
|
---|
[72a4c1] | 81 | int sphereDetails[] = {5, 3, 2, 0};
|
---|
| 82 | int cylinderDetails[] = {16, 8, 6, 3};
|
---|
| 83 | for (int i=0;i<GLMoleculeObject::DETAILTYPES_MAX;i++){
|
---|
| 84 | QGLBuilder emptyBuilder;
|
---|
[8c001a] | 85 | GLMoleculeObject::meshEmpty[i] = emptyBuilder.finalizedSceneNode();
|
---|
[72a4c1] | 86 | QGLBuilder sphereBuilder;
|
---|
| 87 | sphereBuilder << QGLSphere(2.0, sphereDetails[i]);
|
---|
[8c001a] | 88 | GLMoleculeObject::meshSphere[i] = sphereBuilder.finalizedSceneNode();
|
---|
| 89 | GLMoleculeObject::meshSphere[i]->setOption(QGLSceneNode::CullBoundingBox, true);
|
---|
[72a4c1] | 90 | QGLBuilder cylinderBuilder;
|
---|
| 91 | cylinderBuilder << QGLCylinder(.25,.25,1.0,cylinderDetails[i]);
|
---|
[8c001a] | 92 | GLMoleculeObject::meshCylinder[i] = cylinderBuilder.finalizedSceneNode();
|
---|
| 93 | GLMoleculeObject::meshCylinder[i]->setOption(QGLSceneNode::CullBoundingBox, true);
|
---|
[72a4c1] | 94 | }
|
---|
[1b07b1] | 95 | connect(board, SIGNAL(moleculeInserted(QtObservedMolecule::ptr)),
|
---|
[59f1bc] | 96 | this, SLOT(moleculeSignOn(QtObservedMolecule::ptr)), Qt::DirectConnection);
|
---|
[f91ef6] | 97 | connect(board, SIGNAL(moleculeRemoved(ObservedValue_Index_t)),
|
---|
| 98 | this, SLOT(moleculeSignOff(ObservedValue_Index_t)), Qt::DirectConnection);
|
---|
[59f1bc] | 99 | connect(board, SIGNAL(atomInserted(QtObservedAtom::ptr)),
|
---|
| 100 | this, SLOT(atomInserted(QtObservedAtom::ptr)));
|
---|
[f91ef6] | 101 | connect(board, SIGNAL(atomRemoved(ObservedValue_Index_t)),
|
---|
| 102 | this, SLOT(atomRemoved(ObservedValue_Index_t)));
|
---|
[8281cc] | 103 | connect(this, SIGNAL(insertMolecule(QtObservedMolecule::ptr)),
|
---|
| 104 | this, SLOT(moleculeInserted(QtObservedMolecule::ptr)) );
|
---|
[e29427] | 105 | connect(this, SIGNAL(removeMolecule(QtObservedMolecule*)),
|
---|
| 106 | this, SLOT(moleculeRemoved(QtObservedMolecule*)) );
|
---|
[0a6ff9] | 107 |
|
---|
[f714763] | 108 | // connect(this, SIGNAL(updated()), this, SLOT(update()));
|
---|
[907636] | 109 | }
|
---|
| 110 |
|
---|
| 111 | GLWorldScene::~GLWorldScene()
|
---|
[7188b1] | 112 | {
|
---|
| 113 | // remove all elements
|
---|
| 114 | GLMoleculeObject::cleanMaterialMap();
|
---|
| 115 | }
|
---|
[907636] | 116 |
|
---|
[8c001a] | 117 | void GLWorldScene::atomClicked(atomId_t no)
|
---|
| 118 | {
|
---|
| 119 | LOG(3, "INFO: GLMoleculeObject_molecule - atom " << no << " has been clicked.");
|
---|
[f01769] | 120 | const atom * const Walker = const_cast<const World &>(World::getInstance()).
|
---|
| 121 | getAtom(AtomById(no));
|
---|
[369cb1] | 122 | ASSERT( Walker != NULL,
|
---|
| 123 | "GLWorldScene::atomClicked() - clicked atom has disappeared.");
|
---|
[8c001a] | 124 | if (selectionMode == SelectAtom){
|
---|
| 125 | if (!World::getInstance().isSelected(Walker))
|
---|
| 126 | SelectionAtomById(std::vector<atomId_t>(1,no));
|
---|
| 127 | else
|
---|
| 128 | SelectionNotAtomById(std::vector<atomId_t>(1,no));
|
---|
| 129 | }else if (selectionMode == SelectMolecule){
|
---|
| 130 | const molecule *mol = Walker->getMolecule();
|
---|
| 131 | ASSERT(mol, "Atom without molecule has been clicked.");
|
---|
[d7cad1] | 132 | molids_t ids(1, mol->getId());
|
---|
[8c001a] | 133 | if (!World::getInstance().isSelected(mol))
|
---|
[d7cad1] | 134 | SelectionMoleculeById(ids);
|
---|
[8c001a] | 135 | else
|
---|
[d7cad1] | 136 | SelectionNotMoleculeById(ids);
|
---|
[8c001a] | 137 | }
|
---|
| 138 | emit clicked(no);
|
---|
| 139 | }
|
---|
| 140 |
|
---|
[9a7ef9] | 141 | void GLWorldScene::moleculeClicked(moleculeId_t no)
|
---|
| 142 | {
|
---|
| 143 | LOG(3, "INFO: GLMoleculeObject_molecule - mol " << no << " has been clicked.");
|
---|
[63fb7a] | 144 | const molecule * const mol= const_cast<const World &>(World::getInstance()).
|
---|
| 145 | getMolecule(MoleculeById(no));
|
---|
[9a7ef9] | 146 | ASSERT(mol, "Atom without molecule has been clicked.");
|
---|
[d7cad1] | 147 | molids_t ids(1, mol->getId());
|
---|
[9a7ef9] | 148 | if (!World::getInstance().isSelected(mol))
|
---|
[d7cad1] | 149 | SelectionMoleculeById(ids);
|
---|
[9a7ef9] | 150 | else
|
---|
[d7cad1] | 151 | SelectionNotMoleculeById(ids);
|
---|
[9a7ef9] | 152 | emit clicked(no);
|
---|
| 153 | }
|
---|
| 154 |
|
---|
[59f1bc] | 155 | /** Prepares insertion of a general atom.
|
---|
[9c259e] | 156 | *
|
---|
[59f1bc] | 157 | * This is called before the insertion into a molecule and thus before the
|
---|
| 158 | * insertion into the scene.
|
---|
| 159 | *
|
---|
| 160 | * @param _atom atom to insert
|
---|
[9c259e] | 161 | */
|
---|
[1b07b1] | 162 | void GLWorldScene::atomInserted(QtObservedAtom::ptr _atom)
|
---|
[9c259e] | 163 | {
|
---|
[f91ef6] | 164 | const ObservedValue_Index_t atomid = _atom->getIndex();
|
---|
[59f1bc] | 165 | ASSERT( QtObservedAtomMap.find(atomid) == QtObservedAtomMap.end(),
|
---|
[f91ef6] | 166 | "GLWorldScene::AtomInserted() - atom with id "+toString(_atom->getAtomIndex())
|
---|
[59f1bc] | 167 | +" is already present in QtObservedAtomMap.");
|
---|
| 168 | QtObservedAtomMap[atomid] = _atom;
|
---|
| 169 | }
|
---|
| 170 |
|
---|
| 171 | /** Removes an general atom.
|
---|
| 172 | *
|
---|
| 173 | * This is called when the atom has been removed from the molecule.
|
---|
| 174 | *
|
---|
| 175 | * @param _atom atom to remove
|
---|
| 176 | */
|
---|
[f91ef6] | 177 | void GLWorldScene::atomRemoved(ObservedValue_Index_t _atomid)
|
---|
[59f1bc] | 178 | {
|
---|
| 179 | const QtObservedAtomMap_t::iterator eraseiter = QtObservedAtomMap.find(_atomid);
|
---|
| 180 | ASSERT( eraseiter != QtObservedAtomMap.end(),
|
---|
| 181 | "GLWorldScene::AtomRemoved() - atom with id "+toString(_atomid)
|
---|
| 182 | +" is not present in QtObservedAtomMap.");
|
---|
| 183 | QtObservedAtomMap.erase(eraseiter);
|
---|
| 184 | }
|
---|
| 185 |
|
---|
| 186 | /** Inserts an atom into the scene when molecule is present.
|
---|
| 187 | *
|
---|
| 188 | * @param _atom atom to insert
|
---|
| 189 | */
|
---|
[96e145] | 190 | void GLWorldScene::moleculesAtomInserted(QtObservedAtom::ptr _atom, QtObservedMolecule * _mol)
|
---|
[59f1bc] | 191 | {
|
---|
[f91ef6] | 192 | const ObservedValue_Index_t atomid = _atom->getIndex();
|
---|
[1187c5] | 193 | // this ASSERT cannot work: The same molecule may get reassigned to a different
|
---|
| 194 | // molecule, when e.g. the time step changes (which triggers an update-molecules).
|
---|
| 195 | // The GUI is slow and may lack behind and thus get to execute the event
|
---|
| 196 | // moleculeAtomInserted when the change has been already been done.
|
---|
| 197 | // ASSERT( (atommol == NULL) || (_mol == atommol),
|
---|
| 198 | // "GLWorldScene::moleculesAtomInserted() - atom "+toString(atomid)
|
---|
| 199 | // +" claims to belong to QtObservedMolecule "+toString(atommol)
|
---|
| 200 | // +" but signal came from QtObservedMolecule "+toString(_mol)+".");
|
---|
[f91ef6] | 201 | LOG(3, "INFO: GLWorldScene: Received signal atomInserted for atom " << _atom->getAtomIndex());
|
---|
| 202 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
[7c7c4a] | 203 |
|
---|
[9c259e] | 204 | // check of molecule is already present
|
---|
[59f1bc] | 205 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
[96e145] | 206 | const MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid);
|
---|
[8d5fbf1] | 207 | if (moliter != MoleculesinSceneMap.end()) {
|
---|
[4a187d] | 208 | const RemovedMoleculesMap_t::iterator emptyiter = EmptyMolecules.find(_mol);
|
---|
| 209 | if (emptyiter != EmptyMolecules.end())
|
---|
| 210 | EmptyMolecules.erase(emptyiter);
|
---|
[96e145] | 211 | // check that it is the right molecule
|
---|
| 212 | QtObservedMolecule::ptr &checkmol = moliter->second->ObservedMolecule;
|
---|
| 213 | if (checkmol.get() == _mol) {
|
---|
[f91ef6] | 214 | LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomInserted for atom "
|
---|
| 215 | << _atom->getAtomIndex());
|
---|
[96e145] | 216 | QMetaObject::invokeMethod(moliter->second, // pointer to a QObject
|
---|
| 217 | "atomInserted", // member name (no parameters here)
|
---|
| 218 | Qt::QueuedConnection, // connection type
|
---|
| 219 | Q_ARG(QtObservedAtom::ptr, _atom)); // parameters
|
---|
| 220 | } else {
|
---|
| 221 | // relay atomRemoved to GLMoleculeObject_molecule in RemovedMolecules
|
---|
| 222 | // LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomInserted for atom "+toString(_atomid)
|
---|
| 223 | // +" to molecule in RemovedMolecules.");
|
---|
[e29427] | 224 | // const RemovedMoleculesMap_t::iterator removedmoliter = RemovedMolecules.find(molid);
|
---|
[96e145] | 225 | // ASSERT( removedmoliter != RemovedMolecules.end(),
|
---|
| 226 | // "GLWorldScene::moleculesAtomInserted() - signal from old mol "
|
---|
| 227 | // +toString(molid)+", but not present in RemovedMolecules");
|
---|
| 228 | // QMetaObject::invokeMethod(removedmoliter->second, // pointer to a QObject
|
---|
| 229 | // "atomInserted ", // member name (no parameters here)
|
---|
| 230 | // Qt::QueuedConnection, // connection type
|
---|
| 231 | // Q_ARG(QtObservedAtom::ptr, _atom)); // parameters
|
---|
| 232 | ASSERT( 0,
|
---|
| 233 | "GLWorldScene::moleculesAtomInserted() - would need to send atomInserted to already removed molecule.");
|
---|
| 234 | }
|
---|
[9c259e] | 235 | } else {
|
---|
[e29427] | 236 | const RemovedMoleculesMap_t::iterator removedmoliter = RemovedMolecules.find(_mol);
|
---|
| 237 | if (removedmoliter != RemovedMolecules.end()) {
|
---|
| 238 | ASSERT( 0,
|
---|
| 239 | "GLWorldScene::moleculesAtomInserted() - would need to send atomInserted to already removed molecule.");
|
---|
| 240 | } else {
|
---|
| 241 | boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
| 242 | // only record missed state for molecule if (still) present but not instantiated
|
---|
| 243 | if (QtObservedMoleculeMap.count(molid)) {
|
---|
| 244 | // store signal for when it is instantiated
|
---|
| 245 | if (MoleculeMissedStateMap.count(molid) == 0)
|
---|
| 246 | MoleculeMissedStateMap.insert( std::make_pair(molid ,StateChangeMap_t()) );
|
---|
| 247 | MoleculeMissedStateMap[molid].insert( std::make_pair(atomid, atomInsertedState) );
|
---|
| 248 | ASSERT( QtObservedAtomMap[atomid] == _atom,
|
---|
| 249 | "GLWorldScene::moleculesAtomInserted() - atom "+toString(atomid)
|
---|
[f91ef6] | 250 | +" inserted in molecule "+toString(_mol->getMolIndex())
|
---|
[e29427] | 251 | +" which does not match atom in QtObservedAtomMap.");
|
---|
[f91ef6] | 252 | LOG(3, "INFO: GLWorldScene: Placing atomInserted for atom " << _atom->getAtomIndex()
|
---|
| 253 | << " and molecule " << _mol->getMolIndex() << " into missed state map.");
|
---|
[e29427] | 254 | }
|
---|
[59f1bc] | 255 | }
|
---|
[9c259e] | 256 | }
|
---|
| 257 | }
|
---|
| 258 |
|
---|
| 259 | /** Removes an atom into the scene before molecule is present.
|
---|
| 260 | *
|
---|
[59f1bc] | 261 | * @param _atomid atom to remove
|
---|
[9c259e] | 262 | */
|
---|
[f91ef6] | 263 | void GLWorldScene::moleculesAtomRemoved(ObservedValue_Index_t _atomid, QtObservedMolecule * _mol)
|
---|
[9c259e] | 264 | {
|
---|
[8281cc] | 265 | LOG(3, "INFO: GLWorldScene: Received signal atomRemoved for atom "+toString(_atomid)+".");
|
---|
| 266 |
|
---|
[f91ef6] | 267 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
[805fdc] | 268 | // check of molecule is already present
|
---|
| 269 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
| 270 | const MoleculeNodeMap::iterator moliter = MoleculesinSceneMap.find(molid);
|
---|
| 271 | if (moliter != MoleculesinSceneMap.end()) {
|
---|
| 272 | const QtObservedMolecule::ptr &checkmol = moliter->second->ObservedMolecule;
|
---|
| 273 | if (checkmol.get() == _mol) {
|
---|
| 274 | LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomRemoved for atom "+toString(_atomid)+".");
|
---|
| 275 | QMetaObject::invokeMethod(moliter->second, // pointer to a QObject
|
---|
| 276 | "atomRemoved", // member name (no parameters here)
|
---|
| 277 | Qt::QueuedConnection, // connection type
|
---|
[f91ef6] | 278 | Q_ARG(ObservedValue_Index_t, _atomid)); // parameters
|
---|
[805fdc] | 279 | } else {
|
---|
| 280 | // relay atomRemoved to GLMoleculeObject_molecule in RemovedMolecules
|
---|
| 281 | LOG(3, "INFO: GLWorldScene: Sending signal moleculesAtomRemoved for atom "+toString(_atomid)
|
---|
| 282 | +" to molecule in RemovedMolecules.");
|
---|
[e29427] | 283 | const RemovedMoleculesMap_t::iterator removedmoliter = RemovedMolecules.find(_mol);
|
---|
[805fdc] | 284 | ASSERT( removedmoliter != RemovedMolecules.end(),
|
---|
| 285 | "GLWorldScene::moleculesAtomRemoved() - signal from old molecule "
|
---|
| 286 | +toString(molid)+", but not present in RemovedMolecules");
|
---|
| 287 | #ifndef NDEBUG
|
---|
| 288 | const QtObservedMolecule::ptr &othercheckmol = removedmoliter->second->ObservedMolecule;
|
---|
| 289 | #endif
|
---|
| 290 | ASSERT( othercheckmol.get() == _mol,
|
---|
| 291 | "GLWorldScene::moleculesAtomRemoved() - signal from old molecule "
|
---|
| 292 | +toString(molid)+", but different one "+toString(othercheckmol)
|
---|
| 293 | +" present in RemovedMolecules.");
|
---|
| 294 | QMetaObject::invokeMethod(removedmoliter->second, // pointer to a QObject
|
---|
| 295 | "atomRemoved", // member name (no parameters here)
|
---|
| 296 | Qt::QueuedConnection, // connection type
|
---|
[f91ef6] | 297 | Q_ARG(ObservedValue_Index_t, _atomid)); // parameters
|
---|
[805fdc] | 298 | }
|
---|
| 299 | } else {
|
---|
[e29427] | 300 | const RemovedMoleculesMap_t::iterator removedmoliter = RemovedMolecules.find(_mol);
|
---|
[805fdc] | 301 | if (removedmoliter != RemovedMolecules.end()) {
|
---|
| 302 | ASSERT( removedmoliter != RemovedMolecules.end(),
|
---|
| 303 | "GLWorldScene::moleculesAtomRemoved() - signal from old molecule "
|
---|
| 304 | +toString(molid)+", but not present in RemovedMolecules");
|
---|
| 305 | #ifndef NDEBUG
|
---|
| 306 | const QtObservedMolecule::ptr &othercheckmol = removedmoliter->second->ObservedMolecule;
|
---|
| 307 | #endif
|
---|
| 308 | ASSERT( othercheckmol.get() == _mol,
|
---|
| 309 | "GLWorldScene::moleculesAtomRemoved() - signal from old molecule "
|
---|
| 310 | +toString(molid)+", but different one "+toString(othercheckmol)
|
---|
| 311 | +" present in RemovedMolecules.");
|
---|
| 312 | QMetaObject::invokeMethod(removedmoliter->second, // pointer to a QObject
|
---|
| 313 | "atomRemoved", // member name (no parameters here)
|
---|
| 314 | Qt::QueuedConnection, // connection type
|
---|
[f91ef6] | 315 | Q_ARG(ObservedValue_Index_t, _atomid)); // parameters
|
---|
[8281cc] | 316 | } else {
|
---|
[59f1bc] | 317 | boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
| 318 | // only record missed state for molecule if (still) present but not instantiated
|
---|
| 319 | if (QtObservedMoleculeMap.count(molid)) {
|
---|
| 320 | // store signal for when it is instantiated
|
---|
| 321 | if (MoleculeMissedStateMap.count(molid) == 0)
|
---|
| 322 | MoleculeMissedStateMap.insert( std::make_pair(molid, StateChangeMap_t()) );
|
---|
| 323 | MoleculeMissedStateMap[molid].insert( std::make_pair(_atomid, atomRemovedState) );
|
---|
| 324 | LOG(3, "INFO: GLWorldScene: Placing atomRemoved for atom " << _atomid
|
---|
| 325 | << " and molecule " << molid << " into missed state map.");
|
---|
| 326 | }
|
---|
[8281cc] | 327 | }
|
---|
[9c259e] | 328 | }
|
---|
| 329 | }
|
---|
| 330 |
|
---|
[8281cc] | 331 | void GLWorldScene::moleculeSignOn(QtObservedMolecule::ptr _mol)
|
---|
| 332 | {
|
---|
| 333 | // sign on to QtObservedMolecule to get atomInserted/..Removed signals from same
|
---|
| 334 | // source as GLMoleculeObject_molecule would
|
---|
[96e145] | 335 | connect(_mol.get(), SIGNAL(atomInserted(QtObservedAtom::ptr, QtObservedMolecule *)),
|
---|
| 336 | this, SLOT(moleculesAtomInserted(QtObservedAtom::ptr, QtObservedMolecule *)) );
|
---|
[f91ef6] | 337 | connect(_mol.get(), SIGNAL(atomRemoved(ObservedValue_Index_t, QtObservedMolecule *)),
|
---|
| 338 | this, SLOT(moleculesAtomRemoved(ObservedValue_Index_t, QtObservedMolecule *)) );
|
---|
| 339 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
[59f1bc] | 340 | ASSERT( QtObservedMoleculeMap.find(molid) == QtObservedMoleculeMap.end(),
|
---|
[f91ef6] | 341 | "GLWorldScene::moleculeSignOn() - molecule with id "+toString(_mol->getMolIndex())
|
---|
[59f1bc] | 342 | +" is already present in QtObservedMoleculeMap.");
|
---|
| 343 | QtObservedMoleculeMap[molid] = _mol;
|
---|
[8281cc] | 344 |
|
---|
[f91ef6] | 345 | LOG(3, "INFO: GLWorldScene: Received signal moleculeSignOn for molecule " << _mol->getMolIndex());
|
---|
[8281cc] | 346 |
|
---|
| 347 | emit insertMolecule(_mol);
|
---|
| 348 | }
|
---|
| 349 |
|
---|
[f91ef6] | 350 | void GLWorldScene::moleculeSignOff(ObservedValue_Index_t _id)
|
---|
[8281cc] | 351 | {
|
---|
[59f1bc] | 352 | const QtObservedMoleculeMap_t::iterator eraseiter = QtObservedMoleculeMap.find(_id);
|
---|
| 353 | ASSERT( eraseiter != QtObservedMoleculeMap.end(),
|
---|
[8281cc] | 354 | "GLWorldScene::moleculeSignOff() - cannot find id "+toString(_id)+" in map.");
|
---|
[e29427] | 355 | QtObservedMolecule * mol = eraseiter->second.get();
|
---|
[59f1bc] | 356 | QtObservedMoleculeMap.erase(eraseiter);
|
---|
[8281cc] | 357 |
|
---|
[f91ef6] | 358 | LOG(3, "INFO: GLWorldScene: Received signal moleculeSignOff for molecule " << mol->getMolIndex());
|
---|
[8281cc] | 359 |
|
---|
[e29427] | 360 | emit removeMolecule(mol);
|
---|
[8281cc] | 361 | }
|
---|
| 362 |
|
---|
[026bef] | 363 | /** Inserts a molecule into the scene.
|
---|
[c67518] | 364 | *
|
---|
[8c001a] | 365 | * @param _mol molecule to insert
|
---|
[c67518] | 366 | */
|
---|
[1b07b1] | 367 | void GLWorldScene::moleculeInserted(QtObservedMolecule::ptr _mol)
|
---|
[c67518] | 368 | {
|
---|
[1b07b1] | 369 | ASSERT (_mol,
|
---|
| 370 | "GLWorldScene::moleculeInserted() - received shared_ptr for molecule is empty?");
|
---|
[f91ef6] | 371 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
| 372 | LOG(3, "INFO: GLWorldScene: Received signal moleculeInserted for molecule "
|
---|
| 373 | << _mol->getMolIndex());
|
---|
[7cf0eb] | 374 |
|
---|
| 375 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
| 376 |
|
---|
[1b07b1] | 377 | MoleculeNodeMap::const_iterator iter = MoleculesinSceneMap.find(molid);
|
---|
[8c001a] | 378 | ASSERT( iter == MoleculesinSceneMap.end(),
|
---|
[f91ef6] | 379 | "GLWorldScene::moleculeInserted() - molecule's id "+toString(_mol->getMolIndex())
|
---|
| 380 | +" already present.");
|
---|
[8c001a] | 381 |
|
---|
| 382 | // add new object
|
---|
[f91ef6] | 383 | LOG(1, "DEBUG: Adding GLMoleculeObject_molecule to id " << _mol->getMolIndex());
|
---|
[1b07b1] | 384 | GLMoleculeObject_molecule *molObject =
|
---|
| 385 | new GLMoleculeObject_molecule(
|
---|
| 386 | GLMoleculeObject::meshEmpty,
|
---|
| 387 | this,
|
---|
| 388 | *board,
|
---|
| 389 | _mol);
|
---|
| 390 | ASSERT( molObject != NULL,
|
---|
[f91ef6] | 391 | "GLWorldScene::moleculeInserted - could not create molecule object for "
|
---|
| 392 | +toString(_mol->getMolIndex()));
|
---|
[1b07b1] | 393 | #ifndef NDEBUG
|
---|
| 394 | std::pair<MoleculeNodeMap::iterator, bool> inserter =
|
---|
| 395 | #endif
|
---|
| 396 | MoleculesinSceneMap.insert( make_pair(molid, molObject) );
|
---|
| 397 | ASSERT(inserter.second,
|
---|
[f91ef6] | 398 | "GLWorldScene::moleculeInserted() - molecule "+toString(_mol->getMolIndex())
|
---|
| 399 | +" already present in scene.");
|
---|
[1b07b1] | 400 |
|
---|
| 401 | // now handle all state changes that came up before the instantiation
|
---|
| 402 | if (MoleculeMissedStateMap.count(molid) != 0) {
|
---|
| 403 | // ASSERT( !MoleculeMissedStateMap[molid].empty(),
|
---|
[4cac6c] | 404 | // "GLWorldScene::moleculeInserted() - we have an empty state change map for molecule with id "
|
---|
[1b07b1] | 405 | // +toString(molid));
|
---|
| 406 | boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
| 407 | for (StateChangeMap_t::iterator iter = MoleculeMissedStateMap[molid].begin();
|
---|
| 408 | !MoleculeMissedStateMap[molid].empty();
|
---|
| 409 | iter = MoleculeMissedStateMap[molid].begin()) {
|
---|
| 410 | std::pair<StateChangeMap_t::iterator, StateChangeMap_t::iterator> rangeiter =
|
---|
| 411 | MoleculeMissedStateMap[molid].equal_range(iter->first);
|
---|
| 412 | const size_t StateCounts = std::distance(rangeiter.first, rangeiter.second);
|
---|
| 413 | if (StateCounts > 1) {
|
---|
| 414 | // more than one state change, have to combine
|
---|
| 415 | typedef std::map<StateChangeType, size_t> StateChangeAmounts_t;
|
---|
| 416 | StateChangeAmounts_t StateChangeAmounts;
|
---|
| 417 | for (StateChangeMap_t::const_iterator stateiter = rangeiter.first;
|
---|
| 418 | stateiter != rangeiter.second; ++stateiter)
|
---|
| 419 | ++StateChangeAmounts[stateiter->second];
|
---|
| 420 | ASSERT( StateChangeAmounts[atomInsertedState] >= StateChangeAmounts[atomRemovedState],
|
---|
| 421 | "GLWorldScene::moleculeInserted() - more atomRemoved states "
|
---|
| 422 | +toString(StateChangeAmounts[atomRemovedState])+" than atomInserted "
|
---|
| 423 | +toString(StateChangeAmounts[atomInsertedState])+" for atom "+toString(iter->first));
|
---|
| 424 | if (StateChangeAmounts[atomInsertedState] > StateChangeAmounts[atomRemovedState]) {
|
---|
| 425 | LOG(1, "INFO: invoking atomInserted for atom " << iter->first);
|
---|
| 426 | QMetaObject::invokeMethod(molObject, // pointer to a QObject
|
---|
| 427 | "atomInserted", // member name (no parameters here)
|
---|
| 428 | Qt::QueuedConnection, // connection type
|
---|
| 429 | Q_ARG(QtObservedAtom::ptr, QtObservedAtomMap[iter->first])); // parameters
|
---|
| 430 | } else {
|
---|
| 431 | LOG(1, "INFO: Atom " << iter->first << " has been inserted and removed already.");
|
---|
| 432 | }
|
---|
| 433 | // removed all state changes for this atom
|
---|
| 434 | MoleculeMissedStateMap[molid].erase(rangeiter.first, rangeiter.second);
|
---|
| 435 | } else {
|
---|
| 436 | // can only be an insertion
|
---|
| 437 | switch (rangeiter.first->second) {
|
---|
| 438 | case atomRemovedState:
|
---|
| 439 | ASSERT( 0,
|
---|
| 440 | "GLWorldScene::moleculeInserted() - atomRemoved state without atomInserted for atom "
|
---|
| 441 | +toString(iter->first));
|
---|
| 442 | break;
|
---|
| 443 | case atomInsertedState:
|
---|
| 444 | {
|
---|
[73b13c] | 445 | LOG(1, "INFO: invoking atomInserted for atom " << iter->first);
|
---|
[9c259e] | 446 | QMetaObject::invokeMethod(molObject, // pointer to a QObject
|
---|
| 447 | "atomInserted", // member name (no parameters here)
|
---|
[8d5fbf1] | 448 | Qt::QueuedConnection, // connection type
|
---|
[1b07b1] | 449 | Q_ARG(QtObservedAtom::ptr, QtObservedAtomMap[iter->first])); // parameters
|
---|
| 450 | break;
|
---|
[7ded1c] | 451 | }
|
---|
[1b07b1] | 452 | default:
|
---|
| 453 | ASSERT( 0,
|
---|
| 454 | "GLWorldScene::moleculeInserted() - there are unknown change states.");
|
---|
| 455 | break;
|
---|
[9c259e] | 456 | }
|
---|
[7ded1c] | 457 | // removed state changes for this atom
|
---|
[1b07b1] | 458 | MoleculeMissedStateMap[molid].erase(iter);
|
---|
[9c259e] | 459 | }
|
---|
| 460 | }
|
---|
| 461 | }
|
---|
| 462 |
|
---|
[1b07b1] | 463 | connect (molObject, SIGNAL(changed()), this, SIGNAL(changed()));
|
---|
| 464 | connect (molObject, SIGNAL(changeOccured()), this, SIGNAL(changeOccured()));
|
---|
| 465 | connect (molObject, SIGNAL(atomClicked(atomId_t)), this, SLOT(atomClicked(atomId_t)));
|
---|
| 466 | connect (molObject, SIGNAL(moleculeClicked(moleculeId_t)), this, SLOT(moleculeClicked(moleculeId_t)));
|
---|
[e29427] | 467 | connect (molObject, SIGNAL(moleculeEmptied(QtObservedMolecule::ptr)), this, SLOT(moleculeEmpty(QtObservedMolecule::ptr)));
|
---|
[1b07b1] | 468 | connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed()));
|
---|
| 469 | connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed()));
|
---|
| 470 | connect (molObject, SIGNAL(hoverChanged(const atomId_t)), this, SIGNAL(hoverChanged(const atomId_t)));
|
---|
| 471 | connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int)));
|
---|
| 472 | connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int)));
|
---|
| 473 |
|
---|
| 474 | emit changed();
|
---|
| 475 | emit changeOccured();
|
---|
| 476 |
|
---|
[7ded1c] | 477 | // remove state change map for the molecule
|
---|
| 478 | {
|
---|
| 479 | boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
[1b07b1] | 480 | MoleculeMissedStateMap.erase(molid);
|
---|
[7ded1c] | 481 | }
|
---|
[c67518] | 482 | }
|
---|
| 483 |
|
---|
[7cf0eb] | 484 | /** Removes a molecule from the scene.
|
---|
| 485 | *
|
---|
[e29427] | 486 | * @param _mol QtObservedMolecule instance of molecule to remove
|
---|
[7cf0eb] | 487 | */
|
---|
[e29427] | 488 | void GLWorldScene::moleculeRemoved(QtObservedMolecule* _mol)
|
---|
[7cf0eb] | 489 | {
|
---|
[f91ef6] | 490 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
[e29427] | 491 | LOG(3, "INFO: GLWorldScene: Received signal moleculeRemoved for molecule "+toString(molid)+".");
|
---|
[7c7c4a] | 492 |
|
---|
[7cf0eb] | 493 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
| 494 |
|
---|
[e29427] | 495 | MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(molid);
|
---|
[4a187d] | 496 | ASSERT ( iter != MoleculesinSceneMap.end(),
|
---|
[f91ef6] | 497 | "GLWorldScene::moleculeRemoved() - to be removed molecule "+toString(_mol->getMolIndex())
|
---|
[4a187d] | 498 | +" is already gone.");
|
---|
| 499 | // check if it's already empty
|
---|
| 500 | const RemovedMoleculesMap_t::iterator emptyiter = EmptyMolecules.find(_mol);
|
---|
| 501 | if (emptyiter != EmptyMolecules.end()) {
|
---|
[f91ef6] | 502 | LOG(1, "DEBUG: Removing empty GLMoleculeObject_molecule to id " << _mol->getMolIndex()
|
---|
| 503 | << " from scene.");
|
---|
[4a187d] | 504 | // it's already empty, remove it
|
---|
| 505 | ASSERT( emptyiter->second == iter->second,
|
---|
| 506 | "GLWorldScene::moleculeRemoved() - empty molecule "
|
---|
| 507 | +toString(emptyiter->second)+" and removed molecule "
|
---|
| 508 | +toString(iter->second)+" don't match.");
|
---|
[f91ef6] | 509 | LOG(1, "DEBUG: Deleting already empty GLMoleculeObject_molecule to id " << _mol->getMolIndex());
|
---|
[4a187d] | 510 | GLMoleculeObject_molecule *molObject = emptyiter->second;
|
---|
| 511 | EmptyMolecules.erase(emptyiter);
|
---|
| 512 | molObject->disconnect();
|
---|
| 513 | delete molObject;
|
---|
| 514 |
|
---|
| 515 | emit changed();
|
---|
| 516 | emit changeOccured();
|
---|
| 517 | } else {
|
---|
| 518 | // otherwise note it as removal candidate
|
---|
[e29427] | 519 | RemovedMolecules.insert( std::make_pair(_mol, iter->second) );
|
---|
[bcf9cd] | 520 | }
|
---|
[4a187d] | 521 | MoleculesinSceneMap.erase(iter);
|
---|
[bcf9cd] | 522 |
|
---|
| 523 | // remove any possible state changes left
|
---|
| 524 | {
|
---|
| 525 | boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
[e29427] | 526 | MoleculeMissedStateMap.erase(molid);
|
---|
[bcf9cd] | 527 | }
|
---|
| 528 | }
|
---|
| 529 |
|
---|
[e29427] | 530 | void GLWorldScene::moleculeEmpty(QtObservedMolecule::ptr _mol)
|
---|
[bcf9cd] | 531 | {
|
---|
[f91ef6] | 532 | LOG(3, "INFO: GLWorldScene: Received signal moleculeEmpty for molecule "
|
---|
| 533 | +toString(_mol->getMolIndex())+".");
|
---|
[bcf9cd] | 534 |
|
---|
| 535 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
| 536 |
|
---|
[f91ef6] | 537 | const ObservedValue_Index_t molid = _mol->getIndex();
|
---|
[4a187d] | 538 | MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(molid);
|
---|
| 539 | if ( iter == MoleculesinSceneMap.end()) {
|
---|
| 540 | RemovedMoleculesMap_t::iterator removeiter = RemovedMolecules.find(_mol.get());
|
---|
| 541 | ASSERT ( removeiter != RemovedMolecules.end(),
|
---|
[f91ef6] | 542 | "GLWorldScene::moleculeEmpty() - to be removed molecule "+toString(_mol->getMolIndex())
|
---|
[4a187d] | 543 | +" is neither in MoleculesinSceneMap, nor in RemovedMolecules.");
|
---|
| 544 | // it's noted for removal already, remove it
|
---|
[f91ef6] | 545 | LOG(1, "DEBUG: Deleting empty GLMoleculeObject_molecule to id " << _mol->getMolIndex());
|
---|
[4a187d] | 546 | GLMoleculeObject_molecule *molObject = removeiter->second;
|
---|
| 547 | RemovedMolecules.erase(removeiter);
|
---|
[7c7c4a] | 548 | molObject->disconnect();
|
---|
| 549 | delete molObject;
|
---|
[9c259e] | 550 |
|
---|
[4a187d] | 551 | emit changed();
|
---|
| 552 | emit changeOccured();
|
---|
| 553 | } else {
|
---|
| 554 | // otherwise just note it as empty
|
---|
| 555 | EmptyMolecules.insert( std::make_pair(_mol.get(), iter->second) );
|
---|
[73b13c] | 556 | }
|
---|
[9c259e] | 557 |
|
---|
[4a187d] | 558 | // // remove any possible state changes left
|
---|
| 559 | // {
|
---|
| 560 | // boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);
|
---|
| 561 | // MoleculeMissedStateMap.erase(molid);
|
---|
| 562 | // }
|
---|
[ce4126] | 563 | }
|
---|
| 564 |
|
---|
[f91ef6] | 565 | void GLWorldScene::moleculesVisibilityChanged(ObservedValue_Index_t _id, bool _visible)
|
---|
[739ee9] | 566 | {
|
---|
[7c7c4a] | 567 | boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex);
|
---|
[739ee9] | 568 | MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id);
|
---|
| 569 | ASSERT( iter != MoleculesinSceneMap.end(),
|
---|
[f91ef6] | 570 | "GLWorldScene::moleculeInserted() - molecule's id "
|
---|
| 571 | +toString(board->getMoleculeIdToIndex(_id))+" is unknown.");
|
---|
[739ee9] | 572 |
|
---|
| 573 | GLMoleculeObject_molecule *molObject = iter->second;
|
---|
| 574 | molObject->setVisible(_visible);
|
---|
| 575 |
|
---|
| 576 | emit changed();
|
---|
| 577 | emit changeOccured();
|
---|
| 578 | }
|
---|
| 579 |
|
---|
[f75491] | 580 | /** Adds a shape to the scene.
|
---|
[4d6662] | 581 | *
|
---|
[f75491] | 582 | */
|
---|
[07136a] | 583 | void GLWorldScene::addShape(const std::string &_name)
|
---|
[f75491] | 584 | {
|
---|
[07136a] | 585 | Shape * const shape = ShapeRegistry::getInstance().getByName(_name);
|
---|
| 586 | if (shape != NULL) {
|
---|
| 587 | GLMoleculeObject_shape *shapeObject = new GLMoleculeObject_shape(*shape, this);
|
---|
| 588 | ShapeNodeMap::iterator iter = ShapesinSceneMap.find(_name);
|
---|
| 589 | ASSERT(iter == ShapesinSceneMap.end(),
|
---|
| 590 | "GLWorldScene::addShape() - same shape "+_name+" added again.");
|
---|
| 591 | ShapesinSceneMap.insert( make_pair(_name, shapeObject) );
|
---|
| 592 | } else
|
---|
| 593 | ELOG(2, "GLWorldScene::addShape() - shape disappeared before we could draw it.");
|
---|
| 594 |
|
---|
| 595 | emit changed();
|
---|
[284551] | 596 | }
|
---|
| 597 |
|
---|
[07136a] | 598 | void GLWorldScene::removeShape(const std::string &_name)
|
---|
[85c36d] | 599 | {
|
---|
[07136a] | 600 | ShapeNodeMap::iterator iter = ShapesinSceneMap.find(_name);
|
---|
[ba6b5c] | 601 | ASSERT(iter != ShapesinSceneMap.end(),
|
---|
[07136a] | 602 | "GLWorldScene::removeShape() - shape "+_name+" not in scene.");
|
---|
[148dde0] | 603 | ShapesinSceneMap.erase(iter);
|
---|
[85c36d] | 604 | delete(iter->second);
|
---|
[07136a] | 605 |
|
---|
| 606 | emit changed();
|
---|
[85c36d] | 607 | }
|
---|
| 608 |
|
---|
| 609 | void GLWorldScene::updateSelectedShapes()
|
---|
[284551] | 610 | {
|
---|
| 611 | foreach (QObject *obj, children()) {
|
---|
| 612 | GLMoleculeObject_shape *shapeobj = qobject_cast<GLMoleculeObject_shape *>(obj);
|
---|
[85c36d] | 613 | if (shapeobj){
|
---|
| 614 | shapeobj->enable(ShapeRegistry::getInstance().isSelected(shapeobj->getShape()));
|
---|
| 615 | }
|
---|
[284551] | 616 | }
|
---|
[07136a] | 617 |
|
---|
| 618 | emit changed();
|
---|
[f75491] | 619 | }
|
---|
| 620 |
|
---|
[7188b1] | 621 | void GLWorldScene::initialize(QGLView *view, QGLPainter *painter) const
|
---|
| 622 | {
|
---|
| 623 | // Initialize all of the mesh objects that we have as children.
|
---|
| 624 | foreach (QObject *obj, children()) {
|
---|
| 625 | GLMoleculeObject *meshobj = qobject_cast<GLMoleculeObject *>(obj);
|
---|
| 626 | if (meshobj)
|
---|
| 627 | meshobj->initialize(view, painter);
|
---|
| 628 | }
|
---|
| 629 | }
|
---|
| 630 |
|
---|
[72a4c1] | 631 | void GLWorldScene::draw(QGLPainter *painter, const QVector4D &cameraPlane) const
|
---|
[7188b1] | 632 | {
|
---|
| 633 | // Draw all of the mesh objects that we have as children.
|
---|
| 634 | foreach (QObject *obj, children()) {
|
---|
| 635 | GLMoleculeObject *meshobj = qobject_cast<GLMoleculeObject *>(obj);
|
---|
| 636 | if (meshobj)
|
---|
[72a4c1] | 637 | meshobj->draw(painter, cameraPlane);
|
---|
[7188b1] | 638 | }
|
---|
[907636] | 639 | }
|
---|
[06ebf5] | 640 |
|
---|
[6966b7] | 641 | void GLWorldScene::setSelectionMode(SelectionModeType mode)
|
---|
| 642 | {
|
---|
| 643 | selectionMode = mode;
|
---|
| 644 | // TODO send update to toolbar
|
---|
| 645 | }
|
---|
| 646 |
|
---|
| 647 | void GLWorldScene::setSelectionModeAtom()
|
---|
| 648 | {
|
---|
| 649 | setSelectionMode(SelectAtom);
|
---|
| 650 | }
|
---|
| 651 |
|
---|
| 652 | void GLWorldScene::setSelectionModeMolecule()
|
---|
| 653 | {
|
---|
| 654 | setSelectionMode(SelectMolecule);
|
---|
| 655 | }
|
---|
[20f9b5] | 656 |
|
---|