source: src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp@ 5cd3a33

Action_Thermostats Add_AtomRandomPerturbation Add_FitFragmentPartialChargesAction Add_RotateAroundBondAction Add_SelectAtomByNameAction Added_ParseSaveFragmentResults AddingActions_SaveParseParticleParameters Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_ParticleName_to_Atom Adding_StructOpt_integration_tests AtomFragments Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.5.4 Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator CombiningParticlePotentialParsing Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_BoundInBox_CenterInBox_MoleculeActions Fix_ChargeSampling_PBC Fix_ChronosMutex Fix_FitPartialCharges Fix_FitPotential_needs_atomicnumbers Fix_ForceAnnealing Fix_IndependentFragmentGrids Fix_ParseParticles Fix_ParseParticles_split_forward_backward_Actions Fix_PopActions Fix_QtFragmentList_sorted_selection Fix_Restrictedkeyset_FragmentMolecule Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns Fix_fitting_potentials Fixes ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion FragmentAction_writes_AtomFragments FragmentMolecule_checks_bonddegrees GeometryObjects Gui_Fixes Gui_displays_atomic_force_velocity ImplicitCharges IndependentFragmentGrids IndependentFragmentGrids_IndividualZeroInstances IndependentFragmentGrids_IntegrationTest IndependentFragmentGrids_Sole_NN_Calculation JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix MoreRobust_FragmentAutomation ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PdbParser_setsAtomName PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks Rewrite_FitPartialCharges RotateToPrincipalAxisSystem_UndoRedo SaturateAtoms_findBestMatching SaturateAtoms_singleDegree StoppableMakroAction Subpackage_CodePatterns Subpackage_JobMarket Subpackage_LinearAlgebra Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg Switchable_LogView ThirdParty_MPQC_rebuilt_buildsystem TrajectoryDependenant_MaxOrder TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps TremoloParser_setsAtomName Ubuntu_1604_changes stable
Last change on this file since 5cd3a33 was 9e9100, checked in by Frederik Heber <heber@…>, 9 years ago

Added ObservedValue for selection status of atoms and molecules to QtObserved...

  • Property mode set to 100644
