[15c8a9] | 1 | /*
|
---|
| 2 | * Project: MoleCuilder
|
---|
| 3 | * Description: creates and alters molecular systems
|
---|
| 4 | * Copyright (C) 2015 Frederik Heber. All rights reserved.
|
---|
| 5 | *
|
---|
| 6 | *
|
---|
| 7 | * This file is part of MoleCuilder.
|
---|
| 8 | *
|
---|
| 9 | * MoleCuilder is free software: you can redistribute it and/or modify
|
---|
| 10 | * it under the terms of the GNU General Public License as published by
|
---|
| 11 | * the Free Software Foundation, either version 2 of the License, or
|
---|
| 12 | * (at your option) any later version.
|
---|
| 13 | *
|
---|
| 14 | * MoleCuilder is distributed in the hope that it will be useful,
|
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 17 | * GNU General Public License for more details.
|
---|
| 18 | *
|
---|
| 19 | * You should have received a copy of the GNU General Public License
|
---|
| 20 | * along with MoleCuilder. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 21 | */
|
---|
| 22 |
|
---|
| 23 | /*
|
---|
[2f7988] | 24 | * QtObservedInstanceBoard.cpp
|
---|
[15c8a9] | 25 | *
|
---|
| 26 | * Created on: Oct 17, 2015
|
---|
| 27 | * Author: heber
|
---|
| 28 | */
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | // include config.h
|
---|
| 32 | #ifdef HAVE_CONFIG_H
|
---|
| 33 | #include <config.h>
|
---|
| 34 | #endif
|
---|
| 35 |
|
---|
[2f7988] | 36 | #include "QtObservedInstanceBoard.hpp"
|
---|
[15c8a9] | 37 |
|
---|
[04c3a3] | 38 | #include <QtCore/QMetaType>
|
---|
| 39 |
|
---|
[65c323] | 40 | #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp"
|
---|
[494478] | 41 | #include "UIElements/Qt4/InstanceBoard/QtObservedMolecule.hpp"
|
---|
[15c8a9] | 42 |
|
---|
| 43 | #include "CodePatterns/MemDebug.hpp"
|
---|
| 44 |
|
---|
[68418e] | 45 | #include <boost/bind.hpp>
|
---|
| 46 |
|
---|
[15c8a9] | 47 | #include "CodePatterns/Log.hpp"
|
---|
| 48 |
|
---|
| 49 | #include "Atom/atom.hpp"
|
---|
| 50 | #include "Descriptors/AtomIdDescriptor.hpp"
|
---|
| 51 | #include "Descriptors/MoleculeIdDescriptor.hpp"
|
---|
| 52 | #include "molecule.hpp"
|
---|
[41e287] | 53 | #include "UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp"
|
---|
[15c8a9] | 54 | #include "World.hpp"
|
---|
| 55 |
|
---|
[2f7988] | 56 | QtObservedInstanceBoard::QtObservedInstanceBoard(QWidget * _parent) :
|
---|
[15c8a9] | 57 | QWidget(_parent),
|
---|
[2f7988] | 58 | Observer("QtObservedInstanceBoard"),
|
---|
[15c8a9] | 59 | WorldSignedOn(false),
|
---|
[68418e] | 60 | atomObservedValues(
|
---|
| 61 | "atom",
|
---|
| 62 | *this,
|
---|
| 63 | boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1)),
|
---|
| 64 | moleculeObservedValues(
|
---|
| 65 | "molecule",
|
---|
| 66 | *this,
|
---|
| 67 | boost::bind(&QtObservedInstanceBoard::moleculecountsubjectKilled, this, _1)),
|
---|
| 68 | atomSubjectKilled(
|
---|
[90821d] | 69 | boost::bind(&ObservedValuesContainer<QtObservedAtom, atomId_t>::countsubjectKilled,
|
---|
| 70 | boost::ref(atomObservedValues),
|
---|
[68418e] | 71 | _1)),
|
---|
| 72 | moleculeSubjectKilled(
|
---|
[90821d] | 73 | boost::bind(&ObservedValuesContainer<QtObservedMolecule, moleculeId_t>::countsubjectKilled,
|
---|
| 74 | boost::ref(moleculeObservedValues),
|
---|
[68418e] | 75 | _1)),
|
---|
| 76 | lastremovedatom((atomId_t)-1),
|
---|
| 77 | lastremovedatomsmolecule( std::make_pair((moleculeId_t)-1,(atomId_t)-1) ),
|
---|
| 78 | lastremovedmolecule((moleculeId_t)-1)
|
---|
| 79 | {
|
---|
[04c3a3] | 80 | qRegisterMetaType<QtObservedAtom::ptr>("QtObservedAtom::ptr");
|
---|
| 81 | qRegisterMetaType<QtObservedMolecule::ptr>("QtObservedMolecule::ptr");
|
---|
| 82 |
|
---|
[15c8a9] | 83 | // be first (besides ObservedValues to know about new insertions)
|
---|
| 84 | World::getInstance().signOn(this, World::AtomInserted, GlobalObservableInfo::PriorityLevel(int(-10)));
|
---|
| 85 | World::getInstance().signOn(this, World::AtomRemoved, GlobalObservableInfo::PriorityLevel(int(-10)));
|
---|
| 86 | World::getInstance().signOn(this, World::MoleculeInserted, GlobalObservableInfo::PriorityLevel(int(-10)));
|
---|
| 87 | World::getInstance().signOn(this, World::MoleculeRemoved, GlobalObservableInfo::PriorityLevel(int(-10)));
|
---|
| 88 | WorldSignedOn = true;
|
---|
| 89 | }
|
---|
| 90 |
|
---|
[2f7988] | 91 | QtObservedInstanceBoard::~QtObservedInstanceBoard()
|
---|
[15c8a9] | 92 | {
|
---|
| 93 | if (WorldSignedOn) {
|
---|
| 94 | World::getInstance().signOff(this, World::AtomInserted);
|
---|
| 95 | World::getInstance().signOff(this, World::AtomRemoved);
|
---|
| 96 | World::getInstance().signOff(this, World::MoleculeInserted);
|
---|
| 97 | World::getInstance().signOff(this, World::MoleculeRemoved);
|
---|
| 98 | }
|
---|
| 99 | // sign off from all remaining molecules and atoms
|
---|
| 100 | for (SignedOn_t::iterator iter = AtomSignedOn.begin(); !AtomSignedOn.empty();
|
---|
| 101 | iter = AtomSignedOn.begin()) {
|
---|
| 102 | (*iter)->signOff(this, atom::IndexChanged);
|
---|
| 103 | AtomSignedOn.erase(iter);
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | for (SignedOn_t::iterator iter = MoleculeSignedOn.begin(); !MoleculeSignedOn.empty();
|
---|
| 107 | iter = MoleculeSignedOn.begin()) {
|
---|
| 108 | (*iter)->signOff(this, molecule::IndexChanged);
|
---|
[8d5fbf1] | 109 | (*iter)->signOff(this, molecule::AtomInserted);
|
---|
| 110 | (*iter)->signOff(this, molecule::AtomRemoved);
|
---|
| 111 | MoleculeSignedOn.erase(*iter); //erase all instances
|
---|
[15c8a9] | 112 | }
|
---|
| 113 | }
|
---|
| 114 |
|
---|
[2f7988] | 115 | void QtObservedInstanceBoard::update(Observable *publisher)
|
---|
[15c8a9] | 116 | {
|
---|
| 117 | ASSERT(0,
|
---|
[2f7988] | 118 | "QtObservedInstanceBoard::update() - we are not signed on to general updates.");
|
---|
[15c8a9] | 119 | }
|
---|
| 120 |
|
---|
[2f7988] | 121 | void QtObservedInstanceBoard::subjectKilled(Observable *publisher)
|
---|
[15c8a9] | 122 | {
|
---|
| 123 | SignedOn_t::iterator iter = AtomSignedOn.find(publisher);
|
---|
| 124 | if ( iter != AtomSignedOn.end()) {
|
---|
| 125 | LOG(3, "DEBUG: InstanceBoard got subjectKilled() from atom " << publisher);
|
---|
| 126 | AtomSignedOn.erase(iter);
|
---|
| 127 | } else {
|
---|
| 128 | iter = MoleculeSignedOn.find(publisher);
|
---|
| 129 | if ( iter != MoleculeSignedOn.end()) {
|
---|
| 130 | LOG(3, "DEBUG: InstanceBoard got subjectKilled() from molecule " << publisher);
|
---|
| 131 | MoleculeSignedOn.erase(iter);
|
---|
| 132 | } else {
|
---|
| 133 | ASSERT(0,
|
---|
| 134 | "QtObservedInstanceBoard::subjectKilled() - could not find signedOn for atom/molecule "+toString(publisher));
|
---|
| 135 | }
|
---|
| 136 | }
|
---|
| 137 | }
|
---|
| 138 |
|
---|
[2f7988] | 139 | void QtObservedInstanceBoard::recieveNotification(Observable *publisher, Notification_ptr notification)
|
---|
[15c8a9] | 140 | {
|
---|
| 141 | if (static_cast<World *>(publisher) == World::getPointer()) {
|
---|
| 142 | switch (notification->getChannelNo()) {
|
---|
| 143 | case World::MoleculeInserted:
|
---|
| 144 | {
|
---|
| 145 | const moleculeId_t _id = const_cast<const World &>(World::getInstance()).lastChangedMolId();
|
---|
| 146 | #ifdef LOG_OBSERVER
|
---|
| 147 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that molecule "+toString(_id)+" has been inserted.";
|
---|
| 148 | #endif
|
---|
| 149 | LOG(3, "DEBUG: InformationBoard got moleculeInserted signal for molecule " << _id);
|
---|
| 150 | const molecule * const _molecule = const_cast<const World &>(World::getInstance()).
|
---|
| 151 | getMolecule(MoleculeById(_id));
|
---|
| 152 | if (_molecule != NULL) {
|
---|
[494478] | 153 | ObservedValues_t ObservedValues(QtObservedMolecule::MAX_ObservedTypes);
|
---|
[15c8a9] | 154 | LOG(3, "DEBUG: InformationBoard initializes ObservedValues for molecule " << _id);
|
---|
[494478] | 155 | QtObservedMolecule::initObservedValues(
|
---|
[15c8a9] | 156 | ObservedValues,
|
---|
| 157 | _id,
|
---|
| 158 | _molecule,
|
---|
| 159 | moleculeSubjectKilled);
|
---|
[68418e] | 160 | QtObservedMolecule::ptr observedmolecule(new QtObservedMolecule(ObservedValues, *this));
|
---|
[15c8a9] | 161 | #ifndef NDEBUG
|
---|
[41e287] | 162 | bool status =
|
---|
[15c8a9] | 163 | #endif
|
---|
[68418e] | 164 | moleculeObservedValues.insert(_id, observedmolecule);
|
---|
[41e287] | 165 | ASSERT( status,
|
---|
[68418e] | 166 | "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedMolecule for"
|
---|
[15c8a9] | 167 | +toString(_id)+".");
|
---|
| 168 | // we need to check for index changes
|
---|
| 169 | LOG(3, "DEBUG: InformationBoard signOn()s to molecule " << _id);
|
---|
| 170 | _molecule->signOn(this, molecule::IndexChanged);
|
---|
| 171 | MoleculeSignedOn.insert( static_cast<Observable *>(const_cast<molecule *>(_molecule)) );
|
---|
[8d5fbf1] | 172 | _molecule->signOn(this, molecule::AtomInserted);
|
---|
| 173 | MoleculeSignedOn.insert( static_cast<Observable *>(const_cast<molecule *>(_molecule)) );
|
---|
| 174 | _molecule->signOn(this, molecule::AtomRemoved);
|
---|
| 175 | MoleculeSignedOn.insert( static_cast<Observable *>(const_cast<molecule *>(_molecule)) );
|
---|
[15c8a9] | 176 |
|
---|
| 177 | emit moleculeInserted(_id);
|
---|
| 178 | } else {
|
---|
[2f7988] | 179 | ELOG(1, "QtObservedInstanceBoard got MoleculeInserted for unknown molecule id " << _id);
|
---|
[15c8a9] | 180 | }
|
---|
| 181 | break;
|
---|
| 182 | }
|
---|
| 183 | case World::MoleculeRemoved:
|
---|
| 184 | {
|
---|
| 185 | const moleculeId_t _id = const_cast<const World &>(World::getInstance()).lastChangedMolId();
|
---|
| 186 | LOG(3, "DEBUG: InformationBoard got MoleculeRemoved signal for molecule " << _id);
|
---|
| 187 | // note down such that ObservedValues are simply dropped
|
---|
| 188 | lastremovedmolecule = _id;
|
---|
| 189 | break;
|
---|
| 190 | }
|
---|
| 191 | case World::AtomInserted:
|
---|
| 192 | {
|
---|
| 193 | const atomId_t _id = const_cast<const World &>(World::getInstance()).lastChangedAtomId();
|
---|
| 194 | #ifdef LOG_OBSERVER
|
---|
| 195 | observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_id)+" has been inserted.";
|
---|
| 196 | #endif
|
---|
| 197 | LOG(3, "DEBUG: InformationBoard got atomInserted signal for atom " << _id);
|
---|
| 198 | const atom * const _atom = const_cast<const World &>(World::getInstance()).
|
---|
| 199 | getAtom(AtomById(_id));
|
---|
| 200 | if (_atom!= NULL) {
|
---|
[65c323] | 201 | ObservedValues_t ObservedValues(QtObservedAtom::MAX_ObservedTypes);
|
---|
[15c8a9] | 202 | LOG(3, "DEBUG: InformationBoard initializes ObservedValues for atom " << _id);
|
---|
[65c323] | 203 | QtObservedAtom::initObservedValues(
|
---|
[15c8a9] | 204 | ObservedValues,
|
---|
| 205 | _id,
|
---|
| 206 | _atom,
|
---|
| 207 | atomSubjectKilled);
|
---|
[68418e] | 208 | QtObservedAtom::ptr observedatom(new QtObservedAtom(ObservedValues, *this));
|
---|
[15c8a9] | 209 | #ifndef NDEBUG
|
---|
[41e287] | 210 | bool status =
|
---|
[15c8a9] | 211 | #endif
|
---|
[68418e] | 212 | atomObservedValues.insert(_id, observedatom);
|
---|
[41e287] | 213 | ASSERT( status,
|
---|
[2f7988] | 214 | "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
|
---|
[15c8a9] | 215 | +toString(_id)+".");
|
---|
| 216 | // we need to check for index changes
|
---|
| 217 | LOG(3, "DEBUG: InformationBoard signOn()s to atom " << _id);
|
---|
| 218 | _atom->signOn(this, atom::IndexChanged);
|
---|
| 219 | AtomSignedOn.insert( static_cast<Observable *>(const_cast<atom *>(_atom)) );
|
---|
[6d4925] | 220 | emit atomInserted(observedatom->getAtomMoleculeIndex(), observedatom->getAtomIndex());
|
---|
[15c8a9] | 221 | } else {
|
---|
[2f7988] | 222 | ELOG(1, "QtObservedInstanceBoard got AtomInserted for unknown atom id " << _id);
|
---|
[15c8a9] | 223 | }
|
---|
| 224 | break;
|
---|
| 225 | }
|
---|
| 226 | case World::AtomRemoved:
|
---|
| 227 | {
|
---|
| 228 | const atomId_t _id = const_cast<const World &>(World::getInstance()).lastChangedAtomId();
|
---|
| 229 | LOG(3, "DEBUG: InformationBoard got AtomRemoved signal for atom " << _id);
|
---|
| 230 | // note down such that ObservedValues are simply dropped
|
---|
| 231 | lastremovedatom = _id;
|
---|
| 232 | break;
|
---|
| 233 | }
|
---|
| 234 | default:
|
---|
[2f7988] | 235 | ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here for World.");
|
---|
[15c8a9] | 236 | break;
|
---|
| 237 | }
|
---|
| 238 | } else if (dynamic_cast<molecule *>(publisher) != NULL) {
|
---|
| 239 | const moleculeId_t molid = const_cast<const World &>(World::getInstance()).lastChangedMolId();
|
---|
| 240 | switch (notification->getChannelNo()) {
|
---|
| 241 | case molecule::AtomInserted:
|
---|
| 242 | {
|
---|
| 243 | const molecule * const _molecule = const_cast<const World &>(World::getInstance()).
|
---|
| 244 | getMolecule(MoleculeById(molid));
|
---|
| 245 | if (_molecule != NULL) {
|
---|
| 246 | const atomId_t atomid = const_cast<const molecule *>(_molecule)->lastChangedAtomId();
|
---|
| 247 | LOG(3, "DEBUG: InformationBoard got AtomInserted signal for atom "
|
---|
| 248 | << atomid << " from molecule " << molid);
|
---|
| 249 | // check whether atom's observedvalues are present
|
---|
[41e287] | 250 | ASSERT( atomObservedValues.isPresent(atomid),
|
---|
[2f7988] | 251 | "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
|
---|
[15c8a9] | 252 | +toString(atomid)+" are not present yet.");
|
---|
| 253 | // and emit
|
---|
| 254 | emit atomInserted(molid, atomid);
|
---|
| 255 | } else {
|
---|
[2f7988] | 256 | ELOG(2, "QtObservedInstanceBoard::recieveNotification() - molecule "
|
---|
[15c8a9] | 257 | << molid << " has disappeared.");
|
---|
| 258 | }
|
---|
| 259 | break;
|
---|
| 260 | }
|
---|
| 261 | case molecule::AtomRemoved:
|
---|
| 262 | {
|
---|
| 263 | const molecule * const _molecule = const_cast<const World &>(World::getInstance()).
|
---|
| 264 | getMolecule(MoleculeById(molid));
|
---|
| 265 | if (_molecule != NULL) {
|
---|
| 266 | const atomId_t atomid = const_cast<const molecule *>(_molecule)->lastChangedAtomId();
|
---|
| 267 | LOG(3, "DEBUG: InformationBoard got AtomRemoved signal for atom "
|
---|
| 268 | << atomid << " from molecule " << molid);
|
---|
[8d5fbf1] | 269 | lastremovedatomsmolecule = std::make_pair(molid, atomid);
|
---|
[15c8a9] | 270 | }
|
---|
| 271 | break;
|
---|
| 272 | }
|
---|
| 273 | case molecule::IndexChanged:
|
---|
| 274 | {
|
---|
| 275 | // molecule has changed its index
|
---|
| 276 | const moleculeId_t newmoleculeId = dynamic_cast<molecule *>(publisher)->getId();
|
---|
| 277 | LOG(3, "DEBUG: InformationBoard got IndexChanged from molecule " << molid << " to " << newmoleculeId);
|
---|
[41e287] | 278 | #ifndef NDEBUG
|
---|
| 279 | bool status =
|
---|
| 280 | #endif
|
---|
| 281 | moleculeObservedValues.changeIdentifier(molid, newmoleculeId);
|
---|
| 282 | ASSERT( status,
|
---|
| 283 | "QtObservedInstanceBoard::recieveNotification() - cannot change molecule's id "
|
---|
| 284 | +toString(molid)+" "+toString(newmoleculeId)+" in moleculeObservedValues.");
|
---|
[15c8a9] | 285 | // no need update SignedOn, ref does not change
|
---|
| 286 | emit moleculeIndexChanged(molid, newmoleculeId);
|
---|
| 287 | break;
|
---|
| 288 | }
|
---|
| 289 | default:
|
---|
[2f7988] | 290 | ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here.");
|
---|
[15c8a9] | 291 | break;
|
---|
| 292 | }
|
---|
| 293 | } else if (dynamic_cast<atom *>(publisher) != NULL) {
|
---|
| 294 | const atomId_t oldatomId = const_cast<const World &>(World::getInstance()).lastChangedAtomId();
|
---|
| 295 | switch (notification->getChannelNo()) {
|
---|
| 296 | case AtomObservable::IndexChanged:
|
---|
| 297 | {
|
---|
| 298 | const atomId_t newatomId = dynamic_cast<atom *>(publisher)->getId();
|
---|
| 299 | LOG(3, "DEBUG: InformationBoard got IndexChanged from atom " << oldatomId << " to " << newatomId);
|
---|
[6d4925] | 300 | #ifndef NDEBUG
|
---|
| 301 | bool status =
|
---|
| 302 | #endif
|
---|
[41e287] | 303 | atomObservedValues.changeIdentifier(oldatomId, newatomId);
|
---|
[6d4925] | 304 | ASSERT( status,
|
---|
| 305 | "QtObservedInstanceBoard::recieveNotification() - cannot change atom's id "
|
---|
| 306 | +toString(oldatomId)+" "+toString(newatomId)+" in atomObservedValues.");
|
---|
| 307 | // changed insertion delayed
|
---|
| 308 | atomInsertionDelayed_t::iterator iter = atomInsertionDelayed.find(oldatomId);
|
---|
| 309 | if (iter != atomInsertionDelayed.end()) {
|
---|
| 310 | const moleculeId_t molid = iter->second;
|
---|
| 311 | atomInsertionDelayed.erase(iter);
|
---|
| 312 | #ifndef NDEBUG
|
---|
| 313 | std::pair<atomInsertionDelayed_t::iterator, bool> inserter =
|
---|
| 314 | #endif
|
---|
| 315 | atomInsertionDelayed.insert( std::make_pair(newatomId, molid) );
|
---|
| 316 | ASSERT( inserter.second,
|
---|
| 317 | "QtObservedInstanceBoard::recieveNotification() - id "
|
---|
| 318 | +toString(newatomId)+" already present in atomInsertionDelayed.");
|
---|
| 319 | }
|
---|
[15c8a9] | 320 | // no need update SignedOn, ref does not change
|
---|
| 321 | emit atomIndexChanged(oldatomId, newatomId);
|
---|
| 322 | break;
|
---|
| 323 | }
|
---|
| 324 | default:
|
---|
[2f7988] | 325 | ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here.");
|
---|
[15c8a9] | 326 | break;
|
---|
| 327 | }
|
---|
| 328 | } else {
|
---|
[2f7988] | 329 | ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - notification from unknown source.");
|
---|
[15c8a9] | 330 | }
|
---|
| 331 | }
|
---|
| 332 |
|
---|
[2f7988] | 333 | void QtObservedInstanceBoard::atomcountsubjectKilled(const atomId_t _atomid)
|
---|
[15c8a9] | 334 | {
|
---|
[68418e] | 335 | if ((_atomid == lastremovedatomsmolecule.second) && (_atomid == lastremovedatom)) {
|
---|
| 336 | LOG(3, "DEBUG: InstanceBoard emits atomRemoved for " << _atomid);
|
---|
[90821d] | 337 | emit atomRemoved(lastremovedatomsmolecule.first, lastremovedatomsmolecule.second);
|
---|
[68418e] | 338 | } else
|
---|
[90821d] | 339 | ELOG(2, "QtObservedInstanceBoard::atomcountsubjectKilled() - id " << _atomid
|
---|
[68418e] | 340 | << " not fitting with " << lastremovedatomsmolecule << " or " << lastremovedatom);
|
---|
[15c8a9] | 341 | }
|
---|
| 342 |
|
---|
[2f7988] | 343 | void QtObservedInstanceBoard::moleculecountsubjectKilled(const moleculeId_t _molid)
|
---|
[15c8a9] | 344 | {
|
---|
[68418e] | 345 | if (lastremovedmolecule == _molid) {
|
---|
| 346 | LOG(3, "DEBUG: InstanceBoard emits moleculeRemoved for " << _molid);
|
---|
| 347 | emit moleculeRemoved(_molid);
|
---|
| 348 | } else
|
---|
| 349 | ELOG(2, "QtObservedInstanceBoard::moleculecountsubjectKilled() - id " << _molid
|
---|
| 350 | << " not fitting with " << lastremovedmolecule);
|
---|
[15c8a9] | 351 | }
|
---|
| 352 |
|
---|
[41e287] | 353 | QtObservedAtom::ptr QtObservedInstanceBoard::getObservedAtom(const atomId_t _id)
|
---|
[15c8a9] | 354 | {
|
---|
[41e287] | 355 | return atomObservedValues.get(_id);
|
---|
[15c8a9] | 356 | }
|
---|
| 357 |
|
---|
[41e287] | 358 | QtObservedMolecule::ptr QtObservedInstanceBoard::getObservedMolecule(const moleculeId_t _id)
|
---|
[15c8a9] | 359 | {
|
---|
[41e287] | 360 | return moleculeObservedValues.get(_id);
|
---|
[15c8a9] | 361 | }
|
---|
| 362 |
|
---|
[68418e] | 363 | void QtObservedInstanceBoard::markObservedAtomAsConnected(const atomId_t _id)
|
---|
[15c8a9] | 364 | {
|
---|
[68418e] | 365 | atomObservedValues.markObservedValuesAsConnected(_id);
|
---|
[15c8a9] | 366 | }
|
---|
| 367 |
|
---|
[68418e] | 368 | void QtObservedInstanceBoard::markObservedAtomAsDisconnected(const atomId_t _id)
|
---|
[15c8a9] | 369 | {
|
---|
[68418e] | 370 | atomObservedValues.markObservedValuesAsDisconnected(_id);
|
---|
[15c8a9] | 371 | }
|
---|
[98c35c] | 372 |
|
---|
[4e6ffe] | 373 | void QtObservedInstanceBoard::markObservedAtomForErase(const atomId_t _id)
|
---|
| 374 | {
|
---|
| 375 | atomObservedValues.eraseObservedValues(_id);
|
---|
| 376 | }
|
---|
| 377 |
|
---|
[68418e] | 378 | void QtObservedInstanceBoard::markObservedMoleculeAsConnected(const moleculeId_t _id)
|
---|
[98c35c] | 379 | {
|
---|
[68418e] | 380 | moleculeObservedValues.markObservedValuesAsConnected(_id);
|
---|
[98c35c] | 381 | }
|
---|
| 382 |
|
---|
[68418e] | 383 | void QtObservedInstanceBoard::markObservedMoleculeAsDisconnected(const moleculeId_t _id)
|
---|
[98c35c] | 384 | {
|
---|
[68418e] | 385 | moleculeObservedValues.markObservedValuesAsDisconnected(_id);
|
---|
[98c35c] | 386 | }
|
---|
[4e6ffe] | 387 |
|
---|
| 388 | void QtObservedInstanceBoard::markObservedMoleculeForErase(const moleculeId_t _id)
|
---|
| 389 | {
|
---|
| 390 | moleculeObservedValues.eraseObservedValues(_id);
|
---|
| 391 | }
|
---|