- Timestamp:
- Jul 17, 2012, 12:17:23 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:
- 585f78
- Parents:
- d1196d
- git-author:
- Michael Ankele <ankele@…> (05/04/12 14:24:06)
- git-committer:
- Michael Ankele <ankele@…> (07/17/12 12:17:23)
- Location:
- src/UIElements/Views/Qt4/Qt3D
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.cpp
rd1196d re8c636 55 55 { 56 56 init(); 57 58 //changeMaterials(false);59 domainBoxMaterial = new QGLMaterial;60 domainBoxMaterial->setAmbientColor(QColor(0,0,0,255));61 domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255));62 domainBoxMaterial->setEmittedLight(QColor(150,160,200,255));63 64 dreiBeinMaterial = new QGLMaterial;65 dreiBeinMaterial->setAmbientColor(QColor(0,0,0,255));66 dreiBeinMaterial->setDiffuseColor(QColor(0,0,0,255));67 dreiBeinMaterial->setEmittedLight(QColor(150,200,150,255));68 57 } 69 58 … … 72 61 // remove all elements 73 62 GLMoleculeObject::cleanMaterialMap(); 74 75 delete(domainBoxMaterial);76 delete(dreiBeinMaterial);77 63 } 78 64 … … 278 264 } 279 265 280 void GLWorldScene::drawDomainBox(QGLPainter *painter) const281 {282 RealSpaceMatrix m = World::getInstance().getDomain().getM();283 painter->modelViewMatrix().push();284 painter->modelViewMatrix() *= QMatrix4x4(m.at(0,0), m.at(0,1), m.at(0,2), 0.0,285 m.at(1,0), m.at(1,1), m.at(1,2), 0.0,286 m.at(2,0), m.at(2,1), m.at(2,2), 0.0,287 0.0, 0.0, 0.0, 1.0);288 289 painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial);290 //glEnable(GL_LINE_SMOOTH);291 QVector3DArray array;292 array.append(0, 0, 0); array.append(1, 0, 0);293 array.append(1, 0, 0); array.append(1, 1, 0);294 array.append(1, 1, 0); array.append(0, 1, 0);295 array.append(0, 1, 0); array.append(0, 0, 0);296 297 array.append(0, 0, 1); array.append(1, 0, 1);298 array.append(1, 0, 1); array.append(1, 1, 1);299 array.append(1, 1, 1); array.append(0, 1, 1);300 array.append(0, 1, 1); array.append(0, 0, 1);301 302 array.append(0, 0, 0); array.append(0, 0, 1);303 array.append(1, 0, 0); array.append(1, 0, 1);304 array.append(0, 1, 0); array.append(0, 1, 1);305 array.append(1, 1, 0); array.append(1, 1, 1);306 painter->clearAttributes();307 painter->setVertexAttribute(QGL::Position, array);308 painter->draw(QGL::Lines, 24);309 painter->modelViewMatrix().pop();310 }311 312 void GLWorldScene::drawDreiBein(QGLPainter *painter) const313 {314 QGLView *view = dynamic_cast<QGLView*>(this->parent());315 painter->modelViewMatrix().push();316 painter->modelViewMatrix().translate(view->camera()->center());317 painter->setFaceMaterial(QGL::AllFaces, dreiBeinMaterial);318 QVector3DArray array;319 array.append(0, 0, 0); array.append(1, 0, 0);320 array.append(0, 0, 0); array.append(0, 1, 0);321 array.append(0, 0, 0); array.append(0, 0, 1);322 painter->clearAttributes();323 painter->setVertexAttribute(QGL::Position, array);324 painter->draw(QGL::Lines, 6);325 painter->modelViewMatrix().pop();326 }327 328 266 void GLWorldScene::draw(QGLPainter *painter) const 329 267 { … … 334 272 meshobj->draw(painter); 335 273 } 336 337 drawDomainBox(painter);338 drawDreiBein(painter);339 274 } 340 275 -
src/UIElements/Views/Qt4/Qt3D/GLWorldScene.hpp
rd1196d re8c636 56 56 void initialize(QGLView *view, QGLPainter *painter) const; 57 57 void draw(QGLPainter *painter) const; 58 void drawDomainBox(QGLPainter *painter) const;59 void drawDreiBein(QGLPainter *painter) const;60 58 61 59 signals: … … 91 89 BondNodeMap BondsinSceneMap; 92 90 MoleculeNodeMap MoleculesinSceneMap; 93 94 QGLMaterial *domainBoxMaterial;95 QGLMaterial *dreiBeinMaterial;96 91 }; 97 92 -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp
rd1196d re8c636 43 43 setOption(QGLView::CameraNavigation, false); 44 44 setCameraControlMode(Rotate); 45 46 //changeMaterials(false); 47 domainBoxMaterial = new QGLMaterial; 48 domainBoxMaterial->setAmbientColor(QColor(0,0,0,255)); 49 domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255)); 50 domainBoxMaterial->setEmittedLight(QColor(150,160,200,255)); 51 52 for (int i=0;i<3;i++){ 53 dreiBeinMaterial[i] = new QGLMaterial; 54 dreiBeinMaterial[i]->setAmbientColor(QColor(0,0,0,255)); 55 dreiBeinMaterial[i]->setDiffuseColor(QColor(0,0,0,255)); 56 dreiBeinMaterial[i]->setEmittedLight(QColor(150,200,150,255)); 57 } 45 58 46 59 connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled())); … … 72 85 AtomObserver::getInstance().signOff(this, AtomObservable::PositionChanged); 73 86 delete worldscene; 87 88 delete(domainBoxMaterial); 89 for (int i=0;i<3;i++) 90 delete(dreiBeinMaterial[i]); 74 91 } 75 92 … … 192 209 void GLWorldView::paintGL(QGLPainter *painter) 193 210 { 211 drawDomainBox(painter); 212 194 213 if (changesPresent) { 195 214 initializeGL(painter); … … 197 216 } 198 217 worldscene->draw(painter); 218 219 drawDreiBein(painter); 199 220 } 200 221 … … 319 340 // Set new eye position. 320 341 camera()->setEye(camera()->center() + d); 342 } 343 344 void GLWorldView::drawDomainBox(QGLPainter *painter) const 345 { 346 RealSpaceMatrix m = World::getInstance().getDomain().getM(); 347 painter->modelViewMatrix().push(); 348 painter->modelViewMatrix() *= QMatrix4x4(m.at(0,0), m.at(0,1), m.at(0,2), 0.0, 349 m.at(1,0), m.at(1,1), m.at(1,2), 0.0, 350 m.at(2,0), m.at(2,1), m.at(2,2), 0.0, 351 0.0, 0.0, 0.0, 1.0); 352 353 painter->setFaceMaterial(QGL::AllFaces, domainBoxMaterial); 354 //glEnable(GL_LINE_SMOOTH); 355 QVector3DArray array; 356 array.append(0, 0, 0); array.append(1, 0, 0); 357 array.append(1, 0, 0); array.append(1, 1, 0); 358 array.append(1, 1, 0); array.append(0, 1, 0); 359 array.append(0, 1, 0); array.append(0, 0, 0); 360 361 array.append(0, 0, 1); array.append(1, 0, 1); 362 array.append(1, 0, 1); array.append(1, 1, 1); 363 array.append(1, 1, 1); array.append(0, 1, 1); 364 array.append(0, 1, 1); array.append(0, 0, 1); 365 366 array.append(0, 0, 0); array.append(0, 0, 1); 367 array.append(1, 0, 0); array.append(1, 0, 1); 368 array.append(0, 1, 0); array.append(0, 1, 1); 369 array.append(1, 1, 0); array.append(1, 1, 1); 370 painter->clearAttributes(); 371 painter->setVertexAttribute(QGL::Position, array); 372 painter->draw(QGL::Lines, 24); 373 painter->modelViewMatrix().pop(); 374 } 375 376 void GLWorldView::drawDreiBein(QGLPainter *painter) 377 { 378 painter->modelViewMatrix().push(); 379 painter->modelViewMatrix().translate(camera()->center()); 380 painter->setFaceMaterial(QGL::AllFaces, dreiBeinMaterial[0]); 381 QVector3DArray array; 382 array.append(0, 0, 0); array.append(1, 0, 0); 383 array.append(0, 0, 0); array.append(0, 1, 0); 384 array.append(0, 0, 0); array.append(0, 0, 1); 385 painter->clearAttributes(); 386 painter->setVertexAttribute(QGL::Position, array); 387 painter->draw(QGL::Lines, 6); 388 painter->modelViewMatrix().pop(); 321 389 } 322 390 -
src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp
rd1196d re8c636 58 58 void initializeGL(QGLPainter *painter); 59 59 void paintGL(QGLPainter *painter); 60 void drawDomainBox(QGLPainter *painter) const; 61 void drawDreiBein(QGLPainter *painter); 60 62 61 63 // input functions … … 88 90 89 91 QPointF lastMousePos; 92 93 QGLMaterial *domainBoxMaterial; 94 QGLMaterial *dreiBeinMaterial[3]; 90 95 }; 91 96
Note:
See TracChangeset
for help on using the changeset viewer.