Changeset 0e5d14 for src/UIElements


Ignore:
Timestamp:
Jul 17, 2012, 12:17:21 PM (12 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:
3f48c2
Parents:
e13b34
git-author:
Michael Ankele <ankele@…> (05/03/12 10:29:08)
git-committer:
Michael Ankele <ankele@…> (07/17/12 12:17:21)
Message:

added toolbar actions for camera modes

Location:
src/UIElements
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/QtMainWindow.cpp

    re13b34 r0e5d14  
    7070
    7171  toolbar = new QtToolBar(this);
     72  molecule3dDisplay->addToolBarActions(toolbar);
    7273  addToolBar(toolbar);
    7374
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp

    re13b34 r0e5d14  
    2121
    2222#include <Qt/qevent.h>
     23#include <Qt/qaction.h>
     24#include <QtGui/QToolBar>
    2325
    2426#include "GLWorldScene.hpp"
     
    6769  AtomObserver::getInstance().signOff(this, AtomObservable::PositionChanged);
    6870  delete worldscene;
     71}
     72
     73
     74/**
     75 * Add some widget specific actions to the toolbar:
     76 * - camera rotation/translation mode
     77 * - camera fit to domain
     78 */
     79void GLWorldView::addToolBarActions(QToolBar *toolbar)
     80{
     81  toolbar->addSeparator();
     82  QAction *transAction = new QAction(QIcon::fromTheme("forward"), tr("camera translation mode"), this);
     83  connect(transAction, SIGNAL(triggered()), this, SLOT(setCameraControlModeTranslation()));
     84  toolbar->addAction(transAction);
     85  QAction *rotAction = new QAction(QIcon::fromTheme("object-rotate-left"), tr("camera rotation mode"), this);
     86  connect(rotAction, SIGNAL(triggered()), this, SLOT(setCameraControlModeRotation()));
     87  toolbar->addAction(rotAction);
     88  QAction *fitAction = new QAction(QIcon::fromTheme("zoom-best-fit"), tr("camera fit to domain"), this);
     89  connect(fitAction, SIGNAL(triggered()), this, SLOT(fitCameraToDomain()));
     90  toolbar->addAction(fitAction);
    6991}
    7092
     
    191213
    192214
     215/**
     216 * Set the current camera control mode.
     217 */
    193218void GLWorldView::setCameraControlMode(GLWorldView::CameraControlModeType mode)
    194219{
     
    206231}
    207232
     233/**
     234 * Returns the current camera control mode.
     235 * This needs to be invertable (rotation - translation), if the shift key is pressed.
     236 */
    208237GLWorldView::CameraControlModeType GLWorldView::getCameraControlMode(bool inverted)
    209238{
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp

    re13b34 r0e5d14  
    2424class GLWorldScene;
    2525class QGLPainter;
     26class QToolBar;
    2627
    2728/** This class is the view on the 3D representation of the World, i.e. the whole
     
    3536  GLWorldView(QWidget *parent=0);
    3637  virtual ~GLWorldView();
     38
     39  void addToolBarActions(QToolBar *toolbar);
    3740
    3841  // Observer functions
Note: See TracChangeset for help on using the changeset viewer.