Changeset b6d92e for src/UIElements/Views
- Timestamp:
- Jan 11, 2015, 4:42:43 PM (10 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:
- d7cad1
- Parents:
- f115cc
- git-author:
- Frederik Heber <heber@…> (12/05/14 23:06:53)
- git-committer:
- Frederik Heber <heber@…> (01/11/15 16:42:43)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
rf115cc rb6d92e 71 71 setOption(QGLView::ObjectPicking, true); 72 72 setOption(QGLView::CameraNavigation, false); 73 setFocusPolicy(Qt::StrongFocus); 73 74 setCameraControlMode(Rotate); 74 75 defaultEyeSeparation = 4.0; … … 499 500 void GLWorldView::keyPressEvent(QKeyEvent *e) 500 501 { 502 // Find the distance between the eye and focus point. 503 QVector3D d = camera()->eye() - camera()->center(); 504 // LOG(1, "Distance vector eye and center is " 505 // << d.x() << "," << d.y() << "," << d.z()); 506 // scale the move unit by the eye <-> domain center distance 507 const double key_move_unit = 0.04*(d.length()/50.); 508 501 509 if (e->key() == Qt::Key_Tab) { 502 510 // The Tab key turns the ShowPicking option on and off, … … 504 512 setOption(QGLView::ShowPicking, ((options() & QGLView::ShowPicking) == 0)); 505 513 updateGL(); 514 } else if ((e->key() == Qt::Key_Minus) || (e->key() == Qt::Key_Plus)) { 515 // Scale the distance. 516 if (e->key() == Qt::Key_Minus) 517 d *= 1.2; 518 else if (e->key() == Qt::Key_Plus) 519 d /= 1.2; 520 // Set new eye position. 521 camera()->setEye(camera()->center() + d); 522 } else if ((e->key() == Qt::Key_Left) || (e->key() == Qt::Key_Right)) { 523 // Translate the camera. 524 const double d = (e->key() == Qt::Key_Left) ? -key_move_unit : key_move_unit; 525 camera()->translateCenter( d, 0., 0); 526 camera()->translateEye( d, 0., 0); 527 } else if ((e->key() == Qt::Key_Up) || (e->key() == Qt::Key_Down)) { 528 // Translate the camera. 529 const double d = (e->key() == Qt::Key_Up) ? -key_move_unit : key_move_unit; 530 camera()->translateCenter( 0., d, 0); 531 camera()->translateEye( 0., d, 0); 532 } else if ((e->key() == Qt::Key_PageUp) || (e->key() == Qt::Key_PageDown)) { 533 // Translate the camera. 534 const double d = (e->key() == Qt::Key_PageUp) ? -key_move_unit : key_move_unit; 535 camera()->translateCenter( 0., 0., d); 536 camera()->translateEye( 0., 0., d); 506 537 } 507 538 QGLView::keyPressEvent(e);
Note:
See TracChangeset
for help on using the changeset viewer.