Changeset 1467 for trunk/packages
- Timestamp:
- May 27, 2009, 3:00:26 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/nanovis/FlowCmd.cpp
r1465 r1467 179 179 180 180 double sx, sy, sz; 181 s x = 1.0;181 sz = sy = sx = 1.0; 182 182 sy = volPtr->height / (double)volPtr->width; 183 sz = volPtr->depth / (double)volPtr->width; 183 if (volPtr->depth > 0.0) { 184 sz = volPtr->depth / (double)volPtr->width; 185 } 184 186 glScaled(sx, sy, sz); 185 187 … … 190 192 191 193 float x0, y0, z0, x1, y1, z1; 192 x0 = (_sv.corner1.x - min.x) / (max.x - min.x); 193 y0 = (_sv.corner1.y - min.y) / (max.y - min.y); 194 z0 = (_sv.corner1.z - min.z) / (max.z - min.z); 195 x1 = (_sv.corner2.x - min.x) / (max.x - min.x); 196 y1 = (_sv.corner2.y - min.y) / (max.y - min.y); 197 z1 = (_sv.corner2.z - min.z) / (max.z - min.z); 198 194 x0 = y0 = z0 = 0.0f; 195 x1 = y1 = z1 = 1.0f; 196 if (max.y > min.y) { 197 y0 = (_sv.corner1.y - min.y) / (max.y - min.y); 198 y1 = (_sv.corner2.y - min.y) / (max.y - min.y); 199 } 200 if (max.z > min.z) { 201 z0 = (_sv.corner1.z - min.z) / (max.z - min.z); 202 z1 = (_sv.corner2.z - min.z) / (max.z - min.z); 203 } 204 if (max.x > min.x) { 205 x0 = (_sv.corner1.x - min.x) / (max.x - min.x); 206 x1 = (_sv.corner2.x - min.x) / (max.x - min.x); 207 } 199 208 Trace("rendering box %g,%g %g,%g %g,%g\n", x0, x1, y0, y1, z0, z1); 200 209 … … 1802 1811 *--------------------------------------------------------------------------- 1803 1812 * 1813 * FlowGotoOp -- 1814 * 1815 * flow goto number 1816 * 1817 *--------------------------------------------------------------------------- 1818 */ 1819 static int 1820 FlowGotoOp(ClientData clientData, Tcl_Interp *interp, int objc, 1821 Tcl_Obj *const *objv) 1822 { 1823 int nSteps; 1824 if (Tcl_GetIntFromObj(interp, objv[2], &nSteps) != TCL_OK) { 1825 return TCL_ERROR; 1826 } 1827 if ((nSteps < 0) || (nSteps > SHRT_MAX)) { 1828 Tcl_AppendResult(interp, "flow goto: bad # of steps \"", 1829 Tcl_GetString(objv[2]), "\"", (char *)NULL); 1830 return TCL_ERROR; 1831 } 1832 NanoVis::ResetFlows(); 1833 assert(NanoVis::licRenderer != NULL); 1834 NanoVis::licRenderer->reset(); 1835 if (NanoVis::flags & NanoVis::MAP_FLOWS) { 1836 NanoVis::MapFlows(); 1837 } 1838 int i; 1839 for (i = 0; i < nSteps; i++) { 1840 NanoVis::licRenderer->convolve(); 1841 NanoVis::AdvectFlows(); 1842 } 1843 NanoVis::EventuallyRedraw(); 1844 return TCL_OK; 1845 } 1846 1847 /* 1848 *--------------------------------------------------------------------------- 1849 * 1804 1850 * FlowNamesOp -- 1805 1851 * … … 1971 2017 {"delete", 1, FlowDeleteOp, 2, 0, "name...",}, 1972 2018 {"exists", 1, FlowExistsOp, 3, 3, "name",}, 2019 {"goto", 1, FlowGotoOp, 3, 3, "nSteps",}, 1973 2020 {"names", 1, FlowNamesOp, 2, 3, "?pattern?",}, 1974 2021 {"next", 2, FlowNextOp, 2, 2, "",},
Note: See TracChangeset
for help on using the changeset viewer.