Changeset 1484 for trunk/packages/vizservers
- Timestamp:
- Jun 2, 2009 12:05:08 PM (15 years ago)
- Location:
- trunk/packages/vizservers/nanovis
- Files:
-
- 3 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/Command.cpp
r1478 r1484 2033 2033 NanoVis::licRenderer->set_axis(0); 2034 2034 NanoVis::licRenderer->set_offset(NanoVis::lic_slice_x); 2035 NanoVis::velocityArrowsSlice->axis(0); 2036 NanoVis::velocityArrowsSlice->slicePos(NanoVis::lic_slice_x); 2035 2037 break; 2036 2038 case 1 : … … 2038 2040 NanoVis::licRenderer->set_axis(1); 2039 2041 NanoVis::licRenderer->set_offset(NanoVis::lic_slice_y); 2042 NanoVis::velocityArrowsSlice->axis(1); 2043 NanoVis::velocityArrowsSlice->slicePos(NanoVis::lic_slice_y); 2040 2044 break; 2041 2045 case 2 : … … 2043 2047 NanoVis::licRenderer->set_axis(2); 2044 2048 NanoVis::licRenderer->set_offset(NanoVis::lic_slice_z); 2049 NanoVis::velocityArrowsSlice->axis(2); 2050 NanoVis::velocityArrowsSlice->slicePos(NanoVis::lic_slice_z); 2045 2051 break; 2046 2052 } … … 2176 2182 volPtr->wAxis.max()); 2177 2183 NanoVis::licRenderer->set_offset(NanoVis::lic_slice_z); 2184 } 2185 2186 if (NanoVis::velocityArrowsSlice) 2187 { 2188 NanoVis::velocityArrowsSlice->vectorField(volPtr->id, 2189 //*(volPtr->get_location()), 2190 1.0f / volPtr->aspect_ratio_width, 2191 1.0f / volPtr->aspect_ratio_height, 2192 1.0f / volPtr->aspect_ratio_depth 2193 //,volPtr->wAxis.max() 2194 ); 2195 NanoVis::velocityArrowsSlice->slicePos(NanoVis::lic_slice_z); 2178 2196 } 2179 2197 return TCL_OK; -
trunk/packages/vizservers/nanovis/FlowCmd.cpp
r1478 r1484 561 561 SetActive(); 562 562 } 563 564 if (NanoVis::velocityArrowsSlice != NULL) { 565 NanoVis::velocityArrowsSlice->vectorField(volPtr->id, 566 //*(volPtr->get_location()), 567 1.0f, 568 volPtr->aspect_ratio_height / volPtr->aspect_ratio_width, 569 volPtr->aspect_ratio_depth / volPtr->aspect_ratio_width 570 //,volPtr->wAxis.max() 571 ); 572 } 563 573 FlowParticles *particlesPtr; 564 574 FlowParticlesIterator partIter; … … 1025 1035 // FIXME: This doesn't work when there is more than one flow. 1026 1036 licRenderer->set_offset(flowPtr->GetRelativePosition()); 1037 NanoVis::velocityArrowsSlice->slicePos(flowPtr->GetRelativePosition()); 1038 1027 1039 } 1028 1040 AdvectFlows(); -
trunk/packages/vizservers/nanovis/Makefile.in
r1433 r1484 148 148 TransferFunction.o \ 149 149 Util.o \ 150 VelocityArrowSlice.o \ 150 151 Volume.o \ 151 152 VolumeInterpolator.o \ … … 171 172 $(srcdir)/shaders/passthru.cg \ 172 173 $(srcdir)/shaders/pointsvp.cg \ 174 $(srcdir)/shaders/queryvelocity.cg \ 173 175 $(srcdir)/shaders/render_vel.cg \ 174 176 $(srcdir)/shaders/update_pos.cg \ … … 292 294 VolumeInterpolator.o: VolumeInterpolator.cpp VolumeInterpolator.h 293 295 GradientFilter.o: GradientFilter.cpp GradientFilter.h 296 VelocityArrowSlice.o: VelocityArrowSlice.cpp VelocityArrowSlice.h 294 297 295 298 Util.o: Util.cpp Util.h -
trunk/packages/vizservers/nanovis/Vector3.h
r1028 r1484 55 55 return Vector3(x - op2.x, y - op2.y, z - op2.z); 56 56 } 57 float operator *( Vector3 &op2){57 float operator *(const Vector3 &op2){ 58 58 return x*op2.x + y*op2.y + z*op2.z; 59 59 } … … 119 119 return sqrt(x*x + y*y + z*z); 120 120 } 121 122 Vector3 scale(const Vector3& scale) 123 { 124 Vector3 v; 125 v.x = x * scale.x; 126 v.y = y * scale.y; 127 v.z = z * scale.z; 128 return v; 129 } 130 131 friend Vector3 operator+(const Vector3& value1, const Vector3& value2); 132 133 121 134 }; 122 135 136 inline Vector3 operator+(const Vector3& value1, const Vector3& value2) 137 { 138 return Vector3(value1.x + value2.x, value1.y + value2.y, value1.z + value2.z); 139 } 123 140 124 141 #endif -
trunk/packages/vizservers/nanovis/nanovis.cpp
r1478 r1484 121 121 NvFlowVisRenderer* NanoVis::flowVisRenderer = NULL; 122 122 #endif 123 VelocityArrowsSlice* NanoVis::velocityArrowsSlice = 0; 123 124 124 125 graphics::RenderContext* NanoVis::renderContext = NULL; … … 857 858 #endif 858 859 860 NanoVis::velocityArrowsSlice = new VelocityArrowsSlice; 859 861 860 862 licRenderer = new NvLIC(NMESH, NPIX, NPIX, lic_axis, … … 1747 1749 if ((licRenderer != NULL) && (licRenderer->active())) { 1748 1750 licRenderer->render(); 1751 } 1752 1753 if ((velocityArrowsSlice != NULL) && (velocityArrowsSlice->enabled())) { 1754 velocityArrowsSlice->render(); 1749 1755 } 1750 1756 #ifdef notdef … … 2561 2567 volumes[index] = NULL; // slot as empty. 2562 2568 } 2569 2570 /* 2571 void NanoVis::drawArrows(const Vector3& v1, const Vector3& v2) 2572 { 2573 Vector3 v3, v4; 2574 if if((v1.z-v2.z) != 0) 2575 { 2576 v3.set(1, 1, (-(v1.x-v2.x)-(v1.y-v2.y))/(v1.z-v2.z)); 2577 2578 adj = sqrt((x1-x2)^2 + (y1-y2)^2 + (z1-z2)^2)) / (4 * sqrt((x3^2)+(y3^2)+(z3^2))); 2579 v3.scale(adj); 2580 v4 = -v3; 2581 2582 //x3 = x1 + (3/4)*(x1-x2) + x3 2583 //y3 = y1 + (3/4)*(y1-y2) + y3 2584 //z3 = z1 + (3/4)*(z1-z2) + z3 2585 2586 //x4 = x1 + (3/4)*(x1-x2) + x4 2587 //y4 = y1 + (3/4)*(y1-y2) + y4 2588 //z4 = z1 + (3/4)*(z1-z2) + z4 2589 } 2590 } 2591 */ -
trunk/packages/vizservers/nanovis/nanovis.h
r1478 r1484 62 62 #include "HeightMap.h" 63 63 #include "Grid.h" 64 #include "VelocityArrowsSlice.h" 64 65 65 66 #include "config.h" … … 117 118 static NvFlowVisRenderer* flowVisRenderer; 118 119 #endif 120 static VelocityArrowsSlice* velocityArrowsSlice; 119 121 static NvLIC* licRenderer; 120 122 static vector<PointSet*> pointSet;
Note: See TracChangeset
for help on using the changeset viewer.