Ignore:
Timestamp:
Feb 12, 2016, 11:15:07 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:
0070aa
Parents:
0f7ffe
git-author:
Frederik Heber <heber@…> (10/28/15 13:23:09)
git-committer:
Frederik Heber <heber@…> (02/12/16 23:15:07)
Message:

Moved and renamed QtInstanceInformationBoard -> QtObservedInstanceBoard.

Location:
src/UIElements/Qt4/InstanceBoard
Files:
2 moved

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp

    r0f7ffe r2f7988  
    2222
    2323/*
    24  * QtInstanceInformationBoard.cpp
     24 * QtObservedInstanceBoard.cpp
    2525 *
    2626 *  Created on: Oct 17, 2015
     
    3434#endif
    3535
    36 #include "QtInstanceInformationBoard.hpp"
     36#include "QtObservedInstanceBoard.hpp"
    3737
    3838#include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp"
     
    4949#include "World.hpp"
    5050
    51 QtInstanceInformationBoard::QtInstanceInformationBoard(QWidget * _parent) :
     51QtObservedInstanceBoard::QtObservedInstanceBoard(QWidget * _parent) :
    5252  QWidget(_parent),
    53   Observer("QtInstanceInformationBoard"),
     53  Observer("QtObservedInstanceBoard"),
    5454  WorldSignedOn(false),
    5555  atomSubjectKilled(
    56       boost::bind(&QtInstanceInformationBoard::atomcountsubjectKilled, this, _1)),
     56      boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1)),
    5757  moleculeSubjectKilled(
    58       boost::bind(&QtInstanceInformationBoard::moleculecountsubjectKilled, this, _1)),
     58      boost::bind(&QtObservedInstanceBoard::moleculecountsubjectKilled, this, _1)),
    5959  lastremovedatom((atomId_t)-1),
    6060  lastremovedatomsmolecule( std::make_pair((moleculeId_t)-1,(atomId_t)-1) ),
     
    6969}
    7070
    71 QtInstanceInformationBoard::~QtInstanceInformationBoard()
     71QtObservedInstanceBoard::~QtObservedInstanceBoard()
    7272{
    7373  if (WorldSignedOn) {
     
    9393}
    9494
    95 void QtInstanceInformationBoard::update(Observable *publisher)
     95void QtObservedInstanceBoard::update(Observable *publisher)
    9696{
    9797  ASSERT(0,
    98       "QtInstanceInformationBoard::update() - we are not signed on to general updates.");
    99 }
    100 
    101 void QtInstanceInformationBoard::subjectKilled(Observable *publisher)
     98      "QtObservedInstanceBoard::update() - we are not signed on to general updates.");
     99}
     100
     101void QtObservedInstanceBoard::subjectKilled(Observable *publisher)
    102102{
    103103  SignedOn_t::iterator iter = AtomSignedOn.find(publisher);
     
    117117}
    118118
    119 void QtInstanceInformationBoard::recieveNotification(Observable *publisher, Notification_ptr notification)
     119void QtObservedInstanceBoard::recieveNotification(Observable *publisher, Notification_ptr notification)
    120120{
    121121  if (static_cast<World *>(publisher) == World::getPointer()) {
     
    144144                  std::make_pair( _id, ObservedValues));
    145145          ASSERT( inserter.second,
    146               "QtInstanceInformationBoard::recieveNotification() - could not insert ObservedValues for"
     146              "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
    147147              +toString(_id)+".");
    148148          // we need to check for index changes
     
    157157          emit moleculeInserted(_id);
    158158        } else {
    159           ELOG(1, "QtInstanceInformationBoard got MoleculeInserted for unknown molecule id " << _id);
     159          ELOG(1, "QtObservedInstanceBoard got MoleculeInserted for unknown molecule id " << _id);
    160160        }
    161161        break;
     
    192192                  std::make_pair( _id, ObservedValues));
    193193          ASSERT( inserter.second,
    194               "QtInstanceInformationBoard::recieveNotification() - could not insert ObservedValues for"
     194              "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
    195195              +toString(_id)+".");
    196196          // we need to check for index changes
     
    199199          AtomSignedOn.insert( static_cast<Observable *>(const_cast<atom *>(_atom)) );
    200200        } else {
    201           ELOG(1, "QtInstanceInformationBoard got AtomInserted for unknown atom id " << _id);
     201          ELOG(1, "QtObservedInstanceBoard got AtomInserted for unknown atom id " << _id);
    202202        }
    203203        break;
     
    212212      }
    213213      default:
    214         ASSERT(0, "QtInstanceInformationBoard::recieveNotification() - we cannot get here for World.");
     214        ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here for World.");
    215215        break;
    216216    }
     
    228228          // check whether atom's observedvalues are present
    229229          ASSERT( atomObservedValues.find(atomid) != atomObservedValues.end(),
    230               "QtInstanceInformationBoard::recieveNotification() - ObservedValues for atom "
     230              "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
    231231              +toString(atomid)+" are not present yet.");
    232232          // and emit
    233233          emit atomInserted(molid, atomid);
    234234        } else {
    235           ELOG(2, "QtInstanceInformationBoard::recieveNotification() - molecule "
     235          ELOG(2, "QtObservedInstanceBoard::recieveNotification() - molecule "
    236236              << molid << " has disappeared.");
    237237        }
     
    262262            moleculeObservedValues.erase(iter);
    263263            ASSERT( moleculeObservedValues.find(newmoleculeId) == moleculeObservedValues.end(),
    264                 "QtInstanceInformationBoard::recieveNotification() - ObservedValues for atom "
     264                "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
    265265                +toString(newmoleculeId)+" already present.");
    266266            moleculeObservedValues.insert( std::make_pair(newmoleculeId, obsvalues) );
     
    275275      }
    276276      default:
    277         ASSERT(0, "QtInstanceInformationBoard::recieveNotification() - we cannot get here.");
     277        ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here.");
    278278        break;
    279279    }
     
    293293            atomObservedValues.erase(iter);
    294294            ASSERT( atomObservedValues.find(newatomId) == atomObservedValues.end(),
    295                 "QtInstanceInformationBoard::recieveNotification() - ObservedValues for atom "
     295                "QtObservedInstanceBoard::recieveNotification() - ObservedValues for atom "
    296296                +toString(newatomId)+" already present.");
    297297            atomObservedValues.insert( std::make_pair(newatomId, obsvalues) );
     
    306306      }
    307307      default:
    308         ASSERT(0, "QtInstanceInformationBoard::recieveNotification() - we cannot get here.");
     308        ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - we cannot get here.");
    309309        break;
    310310    }
    311311  } else {
    312     ASSERT(0, "QtInstanceInformationBoard::recieveNotification() - notification from unknown source.");
    313   }
    314 }
    315 
    316 void QtInstanceInformationBoard::atomcountsubjectKilled(const atomId_t _atomid)
     312    ASSERT(0, "QtObservedInstanceBoard::recieveNotification() - notification from unknown source.");
     313  }
     314}
     315
     316void QtObservedInstanceBoard::atomcountsubjectKilled(const atomId_t _atomid)
    317317{
    318318  LOG(3, "DEBUG: InformationBoard got subjectKilled() for a value of atom " << _atomid);
     
    329329      emit atomRemoved(lastremovedatomsmolecule.first, lastremovedatomsmolecule.second);
    330330    else
    331       ELOG(2, "QtInstanceInformationBoard::atomcountsubjectKilled() - id " << _atomid
     331      ELOG(2, "QtObservedInstanceBoard::atomcountsubjectKilled() - id " << _atomid
    332332          << " not fitting with " << lastremovedatomsmolecule);
    333333    atomsubjectKilledCount.erase(iter);
     
    335335}
    336336
    337 void QtInstanceInformationBoard::moleculecountsubjectKilled(const moleculeId_t _molid)
     337void QtObservedInstanceBoard::moleculecountsubjectKilled(const moleculeId_t _molid)
    338338{
    339339  LOG(3, "DEBUG: InformationBoard got subjectKilled() for a value of molecule " << _molid);
     
    353353}
    354354
    355 QtInstanceInformationBoard::ObservedValues_t
    356 QtInstanceInformationBoard::getAtomObservedValues(const atomId_t _id)
     355QtObservedInstanceBoard::ObservedValues_t
     356QtObservedInstanceBoard::getAtomObservedValues(const atomId_t _id)
    357357{
    358358  ObservedValues_t returnvalues;
    359359  const atomObservedValues_t::iterator iter = atomObservedValues.find(_id);
    360360  ASSERT(iter != atomObservedValues.end(),
    361       "QtInstanceInformationBoard::getAtomObservedValues() - atom values not present for id"
     361      "QtObservedInstanceBoard::getAtomObservedValues() - atom values not present for id"
    362362      +toString(_id));
    363363  if (iter->first == _id) {
     
    368368}
    369369
    370 QtInstanceInformationBoard::ObservedValues_t
    371 QtInstanceInformationBoard::getMoleculeObservedValues(const moleculeId_t _id)
     370QtObservedInstanceBoard::ObservedValues_t
     371QtObservedInstanceBoard::getMoleculeObservedValues(const moleculeId_t _id)
    372372{
    373373  ObservedValues_t returnvalues;
     
    383383}
    384384
    385 void QtInstanceInformationBoard::returnAtomObservedValues(
     385void QtObservedInstanceBoard::returnAtomObservedValues(
    386386    const atomId_t _id,
    387387    ObservedValues_t &_observedvalues)
     
    394394            std::make_pair( _id, _observedvalues) );
    395395    ASSERT( inserter.second,
    396         "QtInstanceInformationBoard::returnAtomObservedValues() - could not insert ObservedValues for"
     396        "QtObservedInstanceBoard::returnAtomObservedValues() - could not insert ObservedValues for"
    397397        +toString(_id)+".");
    398398  } else
     
    400400}
    401401
    402 void QtInstanceInformationBoard::returnMoleculeObservedValues(
     402void QtObservedInstanceBoard::returnMoleculeObservedValues(
    403403    const moleculeId_t _id,
    404404    ObservedValues_t &_observedvalues)
     
    411411              std::make_pair( _id, _observedvalues) );
    412412      ASSERT( inserter.second,
    413           "QtInstanceInformationBoard::returnMoleculeObservedValues() - could not insert ObservedValues for"
     413          "QtObservedInstanceBoard::returnMoleculeObservedValues() - could not insert ObservedValues for"
    414414          +toString(_id)+".");
    415415  } else
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp

    r0f7ffe r2f7988  
    11/*
    2  * QtInstanceInformationBoard.hpp
     2 * QtObservedInstanceBoard.hpp
    33 *
    44 *  Created on: Oct 17, 2015
     
    77
    88
    9 #ifndef QTINSTANCEINFORMATIONBOARD_HPP_
    10 #define QTINSTANCEINFORMATIONBOARD_HPP_
     9#ifndef QTOBSERVEDINSTANCEBOARD_HPP_
     10#define QTOBSERVEDINSTANCEBOARD_HPP_
    1111
    1212// include config.h
     
    3232class GLMoleculeObject_molecule;
    3333
    34 /** The QtInstanceInformationBoard is the central class for communicating instance
     34/** The QtObservedInstanceBoard is the central class for communicating instance
    3535 * creation and destruction from MoleCuilder into the QtGui realm. It should be
    3636 * thought of as an interface to allow for safe multi-threaded computing.
     
    4242 * independent of the life time. The Observer/Observable signal from the World,
    4343 * i.e. World::MoleculeInserted, is caught (directly within the same thread) by
    44  * the QtInstanceInformationBoard. Here, we instantiate all ObservedValue's needed
     44 * the QtObservedInstanceBoard. Here, we instantiate all ObservedValue's needed
    4545 * for this specific molecule and store them in an internal map. Next, we emit
    4646 * a Qt signal informing the QtGui part about the new molecule.
    4747 * At some later stage, the QtGui will (probably in a different thread)
    4848 * instantiate a GLMoleculeObject_molecule as a visual representation of the
    49  * molecule. It requests the ObservedValues from the QtInstanceInformationBoard
     49 * molecule. It requests the ObservedValues from the QtObservedInstanceBoard
    5050 * and uses these directly.
    51  * The QtInstanceInformationBoard also records all subjectKilled() signals from
     51 * The QtObservedInstanceBoard also records all subjectKilled() signals from
    5252 * each ObservedValue. Additionally, each class using the ObservedValues
    53  * additionally informs the QtInstanceInformationBoard when subjectKilled() was
     53 * additionally informs the QtObservedInstanceBoard when subjectKilled() was
    5454 * called. If subjectKilled() for each ObservedValue of a molecule and from the
    5555 * visual representation have been received, a removal Qt signal is emitted.
     
    5757 * The same holds for the atom
    5858 */
    59 class QtInstanceInformationBoard : public QWidget, public Observer
     59class QtObservedInstanceBoard : public QWidget, public Observer
    6060{
    6161  Q_OBJECT
     
    6767  typedef std::vector<boost::any> ObservedValues_t;
    6868
    69   /** Cstor of QtInstanceInformationBoard.
     69  /** Cstor of QtObservedInstanceBoard.
     70   *
     71   * \param _parent Qt parent to automatically destroy when parent is destroyed
     72   */
     73  QtObservedInstanceBoard(QWidget * _parent=0);
     74
     75  /** Dstor of QtObservedInstanceBoard.
    7076   *
    7177   */
    72   QtInstanceInformationBoard(QWidget * _parent=0);
    73 
    74   /** Dstor of QtInstanceInformationBoard.
    75    *
    76    */
    77   ~QtInstanceInformationBoard();
     78  ~QtObservedInstanceBoard();
    7879
    7980  // Observer functions
     
    153154  moleculeObservedValues_t moleculeObservedValues;
    154155
    155   //!> stored callback function for notifying QtInstanceInformationBoard about subjectKilled in atom
     156  //!> stored callback function for notifying QtObservedInstanceBoard about subjectKilled in atom
    156157  boost::function<void (atomId_t)> atomSubjectKilled;
    157   //!> stored callback function for notifying QtInstanceInformationBoard about subjectKilled in molecule
     158  //!> stored callback function for notifying QtObservedInstanceBoard about subjectKilled in molecule
    158159  boost::function<void (moleculeId_t)> moleculeSubjectKilled;
    159160
     
    169170};
    170171
    171 #endif /* QTINSTANCEINFORMATIONBOARD_HPP_ */
     172#endif /* QTOBSERVEDINSTANCEBOARD_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.