source: src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp@ 6af6a62

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 6af6a62 was bf6245, checked in by Frederik Heber <heber@…>, 9 years ago

QtObservedMolecule also uses new index internally.

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