source: src/documentation/constructs/qt-gui.dox@ c8302f3

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
Last change on this file since c8302f3 was 2ad1ec, checked in by Frederik Heber <heber@…>, 13 years ago

Rewrite of how GLWorldScene and subsidiaries get notified of changed bonds and atoms.

  • we have made the connections from the real atoms and bonds to the nodes within GLWorldScene a lot easier. Also this fixes a crash when Subgraph- Dissection is called.
  • renamed BondedParticle::BondsChanged -> ::BondsAdded.
  • GLMoleculeObject_bond now observes its associated bond.
  • added documentation on how the mechanism works in qt-gui.dox.
  • Property mode set to 100644
File size: 3.2 KB
Line 
1/*
2 * Project: MoleCuilder
3 * Description: creates and alters molecular systems
4 * Copyright (C) 2010 University of Bonn. All rights reserved.
5 * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
6 */
7
8/**
9 * \file qt-gui.dox
10 *
11 * Created on: Jan 5, 2012
12 * Author: heber
13 */
14
15/**
16 * \page qt-gui Qt GUI
17 *
18 * The Qt GUI is the most advanced interface and thus the most complex.
19 *
20 * In the following we want to explain some of the details that are involved.
21 *
22 * \section qt-gui-qt3d Qt3D and the way to get atoms and bonds displayed
23 *
24 * Atoms and Bonds have to displayed, the widget for this is GLWorldView. This
25 * this class belongs GLWorldScene that contains lots of GLMoleculeObject's or
26 * nodes in the speak of Qt3D. We have two derived class for these kind of
27 * objects:
28 * -# GLMoleculeObject_atom: for each atom,
29 * -# GLMoleculeObject_bond: for each "side" of the bond.
30 *
31 * We can only add new nodes to the Qt3D scene at the level of GLWorldScene,
32 * hence all insertion go through this instance to add new nodes. Destruction
33 * may occur anywhere as the new nodes are parentized to the scene.
34 *
35 * \subsection qt-gui-qt3d-atoms How atom object are constructed/destroyed.
36 *
37 * Atoms are rendered as spheres, see createAtom(). GLWorldView gets notified
38 * by the World about new and removed atoms via the Channel's World::AtomInserted
39 * and World::AtomRemoved. It translates these into Qt signals with the correct
40 * affected atom, by looking at
41 * \code
42 * const atom *_atom = World::getInstance().lastChanged<atom>();
43 * \endcode
44 * These signals call slots of GLWorldScene that has a map of all contained
45 * GLMoleculeObject, one for either of the two kinds:
46 * -# GLWorldScene::atomInserted(): create a new node and connect its signals
47 * with us, add to map
48 * -# GLWorldScene::atomRemoved(): disconnect, remove from map, destroy
49 *
50 * We do not need to destroy the node itself as it is connected via the Observer
51 * mechanism to the associated atom
52 *
53 * \subsection qt-gui-qt3d-bonds How bond object are constructed/destroyed.
54 *
55 * Bonds are displayed as cylinders that elongate from one atom to the midpoint
56 * of the bond (i.e. the spot in between the two atoms). That is we have always
57 * two cylinders per bond. That's why we need to distinguish
58 * GLMoleculeObject_bond::SideOfBond to get the right node.
59 *
60 * Bonds are not as easy as atoms: The World does not know about bonds being
61 * created or destroyed, only the atoms themselves know about them.
62 *
63 * That's way the atom node object GLMoleculeObject_atom is an Observer of is
64 * associated atom and listens to the Channel AtomObservable::BondsAdded. It then
65 * translates this into a Qt signal that calls a slot GLWorldScene:BondInserted.
66 *
67 *
68 * Bonds themselves are also Observables, as are atoms. Hence,
69 * GLMoleculeObject_bond connect via the Observer mechanism to their associated
70 * bond and are thus notified when they are destroyed.
71 *
72 * Additionally, we use GLWorldScene to do some bookkeeping about all bond nodes.
73 * This is not strictly required but might in general be useful. Hence, signals
74 * notify GLWorldScene also about GLWorldScene::BondRemoved that are emitted by
75 * the node itself.
76 *
77 * \date 2012-01-05
78 */
Note: See TracBrowser for help on using the repository browser.