Changeset c67518
- Timestamp:
- Apr 6, 2012, 11:57:23 AM (13 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:
- 3b229e
- Parents:
- 42c6a47
- git-author:
- Michael Ankele <ankele@…> (03/30/12 14:59:47)
- git-committer:
- Frederik Heber <heber@…> (04/06/12 11:57:23)
- Location:
- src/UIElements
- Files:
-
- 2 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Makefile.am
r42c6a47 rc67518 205 205 UIElements/Views/Qt4/Qt3D/GLMoleculeObject.cpp \ 206 206 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp \ 207 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp 207 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.cpp \ 208 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.cpp 208 209 # UIElements/Views/Qt4/dialoglight.cpp 209 210 … … 237 238 UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp \ 238 239 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp \ 239 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp 240 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_bond.hpp \ 241 UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp 240 242 241 243 QTUIUI_UIFILES = \ -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.cpp
r42c6a47 rc67518 78 78 GLMoleculeObject::~GLMoleculeObject() 79 79 { 80 delete m_mesh;81 80 } 82 81 … … 234 233 } 235 234 } 235 236 237 void GLMoleculeObject::setSelected(bool value) 238 { 239 if (value != m_selected){ 240 m_selected = value; 241 emit selectionChanged(); 242 } 243 } -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject.hpp
r42c6a47 rc67518 73 73 74 74 bool selected() const { return m_selected; } 75 void setSelected(bool value) { m_selected = value; }75 void setSelected(bool value); 76 76 77 77 void initialize(QGLView *view, QGLPainter *painter); -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.cpp
r42c6a47 rc67518 195 195 case World::SelectionChanged: 196 196 setSelected(World::getInstance().isSelected(_atom)); 197 emit selectionChanged();198 197 break; 199 198 default: -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
r42c6a47 rc67518 25 25 #include "GLMoleculeObject_atom.hpp" 26 26 #include "GLMoleculeObject_bond.hpp" 27 #include "GLMoleculeObject_molecule.hpp" 27 28 28 29 #include "CodePatterns/MemDebug.hpp" … … 74 75 Runner != molecules.end(); 75 76 Runner++) { 77 76 78 // create molecule 79 moleculeInserted(*Runner); 80 77 81 for (molecule::const_iterator atomiter = (*Runner)->begin(); 78 82 atomiter != (*Runner)->end(); … … 133 137 AtomsinSceneMap.erase(iter); 134 138 delete atomObject; 139 emit changeOccured(); 140 } 141 142 /** Adds a molecule to the scene. 143 * 144 * @param _molecule molecule to add 145 */ 146 void GLWorldScene::moleculeInserted(const molecule*_molecule) 147 { 148 LOG(3, "INFO: GLWorldScene: Received signal moleculeInserted for atom "+toString(_molecule->getId())+"."); 149 GLMoleculeObject_molecule *molObject = new GLMoleculeObject_molecule(this, _molecule); 150 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molecule->getId()); 151 ASSERT(iter == MoleculesinSceneMap.end(), 152 "GLWorldScene::moleculeInserted() - same molecule "+_molecule->getName()+" added again."); 153 MoleculesinSceneMap.insert( make_pair(_molecule->getId(), molObject) ); 154 connect (molObject, SIGNAL(changed()), this, SIGNAL(changed())); 155 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 156 connect (molObject, SIGNAL(selectionChanged()), this, SIGNAL(changed())); 157 emit changeOccured(); 158 } 159 160 /** Removes a molecule from the scene. 161 * 162 * @param _molecule molecule to remove 163 */ 164 void GLWorldScene::moleculeRemoved(const molecule *_molecule) 165 { 166 LOG(3, "INFO: GLWorldScene: Received signal moleculeRemoved for atom "+toString(_molecule->getId())+"."); 167 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molecule->getId()); 168 ASSERT(iter != MoleculesinSceneMap.end(), 169 "GLWorldScene::moleculeRemoved() - molecule "+_molecule->getName()+" not on display."); 170 GLMoleculeObject_molecule *molObject = iter->second; 171 molObject->disconnect(); 172 MoleculesinSceneMap.erase(iter); 173 delete molObject; 135 174 emit changeOccured(); 136 175 } -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
r42c6a47 rc67518 23 23 24 24 #include "GLMoleculeObject_bond.hpp" 25 #include "GLMoleculeObject_molecule.hpp" 25 26 26 27 class atom; 28 class molecule; 27 29 28 30 class QGLPainter; … … 32 34 class GLMoleculeObject; 33 35 class GLMoleculeObject_atom; 36 class GLMoleculeObject_molecule; 34 37 35 38 /** This class contains a list of all molecules in the world. … … 49 52 void changeMaterials(bool perPixel); 50 53 QGLSceneNode* getAtom(size_t); 54 QGLSceneNode* getMolecule(size_t); 51 55 QGLSceneNode* getBond(size_t, size_t); 52 56 … … 68 72 void atomInserted(const atom *_atom); 69 73 void atomRemoved(const atom *_atom); 74 void moleculeInserted(const molecule *_molecule); 75 void moleculeRemoved(const molecule *_molecule); 70 76 void bondInserted(const bond *_bond, const GLMoleculeObject_bond::SideOfBond side); 71 77 void bondRemoved(const atomId_t leftnr, const atomId_t rightnr); … … 80 86 typedef std::map< atomId_t, GLMoleculeObject_atom* > AtomNodeMap; 81 87 typedef std::map< BondIds , GLMoleculeObject_bond* > BondNodeMap; 88 typedef std::map< moleculeId_t , GLMoleculeObject_molecule* > MoleculeNodeMap; 82 89 AtomNodeMap AtomsinSceneMap; 83 90 BondNodeMap BondsinSceneMap; 91 MoleculeNodeMap MoleculesinSceneMap; 84 92 }; 85 93 -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
r42c6a47 rc67518 42 42 connect(this, SIGNAL(atomInserted(const atom *)), worldscene, SLOT(atomInserted(const atom *))); 43 43 connect(this, SIGNAL(atomRemoved(const atom *)), worldscene, SLOT(atomRemoved(const atom *))); 44 connect(this, SIGNAL(moleculeInserted(const molecule *)), worldscene, SLOT(moleculeInserted(const molecule *))); 45 connect(this, SIGNAL(moleculeRemoved(const molecule *)), worldscene, SLOT(moleculeRemoved(const molecule *))); 44 46 connect(this, SIGNAL(changed()), this, SLOT(updateGL())); 45 47 … … 49 51 World::getInstance().signOn(this, World::AtomRemoved); 50 52 World::getInstance().signOn(this, World::AtomPositionChanged); 53 World::getInstance().signOn(this, World::MoleculeInserted); 54 World::getInstance().signOn(this, World::MoleculeRemoved); 51 55 } 52 56 … … 57 61 World::getInstance().signOff(this, World::AtomRemoved); 58 62 World::getInstance().signOff(this, World::AtomPositionChanged); 63 World::getInstance().signOff(this, World::MoleculeInserted); 64 World::getInstance().signOff(this, World::MoleculeRemoved); 59 65 delete worldscene; 60 66 } … … 107 113 #endif 108 114 emit changed(); 115 break; 116 } 117 case World::MoleculeInserted: 118 { 119 const molecule *_molecule = World::getInstance().lastChanged<molecule>(); 120 #ifdef LOG_OBSERVER 121 observerLog().addMessage() << "++ Observer " << observerLog().getName(this) << " received notification that molecule "+toString(_molecule->getId())+" has been inserted."; 122 #endif 123 emit moleculeInserted(_molecule); 124 break; 125 } 126 case World::MoleculeRemoved: 127 { 128 const molecule *_molecule = World::getInstance().lastChanged<molecule>(); 129 #ifdef LOG_OBSERVER 130 observerLog().addMessage() << "++ Observer " << observerLog().getName(this) << " received notification that molecule "+toString(_molecule->getId())+" has been removed."; 131 #endif 132 emit moleculeRemoved(_molecule); 109 133 break; 110 134 } -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
r42c6a47 rc67518 47 47 void atomInserted(const atom *_atom); 48 48 void atomRemoved(const atom *_atom); 49 void moleculeInserted(const molecule *_molecule); 50 void moleculeRemoved(const molecule *_molecule); 49 51 50 52 protected:
Note:
See TracChangeset
for help on using the changeset viewer.