File size: 18.9 KB
Line 
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/*
24 * QtObservedMolecule.cpp
25 *
26 * Created on: Oct 28, 2015
27 * Author: heber
28 */
29
30
31// include config.h
32#ifdef HAVE_CONFIG_H
33#include <config.h>
34#endif
35
36#include "QtObservedMolecule.hpp"
37
38#include "UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp"
39
40#include "CodePatterns/MemDebug.hpp"
41#include "CodePatterns/Assert.hpp"
42#include "CodePatterns/Log.hpp"
43
44#include <boost/assign.hpp>
45#include <boost/bind.hpp>
46
47#include "UIElements/Qt4/InstanceBoard/ObservedValue_wCallback.hpp"
48#include "UIElements/Qt4/InstanceBoard/ObservedValue_UpdateAtoms.hpp"
49
50#include "Atom/atom.hpp"
51#include "Descriptors/MoleculeIdDescriptor.hpp"
52#include "World.hpp"
53
54using namespace boost::assign;
55
56static const Observable::channels_t getAllObservedChannels()
57{
58 Observable::channels_t channels;
59 channels +=
60 molecule::AtomInserted,
61 molecule::AtomMoved,
62 molecule::AtomRemoved,
63 molecule::FormulaChanged,
64 molecule::IndexChanged,
65 molecule::MoleculeNameChanged,
66 molecule::BoundingBoxChanged,
67 molecule::SelectionChanged;
68 return channels;
69}
70
71static const Observable::channels_t getAllAtomCountChannels()
72{
73 Observable::channels_t channels;
74 channels +=
75 molecule::AtomInserted,
76 molecule::AtomRemoved;
77 return channels;
78}
79
80static const Observable::channels_t getAllCenterChannels()
81{
82 Observable::channels_t channels;
83 channels +=
84 molecule::AtomInserted,
85 molecule::AtomMoved,
86 molecule::AtomRemoved;
87 return channels;
88}
89
90// static instances
91const Observable::channels_t QtObservedMolecule::AtomCountChannels(getAllAtomCountChannels());
92const Observable::channels_t QtObservedMolecule::BondCountChannels(getAllAtomCountChannels());
93const Observable::channels_t QtObservedMolecule::BoundingBoxChannels(1, molecule::BoundingBoxChanged);
94const Observable::channels_t QtObservedMolecule::FormulaStringChannels(1, molecule::FormulaChanged);
95const Observable::channels_t QtObservedMolecule::CenterChannels(getAllCenterChannels());
96const Observable::channels_t QtObservedMolecule::IndexChannels(1, molecule::IndexChanged);
97const Observable::channels_t QtObservedMolecule::NameChannels(1, molecule::MoleculeNameChanged);
98const Observable::channels_t QtObservedMolecule::NonHydrogenCountChannels(1, molecule::FormulaChanged);
99const Observable::channels_t QtObservedMolecule::SelectedChannels(1, molecule::SelectionChanged);
100
101QtObservedMolecule::QtObservedMolecule(
102 const ObservedValues_t &_ObservedValues,
103 QtObservedInstanceBoard &_board,
104 QWidget * _parent) :
105 QWidget(_parent),
106 Observer("QtObservedMolecule"),
107 subjectKilledCount(0),
108 AllsignedOnChannels(getAllObservedChannels().size()),
109 signedOffChannels(0),
110 owner(NULL),
111 board(_board),
112 BoardIsGone(false),
113 ObservedValues(_ObservedValues)
114{
115 // activating Observer is done by ObservedValueContainer when it's prepared
116}
117
118QtObservedMolecule::~QtObservedMolecule()
119{
120 boost::any_cast<ObservedValue_wCallback<moleculeId_t> *>(ObservedValues[MolIndex])->noteCallBackIsGone();
121 boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[AtomCount])->noteCallBackIsGone();
122 boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[BondCount])->noteCallBackIsGone();
123 boost::any_cast<ObservedValue_wCallback<molecule::BoundingBoxInfo, moleculeId_t> *>(ObservedValues[BoundingBox])->noteCallBackIsGone();
124 boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(ObservedValues[FormulaString])->noteCallBackIsGone();
125 boost::any_cast<ObservedValue_wCallback<Vector, moleculeId_t> *>(ObservedValues[MolCenter])->noteCallBackIsGone();
126 boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(ObservedValues[MolName])->noteCallBackIsGone();
127 boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[NonHydrogenCount])->noteCallBackIsGone();
128 boost::any_cast<ObservedValue_wCallback<bool, moleculeId_t> *>(ObservedValues[MolSelected])->noteCallBackIsGone();
129
130 deactivateObserver();
131}
132
133void QtObservedMolecule::deactivateObserver()
134{
135 if (owner != NULL) {
136 Observable::channels_t channels = getAllObservedChannels();
137 for (Observable::channels_t::const_iterator iter = channels.begin();
138 iter != channels.end(); ++iter)
139 owner->signOff(this, *iter);
140 owner = NULL;
141 signedOffChannels = AllsignedOnChannels;
142 if (!BoardIsGone)
143 board.markObservedMoleculeAsDisconnected(getMolIndex());
144 }
145}
146
147void QtObservedMolecule::activateObserver()
148{
149 // sign on as observer (obtain non-const instance before)
150 const molecule * const _molecule = getMolecule(getMolIndex());
151 if (_molecule != NULL) {
152 Observable::channels_t channels = getAllObservedChannels();
153 owner = static_cast<const Observable *>(_molecule);
154 for (Observable::channels_t::const_iterator iter = channels.begin();
155 iter != channels.end(); ++iter)
156 owner->signOn(this, *iter);
157 if (!BoardIsGone)
158 board.markObservedMoleculeAsConnected(getMolIndex());
159 } else
160 signedOffChannels = AllsignedOnChannels;
161}
162
163void QtObservedMolecule::update(Observable *publisher)
164{
165 ASSERT(0,
166 "QtObservedMolecule::update() - general update from unexpected source.");
167}
168
169void QtObservedMolecule::subjectKilled(Observable *publisher)
170{
171 ++signedOffChannels;
172
173 if (signedOffChannels == AllsignedOnChannels) {
174 // remove owner: no more signOff needed
175 owner = NULL;
176
177 emit moleculeRemoved();
178
179 if (!BoardIsGone) {
180 board.markObservedMoleculeAsDisconnected(getMolIndex());
181 board.markObservedMoleculeForErase(getMolIndex());
182 }
183 }
184}
185
186void QtObservedMolecule::recieveNotification(Observable *publisher, Notification_ptr notification)
187{
188 const molecule * const _molecule = getMolecule(getMolIndex());
189 // when molecule is NULL we will soon get destroyed anyway
190 if (_molecule == NULL)
191 return;
192 if (publisher == dynamic_cast<const Observable*>(_molecule)){
193 // notification from atom
194#ifdef LOG_OBSERVER
195 observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(static_cast<Observer *>(this))
196 << " received notification from molecule " << getMolIndex() << " for channel "
197 << notification->getChannelNo() << ".";
198#endif
199 switch (notification->getChannelNo()) {
200 case molecule::AtomInserted:
201 {
202 const atomId_t _id = _molecule->lastChangedAtomId();
203 emit atomcountChanged();
204 emit atomInserted(_id);
205 emit bondcountChanged();
206 emit boundingboxChanged();
207 emit centerChanged();
208 emit tesselationhullChanged();
209 break;
210 }
211 case molecule::AtomMoved:
212 {
213 emit boundingboxChanged();
214 emit centerChanged();
215 emit tesselationhullChanged();
216 break;
217 }
218 case molecule::AtomRemoved:
219 {
220 const atomId_t _id = _molecule->lastChangedAtomId();
221 emit atomcountChanged();
222 emit atomRemoved(_id);
223 emit bondcountChanged();
224 emit boundingboxChanged();
225 emit centerChanged();
226 emit tesselationhullChanged();
227 break;
228 }
229 case molecule::BoundingBoxChanged:
230 {
231 #ifdef LOG_OBSERVER
232 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that bounding box has changed.";
233 #endif
234 emit tesselationhullChanged();
235 emit boundingboxChanged();
236 break;
237 }
238 case molecule::FormulaChanged:
239 {
240 emit formulaChanged();
241 emit nononhydrogenChanged();
242 break;
243 }
244 case molecule::IndexChanged:
245 {
246 #ifdef LOG_OBSERVER
247 const atomId_t _id = _molecule->lastChangedAtomId();
248 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_id)+"'s index has changed.";
249 #endif
250 emit indexChanged();
251 break;
252 }
253 case molecule::MoleculeNameChanged:
254 {
255 #ifdef LOG_OBSERVER
256 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that name has changed.";
257 #endif
258 emit nameChanged();
259 break;
260 }
261 case molecule::SelectionChanged:
262 {
263 #ifdef LOG_OBSERVER
264 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that selected has changed.";
265 #endif
266 emit selectedChanged();
267 break;
268 }
269 default:
270 break;
271 }
272 }
273}
274
275const molecule * const QtObservedMolecule::getMolecule(const moleculeId_t _id)
276{
277 const molecule * const mol = const_cast<const World &>(World::getInstance()).
278 getMolecule(MoleculeById(_id));
279 return mol;
280}
281
282static molecule::BoundingBoxInfo initBoundingBox()
283{
284 molecule::BoundingBoxInfo info;
285 info.position = zeroVec;
286 info.radius = 0.;
287 return info;
288}
289
290void QtObservedMolecule::initObservedValues(
291 ObservedValues_t &_ObservedValues,
292 const moleculeId_t _molid,
293 const molecule * const _molref,
294 const boost::function<void(const moleculeId_t)> &_subjectKilled)
295{
296 /* This is an old note from when the code was still part of cstor's initializer body.
297 * TODO: Probably does not apply anymore but has not yet been tested.
298 *
299 * We must not use boost::cref(this) as "this" has not been properly constructed and seemingly
300 * boost::cref tries to do some magic to grasp the inheritance hierarchy which fails because
301 * the class has not been fully constructed yet. "This" itself seems to be working fine.
302 */
303
304 ASSERT( _ObservedValues.size() == MAX_ObservedTypes,
305 "QtObservedMolecule::initObservedValues() - given ObservedValues has not correct size.");
306
307 // fill ObservedValues: index first
308 const boost::function<moleculeId_t ()> MolIndexUpdater(
309 boost::bind(&QtObservedMolecule::updateIndex));
310
311 ObservedValue_wCallback<moleculeId_t> * const IndexObservable =
312 new ObservedValue_wCallback<moleculeId_t>(
313 _molref,
314 MolIndexUpdater,
315 "MoleculeIndex_"+toString(_molid),
316 _molid,
317 IndexChannels,
318 _subjectKilled);
319 _ObservedValues[MolIndex] = IndexObservable;
320
321 const boost::function<const moleculeId_t ()> MolIndexGetter =
322 boost::bind(&ObservedValue_wCallback<moleculeId_t>::get,
323 IndexObservable);
324
325 // fill ObservedValues: then all the other that need index
326 const boost::function<int ()> AtomCountUpdater(
327 boost::bind(&QtObservedMolecule::updateAtomCount, MolIndexGetter));
328 const boost::function<int ()> BondCountUpdater(
329 boost::bind(&QtObservedMolecule::updateBondCount, MolIndexGetter));
330 const boost::function<Vector ()> MolCenterUpdater(
331 boost::bind(&QtObservedMolecule::updateCenter, MolIndexGetter));
332 const boost::function<std::string ()> MolFormulaUpdater(
333 boost::bind(&QtObservedMolecule::updateFormulaString, MolIndexGetter));
334 const boost::function<std::string ()> MolNameUpdater(
335 boost::bind(&QtObservedMolecule::updateName, MolIndexGetter));
336 const boost::function<int ()> NonHydrogenCountUpdater(
337 boost::bind(&QtObservedMolecule::updateNonHydrogenCount, MolIndexGetter));
338 const boost::function<molecule::BoundingBoxInfo ()> BoundingBoxUpdater(
339 boost::bind(&QtObservedMolecule::updateBoundingBox, MolIndexGetter));
340 const boost::function<bool ()> SelectedUpdater(
341 boost::bind(&QtObservedMolecule::updateSelected, MolIndexGetter));
342
343 _ObservedValues[AtomCount] = new ObservedValue_wCallback<int, moleculeId_t>(
344 _molref,
345 AtomCountUpdater,
346 "MoleculeAtomCount_"+toString(_molid),
347 AtomCountUpdater(),
348 AtomCountChannels,
349 _subjectKilled,
350 MolIndexGetter);
351 _ObservedValues[BondCount] = new ObservedValue_wCallback<int, moleculeId_t>(
352 _molref,
353 BondCountUpdater,
354 "MoleculeBondCount_"+toString(_molid),
355 BondCountUpdater(),
356 BondCountChannels,
357 _subjectKilled,
358 MolIndexGetter);
359 _ObservedValues[BoundingBox] = new ObservedValue_wCallback<molecule::BoundingBoxInfo, moleculeId_t>(
360 _molref,
361 BoundingBoxUpdater,
362 "MoleculeBoundingBox_"+toString(_molid),
363 initBoundingBox(),
364 BoundingBoxChannels,
365 _subjectKilled,
366 MolIndexGetter);
367 _ObservedValues[FormulaString] = new ObservedValue_wCallback<std::string, moleculeId_t>(
368 _molref,
369 MolFormulaUpdater,
370 "MoleculeFormula_"+toString(_molid),
371 MolFormulaUpdater(),
372 FormulaStringChannels,
373 _subjectKilled,
374 MolIndexGetter);
375 _ObservedValues[MolCenter] = new ObservedValue_wCallback<Vector, moleculeId_t>(
376 _molref,
377 MolCenterUpdater,
378 "MoleculeCenter_"+toString(_molid),
379 MolCenterUpdater(),
380 CenterChannels,
381 _subjectKilled,
382 MolIndexGetter);
383 _ObservedValues[MolName] = new ObservedValue_wCallback<std::string, moleculeId_t>(
384 _molref,
385 MolNameUpdater,
386 "MoleculeName_"+toString(_molid),
387 MolNameUpdater(),
388 NameChannels,
389 _subjectKilled,
390 MolIndexGetter);
391 _ObservedValues[NonHydrogenCount] = new ObservedValue_wCallback<int, moleculeId_t>(
392 _molref,
393 NonHydrogenCountUpdater,
394 "MoleculeNonHydrogenCount_"+toString(_molid),
395 NonHydrogenCountUpdater(),
396 NonHydrogenCountChannels,
397 _subjectKilled,
398 MolIndexGetter);
399 _ObservedValues[MolSelected] = new ObservedValue_wCallback<bool, moleculeId_t>(
400 _molref,
401 SelectedUpdater,
402 "MoleculeSelected_"+toString(_molid),
403 SelectedUpdater(),
404 SelectedChannels,
405 _subjectKilled,
406 MolIndexGetter);
407}
408
409void QtObservedMolecule::destroyObservedValues(
410 std::vector<boost::any> &_ObservedValues)
411{
412 delete boost::any_cast<ObservedValue_wCallback<moleculeId_t> *>(_ObservedValues[MolIndex]);
413 delete boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(_ObservedValues[AtomCount]);
414 delete boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(_ObservedValues[BondCount]);
415 delete boost::any_cast<ObservedValue_wCallback<molecule::BoundingBoxInfo, moleculeId_t> *>(_ObservedValues[BoundingBox]);
416 delete boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(_ObservedValues[FormulaString]);
417 delete boost::any_cast<ObservedValue_wCallback<Vector, moleculeId_t> *>(_ObservedValues[MolCenter]);
418 delete boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(_ObservedValues[MolName]);
419 delete boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(_ObservedValues[NonHydrogenCount]);
420 delete boost::any_cast<ObservedValue_wCallback<bool, moleculeId_t> *>(_ObservedValues[MolSelected]);
421 _ObservedValues.clear();
422}
423
424int QtObservedMolecule::updateAtomCount(
425 const boost::function<const moleculeId_t ()> &_getMolIndex)
426{
427 const molecule * const mol = getMolecule(_getMolIndex());
428 if (mol != NULL)
429 return mol->getAtomCount();
430 else
431 return (int)0;
432}
433
434int QtObservedMolecule::updateBondCount(
435 const boost::function<const moleculeId_t ()> &_getMolIndex)
436{
437 const molecule * const mol = getMolecule(_getMolIndex());
438 if (mol != NULL)
439 return mol->getBondCount();
440 else
441 return (int)0;
442}
443
444molecule::BoundingBoxInfo QtObservedMolecule::updateBoundingBox(
445 const boost::function<const moleculeId_t ()> &_getMolIndex)
446{
447 const molecule * const mol = getMolecule(_getMolIndex());
448 if (mol != NULL)
449 return mol->getBoundingBox();
450 else
451 return molecule::BoundingBoxInfo();
452}
453
454std::string QtObservedMolecule::updateFormulaString(
455 const boost::function<const moleculeId_t ()> &_getMolIndex)
456{
457 const molecule * const mol = getMolecule(_getMolIndex());
458 if (mol != NULL)
459 return mol->getFormula().toString();
460 else
461 return std::string("");
462}
463
464Vector QtObservedMolecule::updateCenter(
465 const boost::function<const moleculeId_t ()> &_getMolIndex)
466{
467 const molecule * const mol = getMolecule(_getMolIndex());
468 if (mol != NULL)
469 return mol->DetermineCenterOfAll();
470 else
471 return zeroVec;
472}
473
474moleculeId_t QtObservedMolecule::updateIndex()
475{
476 return const_cast<const World &>(World::getInstance()).lastChangedMolId();
477}
478
479std::string QtObservedMolecule::updateName(
480 const boost::function<const moleculeId_t ()> &_getMolIndex)
481{
482 const molecule * const mol = getMolecule(_getMolIndex());
483 if (mol != NULL)
484 return mol->getName();
485 else
486 return std::string("");
487}
488
489int QtObservedMolecule::updateNonHydrogenCount(
490 const boost::function<const moleculeId_t ()> &_getMolIndex)
491{
492 const molecule * const mol = getMolecule(_getMolIndex());
493 if (mol != NULL)
494 return mol->getNoNonHydrogen();
495 else
496 return (int)0;
497}
498
499bool QtObservedMolecule::updateSelected(
500 const boost::function<const moleculeId_t ()> &_getMolIndex)
501{
502 const molecule * const mol = getMolecule(_getMolIndex());
503 if (mol != NULL)
504 return mol->getSelected();
505 else
506 return false;
507}
508
509const int& QtObservedMolecule::getAtomCount() const
510{
511 return boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[AtomCount])->get();
512}
513
514const int& QtObservedMolecule::getBondCount() const
515{
516 return boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[BondCount])->get();
517}
518
519const std::string& QtObservedMolecule::getMolFormula() const
520{
521 return boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(ObservedValues[FormulaString])->get();
522}
523
524const Vector& QtObservedMolecule::getMolCenter() const
525{
526 return boost::any_cast<ObservedValue_wCallback<Vector, moleculeId_t> *>(ObservedValues[MolCenter])->get();
527}
528
529const moleculeId_t& QtObservedMolecule::getMolIndex() const
530{
531 return boost::any_cast<ObservedValue_wCallback<moleculeId_t> *>(ObservedValues[MolIndex])->get();
532}
533
534const std::string& QtObservedMolecule::getMolName() const
535{
536 return boost::any_cast<ObservedValue_wCallback<std::string, moleculeId_t> *>(ObservedValues[MolName])->get();
537}
538
539const int& QtObservedMolecule::getNonHydrogenCount() const
540{
541 return boost::any_cast<ObservedValue_wCallback<int, moleculeId_t> *>(ObservedValues[NonHydrogenCount])->get();
542}
543
544const molecule::BoundingBoxInfo& QtObservedMolecule::getBoundingBox() const
545{
546 return boost::any_cast<ObservedValue_wCallback<molecule::BoundingBoxInfo, moleculeId_t> *>(ObservedValues[BoundingBox])->get();
547}
548
549const bool& QtObservedMolecule::getMolSelected() const
550{
551 return boost::any_cast<ObservedValue_wCallback<bool, moleculeId_t> *>(ObservedValues[MolSelected])->get();
552}
Note: See TracBrowser for help on using the repository browser.