Changeset 3958 for branches/blt4/packages/vizservers/nanovis/nanovis.cpp
- Timestamp:
- Sep 24, 2013, 4:41:59 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/packages/vizservers/nanovis/nanovis.cpp
r3892 r3958 504 504 } 505 505 #endif 506 // FIXME: should use ARB programs or (preferably) a GLSL profile for portability 506 // FIXME: should use GLSL for portability 507 #ifdef USE_ARB_PROGRAMS 508 if (!GLEW_ARB_vertex_program || 509 !GLEW_ARB_fragment_program) { 510 ERROR("ARB_vertex_program and ARB_fragment_program extensions are required"); 511 return false; 512 } 513 #else 507 514 if (!GLEW_NV_vertex_program3 || 508 515 !GLEW_NV_fragment_program2) { … … 510 517 return false; 511 518 } 519 #endif 512 520 513 521 if (!FilePath::getInstance()->setPath(path)) { … … 611 619 } 612 620 621 /** 622 * \brief Called when new volumes are added to update ranges 623 */ 613 624 void 614 625 NanoVis::setVolumeRanges() … … 636 647 } 637 648 649 /** 650 * \brief Called when new heightmaps are added to update ranges 651 */ 638 652 void 639 653 NanoVis::setHeightmapRanges() … … 668 682 NanoVis::collectBounds(bool onlyVisible) 669 683 { 670 if (Flow::updatePending) {671 mapFlows();672 }673 674 684 sceneBounds.makeEmpty(); 675 685 … … 698 708 } 699 709 700 { 710 for (FlowHashmap::iterator itr = flowTable.begin(); 711 itr != flowTable.end(); ++itr) { 712 Flow *flow = itr->second; 713 701 714 BBox bbox; 702 getFlowBounds(bbox.min, bbox.max, onlyVisible);715 flow->getBounds(bbox.min, bbox.max, onlyVisible); 703 716 sceneBounds.extend(bbox); 704 717 } … … 714 727 } 715 728 729 #if 0 716 730 if (!onlyVisible || grid->isVisible()) { 717 731 BBox bbox; … … 719 733 sceneBounds.extend(bbox); 720 734 } 735 #endif 721 736 722 737 if (sceneBounds.isEmpty()) { … … 802 817 } 803 818 819 /** 820 * \brief Called when new flows are added to update ranges 821 */ 804 822 bool 805 NanoVis:: mapFlows()823 NanoVis::setFlowRanges() 806 824 { 807 825 TRACE("Enter"); … … 817 835 itr != flowTable.end(); ++itr) { 818 836 Flow *flow = itr->second; 819 double min, max;820 837 if (!flow->isDataLoaded()) { 821 838 continue; 822 839 } 823 Rappture::Unirect3d *data = flow->data(); 824 min = data->magMin(); 825 max = data->magMax(); 826 if (min < Flow::magMin) { 827 Flow::magMin = min; 840 double range[2]; 841 flow->getVectorRange(range); 842 if (range[0] < Flow::magMin) { 843 Flow::magMin = range[0]; 828 844 } 829 if ( max> Flow::magMax) {830 Flow::magMax = max;845 if (range[1] > Flow::magMax) { 846 Flow::magMax = range[1]; 831 847 } 832 848 } … … 846 862 flow->initializeParticles(); 847 863 } 848 if (!flow->scaleVectorField()) {849 return false;850 }851 864 } 852 865 853 866 Flow::updatePending = false; 854 867 return true; 855 }856 857 void858 NanoVis::getFlowBounds(Vector3f& min,859 Vector3f& max,860 bool onlyVisible)861 {862 TRACE("Enter");863 864 BBox allBounds;865 for (FlowHashmap::iterator itr = flowTable.begin();866 itr != flowTable.end(); ++itr) {867 BBox bbox;868 itr->second->getBounds(bbox.min, bbox.max, onlyVisible);869 allBounds.extend(bbox);870 }871 872 min = allBounds.min;873 max = allBounds.max;874 868 } 875 869 … … 918 912 919 913 if (Flow::updatePending) { 920 mapFlows();914 setFlowRanges(); 921 915 } 922 916 if (HeightMap::updatePending) {
Note: See TracChangeset
for help on using the changeset viewer.