Changeset 26ed25 for src/UIElements


Ignore:
Timestamp:
Jul 17, 2012, 12:17:24 PM (12 years ago)
Author:
Michael Ankele <ankele@…>
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:
02b2d3
Parents:
bca99d
git-author:
Michael Ankele <ankele@…> (05/08/12 11:54:37)
git-committer:
Michael Ankele <ankele@…> (07/17/12 12:17:24)
Message:

GL: dreibein as a real mesh

Location:
src/UIElements/Views/Qt4/Qt3D
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.cpp

    rbca99d r26ed25  
    2424#include <QtGui/QToolBar>
    2525#include <Qt/qtimer.h>
     26#include <Qt3D/qglbuilder.h>
     27#include <Qt3D/qglscenenode.h>
     28#include <Qt3D/qglsphere.h>
     29#include <Qt3D/qglcylinder.h>
    2630
    2731#include "GLWorldScene.hpp"
     
    4549  setCameraControlMode(Rotate);
    4650
     51  createDomainBox();
     52  createDreiBein();
    4753  //changeMaterials(false);
    4854  domainBoxMaterial = new QGLMaterial;
     
    5056  domainBoxMaterial->setDiffuseColor(QColor(0,0,0,255));
    5157  domainBoxMaterial->setEmittedLight(QColor(150,160,200,255));
    52 
    53   for (int i=0;i<3;i++){
    54     dreiBeinMaterial[i] = new QGLMaterial;
    55     dreiBeinMaterial[i]->setAmbientColor(QColor(0,0,0,255));
    56     dreiBeinMaterial[i]->setDiffuseColor(QColor(0,0,0,255));
    57     dreiBeinMaterial[i]->setEmittedLight(QColor(150,200,150,255));
    58   }
    5958
    6059  connect(worldscene, SIGNAL(changeOccured()), this, SLOT(changeSignalled()));
     
    113112  connect(fitAction, SIGNAL(triggered()), this, SLOT(fitCameraToDomain()));
    114113  toolbar->addAction(fitAction);
     114}
     115
     116void GLWorldView::createDomainBox()
     117{
     118
     119}
     120
     121void GLWorldView::createDreiBein()
     122{
     123  dreiBeinMaterial[0] = new QGLMaterial;
     124  dreiBeinMaterial[0]->setColor(QColor(255,50,50,255));
     125  dreiBeinMaterial[1] = new QGLMaterial;
     126  dreiBeinMaterial[1]->setColor(QColor(50,255,50,255));
     127  dreiBeinMaterial[2] = new QGLMaterial;
     128  dreiBeinMaterial[2]->setColor(QColor(50,50,255,255));
     129
     130  QGLBuilder builderCyl;
     131  builderCyl << QGLCylinder(.15,.15,1.0,16);
     132  QGLSceneNode *cyl = builderCyl.finalizedSceneNode();
     133
     134  QGLBuilder builderCone;
     135  builderCone << QGLCylinder(0,.4,0.4,16);
     136  QGLSceneNode *cone = builderCone.finalizedSceneNode();
     137  {
     138    QMatrix4x4 mat;
     139    mat.translate(0.0f, 0.0f, 1.0f);
     140    cone->setLocalTransform(mat);
     141  }
     142
     143  meshDreiBein = new QGLSceneNode(this);
     144
     145  // X-direction
     146  QGLSceneNode *node = new QGLSceneNode(meshDreiBein);
     147  node->setMaterial(dreiBeinMaterial[0]);
     148  node->addNode(cyl);
     149  node->addNode(cone);
     150  {
     151    QMatrix4x4 mat;
     152    mat.rotate(90, 0.0f, 1.0f, 0.0f);
     153    node->setLocalTransform(mat);
     154  }
     155
     156  // Y-direction
     157  node = new QGLSceneNode(meshDreiBein);
     158  node->setMaterial(dreiBeinMaterial[1]);
     159  node->addNode(cyl);
     160  node->addNode(cone);
     161  {
     162    QMatrix4x4 mat;
     163    mat.rotate(-90, 1.0f, 0.0f, 0.0f);
     164    node->setLocalTransform(mat);
     165  }
     166
     167  // Z-direction
     168  node = new QGLSceneNode(meshDreiBein);
     169  node->setMaterial(dreiBeinMaterial[2]);
     170  node->addNode(cyl);
     171  node->addNode(cone);
    115172}
    116173
     
    397454  painter->modelViewMatrix().push();
    398455  painter->modelViewMatrix().translate(camera()->center());
    399   painter->setFaceMaterial(QGL::AllFaces, dreiBeinMaterial[0]);
    400   QVector3DArray array;
    401   array.append(0, 0, 0); array.append(1, 0, 0);
    402   array.append(0, 0, 0); array.append(0, 1, 0);
    403   array.append(0, 0, 0); array.append(0, 0, 1);
    404   painter->clearAttributes();
    405   painter->setVertexAttribute(QGL::Position, array);
    406   painter->draw(QGL::Lines, 6);
     456  painter->setFaceMaterial(QGL::AllFaces, NULL);
     457  meshDreiBein->draw(painter);
    407458  painter->modelViewMatrix().pop();
    408459}
  • src/UIElements/Views/Qt4/Qt3D/GLWorldView.hpp

    rbca99d r26ed25  
    3939
    4040  void addToolBarActions(QToolBar *toolbar);
     41  void createDomainBox();
     42  void createDreiBein();
    4143
    4244  // Observer functions
     
    9395
    9496  QPointF lastMousePos;
     97
     98  QGLSceneNode *meshDomainBox;
     99  QGLSceneNode *meshDreiBein;
    95100
    96101  QGLMaterial *domainBoxMaterial;
Note: See TracChangeset for help on using the changeset viewer.