Changeset 7c7c4a
- Timestamp:
- Feb 12, 2016, 11:15:04 PM (9 years ago)
- Branches:
- 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
- Children:
- 2831b3
- Parents:
- e25448
- git-author:
- Frederik Heber <heber@…> (10/16/15 11:51:16)
- git-committer:
- Frederik Heber <heber@…> (02/12/16 23:15:04)
- Location:
- src/UIElements
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Makefile.am
re25448 r7c7c4a 225 225 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp \ 226 226 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_shape.hpp \ 227 UIElements/Views/Qt4/Qt3D/ObservedValue_wCallback.hpp \ 227 228 UIElements/Views/Qt4/QDebugStream.hpp 228 229 -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
re25448 r7c7c4a 57 57 #include "WorldTime.hpp" 58 58 59 #include "ObservedValue_wCallback.hpp" 60 59 61 using namespace boost::assign; 60 62 … … 80 82 Observer(std::string("GLMoleculeObject_atom")+toString(_id)), 81 83 atomref(getAtom(_id)), 82 AtomIndex( 83 atomref, 84 boost::bind(&GLMoleculeObject_atom::updateIndex, this), 85 "AtomIndex_"+toString(_id), 86 _id, 87 AtomIndexChannels), 88 AtomPosition( 89 atomref, 90 boost::bind(&GLMoleculeObject_atom::updatePosition, this), 91 "AtomPosition_"+toString(_id), 92 updatePosition(), 93 AtomPositionChannels), 94 AtomElement( 95 atomref, 96 boost::bind(&GLMoleculeObject_atom::updateElement, this), 97 "AtomElement"+toString(_id), 98 updateElement(), 99 AtomElementChannels), 100 AtomBonds( 101 atomref, 102 boost::bind(&GLMoleculeObject_atom::updateBonds, this), 103 "AtomBonds_"+toString(_id), 104 updateBonds(), 105 AtomBondsChannels), 84 ObservedValues(MAX_ObservedTypes), 85 subjectKilledCount(0), 106 86 owner(NULL) 107 87 { 88 initObservedValues(_id); 89 108 90 setObjectId(_id); 109 91 resetPosition(); … … 154 136 { 155 137 deactivateObserver(); 138 destroyObservedValues(); 156 139 } 157 140 158 141 void GLMoleculeObject_atom::resetIndex() 159 142 { 160 const atomId_t newId = AtomIndex.get();143 const atomId_t newId = getAtomIndex(); 161 144 const size_t oldId = objectId(); 162 145 ASSERT( newId != oldId, … … 170 153 void GLMoleculeObject_atom::resetPosition() 171 154 { 172 const Vector Position = AtomPosition.get();155 const Vector Position = getAtomPosition(); 173 156 LOG(4, "INFO: GLMoleculeObject_atom::resetIndex() - new position is "+toString(Position)+"."); 174 157 setPosition(QVector3D(Position[0], Position[1], Position[2])); … … 179 162 size_t elementno = 0; 180 163 const element * const _type = World::getInstance(). 181 getPeriode()->FindElement( AtomElement.get());164 getPeriode()->FindElement(getAtomElement()); 182 165 if (_type != NULL) { 183 166 elementno = _type->getAtomicNumber(); … … 205 188 void GLMoleculeObject_atom::resetBonds() 206 189 { 207 ListOfBonds_t ListOfBonds_new = AtomBonds.get();190 ListOfBonds_t ListOfBonds_new = getAtomBonds(); 208 191 std::sort(ListOfBonds_new.begin(), ListOfBonds_new.end()); 209 192 ListOfBonds_t BondsToAdd; … … 220 203 iter != BondsToAdd.end(); 221 204 ++iter) { 222 const GLMoleculeObject_bond::SideOfBond side = (iter->first == AtomIndex.get()) ?205 const GLMoleculeObject_bond::SideOfBond side = (iter->first == getAtomIndex()) ? 223 206 GLMoleculeObject_bond::left : GLMoleculeObject_bond::right; 224 207 emit BondsAdded(iter->first, iter->second, side); … … 259 242 void GLMoleculeObject_atom::wasClicked() 260 243 { 261 LOG(4, "INFO: GLMoleculeObject_atom: atom " << AtomIndex.get() << " has been clicked");262 emit clicked( AtomIndex.get());244 LOG(4, "INFO: GLMoleculeObject_atom: atom " << getAtomIndex() << " has been clicked"); 245 emit clicked(getAtomIndex()); 263 246 } 264 247 … … 283 266 Vector GLMoleculeObject_atom::updatePosition() const 284 267 { 285 const atom * const _atom = getAtom( AtomIndex.get());268 const atom * const _atom = getAtom(getAtomIndex()); 286 269 if (_atom != NULL) { 287 270 return _atom->getPosition(); … … 293 276 atomicNumber_t GLMoleculeObject_atom::updateElement() const 294 277 { 295 const atom * const _atom = getAtom( AtomIndex.get());278 const atom * const _atom = getAtom(getAtomIndex()); 296 279 if (_atom != NULL) { 297 280 return _atom->getElementNo(); … … 304 287 { 305 288 ListOfBonds_t ListOfBonds; 306 const atom * const _atom = getAtom( AtomIndex.get());289 const atom * const _atom = getAtom(getAtomIndex()); 307 290 if (_atom != NULL) { 308 291 // make sure position is up-to-date … … 315 298 (*iter)->rightatom->getId()) ); 316 299 } else { 317 ELOG(2, "Atom with id "+toString( AtomIndex.get())+" is already gone.");300 ELOG(2, "Atom with id "+toString(getAtomIndex())+" is already gone."); 318 301 } 319 302 return ListOfBonds; … … 328 311 { 329 312 deactivateObserver(); 313 314 countsubjectKilled(); 330 315 } 331 316 … … 357 342 ASSERT(0, "GLMoleculeObject_atom::recieveNotification() - received notification from unexpected source."); 358 343 } 344 345 void GLMoleculeObject_atom::countsubjectKilled() 346 { 347 ++subjectKilledCount; 348 349 if (subjectKilledCount > ObservedValues.size()) 350 emit InstanceRemoved(getAtomIndex()); 351 } 352 353 void GLMoleculeObject_atom::initObservedValues(const atomId_t _id) 354 { 355 // fill ObservedValues 356 boost::function<void()> subjectKilled = 357 boost::bind(&GLMoleculeObject_atom::countsubjectKilled, this); 358 ObservedValues[AtomIndex] = new ObservedValue_wCallback<atomId_t>( 359 atomref, 360 boost::bind(&GLMoleculeObject_atom::updateIndex, this), 361 "AtomIndex_"+toString(_id), 362 _id, 363 AtomIndexChannels, 364 subjectKilled); 365 ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector>( 366 atomref, 367 boost::bind(&GLMoleculeObject_atom::updatePosition, this), 368 "AtomPosition_"+toString(_id), 369 updatePosition(), 370 AtomPositionChannels, 371 subjectKilled); 372 ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t>( 373 atomref, 374 boost::bind(&GLMoleculeObject_atom::updateElement, this), 375 "AtomElement"+toString(_id), 376 updateElement(), 377 AtomElementChannels, 378 subjectKilled); 379 ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t>( 380 atomref, 381 boost::bind(&GLMoleculeObject_atom::updateBonds, this), 382 "AtomBonds_"+toString(_id), 383 updateBonds(), 384 AtomBondsChannels, 385 subjectKilled); 386 } 387 388 void GLMoleculeObject_atom::destroyObservedValues() 389 { 390 delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(ObservedValues[AtomIndex]); 391 delete boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[AtomPosition]); 392 delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[AtomElement]); 393 delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t> *>(ObservedValues[AtomBonds]); 394 ObservedValues.clear(); 395 } 396 397 atomId_t GLMoleculeObject_atom::getAtomIndex() const 398 { 399 return boost::any_cast<ObservedValue_wCallback<atomId_t> *>(ObservedValues[AtomIndex])->get(); 400 } 401 402 Vector GLMoleculeObject_atom::getAtomPosition() const 403 { 404 return boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[AtomPosition])->get(); 405 } 406 407 atomicNumber_t GLMoleculeObject_atom::getAtomElement() const 408 { 409 return boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[AtomElement])->get(); 410 } 411 412 GLMoleculeObject_atom::ListOfBonds_t GLMoleculeObject_atom::getAtomBonds() const 413 { 414 return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t> *>(ObservedValues[AtomBonds])->get(); 415 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp
re25448 r7c7c4a 15 15 16 16 #include "GLMoleculeObject.hpp" 17 18 #include <vector> 19 #include <boost/any.hpp> 17 20 18 21 #include "CodePatterns/ObservedValue.hpp" … … 61 64 void elementChanged(); 62 65 void bondsChanged(); 66 void InstanceRemoved(const atomId_t); 63 67 64 68 private: … … 88 92 atom * const atomref; 89 93 90 //!> cached value of the atom's id 91 ObservedValue<atomId_t> AtomIndex; 92 //!> cached value of the atom's position 93 ObservedValue<Vector> AtomPosition; 94 //!> cached value of the atom's element 95 ObservedValue<atomicNumber_t> AtomElement; 96 //!> cached value of the atom's id 97 ObservedValue<ListOfBonds_t> AtomBonds; 94 private: 95 /** Observed Values **/ 96 97 //!> enumeration of observed values to match with entries in ObservedValues 98 enum ObservedTypes { 99 //!> contains the current atom index 100 AtomIndex, 101 //!> contains the current atom position 102 AtomPosition, 103 //!> contains the current atom element 104 AtomElement, 105 //!> contains the current set of bonds atoms fort the atom 106 AtomBonds, 107 //!> gives the size of the enumeration 108 MAX_ObservedTypes 109 }; 110 111 //!> vector with all observed values 112 std::vector<boost::any> ObservedValues; 113 114 /** Initializes all \a ObservedValues entries. 115 * 116 * \param _id atom id 117 */ 118 void initObservedValues(const atomId_t _id); 119 120 /** Destroys all \a ObservedValues entries. 121 * 122 */ 123 void destroyObservedValues(); 124 125 /** Getter to atom index contained in \a ObservedValues. 126 * 127 * \return atom's index 128 */ 129 atomId_t getAtomIndex() const; 130 131 /** Getter to atom position contained in \a ObservedValues. 132 * 133 * \return atom's position 134 */ 135 Vector getAtomPosition() const; 136 137 /** Getter to atom element contained in \a ObservedValues. 138 * 139 * \return atom's elemnt 140 */ 141 atomicNumber_t getAtomElement() const; 142 143 /** Getter to atom bonds contained in \a ObservedValues. 144 * 145 * \return atom's bonds 146 */ 147 ListOfBonds_t getAtomBonds() const; 148 149 /** Counts how many ObservedValues got subjectKilled. 150 * 151 * This is used to give InstanceRemoved() signal only when each and every 152 * ObservedValue (and the instance itself) has been subjectKilled by the 153 * monitored Observable. Only then can we safely remove the instance. 154 * 155 */ 156 void countsubjectKilled(); 157 158 //!> counts how many ObservedValues have already been subjectKilled() 159 mutable size_t subjectKilledCount; 160 161 private: 98 162 99 163 //!> list of channels when index needs to update -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp
re25448 r7c7c4a 57 57 #include "World.hpp" 58 58 59 #include "ObservedValue_wCallback.hpp" 60 59 61 60 62 // static entities … … 82 84 bondowner(getAtom(leftatomId)->getBond(getAtom(rightatomId)).get()), 83 85 BondSide(side), 84 leftPosition( 85 leftowner, 86 boost::bind(&GLMoleculeObject_bond::updateLeftPosition, this), 87 "BondleftPosition_"+toString(leftatomId), 88 updateLeftPosition(), 89 BondPositionChannels), 90 rightPosition( 91 rightowner, 92 boost::bind(&GLMoleculeObject_bond::updateRightPosition, this), 93 "BondrightPosition_"+toString(rightatomId), 94 updateRightPosition(), 95 BondPositionChannels), 96 leftElement( 97 leftowner, 98 boost::bind(&GLMoleculeObject_bond::updateLeftElement, this), 99 "BondleftElement"+toString(leftatomId), 100 updateLeftElement(), 101 BondElementChannels), 102 rightElement( 103 rightowner, 104 boost::bind(&GLMoleculeObject_bond::updateRightElement, this), 105 "BondrightElement"+toString(rightatomId), 106 updateRightElement(), 107 BondElementChannels), 108 Degree( 109 bondowner, 110 boost::bind(&GLMoleculeObject_bond::updateDegree, this), 111 "BondDegree"+toString(leftatomId)+"_"+toString(rightatomId), 112 updateDegree(), 113 BondDegreeChannels), 86 ObservedValues(MAX_ObservedTypes), 87 subjectKilledCount(0), 114 88 leftobservable_enabled(false), 115 89 rightobservable_enabled(false) 116 90 { 91 initObservedValues(); 92 117 93 // sign on as observer (obtain non-const instance before) 118 94 bondowner->signOn(this, BondObservable::BondRemoved); … … 141 117 // signOff() if not already done 142 118 removeChannels(); 119 destroyObservedValues(); 143 120 } 144 121 … … 170 147 } 171 148 172 void GLMoleculeObject_bond::removeMe()173 {174 // sign off175 emit BondRemoved(leftatomId, rightatomId);176 }177 178 149 void GLMoleculeObject_bond::update(Observable *publisher) 179 150 { … … 185 156 // we signOff from all other sources 186 157 removeChannels(); 187 // then indicate to remove us188 removeMe();158 // check whether we should be removed 159 countsubjectKilled(); 189 160 } 190 161 … … 278 249 void GLMoleculeObject_bond::resetElement() 279 250 { 280 size_t elementno = rightElement.get();251 size_t elementno = getrightElement(); 281 252 QGLMaterial *elementmaterial = getMaterial(elementno); 282 253 setMaterial(elementmaterial); … … 285 256 void GLMoleculeObject_bond::resetWidth() 286 257 { 287 const double factor = 1.0f+.5f*( Degree.get()-1);258 const double factor = 1.0f+.5f*(getDegree()-1); 288 259 LOG(2, "DEBUG: GLMoleculeObject_bond::resetWidth() - setting bond's width to " << factor << "."); 289 260 setScaleX(factor); … … 295 266 void GLMoleculeObject_bond::resetPosition() 296 267 { 297 Vector Position = leftPosition.get();298 Vector OtherPosition = rightPosition.get();268 Vector Position = getleftPosition(); 269 Vector OtherPosition = getrightPosition(); 299 270 const double distance = 300 271 Position.distance(OtherPosition)/2.; … … 346 317 return _atom; 347 318 } 319 320 void GLMoleculeObject_bond::countsubjectKilled() 321 { 322 ++subjectKilledCount; 323 324 if (subjectKilledCount > ObservedValues.size()) 325 emit BondRemoved(leftatomId, rightatomId); 326 } 327 328 void GLMoleculeObject_bond::initObservedValues() 329 { 330 // fill ObservedValues 331 boost::function<void()> subjectKilled = 332 boost::bind(&GLMoleculeObject_bond::countsubjectKilled, this); 333 ObservedValues[leftPosition] = new ObservedValue_wCallback<Vector>( 334 leftowner, 335 boost::bind(&GLMoleculeObject_bond::updateLeftPosition, this), 336 "BondleftPosition_"+toString(leftatomId), 337 updateLeftPosition(), 338 BondPositionChannels, 339 subjectKilled); 340 ObservedValues[rightPosition] = new ObservedValue_wCallback<Vector>( 341 rightowner, 342 boost::bind(&GLMoleculeObject_bond::updateRightPosition, this), 343 "BondrightPosition_"+toString(rightatomId), 344 updateRightPosition(), 345 BondPositionChannels, 346 subjectKilled); 347 ObservedValues[leftElement] = new ObservedValue_wCallback<atomicNumber_t>( 348 leftowner, 349 boost::bind(&GLMoleculeObject_bond::updateLeftElement, this), 350 "BondleftElement"+toString(leftatomId), 351 updateLeftElement(), 352 BondElementChannels, 353 subjectKilled); 354 ObservedValues[rightElement] = new ObservedValue_wCallback<atomicNumber_t>( 355 rightowner, 356 boost::bind(&GLMoleculeObject_bond::updateRightElement, this), 357 "BondrightElement"+toString(rightatomId), 358 updateRightElement(), 359 BondElementChannels, 360 subjectKilled); 361 ObservedValues[Degree] = new ObservedValue_wCallback<int>( 362 bondowner, 363 boost::bind(&GLMoleculeObject_bond::updateDegree, this), 364 "BondDegree"+toString(leftatomId)+"_"+toString(rightatomId), 365 updateDegree(), 366 BondDegreeChannels, 367 subjectKilled); 368 } 369 370 void GLMoleculeObject_bond::destroyObservedValues() 371 { 372 delete boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[leftPosition]); 373 delete boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[rightPosition]); 374 delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[leftElement]); 375 delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[rightElement]); 376 delete boost::any_cast<ObservedValue_wCallback<int> *>(ObservedValues[Degree]); 377 ObservedValues.clear(); 378 } 379 380 Vector GLMoleculeObject_bond::getleftPosition() const 381 { 382 return boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[leftPosition])->get(); 383 } 384 385 Vector GLMoleculeObject_bond::getrightPosition() const 386 { 387 return boost::any_cast<ObservedValue_wCallback<Vector> *>(ObservedValues[rightPosition])->get(); 388 } 389 390 atomicNumber_t GLMoleculeObject_bond::getleftElement() const 391 { 392 return boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[leftElement])->get(); 393 } 394 395 atomicNumber_t GLMoleculeObject_bond::getrightElement() const 396 { 397 return boost::any_cast<ObservedValue_wCallback<atomicNumber_t> *>(ObservedValues[rightElement])->get(); 398 } 399 400 int GLMoleculeObject_bond::getDegree() const 401 { 402 return boost::any_cast<ObservedValue_wCallback<int> *>(ObservedValues[Degree])->get(); 403 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp
re25448 r7c7c4a 15 15 16 16 #include "GLMoleculeObject.hpp" 17 18 #include <vector> 19 #include <boost/any.hpp> 17 20 18 21 #include "CodePatterns/Observer/Observer.hpp" … … 70 73 71 74 private: 72 /** This must be called from subjectKilled() only.73 *74 * We remove from all other Observables in a controlled manner.75 *76 * removeBond(), and removeChannels() must have been called before (or one of77 * the subjects has been killed).78 *79 */80 void removeMe();81 75 void removeChannels(); 82 76 … … 105 99 const enum SideOfBond BondSide; 106 100 107 ObservedValue<Vector> leftPosition; 108 ObservedValue<Vector> rightPosition; 109 ObservedValue<atomicNumber_t> leftElement; 110 ObservedValue<atomicNumber_t> rightElement; 111 ObservedValue<int> Degree; 101 102 private: 103 /** Observed Values **/ 104 105 //!> enumeration of observed values to match with entries in ObservedValues 106 enum ObservedTypes { 107 //!> contains the position of the left atom 108 leftPosition, 109 //!> contains the position of the right atom 110 rightPosition, 111 //!> contains the element of the left atom 112 leftElement, 113 //!> contains the element of the right atom 114 rightElement, 115 //!> contains the degree of the bond 116 Degree, 117 //!> gives the size of the enumeration 118 MAX_ObservedTypes 119 }; 120 121 //!> vector with all observed values 122 std::vector<boost::any> ObservedValues; 123 124 /** Initializes all \a ObservedValues entries. 125 * 126 */ 127 void initObservedValues(); 128 129 /** Destroys all \a ObservedValues entries. 130 * 131 */ 132 void destroyObservedValues(); 133 134 /** Getter to left atom's position contained in \a ObservedValues. 135 * 136 * \return left atom's position 137 */ 138 Vector getleftPosition() const; 139 140 /** Getter to right atom's position contained in \a ObservedValues. 141 * 142 * \return right atom's position 143 */ 144 Vector getrightPosition() const; 145 146 /** Getter to left atom's element contained in \a ObservedValues. 147 * 148 * \return left atom's element 149 */ 150 atomicNumber_t getleftElement() const; 151 152 /** Getter to rightatom's element contained in \a ObservedValues. 153 * 154 * \return right atom's element 155 */ 156 atomicNumber_t getrightElement() const; 157 158 /** Getter to bond's degree contained in \a ObservedValues. 159 * 160 * \return bond's degree 161 */ 162 int getDegree() const; 163 164 /** Counts how many ObservedValues got subjectKilled. 165 * 166 * This is used to give InstanceRemoved() signal only when each and every 167 * ObservedValue (and the instance itself) has been subjectKilled by the 168 * monitored Observable. Only then can we safely remove the instance. 169 * 170 */ 171 void countsubjectKilled(); 172 173 //!> counts how many ObservedValues have already been subjectKilled() 174 mutable size_t subjectKilledCount; 175 176 private: 112 177 113 178 //!> indicate whether we are signed in to leftobservable -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp
re25448 r7c7c4a 63 63 #include "Atom/TesselPoint.hpp" 64 64 #include "World.hpp" 65 66 #include "ObservedValue_wCallback.hpp" 65 67 66 68 using namespace boost::assign; … … 122 124 boost::bind(&GLMoleculeObject_molecule::updateAtoms, this) 123 125 ), 124 MolIndex( 125 molref, 126 MolIndexUpdater, 127 "MoleculeIndex_"+toString(_molid), 128 _molid, 129 IndexChannels), 130 MolName( 131 molref, 132 MolNameUpdater, 133 "MoleculeName_"+toString(_molid), 134 updateName(), 135 NameChannels), 126 ObservedValues(MAX_ObservedTypes), 127 subjectKilledCount(0), 136 128 TesselationHull( 137 129 molref, … … 139 131 "MoleculeTesselationHull_"+toString(_molid), 140 132 HullChannels), 141 BoundingBox(142 molref,143 BoundingBoxUpdater,144 "MoleculeBoundingBox_"+toString(_molid),145 initBoundingBox(),146 BoundingBoxChannels),147 PresentAtoms(148 molref,149 PresentAtomsUpdater,150 "MoleculeAtoms_"+toString(_molid),151 updateAtoms(),152 AtomsChannels),153 133 hoverAtomId(-1) 154 134 { 135 initObservedValues(_molid); 136 155 137 setObjectId(_molid); 156 138 setMaterial(getMaterial(1)); … … 199 181 boost::bind(&GLMoleculeObject_molecule::updateAtoms, this) 200 182 ), 201 MolIndex( 202 molref, 203 MolIndexUpdater, 204 "MoleculeIndex_"+toString(_molid), 205 _molid, 206 IndexChannels), 207 MolName( 208 molref, 209 MolNameUpdater, 210 "MoleculeName_"+toString(_molid), 211 updateName(), 212 NameChannels), 183 ObservedValues(MAX_ObservedTypes), 184 subjectKilledCount(0), 213 185 TesselationHull( 214 186 molref, … … 216 188 "MoleculeTesselationHull_"+toString(_molid), 217 189 HullChannels), 218 BoundingBox(219 molref,220 BoundingBoxUpdater,221 "MoleculeBoundingBox_"+toString(_molid),222 initBoundingBox(),223 BoundingBoxChannels),224 PresentAtoms(225 molref,226 PresentAtomsUpdater,227 "MoleculeAtoms_"+toString(_molid),228 atoms_t(),229 AtomsChannels),230 190 hoverAtomId(-1) 231 191 { 192 initObservedValues(_molid); 193 232 194 setObjectId(_molid); 233 195 setMaterial(getMaterial(1)); … … 254 216 { 255 217 deactivateObserver(); 218 destroyObservedValues(); 256 219 } 257 220 … … 270 233 { 271 234 // sign on as observer (obtain non-const instance before) 272 const molecule * const _molecule = getMolecule( MolIndex.get());235 const molecule * const _molecule = getMolecule(getMolIndex()); 273 236 if (_molecule != NULL) { 274 237 owner = static_cast<const Observable *>(_molecule); … … 278 241 owner->signOn(this, molecule::IndexChanged); 279 242 } else { 280 ELOG(1, "GLMoleculeObject_molecule() - added null object for not present mol id " << MolIndex.get());243 ELOG(1, "GLMoleculeObject_molecule() - added null object for not present mol id " << getMolIndex()); 281 244 } 282 245 … … 332 295 QGeometryData geo; 333 296 334 const molecule * const molref = getMolecule( MolIndex.get());297 const molecule * const molref = getMolecule(getMolIndex()); 335 298 if (molref == NULL) { 336 ELOG(1, "Could not createMoleculeMesh, molecule with id " << MolIndex.get() << " already gone.");299 ELOG(1, "Could not createMoleculeMesh, molecule with id " << getMolIndex() << " already gone."); 337 300 return geo; 338 301 } … … 353 316 354 317 // we need at least three points for tesselation 355 if ( PresentAtoms.get().size() >= 3) {318 if (getPresentAtoms().size() >= 3) { 356 319 // Tesselate the points. 357 320 Tesselation T; 358 PointCloudAdaptor<molecule> cloud(const_cast<molecule *>(molref), MolName.get());321 PointCloudAdaptor<molecule> cloud(const_cast<molecule *>(molref), getMolName()); 359 322 T(cloud, minradius); 360 323 … … 413 376 molecule::BoundingBoxInfo GLMoleculeObject_molecule::updateBoundingBox() const 414 377 { 415 return BoundingBox.get();378 return getBoundingBox(); 416 379 } 417 380 418 381 GLMoleculeObject_molecule::atoms_t GLMoleculeObject_molecule::updateAtoms() 419 382 { 420 const molecule * const mol = getMolecule( MolIndex.get());383 const molecule * const mol = getMolecule(getMolIndex()); 421 384 if (mol != NULL) { 422 385 const atomId_t id = mol->lastChangedAtomId(); … … 436 399 std::string GLMoleculeObject_molecule::updateName() const 437 400 { 438 const molecule * const mol = getMolecule( MolIndex.get());401 const molecule * const mol = getMolecule(getMolIndex()); 439 402 return mol->getName(); 440 403 } … … 448 411 void GLMoleculeObject_molecule::resetBoundingBox() 449 412 { 450 molecule::BoundingBoxInfo info = BoundingBox.get();413 molecule::BoundingBoxInfo info = getBoundingBox(); 451 414 setPosition(QVector3D(info.position[0], info.position[1], info.position[2])); 452 415 setScale(info.radius + 0.3); // getBoundingSphere() only sees atoms as points, so make the box a bit bigger … … 455 418 void GLMoleculeObject_molecule::resetAtoms() 456 419 { 457 const atoms_t atoms = PresentAtoms.get();420 const atoms_t atoms = getPresentAtoms(); 458 421 std::vector<atomId_t> InsertedAtoms; 459 422 std::vector<atomId_t> RemovedAtoms; … … 479 442 void GLMoleculeObject_molecule::resetIndex() 480 443 { 481 const atomId_t newId = MolIndex.get();444 const atomId_t newId = getMolIndex(); 482 445 const size_t oldId = objectId(); 483 446 ASSERT( newId != oldId, … … 544 507 // remove owner: no more signOff needed 545 508 owner = NULL; 509 510 countsubjectKilled(); 546 511 } 547 512 548 513 void GLMoleculeObject_molecule::recieveNotification(Observable *publisher, Notification_ptr notification) 549 514 { 550 const molecule * const _molecule = getMolecule( MolIndex.get());515 const molecule * const _molecule = getMolecule(getMolIndex()); 551 516 // when molecule is NULL we will soon get destroyed anyway 552 517 if (_molecule == NULL) … … 556 521 #ifdef LOG_OBSERVER 557 522 observerLog().addMessage() << "++ Update of Observer "<< observerLog().getName(static_cast<Observer *>(this)) 558 << " received notification from molecule " << MolIndex.get() << " for channel "523 << " received notification from molecule " << getMolIndex() << " for channel " 559 524 << notification->getChannelNo() << "."; 560 525 #endif … … 577 542 observerLog().addMessage() << "++ Observer " << observerLog().getName(static_cast<Observer *>(this)) << " received notification that atom "+toString(_id)+" has been removed."; 578 543 #endif 579 emit AtomRemoved(_id);580 544 emit TesselationHullChanged(); 581 545 emit BoundingBoxChanged(); … … 719 683 connect (atomObject, SIGNAL(BondsRemoved(const atomId_t, const atomId_t)), this, SLOT(bondRemoved(const atomId_t, const atomId_t))); 720 684 connect (atomObject, SIGNAL(indexChanged(GLMoleculeObject_atom*, const atomId_t, const atomId_t)), this, SLOT(changeAtomId(GLMoleculeObject_atom*, const atomId_t, const atomId_t))); 685 connect (atomObject, SIGNAL(InstanceRemoved(const atomId_t)), this, SIGNAL(AtomRemoved(const atomId_t))); 721 686 722 687 if (m_objectId == -1) … … 773 738 if (moleculeObject == this){ 774 739 // Propagate signal. 775 emit hoverChanged( MolIndex.get(), 0);740 emit hoverChanged(getMolIndex(), 0); 776 741 } 777 742 } … … 871 836 void GLMoleculeObject_molecule::wasClicked() 872 837 { 873 LOG(4, "INFO: GLMoleculeObject_molecule: atom " << MolIndex.get() << " has been clicked");874 emit moleculeClicked( MolIndex.get());838 LOG(4, "INFO: GLMoleculeObject_molecule: atom " << getMolIndex() << " has been clicked"); 839 emit moleculeClicked(getMolIndex()); 875 840 } 876 841 … … 906 871 return mol; 907 872 } 873 874 void GLMoleculeObject_molecule::countsubjectKilled() 875 { 876 ++subjectKilledCount; 877 878 if (subjectKilledCount > ObservedValues.size()) 879 emit InstanceRemoved(getMolIndex()); 880 } 881 882 void GLMoleculeObject_molecule::initObservedValues(const moleculeId_t _molid) 883 { 884 // fill ObservedValues 885 boost::function<void()> subjectKilled = 886 boost::bind(&GLMoleculeObject_molecule::countsubjectKilled, this); 887 ObservedValues[MolIndex] = new ObservedValue_wCallback<moleculeId_t>( 888 molref, 889 MolIndexUpdater, 890 "MoleculeIndex_"+toString(_molid), 891 _molid, 892 IndexChannels, 893 subjectKilled); 894 ObservedValues[MolName] = new ObservedValue_wCallback<std::string>( 895 molref, 896 MolNameUpdater, 897 "MoleculeName_"+toString(_molid), 898 updateName(), 899 NameChannels, 900 subjectKilled); 901 ObservedValues[BoundingBox] = new ObservedValue_wCallback<molecule::BoundingBoxInfo>( 902 molref, 903 BoundingBoxUpdater, 904 "MoleculeBoundingBox_"+toString(_molid), 905 initBoundingBox(), 906 BoundingBoxChannels, 907 subjectKilled); 908 ObservedValues[PresentAtoms] = new ObservedValue_wCallback<atoms_t>( 909 molref, 910 PresentAtomsUpdater, 911 "MoleculeAtoms_"+toString(_molid), 912 updateAtoms(), 913 AtomsChannels, 914 subjectKilled); 915 } 916 917 void GLMoleculeObject_molecule::destroyObservedValues() 918 { 919 delete boost::any_cast<ObservedValue_wCallback<moleculeId_t> *>(ObservedValues[MolIndex]); 920 delete boost::any_cast<ObservedValue_wCallback<std::string> *>(ObservedValues[MolName]); 921 delete boost::any_cast<ObservedValue_wCallback<molecule::BoundingBoxInfo> *>(ObservedValues[BoundingBox]); 922 delete boost::any_cast<ObservedValue_wCallback<atoms_t> *>(ObservedValues[PresentAtoms]); 923 ObservedValues.clear(); 924 } 925 926 moleculeId_t GLMoleculeObject_molecule::getMolIndex() const 927 { 928 return boost::any_cast<ObservedValue_wCallback<moleculeId_t> *>(ObservedValues[MolIndex])->get(); 929 } 930 931 std::string GLMoleculeObject_molecule::getMolName() const 932 { 933 return boost::any_cast<ObservedValue_wCallback<std::string> *>(ObservedValues[MolName])->get(); 934 } 935 936 molecule::BoundingBoxInfo GLMoleculeObject_molecule::getBoundingBox() const 937 { 938 return boost::any_cast<ObservedValue_wCallback<molecule::BoundingBoxInfo> *>(ObservedValues[BoundingBox])->get(); 939 } 940 941 GLMoleculeObject_molecule::atoms_t GLMoleculeObject_molecule::getPresentAtoms() const 942 { 943 return boost::any_cast<ObservedValue_wCallback<atoms_t> *>(ObservedValues[PresentAtoms])->get(); 944 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp
re25448 r7c7c4a 17 17 18 18 #include <Qt3D/qgeometrydata.h> 19 20 #include <vector> 21 #include <boost/any.hpp> 19 22 20 23 #include "CodePatterns/Cacheable.hpp" … … 68 71 void AtomRemoved(const atomId_t _id); 69 72 void IdChanged(); 73 void InstanceRemoved(const moleculeId_t); 70 74 71 75 private slots: … … 141 145 boost::function<atoms_t ()> PresentAtomsUpdater; 142 146 143 //!> contains the current molecule index 144 ObservedValue<moleculeId_t> MolIndex; 145 //!> contains the current molecule name 146 ObservedValue<std::string> MolName; 147 private: 148 /** Observed Values **/ 149 150 //!> enumeration of observed values to match with entries in ObservedValues 151 enum ObservedTypes { 152 //!> contains the current molecule index 153 MolIndex, 154 //!> contains the current molecule name 155 MolName, 156 //!> contains newest version of the bounding box on request 157 BoundingBox, 158 //!> contains the current live set of atoms for the molecule 159 PresentAtoms, 160 //!> gives the size of the enumeration 161 MAX_ObservedTypes 162 }; 163 164 //!> vector with all observed values 165 std::vector<boost::any> ObservedValues; 166 167 /** Initializes all \a ObservedValues entries. 168 * 169 * \param _moid molecule id 170 */ 171 void initObservedValues(const moleculeId_t _molid); 172 173 /** Destroys all \a ObservedValues entries. 174 * 175 */ 176 void destroyObservedValues(); 177 178 /** Getter to molecule index contained in \a ObservedValues. 179 * 180 * \return molecule's index 181 */ 182 moleculeId_t getMolIndex() const; 183 184 /** Getter to molecule name contained in \a ObservedValues. 185 * 186 * \return molecule's name 187 */ 188 std::string getMolName() const; 189 190 /** Getter to molecule's bounding box contained in \a ObservedValues. 191 * 192 * \return molecule's bounding box 193 */ 194 molecule::BoundingBoxInfo getBoundingBox() const; 195 196 /** Getter to contained atoms contained in \a ObservedValues. 197 * 198 * \return molecule's contained atoms 199 */ 200 atoms_t getPresentAtoms() const; 201 202 /** Counts how many ObservedValues got subjectKilled. 203 * 204 * This is used to give InstanceRemoved() signal only when each and every 205 * ObservedValue (and the instance itself) has been subjectKilled by the 206 * monitored Observable. Only then can we safely remove the instance. 207 * 208 */ 209 void countsubjectKilled(); 210 211 //!> counts how many ObservedValues have already been subjectKilled() 212 mutable size_t subjectKilledCount; 213 147 214 //!> contains current version of the tesselation hull on request 148 215 Cacheable<QGeometryData> TesselationHull; 149 //!> contains newest version of the bounding box on request 150 ObservedValue<molecule::BoundingBoxInfo> BoundingBox; 151 //!> contains the current live set of atoms for the molecule 152 ObservedValue<atoms_t> PresentAtoms; 153 216 217 private: 154 218 //!> contains the set of atoms displayed 155 219 atoms_t DisplayedAtoms; -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
re25448 r7c7c4a 91 91 } 92 92 connect(this, SIGNAL(moleculePreparedInserted(const moleculeId_t)), this, SLOT(moleculeInserted(const moleculeId_t))); 93 connect(this, SIGNAL(moleculePreparedRemoved(const moleculeId_t)), this, SLOT(moleculeRemoved(const moleculeId_t)));94 93 95 94 // connect(this, SIGNAL(updated()), this, SLOT(update())); … … 116 115 // moliter != molecules.end(); 117 116 // moliter++) { 117 // boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 118 118 // // check whether molecule already exists 119 119 // const moleculeId_t molid = (*moliter)->getId(); … … 123 123 // } 124 124 // 125 // boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 125 126 // MoleculeNodeMap::iterator iter = MoleculesinSceneMap.begin(); 126 127 // for (;iter != MoleculesinSceneMap.end();) { … … 182 183 void GLWorldScene::atomInserted(const moleculeId_t _molid, const atomId_t _atomid) 183 184 { 185 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 186 184 187 LOG(3, "INFO: GLWorldScene: Received signal atomInserted for atom "+toString(_atomid)+"."); 185 186 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex);187 188 188 189 // check of molecule is already present … … 268 269 269 270 // add new object 271 LOG(1, "DEBUG: Adding GLMoleculeObject_molecule to id " << _id); 270 272 GLMoleculeObject_molecule *molObject = 271 273 new GLMoleculeObject_molecule(GLMoleculeObject::meshEmpty, this, _id); … … 344 346 connect (molObject, SIGNAL(hoverChanged(const atomId_t)), this, SIGNAL(hoverChanged(const atomId_t))); 345 347 connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int))); 346 connect (molObject, SIGNAL(indexChanged(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t)), this, SLOT(changeMoleculeId(GLMoleculeObject_molecule *, const moleculeId_t, const moleculeId_t))); 348 connect (molObject, SIGNAL(hoverChanged(const moleculeId_t, int)), this, SIGNAL(hoverChanged(const moleculeId_t, int))); 349 connect (molObject, SIGNAL(InstanceRemoved(const moleculeId_t)), this, SLOT(moleculeRemoved(const moleculeId_t))); 347 350 348 351 emit changed(); … … 350 353 } 351 354 352 /** Prepares removinga molecule from the scene.353 * 354 * \sa moleculePrepareInserted()355 /** Removes a molecule from the scene. 356 * 357 * * \sa moleculePrepareRemoved() 355 358 * 356 359 * @param _id id of molecule to remove 357 360 */ 358 void GLWorldScene::molecule PrepareRemoved(const moleculeId_t _id)361 void GLWorldScene::moleculeRemoved(const moleculeId_t _id) 359 362 { 360 363 LOG(3, "INFO: GLWorldScene: Received signal moleculePrepareRemoved for molecule "+toString(_id)+"."); … … 363 366 364 367 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 365 if ( iter == MoleculesinSceneMap.end()) 368 if ( iter == MoleculesinSceneMap.end()) { 366 369 RemovalMolecules.insert(_id); 367 368 emit moleculePreparedRemoved(_id); 369 } 370 371 /** Removes a molecule from the scene. 372 * 373 * * \sa moleculePrepareRemoved() 374 * 375 * @param _id id of molecule to remove 376 */ 377 void GLWorldScene::moleculeRemoved(const moleculeId_t _id) 378 { 379 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 380 381 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 382 GLMoleculeObject_molecule *molObject = iter->second; 383 molObject->disconnect(); 384 MoleculesinSceneMap.erase(iter); 385 delete molObject; 370 } else { 371 LOG(1, "DEBUG: Removing GLMoleculeObject_molecule to id " << _id); 372 GLMoleculeObject_molecule *molObject = iter->second; 373 molObject->disconnect(); 374 MoleculesinSceneMap.erase(iter); 375 delete molObject; 376 } 386 377 387 378 // remove any possible state changes left … … 397 388 void GLWorldScene::moleculesVisibilityChanged(const moleculeId_t _id, bool _visible) 398 389 { 390 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 399 391 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_id); 400 392 ASSERT( iter != MoleculesinSceneMap.end(), … … 506 498 507 499 { 500 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 508 501 // Remove from map. 509 502 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(oldId); … … 525 518 526 519 { 520 boost::recursive_mutex::scoped_lock lock(MoleculeMissedStateMap_mutex); 527 521 // Remove and re-insert from map if present. 528 522 MoleculeMissedStateMap_t::iterator iter = MoleculeMissedStateMap.find(oldId); … … 537 531 void GLWorldScene::AtomSelected(const moleculeId_t _molid, const atomId_t _id) 538 532 { 533 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 539 534 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 540 535 if (iter != MoleculesinSceneMap.end()) … … 550 545 void GLWorldScene::AtomUnselected(const moleculeId_t _molid, const atomId_t _id) 551 546 { 547 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 552 548 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 553 549 if (iter != MoleculesinSceneMap.end()) … … 563 559 void GLWorldScene::MoleculeSelected(const moleculeId_t _molid) 564 560 { 565 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 561 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 562 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 566 563 if (iter != MoleculesinSceneMap.end()) 567 564 QMetaObject::invokeMethod(iter->second, // pointer to a QObject … … 575 572 void GLWorldScene::MoleculeUnselected(const moleculeId_t _molid) 576 573 { 574 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 577 575 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 578 576 if (iter != MoleculesinSceneMap.end()) -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
re25448 r7c7c4a 83 83 void hoverChanged(const moleculeId_t, int); 84 84 void moleculePreparedInserted(const moleculeId_t _id); 85 void moleculePreparedRemoved(const moleculeId_t _id);86 85 87 86 private slots: 88 87 void atomClicked(atomId_t no); 89 88 void moleculeClicked(moleculeId_t no); 90 void moleculePrepareRemoved(const moleculeId_t _id);91 89 void moleculePrepareInserted(const moleculeId_t _id); 92 90 void moleculeRemoved(const moleculeId_t _id); -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
re25448 r7c7c4a 93 93 connect(this, SIGNAL(atomInserted(const moleculeId_t, const atomId_t)), worldscene, SLOT(atomInserted(const moleculeId_t, const atomId_t)), Qt::DirectConnection); 94 94 connect(this, SIGNAL(moleculeInserted(const moleculeId_t)), worldscene, SLOT(moleculePrepareInserted(const moleculeId_t)), Qt::DirectConnection); 95 connect(this, SIGNAL(moleculeRemoved(const moleculeId_t)), worldscene, SLOT(moleculePrepareRemoved(const moleculeId_t)), Qt::DirectConnection);96 95 //connect(this, SIGNAL(changed()), this, SLOT(updateGL())); 97 96 connect(this, SIGNAL(changed()), this, SLOT(sceneChangeSignalled())); … … 370 369 371 370 if (mol != NULL) { 372 373 // sign off 374 signOffFromMolecule(mol); 371 ObservedMolecules.erase(mol); 372 // 373 // // sign off 374 // signOffFromMolecule(mol); 375 375 376 376 // emit removed signal
Note:
See TracChangeset
for help on using the changeset viewer.