Changeset 691318 for src/UIElements/Views/Qt4
- Timestamp:
- Apr 17, 2013, 6:56:32 PM (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:
- ba6b5c
- Parents:
- 708277
- git-author:
- Frederik Heber <heber@…> (03/18/13 18:40:52)
- git-committer:
- Frederik Heber <heber@…> (04/17/13 18:56:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/Qt3D/GLMoleculeObject_shape.cpp
r708277 r691318 63 63 QGLSceneNode *createShapeMesh(Shape &shape, QObject *parent) 64 64 { 65 size_t NumPointsonSurface = 200; 66 // guess the surface area which divided by 200 determines rolling sphere's size 67 const double surfacearea = shape.getSurfaceArea(); 68 const size_t EstimatedNumberTriangles = NumPointsonSurface*1; 69 const double MeanAreaPerTriangle = surfacearea/((double)EstimatedNumberTriangles); 70 // assume two triangles to form a square and take its diameter as the radius 71 double minradius = sqrt(2. * 2.*MeanAreaPerTriangle); 72 LOG(3, "DEBUG: Surface area is " << surfacearea << ", minradius is " << minradius << "."); 73 if (minradius < 1.) 74 minradius = 1.; 75 LOG(2, "DEBUG: Tesselating shape " << shape.getName() << " with sphere of radius " << minradius << "."); 76 65 77 // Create some points on our shape. 66 std::vector<Vector> points = shape.getHomogeneousPointsOnSurface( 200);78 std::vector<Vector> points = shape.getHomogeneousPointsOnSurface(NumPointsonSurface); 67 79 68 80 // Fill the points into a tesselate-able container. 69 81 TesselPointSTLList Corners; 70 for ( int i=0;i<points.size();i++){82 for (size_t i=0;i<points.size();++i){ 71 83 TesselPoint *Walker = new TesselPoint; 72 84 Walker->setPosition(points[i]); … … 78 90 // Fill the points into a Qt geometry. 79 91 QGeometryData geo; 80 for( int i=0;i<points.size();i++){92 for(size_t i=0;i<points.size();++i){ 81 93 // add data to the primitive 82 94 geo.appendVertex(QVector3D(points[i][0], points[i][1], points[i][2])); … … 90 102 Tesselation *T = new Tesselation; 91 103 PointCloudAdaptor<TesselPointSTLList> cloud(&Corners, "TesselPointSTLList"); 92 (*T)(cloud, 2);104 (*T)(cloud, minradius); 93 105 94 106 // Fill the tesselated triangles into the geometry. 95 107 for (TriangleMap::const_iterator runner = T->TrianglesOnBoundary.begin(); runner != T->TrianglesOnBoundary.end(); runner++) { 96 108 int v[3]; 97 for ( int i=0; i<3; i++)109 for (size_t i=0; i<3; ++i) 98 110 v[i] = runner->second->endpoints[i]->node->getNr(); 99 111
Note:
See TracChangeset
for help on using the changeset viewer.