Ignore:
Timestamp:
Jul 17, 2012, 12:17:26 PM (13 years ago)
Author:
Michael Ankele <ankele@…>
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)
Message:

GLWorldScene: added selection mode (atom/molecule)

  • this controls whether atoms or molecules will get selected by clicking on an atom
Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp

    r41815a3 r6966b7  
    3838#include "Actions/SelectionAction/Atoms/AtomByIdAction.hpp"
    3939#include "Actions/SelectionAction/Atoms/NotAtomByIdAction.hpp"
     40#include "Actions/SelectionAction/Molecules/MoleculeByIdAction.hpp"
     41#include "Actions/SelectionAction/Molecules/NotMoleculeByIdAction.hpp"
    4042#include "Atom/atom.hpp"
    4143#include "Bond/bond.hpp"
     
    7880  meshCylinderLo->setOption(QGLSceneNode::CullBoundingBox, true);
    7981
     82  setSelectionMode(SelectAtom);
     83
    8084  init();
    8185}
     
    302306   LOG(3, "INFO: GLWorldScene - atom " << no << " has been clicked.");
    303307   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   }
    308321   emit clicked(no);
    309322}
    310323
     324void GLWorldScene::setSelectionMode(SelectionModeType mode)
     325{
     326  selectionMode = mode;
     327  // TODO send update to toolbar
     328}
     329
     330void GLWorldScene::setSelectionModeAtom()
     331{
     332  setSelectionMode(SelectAtom);
     333}
     334
     335void GLWorldScene::setSelectionModeMolecule()
     336{
     337  setSelectionMode(SelectMolecule);
     338}
     339
  • src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp

    r41815a3 r6966b7  
    5757  void draw(QGLPainter *painter) const;
    5858
     59  enum SelectionModeType{
     60    SelectAtom,
     61    SelectMolecule
     62  };
     63  void setSelectionMode(SelectionModeType mode);
     64
    5965signals:
    6066  void changed();
     
    7581  void bondInserted(const bond *_bond, const GLMoleculeObject_bond::SideOfBond side);
    7682  void bondRemoved(const atomId_t leftnr, const atomId_t rightnr);
     83  void setSelectionModeAtom();
     84  void setSelectionModeMolecule();
    7785
    7886private:
     
    95103  QGLSceneNode *meshCylinderHi;
    96104  QGLSceneNode *meshCylinderLo;
     105
     106  SelectionModeType selectionMode;
    97107};
    98108
Note: See TracChangeset for help on using the changeset viewer.