Changeset 284551 for src/UIElements/Views/Qt4/Qt3D
- Timestamp:
- Nov 16, 2012, 11:10:53 AM (12 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:
- dc438c
- Parents:
- f75491
- git-author:
- Michael Ankele <ankele@…> (10/02/12 14:04:47)
- git-committer:
- Frederik Heber <heber@…> (11/16/12 11:10:53)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rf75491 r284551 303 303 { 304 304 GLMoleculeObject_shape *shapeObject = new GLMoleculeObject_shape(shape, this); 305 ShapeNodeMap::iterator iter = ShapesinSceneMap.find(shape.getName()); 306 ASSERT(iter == ShapesinSceneMap.end(), 307 "GLWorldScene::addShape() - same shape "+shape.getName()+" added again."); 308 ShapesinSceneMap.insert( make_pair(shape.getName(), shapeObject) ); 309 } 310 311 void GLWorldScene::clearShapes() 312 { 313 foreach (QObject *obj, children()) { 314 GLMoleculeObject_shape *shapeobj = qobject_cast<GLMoleculeObject_shape *>(obj); 315 if (shapeobj) 316 delete(shapeobj); 317 } 318 ShapesinSceneMap.clear(); 305 319 } 306 320 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rf75491 r284551 35 35 class GLMoleculeObject_atom; 36 36 class GLMoleculeObject_molecule; 37 class GLMoleculeObject_shape; 37 38 38 39 /** This class contains a list of all molecules in the world. … … 86 87 void hoverChangedSignalled(GLMoleculeObject *ob); 87 88 void changeAtomId(GLMoleculeObject_atom *ob, int oldId, int newOd); 89 90 public: 88 91 void addShape(const Shape &shape); 92 void clearShapes(); 89 93 90 94 private: … … 98 102 typedef std::map< BondIds , GLMoleculeObject_bond* > BondNodeMap; 99 103 typedef std::map< moleculeId_t , GLMoleculeObject_molecule* > MoleculeNodeMap; 104 typedef std::map< std::string , GLMoleculeObject_shape* > ShapeNodeMap; 100 105 AtomNodeMap AtomsinSceneMap; 101 106 BondNodeMap BondsinSceneMap; 102 107 MoleculeNodeMap MoleculesinSceneMap; 108 ShapeNodeMap ShapesinSceneMap; 103 109 104 110 QGLSceneNode *meshEmpty[GLMoleculeObject::DETAILTYPES_MAX]; -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
rf75491 r284551 57 57 #include "CodePatterns/Observer/Notification.hpp" 58 58 #include "CodePatterns/Observer/ObserverLog.hpp" 59 #include "Shapes/ShapeRegistry.hpp" 59 60 #include "World.hpp" 60 61 #include "Box.hpp" … … 94 95 AtomObserver::getInstance().signOn(this, AtomObservable::PositionChanged); 95 96 97 ShapeRegistry::getInstance().signOn(this); 98 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::ShapeRemoved); 99 ShapeRegistry::getInstance().signOn(this, ShapeRegistry::SelectionChanged); 100 96 101 redrawTimer = new QTimer(this); 97 102 } … … 106 111 World::getInstance().signOff(this, World::SelectionChanged); 107 112 AtomObserver::getInstance().signOff(this, AtomObservable::PositionChanged); 113 ShapeRegistry::getInstance().signOff(this); 114 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::ShapeRemoved); 115 ShapeRegistry::getInstance().signOff(this, ShapeRegistry::SelectionChanged); 108 116 delete worldscene; 109 117 … … 357 365 break; 358 366 } 367 } else if (static_cast<ShapeRegistry*>(publisher) == ShapeRegistry::getPointer()) { 368 switch (notification->getChannelNo()) { 369 case ShapeRegistry::ShapeRemoved: 370 { 371 updateSelectedShapes(); 372 break; 373 } 374 case ShapeRegistry::SelectionChanged: 375 { 376 updateSelectedShapes(); 377 break; 378 } 379 default: 380 ASSERT(0, "GLWorldView::recieveNotification() - we cannot get here."); 381 break; 382 } 359 383 } else 360 384 ASSERT(0, "GLWorldView::recieveNotification() - received notification from unknown source."); … … 635 659 { 636 660 emit hoverChanged(_atom); 661 } 662 663 void GLWorldView::updateSelectedShapes() 664 { 665 worldscene->clearShapes(); 666 std::vector<Shape*> selectedShapes = ShapeRegistry::getInstance().getSelectedShapes(); 667 for (unsigned int i=0; i<selectedShapes.size(); i++) 668 worldscene->addShape(*selectedShapes[i]); 637 669 } 638 670 -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
rf75491 r284551 98 98 99 99 private: 100 void updateSelectedShapes(); 101 100 102 GLWorldScene *worldscene; 101 103
Note:
See TracChangeset
for help on using the changeset viewer.