Ignore:
File:
1 edited

Legend:

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

    rf115cc rce4126  
    5656  GLMoleculeObject(mesh, parent),
    5757  Observer(std::string("GLMoleculeObject_atom")+toString(_id)),
    58   atomicid(_id),
    59   uptodatePosition(false),
    60   uptodateElement(false)
     58  atomicid(_id)
    6159{
    6260  // sign on as observer (obtain non-const instance before)
     
    110108    ELOG(2, "Atom with id "+toString(atomicid)+" is already gone.");
    111109  }
    112   uptodatePosition = true;
    113110}
    114111
     
    144141  }
    145142  setScale( radius / 4. );
    146 
    147   uptodateElement = true;
    148143}
    149144
     
    170165  // selected?
    171166  setSelected(World::getInstance().isAtomSelected(atomicid));
    172 }
    173 
    174 void GLMoleculeObject_atom::draw(QGLPainter *painter, const QVector4D &cameraPlane)
    175 {
    176   // hook to update prior to painting
    177   if (!uptodatePosition)
    178     resetPosition();
    179   if (!uptodateElement)
    180     resetElement();
    181 
    182   // call old hook to do the actual paining
    183   GLMoleculeObject::draw(painter, cameraPlane);
    184167}
    185168
     
    202185    switch (notification->getChannelNo()) {
    203186      case AtomObservable::ElementChanged:
    204         uptodateElement = false;
     187        resetElement();
     188        emit changed();
    205189        break;
    206190      case AtomObservable::IndexChanged:
     
    208192        break;
    209193      case AtomObservable::PositionChanged:
    210         uptodatePosition = false;
     194        resetPosition();
     195        emit changed();
    211196        break;
    212197      case AtomObservable::BondsAdded:
     
    214199        const atom *_atom = World::getInstance().getAtom(AtomById(atomicid));
    215200        if (_atom != NULL) {
    216           // make sure position is up-to-date
    217           if (!uptodatePosition)
    218             resetPosition();
    219201          ASSERT(!_atom->getListOfBonds().empty(),
    220202              "GLMoleculeObject_atom::recieveNotification() - received BondsAdded but ListOfBonds is empty.");
Note: See TracChangeset for help on using the changeset viewer.