Changeset 15c8a9 for src/UIElements/Views/Qt4/Qt3D
- Timestamp:
- Feb 12, 2016, 11:15:06 PM (9 years ago)
- 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:
- 47f0e4
- Parents:
- 026bef
- git-author:
- Frederik Heber <heber@…> (10/17/15 15:42:17)
- git-committer:
- Frederik Heber <heber@…> (02/12/16 23:15:06)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_atom.hpp
r026bef r15c8a9 29 29 30 30 class GLWorldScene; 31 class QtInstanceInformationBoard; 31 32 32 33 class GLMoleculeObject_atom : public GLMoleculeObject, Observer … … 108 109 109 110 private: 111 friend class QtInstanceInformationBoard; 110 112 /** Observed Values **/ 111 113 -
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_molecule.hpp
r026bef r15c8a9 34 34 class GLMoleculeObject_atom; 35 35 class GLWorldScene; 36 class QtInstanceInformationBoard; 36 37 37 38 class GLMoleculeObject_molecule : public GLMoleculeObject, public Observer … … 147 148 148 149 private: 150 friend class QtInstanceInformationBoard; 149 151 /** Observed Values **/ 150 152 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
r026bef r15c8a9 49 49 #include "UIElements/Views/Qt4/Qt3D/GLMoleculeObject_shape.hpp" 50 50 51 #include "UIElements/Views/Qt4/QtInstanceInformationBoard.hpp" 51 52 #include "UIElements/Views/Qt4/QtSelectionChangedAgent.hpp" 52 53 … … 72 73 using namespace MoleCuilder; 73 74 74 GLWorldScene::GLWorldScene(QObject *parent) : 75 QObject(parent), 76 selectionMode(SelectAtom) 75 GLWorldScene::GLWorldScene( 76 QtInstanceInformationBoard * _board, 77 QObject *parent) : 78 QObject(parent), 79 selectionMode(SelectAtom), 80 board(_board) 77 81 { 78 82 int sphereDetails[] = {5, 3, 2, 0}; … … 90 94 GLMoleculeObject::meshCylinder[i]->setOption(QGLSceneNode::CullBoundingBox, true); 91 95 } 96 connect(board, SIGNAL(moleculeIndexChanged(const moleculeId_t, const moleculeId_t)), 97 this, SLOT(moleculeIndexChanged(const moleculeId_t, const moleculeId_t))); 98 connect(board, SIGNAL(moleculeInserted(const moleculeId_t)), 99 this, SLOT(moleculeInserted(const moleculeId_t))); 100 connect(board, SIGNAL(moleculeRemoved(const moleculeId_t)), 101 this, SLOT(moleculeRemoved(const moleculeId_t))); 102 connect(board, SIGNAL(moleculeIndexChanged(const moleculeId_t, const moleculeId_t)), 103 this, SLOT(moleculeIndexChanged(const moleculeId_t, const moleculeId_t))); 92 104 93 105 // connect(this, SIGNAL(updated()), this, SLOT(update())); … … 359 371 } 360 372 373 void GLWorldScene::moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid) 374 { 375 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_oldid); 376 if ( iter == MoleculesinSceneMap.end()) { 377 RemovalMolecule_t::iterator removeiter = 378 RemovalMolecules.find(_oldid); 379 ASSERT( removeiter != RemovalMolecules.end(), 380 "GLWorldScene::moleculeIndexChanged() - cannot find id "+toString(_oldid)+" in any map."); 381 RemovalMolecules.erase(removeiter); 382 RemovalMolecules.insert(_newid); 383 } else { 384 LOG(1, "DEBUG: Changing GLMoleculeObject_molecule from " << _oldid << " to id " << _newid); 385 GLMoleculeObject_molecule* molObject = iter->second; 386 MoleculesinSceneMap.erase(iter); 387 MoleculesinSceneMap.insert( 388 std::make_pair( _newid, molObject) ); 389 } 390 } 391 361 392 void GLWorldScene::moleculesVisibilityChanged(const moleculeId_t _id, bool _visible) 362 393 { … … 506 537 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 507 538 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 539 // use direct connection as it's lightweight and we avoid index change troubles 508 540 if (iter != MoleculesinSceneMap.end()) 509 541 QMetaObject::invokeMethod(iter->second, // pointer to a QObject 510 542 "AtomSelected", // member name (no parameters here) 511 Qt:: QueuedConnection, // connection type543 Qt::DirectConnection, // connection type 512 544 Q_ARG(const atomId_t, _id)); // parameters 513 545 else … … 520 552 boost::recursive_mutex::scoped_lock lock(MoleculeinSceneMap_mutex); 521 553 MoleculeNodeMap::iterator iter = MoleculesinSceneMap.find(_molid); 554 // use direct connection as it's lightweight and we avoid index change troubles 522 555 if (iter != MoleculesinSceneMap.end()) 523 556 QMetaObject::invokeMethod(iter->second, // pointer to a QObject 524 557 "AtomUnselected", // member name (no parameters here) 525 Qt:: QueuedConnection, // connection type558 Qt::DirectConnection, // connection type 526 559 Q_ARG(const atomId_t, _id)); // parameters 527 560 else -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
r026bef r15c8a9 41 41 class QtSelectionChangedAgent; 42 42 43 class QtInstanceInformationBoard; 44 43 45 /** This class contains a list of all molecules in the world. 44 46 * … … 48 50 Q_OBJECT 49 51 public: 50 GLWorldScene(QObject *parent=0); 52 GLWorldScene( 53 QtInstanceInformationBoard * _board, 54 QObject *parent=0); 51 55 virtual ~GLWorldScene(); 52 56 … … 88 92 void moleculeRemoved(const moleculeId_t _id); 89 93 void moleculeInserted(const moleculeId_t _id); 94 void moleculeIndexChanged(const moleculeId_t _oldid, const moleculeId_t _newid); 90 95 void atomRemoved(const moleculeId_t _molid, const atomId_t _atomid); 91 96 void atomInserted(const moleculeId_t _molid, const atomId_t _atomid); … … 133 138 134 139 SelectionModeType selectionMode; 140 141 QtInstanceInformationBoard * board; 135 142 }; 136 143 -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
r026bef r15c8a9 65 65 #include "WorldTime.hpp" 66 66 67 GLWorldView::GLWorldView(QWidget *parent) 68 : QGLView(parent), Observer("GLWorldView"), worldscene(NULL), changesPresent(false), needsRedraw(false) 69 { 70 worldscene = new GLWorldScene(this); 67 GLWorldView::GLWorldView( 68 QtInstanceInformationBoard * _board, 69 QWidget *parent) : 70 QGLView(parent), 71 Observer("GLWorldView"), 72 worldscene(NULL), 73 changesPresent(false), 74 needsRedraw(false) 75 { 76 worldscene = new GLWorldScene(_board, this); 71 77 72 78 setOption(QGLView::ObjectPicking, true); -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
r026bef r15c8a9 28 28 class QtSelectionChangedAgent; 29 29 30 class QtInstanceInformationBoard; 31 30 32 /** This class is the view on the 3D representation of the World, i.e. the whole 31 33 * of all molecules (consisting of atoms). … … 36 38 Q_OBJECT 37 39 public: 38 GLWorldView(QWidget *parent=0); 40 GLWorldView( 41 QtInstanceInformationBoard * _board, 42 QWidget *parent=0); 39 43 virtual ~GLWorldView(); 40 44
Note:
See TracChangeset
for help on using the changeset viewer.