Ignore:
Timestamp:
Jan 31, 2016, 12:43:17 PM (9 years ago)
Author:
Frederik Heber <heber@…>
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:
6a922b
Parents:
e3e52a
git-author:
Frederik Heber <heber@…> (08/31/15 12:38:50)
git-committer:
Frederik Heber <heber@…> (01/31/16 12:43:17)
Message:

Implemented more efficient per-molecule bounding box information.

Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

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

    re3e52a re39e7a  
    8585const Observable::channels_t GLMoleculeObject_molecule::AtomsChannels(getAtomsChannels());
    8686const Observable::channels_t GLMoleculeObject_molecule::HullChannels(getAllAtomicChangesChannels());
    87 const Observable::channels_t GLMoleculeObject_molecule::BoundingBoxChannels(getAllAtomicChangesChannels());
     87const Observable::channels_t GLMoleculeObject_molecule::BoundingBoxChannels(1, molecule::BoundingBoxChanged);
    8888const Observable::channels_t GLMoleculeObject_molecule::IndexChannels(1, molecule::IndexChanged);
    8989const Observable::channels_t GLMoleculeObject_molecule::NameChannels(1, molecule::MoleculeNameChanged);
     
    403403}
    404404
    405 GLMoleculeObject_molecule::BoundingBoxInfo GLMoleculeObject_molecule::initBoundingBox() const
    406 {
    407   BoundingBoxInfo info;
     405molecule::BoundingBoxInfo GLMoleculeObject_molecule::initBoundingBox() const
     406{
     407  molecule::BoundingBoxInfo info;
    408408  info.position = zeroVec;
    409409  info.radius = 0.;
     
    411411}
    412412
    413 GLMoleculeObject_molecule::BoundingBoxInfo GLMoleculeObject_molecule::updateBoundingBox() const
    414 {
    415   BoundingBoxInfo info = BoundingBox.get();
     413molecule::BoundingBoxInfo GLMoleculeObject_molecule::updateBoundingBox() const
     414{
     415  molecule::BoundingBoxInfo info = BoundingBox.get();
    416416  const molecule * const _molecule = getMolecule(MolIndex.get());
    417417  if (_molecule != NULL) {
     
    472472void GLMoleculeObject_molecule::resetBoundingBox()
    473473{
    474   BoundingBoxInfo info = BoundingBox.get();
     474  molecule::BoundingBoxInfo info = BoundingBox.get();
    475475  setPosition(QVector3D(info.position[0], info.position[1], info.position[2]));
    476476  setScale(info.radius + 0.3); // getBoundingSphere() only sees atoms as points, so make the box a bit bigger
  • src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp

    re3e52a re39e7a  
    2424#include "GLMoleculeObject_bond.hpp"
    2525
     26#include "molecule.hpp"
     27
    2628class atom;
    2729class bond;
    2830class GLMoleculeObject_atom;
    2931class GLWorldScene;
    30 class molecule;
    3132
    3233class GLMoleculeObject_molecule : public GLMoleculeObject, public Observer
     
    109110  typedef std::set<atomId_t> atoms_t;
    110111
    111   /** Structure for the required information on the bounding box.
    112    *
    113    */
    114   struct BoundingBoxInfo {
    115     //!> position of center
    116     Vector position;
    117     //!> radius of sphere
    118     double radius;
    119   };
    120 
    121   /** Structure for the required information on the tesselation hull.
    122    *
    123    */
    124   struct TesselationHullInfo {
    125   };
    126 
    127   BoundingBoxInfo initBoundingBox() const;
     112  molecule::BoundingBoxInfo initBoundingBox() const;
    128113
    129114  QGeometryData updateTesselationHull() const;
    130   BoundingBoxInfo updateBoundingBox() const;
     115  molecule::BoundingBoxInfo updateBoundingBox() const;
    131116  atoms_t updateAtoms();
    132117  moleculeId_t updateIndex() const;
     
    153138  boost::function<std::string ()> MolNameUpdater;
    154139  boost::function<QGeometryData ()> TesselationHullUpdater;
    155   boost::function<BoundingBoxInfo ()> BoundingBoxUpdater;
     140  boost::function<molecule::BoundingBoxInfo ()> BoundingBoxUpdater;
    156141  boost::function<atoms_t ()> PresentAtomsUpdater;
    157142
     
    163148  Cacheable<QGeometryData> TesselationHull;
    164149  //!> contains newest version of the bounding box on request
    165   ObservedValue<BoundingBoxInfo> BoundingBox;
     150  ObservedValue<molecule::BoundingBoxInfo> BoundingBox;
    166151  //!> contains the current live set of atoms for the molecule
    167152  ObservedValue<atoms_t> PresentAtoms;
Note: See TracChangeset for help on using the changeset viewer.