- Timestamp:
- Oct 5, 2013, 9:31:54 AM (11 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:
- 76e224
- Parents:
- 5e4bfd
- git-author:
- Frederik Heber <heber@…> (09/27/13 19:45:07)
- git-committer:
- Frederik Heber <heber@…> (10/05/13 09:31:54)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
r5e4bfd r592d42 113 113 GLWorldView::~GLWorldView() 114 114 { 115 QSettings settings; 116 settings.beginGroup("WorldView"); 117 settings.setValue("domainBoxEnabled", (meshDomainBox->options() & QGLSceneNode::HideNode) == 0); 118 settings.setValue("dreiBeinEnabled", (meshDreiBein->options() & QGLSceneNode::HideNode) == 0); 119 settings.endGroup(); 120 121 115 122 World::getInstance().signOff(this); 116 123 World::getInstance().signOff(this, World::AtomInserted); … … 189 196 connect(selMolAction, SIGNAL(triggered()), worldscene, SLOT(setSelectionModeMolecule())); 190 197 toolbar->addAction(selMolAction); 198 199 // dreiBein/domain enabler 200 toolbar->addSeparator(); 201 QAction *seldreiBein = new QAction(QIcon(QPixmap(":/icon_dreiBein.png")), tr("enable/disable dreiBein"), this); 202 connect(seldreiBein, SIGNAL(triggered()), this, SLOT(changeDreiBein())); 203 toolbar->addAction(seldreiBein); 204 QAction *seldomain = new QAction(QIcon(QPixmap(":/icon_domain.png")), tr("enable/disable domain box"), this); 205 connect(seldomain, SIGNAL(triggered()), this, SLOT(changeDomain())); 206 toolbar->addAction(seldomain); 191 207 } 192 208 … … 201 217 settings.setValue("domainBoxColorAmbient", colorAmbient); 202 218 settings.setValue("domainBoxColorDiffuse", colorDiffuse); 219 const bool status = settings.value("domainBoxEnabled").toBool(); 203 220 settings.endGroup(); 204 221 … … 221 238 meshDomainBox->setLocalTransform(mat); 222 239 meshDomainBox->setMaterial(material); 240 241 setDomainStatus( status ); 223 242 } 224 243 … … 233 252 settings.setValue("dreiBeinColorY", colorY); 234 253 settings.setValue("dreiBeinColorZ", colorZ); 235 settings.setValue("dreiBeinEnabled", true);254 const bool status = settings.value("dreiBeinEnabled").toBool(); 236 255 settings.endGroup(); 237 256 … … 291 310 node->addNode(cone); 292 311 node->setPosition(QVector3D(0.f, 0.f, .8f)); 312 313 setdreiBeinStatus( status ); 293 314 } 294 315 … … 424 445 } 425 446 447 void GLWorldView::changeDreiBein() 448 { 449 // invert to new status 450 const bool status = ((meshDreiBein->options() & QGLSceneNode::HideNode) == 0); 451 setdreiBeinStatus(!status); 452 // realize 453 updateGL(); 454 needsRedraw = true; 455 } 456 457 void GLWorldView::setdreiBeinStatus(const bool status) 458 { 459 if (status) 460 meshDreiBein->setOptions( meshDreiBein->options() & (255-QGLSceneNode::HideNode) ); 461 else 462 meshDreiBein->setOptions( meshDreiBein->options() | QGLSceneNode::HideNode ); 463 } 464 465 void GLWorldView::changeDomain() 466 { 467 // invert to new status 468 const bool status = ((meshDomainBox->options() & QGLSceneNode::HideNode) == 0); 469 setDomainStatus(!status); 470 // realize 471 updateGL(); 472 needsRedraw = true; 473 } 474 475 void GLWorldView::setDomainStatus(const bool status) 476 { 477 if (status) 478 meshDomainBox->setOptions( meshDomainBox->options() & (255-QGLSceneNode::HideNode) ); 479 else 480 meshDomainBox->setOptions( meshDomainBox->options() | QGLSceneNode::HideNode ); 481 } 482 426 483 void GLWorldView::sceneChangeSignalled() 427 484 { … … 654 711 glDisable(GL_CULL_FACE); 655 712 656 // Draw the outlines. 657 painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial); 658 //glEnable(GL_LINE_SMOOTH); 659 QVector3DArray array; 660 array.append(0, 0, 0); array.append(1, 0, 0); 661 array.append(1, 0, 0); array.append(1, 1, 0); 662 array.append(1, 1, 0); array.append(0, 1, 0); 663 array.append(0, 1, 0); array.append(0, 0, 0); 664 665 array.append(0, 0, 1); array.append(1, 0, 1); 666 array.append(1, 0, 1); array.append(1, 1, 1); 667 array.append(1, 1, 1); array.append(0, 1, 1); 668 array.append(0, 1, 1); array.append(0, 0, 1); 669 670 array.append(0, 0, 0); array.append(0, 0, 1); 671 array.append(1, 0, 0); array.append(1, 0, 1); 672 array.append(0, 1, 0); array.append(0, 1, 1); 673 array.append(1, 1, 0); array.append(1, 1, 1); 674 painter->clearAttributes(); 675 painter->setVertexAttribute(QGL::Position, array); 676 painter->draw(QGL::Lines, 24); 713 // Draw the outlines (if we have drawn the box itself) 714 if ((meshDomainBox->options() & QGLSceneNode::HideNode) == 0) { 715 painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial); 716 //glEnable(GL_LINE_SMOOTH); 717 QVector3DArray array; 718 array.append(0, 0, 0); array.append(1, 0, 0); 719 array.append(1, 0, 0); array.append(1, 1, 0); 720 array.append(1, 1, 0); array.append(0, 1, 0); 721 array.append(0, 1, 0); array.append(0, 0, 0); 722 723 array.append(0, 0, 1); array.append(1, 0, 1); 724 array.append(1, 0, 1); array.append(1, 1, 1); 725 array.append(1, 1, 1); array.append(0, 1, 1); 726 array.append(0, 1, 1); array.append(0, 0, 1); 727 728 array.append(0, 0, 0); array.append(0, 0, 1); 729 array.append(1, 0, 0); array.append(1, 0, 1); 730 array.append(0, 1, 0); array.append(0, 1, 1); 731 array.append(1, 1, 0); array.append(1, 1, 1); 732 painter->clearAttributes(); 733 painter->setVertexAttribute(QGL::Position, array); 734 painter->draw(QGL::Lines, 24); 735 } 677 736 678 737 painter->modelViewMatrix().pop(); -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
r5e4bfd r592d42 52 52 void sceneChangeSignalled(); 53 53 void sceneHoverSignalled(const atom *_atom); 54 void changeDreiBein(); 55 void changeDomain(); 54 56 55 57 signals: … … 100 102 101 103 private: 104 void setdreiBeinStatus(const bool status); 105 void setDomainStatus(const bool status); 106 107 private: 102 108 103 109 GLWorldScene *worldscene;
Note:
See TracChangeset
for help on using the changeset viewer.