Changeset 6966b7 for src/UIElements/Views/Qt4
- Timestamp:
- Jul 17, 2012, 12:17:26 PM (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:
- 859a00
- Parents:
- 41815a3
- git-author:
- Michael Ankele <ankele@…> (06/15/12 15:42:22)
- git-committer:
- Michael Ankele <ankele@…> (07/17/12 12:17:26)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
r41815a3 r6966b7 38 38 #include "Actions/SelectionAction/Atoms/AtomByIdAction.hpp" 39 39 #include "Actions/SelectionAction/Atoms/NotAtomByIdAction.hpp" 40 #include "Actions/SelectionAction/Molecules/MoleculeByIdAction.hpp" 41 #include "Actions/SelectionAction/Molecules/NotMoleculeByIdAction.hpp" 40 42 #include "Atom/atom.hpp" 41 43 #include "Bond/bond.hpp" … … 78 80 meshCylinderLo->setOption(QGLSceneNode::CullBoundingBox, true); 79 81 82 setSelectionMode(SelectAtom); 83 80 84 init(); 81 85 } … … 302 306 LOG(3, "INFO: GLWorldScene - atom " << no << " has been clicked."); 303 307 const atom *Walker = World::getInstance().getAtom(AtomById(no)); 304 if (!World::getInstance().isSelected(Walker)) 305 SelectionAtomById(no); 306 else 307 SelectionNotAtomById(no); 308 if (selectionMode == SelectAtom){ 309 if (!World::getInstance().isSelected(Walker)) 310 SelectionAtomById(no); 311 else 312 SelectionNotAtomById(no); 313 }else if (selectionMode == SelectMolecule){ 314 const molecule *mol = Walker->getMolecule(); 315 ASSERT(mol, "Atom without molecule has been clicked."); 316 if (!World::getInstance().isSelected(mol)) 317 SelectionMoleculeById(mol->getId()); 318 else 319 SelectionNotMoleculeById(mol->getId()); 320 } 308 321 emit clicked(no); 309 322 } 310 323 324 void GLWorldScene::setSelectionMode(SelectionModeType mode) 325 { 326 selectionMode = mode; 327 // TODO send update to toolbar 328 } 329 330 void GLWorldScene::setSelectionModeAtom() 331 { 332 setSelectionMode(SelectAtom); 333 } 334 335 void GLWorldScene::setSelectionModeMolecule() 336 { 337 setSelectionMode(SelectMolecule); 338 } 339 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
r41815a3 r6966b7 57 57 void draw(QGLPainter *painter) const; 58 58 59 enum SelectionModeType{ 60 SelectAtom, 61 SelectMolecule 62 }; 63 void setSelectionMode(SelectionModeType mode); 64 59 65 signals: 60 66 void changed(); … … 75 81 void bondInserted(const bond *_bond, const GLMoleculeObject_bond::SideOfBond side); 76 82 void bondRemoved(const atomId_t leftnr, const atomId_t rightnr); 83 void setSelectionModeAtom(); 84 void setSelectionModeMolecule(); 77 85 78 86 private: … … 95 103 QGLSceneNode *meshCylinderHi; 96 104 QGLSceneNode *meshCylinderLo; 105 106 SelectionModeType selectionMode; 97 107 }; 98 108
Note:
See TracChangeset
for help on using the changeset viewer.