Changeset 02b2d3 for src/UIElements/Views
- Timestamp:
- Jul 17, 2012, 12:17:24 PM (13 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:
- 0a6ff9
- Parents:
- 26ed25
- git-author:
- Michael Ankele <ankele@…> (05/08/12 13:11:41)
- git-committer:
- Michael Ankele <ankele@…> (07/17/12 12:17:24)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
r26ed25 r02b2d3 28 28 #include <Qt3D/qglsphere.h> 29 29 #include <Qt3D/qglcylinder.h> 30 #include <Qt3D/qglcube.h> 30 31 31 32 #include "GLWorldScene.hpp" … … 52 53 createDreiBein(); 53 54 //changeMaterials(false); 54 domainBoxMaterial = new QGLMaterial;55 domainBoxMaterial->setAmbientColor(QColor(0,0,0,255));56 domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255));57 domainBoxMaterial->setEmittedLight(QColor(150,160,200,255));58 55 59 56 connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled())); … … 116 113 void GLWorldView::createDomainBox() 117 114 { 118 115 domainBoxMaterial = new QGLMaterial; 116 domainBoxMaterial->setAmbientColor(QColor(0,0,0,255)); 117 domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255)); 118 domainBoxMaterial->setEmittedLight(QColor(150,160,200,255)); 119 120 121 QGLMaterial *material = new QGLMaterial; 122 material->setAmbientColor(QColor(50,60,100,255)); 123 material->setDiffuseColor(QColor(150,160,200,180)); 124 125 QGLBuilder builder; 126 builder << QGL::Faceted; 127 builder << QGLCube(-1.0); // "inverted" => inside faces are used as front. 128 meshDomainBox = builder.finalizedSceneNode(); 129 QMatrix4x4 mat; 130 mat.translate(0.5f, 0.5f, 0.5f); 131 meshDomainBox->setLocalTransform(mat); 132 meshDomainBox->setMaterial(material); 119 133 } 120 134 121 135 void GLWorldView::createDreiBein() 122 136 { 137 // Create 3 color for the 3 axes. 123 138 dreiBeinMaterial[0] = new QGLMaterial; 124 139 dreiBeinMaterial[0]->setColor(QColor(255,50,50,255)); … … 128 143 dreiBeinMaterial[2]->setColor(QColor(50,50,255,255)); 129 144 145 // Create the basic meshes (cylinder and cone). 130 146 QGLBuilder builderCyl; 131 147 builderCyl << QGLCylinder(.15,.15,1.0,16); … … 141 157 } 142 158 159 // Create a scene node from the 3 axes. 143 160 meshDreiBein = new QGLSceneNode(this); 144 161 … … 285 302 void GLWorldView::paintGL(QGLPainter *painter) 286 303 { 287 drawDomainBox(painter);288 289 304 if (changesPresent) { 290 305 initializeGL(painter); … … 294 309 295 310 drawDreiBein(painter); 311 312 // Domain box has to be last because of its transparency. 313 drawDomainBox(painter); 296 314 } 297 315 … … 418 436 } 419 437 438 /** 439 * Draw a transparent cube representing the domain. 440 */ 420 441 void GLWorldView::drawDomainBox(QGLPainter *painter) const 421 442 { 443 // Apply the domain matrix. 422 444 RealSpaceMatrix m = World::getInstance().getDomain().getM(); 423 445 painter->modelViewMatrix().push(); … … 427 449 0.0, 0.0, 0.0, 1.0); 428 450 451 // Draw the transparent cube. 452 glCullFace(GL_BACK); 453 glEnable(GL_CULL_FACE); 454 glEnable(GL_BLEND); 455 glDepthMask(0); 456 //glDisable(GL_DEPTH_TEST); 457 meshDomainBox->draw(painter); 458 //glEnable(GL_DEPTH_TEST); 459 glDepthMask(1); 460 glDisable(GL_BLEND); 461 glDisable(GL_CULL_FACE); 462 463 // Draw the outlines. 429 464 painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial); 430 465 //glEnable(GL_LINE_SMOOTH); … … 447 482 painter->setVertexAttribute(QGL::Position, array); 448 483 painter->draw(QGL::Lines, 24); 484 449 485 painter->modelViewMatrix().pop(); 450 486 } … … 454 490 painter->modelViewMatrix().push(); 455 491 painter->modelViewMatrix().translate(camera()->center()); 456 painter->setFaceMaterial(QGL:: AllFaces, NULL);492 painter->setFaceMaterial(QGL::FrontFaces, NULL); 457 493 meshDreiBein->draw(painter); 458 494 painter->modelViewMatrix().pop();
Note:
See TracChangeset
for help on using the changeset viewer.