Changeset 2335 for trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
- Timestamp:
- Aug 8, 2011 9:34:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpVtkRendererCmd.cpp
r2332 r2335 757 757 758 758 static int 759 Contour2DOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 760 Tcl_Obj *const *objv) 761 { 762 double quat[4]; 763 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 764 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 765 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 766 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 767 return TCL_ERROR; 768 } 769 if (objc == 7) { 770 const char *name = Tcl_GetString(objv[6]); 771 g_renderer->setContour2DOrientation(name, quat); 772 } else { 773 g_renderer->setContour2DOrientation("all", quat); 774 } 775 return TCL_OK; 776 } 777 778 static int 779 Contour2DPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 780 Tcl_Obj *const *objv) 781 { 782 double pos[3]; 783 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 784 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 785 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 786 return TCL_ERROR; 787 } 788 if (objc == 6) { 789 const char *name = Tcl_GetString(objv[5]); 790 g_renderer->setContour2DPosition(name, pos); 791 } else { 792 g_renderer->setContour2DPosition("all", pos); 793 } 794 return TCL_OK; 795 } 796 797 static int 798 Contour2DScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 799 Tcl_Obj *const *objv) 800 { 801 double scale[3]; 802 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 803 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 804 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 805 return TCL_ERROR; 806 } 807 if (objc == 6) { 808 const char *name = Tcl_GetString(objv[5]); 809 g_renderer->setContour2DScale(name, scale); 810 } else { 811 g_renderer->setContour2DScale("all", scale); 812 } 813 return TCL_OK; 814 } 815 816 static int 759 817 Contour2DVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc, 760 818 Tcl_Obj *const *objv) … … 779 837 {"linecolor", 5, Contour2DLineColorOp, 5, 6, "r g b ?dataSetName?"}, 780 838 {"linewidth", 5, Contour2DLineWidthOp, 3, 4, "width ?dataSetName?"}, 781 {"opacity", 1, Contour2DOpacityOp, 3, 4, "value ?dataSetName?"}, 839 {"opacity", 2, Contour2DOpacityOp, 3, 4, "value ?dataSetName?"}, 840 {"orient", 2, Contour2DOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 841 {"pos", 1, Contour2DPositionOp, 5, 6, "x y z ?dataSetName?"}, 842 {"scale", 1, Contour2DScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 782 843 {"visible", 1, Contour2DVisibleOp, 3, 4, "bool ?dataSetName?"} 783 844 }; … … 998 1059 } else { 999 1060 g_renderer->setContour3DOpacity("all", opacity); 1061 } 1062 return TCL_OK; 1063 } 1064 1065 static int 1066 Contour3DOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 1067 Tcl_Obj *const *objv) 1068 { 1069 double quat[4]; 1070 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 1071 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 1072 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 1073 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 1074 return TCL_ERROR; 1075 } 1076 if (objc == 7) { 1077 const char *name = Tcl_GetString(objv[6]); 1078 g_renderer->setContour3DOrientation(name, quat); 1079 } else { 1080 g_renderer->setContour3DOrientation("all", quat); 1081 } 1082 return TCL_OK; 1083 } 1084 1085 static int 1086 Contour3DPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 1087 Tcl_Obj *const *objv) 1088 { 1089 double pos[3]; 1090 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 1091 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 1092 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 1093 return TCL_ERROR; 1094 } 1095 if (objc == 6) { 1096 const char *name = Tcl_GetString(objv[5]); 1097 g_renderer->setContour3DPosition(name, pos); 1098 } else { 1099 g_renderer->setContour3DPosition("all", pos); 1100 } 1101 return TCL_OK; 1102 } 1103 1104 static int 1105 Contour3DScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 1106 Tcl_Obj *const *objv) 1107 { 1108 double scale[3]; 1109 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 1110 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 1111 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 1112 return TCL_ERROR; 1113 } 1114 if (objc == 6) { 1115 const char *name = Tcl_GetString(objv[5]); 1116 g_renderer->setContour3DScale(name, scale); 1117 } else { 1118 g_renderer->setContour3DScale("all", scale); 1000 1119 } 1001 1120 return TCL_OK; … … 1045 1164 {"linecolor", 5, Contour3DLineColorOp, 5, 6, "r g b ?dataSetName?"}, 1046 1165 {"linewidth", 5, Contour3DLineWidthOp, 3, 4, "width ?dataSetName?"}, 1047 {"opacity", 1, Contour3DOpacityOp, 3, 4, "value ?dataSetName?"}, 1166 {"opacity", 2, Contour3DOpacityOp, 3, 4, "value ?dataSetName?"}, 1167 {"orient", 2, Contour3DOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 1168 {"pos", 1, Contour3DPositionOp, 5, 6, "x y z ?dataSetName?"}, 1169 {"scale", 1, Contour3DScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 1048 1170 {"visible", 1, Contour3DVisibleOp, 3, 4, "bool ?dataSetName?"}, 1049 1171 {"wireframe", 1, Contour3DWireframeOp, 3, 4, "bool ?dataSetName?"} … … 1338 1460 1339 1461 static int 1462 GlyphsColorModeOp(ClientData clientData, Tcl_Interp *interp, int objc, 1463 Tcl_Obj *const *objv) 1464 { 1465 Glyphs::ColorMode mode; 1466 const char *str = Tcl_GetString(objv[2]); 1467 if (str[0] == 's' && strcmp(str, "scale") == 0) { 1468 mode = Glyphs::COLOR_BY_SCALE; 1469 } else if (str[0] == 's' && strcmp(str, "scalar") == 0) { 1470 mode = Glyphs::COLOR_BY_SCALAR; 1471 } else if (str[0] == 'v' && strcmp(str, "vector") == 0) { 1472 mode = Glyphs::COLOR_BY_VECTOR; 1473 } else { 1474 Tcl_AppendResult(interp, "bad color mode option \"", str, 1475 "\": should be one of: 'scale', 'scalar', 'vector'", (char*)NULL); 1476 return TCL_ERROR; 1477 } 1478 if (objc == 4) { 1479 const char *name = Tcl_GetString(objv[3]); 1480 g_renderer->setGlyphsColorMode(name, mode); 1481 } else { 1482 g_renderer->setGlyphsColorMode("all", mode); 1483 } 1484 return TCL_OK; 1485 } 1486 1487 static int 1340 1488 GlyphsDeleteOp(ClientData clientData, Tcl_Interp *interp, int objc, 1341 1489 Tcl_Obj *const *objv) … … 1438 1586 1439 1587 static int 1588 GlyphsOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 1589 Tcl_Obj *const *objv) 1590 { 1591 double quat[4]; 1592 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 1593 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 1594 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 1595 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 1596 return TCL_ERROR; 1597 } 1598 if (objc == 7) { 1599 const char *name = Tcl_GetString(objv[6]); 1600 g_renderer->setGlyphsOrientation(name, quat); 1601 } else { 1602 g_renderer->setGlyphsOrientation("all", quat); 1603 } 1604 return TCL_OK; 1605 } 1606 1607 static int 1608 GlyphsPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 1609 Tcl_Obj *const *objv) 1610 { 1611 double pos[3]; 1612 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 1613 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 1614 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 1615 return TCL_ERROR; 1616 } 1617 if (objc == 6) { 1618 const char *name = Tcl_GetString(objv[5]); 1619 g_renderer->setGlyphsPosition(name, pos); 1620 } else { 1621 g_renderer->setGlyphsPosition("all", pos); 1622 } 1623 return TCL_OK; 1624 } 1625 1626 static int 1440 1627 GlyphsScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 1441 1628 Tcl_Obj *const *objv) 1442 1629 { 1630 double scale[3]; 1631 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 1632 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 1633 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 1634 return TCL_ERROR; 1635 } 1636 if (objc == 6) { 1637 const char *name = Tcl_GetString(objv[5]); 1638 g_renderer->setGlyphsScale(name, scale); 1639 } else { 1640 g_renderer->setGlyphsScale("all", scale); 1641 } 1642 return TCL_OK; 1643 } 1644 1645 static int 1646 GlyphsScaleFactorOp(ClientData clientData, Tcl_Interp *interp, int objc, 1647 Tcl_Obj *const *objv) 1648 { 1443 1649 double scale; 1444 1650 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale) != TCL_OK) { … … 1450 1656 } else { 1451 1657 g_renderer->setGlyphsScaleFactor("all", scale); 1658 } 1659 return TCL_OK; 1660 } 1661 1662 static int 1663 GlyphsScalingModeOp(ClientData clientData, Tcl_Interp *interp, int objc, 1664 Tcl_Obj *const *objv) 1665 { 1666 Glyphs::ScalingMode mode; 1667 const char *str = Tcl_GetString(objv[2]); 1668 if (str[0] == 's' && strcmp(str, "scalar") == 0) { 1669 mode = Glyphs::SCALE_BY_SCALAR; 1670 } else if (str[0] == 'v' && strcmp(str, "vector") == 0) { 1671 mode = Glyphs::SCALE_BY_VECTOR; 1672 } else if (str[0] == 'v' && strcmp(str, "vector_comp") == 0) { 1673 mode = Glyphs::SCALE_BY_VECTOR_COMPONENTS; 1674 } else if (str[0] == 'o' && strcmp(str, "off") == 0) { 1675 mode = Glyphs::SCALING_OFF; 1676 } else { 1677 Tcl_AppendResult(interp, "bad scaling mode option \"", str, 1678 "\": should be one of: 'scalar', 'vector', 'vector_comp', 'off'", (char*)NULL); 1679 return TCL_ERROR; 1680 } 1681 if (objc == 4) { 1682 const char *name = Tcl_GetString(objv[3]); 1683 g_renderer->setGlyphsScalingMode(name, mode); 1684 } else { 1685 g_renderer->setGlyphsScalingMode("all", mode); 1452 1686 } 1453 1687 return TCL_OK; … … 1530 1764 static Rappture::CmdSpec glyphsOps[] = { 1531 1765 {"add", 1, GlyphsAddOp, 3, 4, "shape ?dataSetNme?"}, 1532 {"colormap", 1, GlyphsColorMapOp, 3, 4, "colorMapName ?dataSetNme?"}, 1766 {"colormap", 7, GlyphsColorMapOp, 3, 4, "colorMapName ?dataSetNme?"}, 1767 {"colormode", 7, GlyphsColorModeOp, 3, 4, "mode ?dataSetNme?"}, 1533 1768 {"delete", 1, GlyphsDeleteOp, 2, 3, "?dataSetName?"}, 1534 1769 {"edges", 1, GlyphsEdgeVisibilityOp, 3, 4, "bool ?dataSetName?"}, 1770 {"gscale", 1, GlyphsScaleFactorOp, 3, 4, "scaleFactor ?dataSetName?"}, 1535 1771 {"lighting", 3, GlyphsLightingOp, 3, 4, "bool ?dataSetName?"}, 1536 1772 {"linecolor", 5, GlyphsLineColorOp, 5, 6, "r g b ?dataSetName?"}, 1537 1773 {"linewidth", 5, GlyphsLineWidthOp, 3, 4, "width ?dataSetName?"}, 1538 {"opacity", 1, GlyphsOpacityOp, 3, 4, "value ?dataSetName?"}, 1539 {"scale", 2, GlyphsScaleOp, 3, 4, "scaleFactor ?dataSetName?"}, 1774 {"opacity", 2, GlyphsOpacityOp, 3, 4, "value ?dataSetName?"}, 1775 {"orient", 2, GlyphsOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 1776 {"pos", 1, GlyphsPositionOp, 5, 6, "x y z ?dataSetName?"}, 1777 {"scale", 2, GlyphsScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 1540 1778 {"shape", 2, GlyphsShapeOp, 3, 4, "shapeVal ?dataSetName?"}, 1779 {"smode", 2, GlyphsScalingModeOp, 3, 4, "mode ?dataSetNme?"}, 1541 1780 {"visible", 1, GlyphsVisibleOp, 3, 4, "bool ?dataSetName?"}, 1542 1781 {"wireframe", 1, GlyphsWireframeOp, 3, 4, "bool ?dataSetName?"} … … 1934 2173 {"orient", 2, HeightMapOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 1935 2174 {"pos", 1, HeightMapPositionOp, 5, 6, "x y z ?dataSetName?"}, 1936 {"scale", 1, HeightMapScaleOp, 5, 6, "sx sy sz 2175 {"scale", 1, HeightMapScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 1937 2176 {"visible", 2, HeightMapVisibleOp, 3, 4, "bool ?dataSetName?"}, 1938 2177 {"volumeslice", 2, HeightMapVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"} … … 2135 2374 2136 2375 static int 2376 LICOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 2377 Tcl_Obj *const *objv) 2378 { 2379 double quat[4]; 2380 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 2381 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 2382 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 2383 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 2384 return TCL_ERROR; 2385 } 2386 if (objc == 7) { 2387 const char *name = Tcl_GetString(objv[6]); 2388 g_renderer->setLICOrientation(name, quat); 2389 } else { 2390 g_renderer->setLICOrientation("all", quat); 2391 } 2392 return TCL_OK; 2393 } 2394 2395 static int 2396 LICPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 2397 Tcl_Obj *const *objv) 2398 { 2399 double pos[3]; 2400 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 2401 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 2402 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 2403 return TCL_ERROR; 2404 } 2405 if (objc == 6) { 2406 const char *name = Tcl_GetString(objv[5]); 2407 g_renderer->setLICPosition(name, pos); 2408 } else { 2409 g_renderer->setLICPosition("all", pos); 2410 } 2411 return TCL_OK; 2412 } 2413 2414 static int 2415 LICScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 2416 Tcl_Obj *const *objv) 2417 { 2418 double scale[3]; 2419 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 2420 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 2421 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 2422 return TCL_ERROR; 2423 } 2424 if (objc == 6) { 2425 const char *name = Tcl_GetString(objv[5]); 2426 g_renderer->setLICScale(name, scale); 2427 } else { 2428 g_renderer->setLICScale("all", scale); 2429 } 2430 return TCL_OK; 2431 } 2432 2433 static int 2137 2434 LICVisibleOp(ClientData clientData, Tcl_Interp *interp, int objc, 2138 2435 Tcl_Obj *const *objv) … … 2190 2487 {"linecolor", 5, LICLineColorOp, 5, 6, "r g b ?dataSetName?"}, 2191 2488 {"linewidth", 5, LICLineWidthOp, 3, 4, "width ?dataSetName?"}, 2192 {"opacity", 1, LICOpacityOp, 3, 4, "value ?dataSetName?"}, 2489 {"opacity", 2, LICOpacityOp, 3, 4, "value ?dataSetName?"}, 2490 {"orient", 2, LICOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 2491 {"pos", 1, LICPositionOp, 5, 6, "x y z ?dataSetName?"}, 2492 {"scale", 1, LICScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 2193 2493 {"visible", 2, LICVisibleOp, 3, 4, "bool ?dataSetName?"}, 2194 2494 {"volumeslice", 2, LICVolumeSliceOp, 4, 5, "axis ratio ?dataSetName?"} … … 2505 2805 {"pos", 1, MoleculePositionOp, 5, 6, "x y z ?dataSetName?"}, 2506 2806 {"rscale", 1, MoleculeAtomScalingOp, 3, 4, "scaling ?dataSetName?"}, 2507 {"scale", 1, MoleculeScaleOp, 5, 6, "sx sy sz 2807 {"scale", 1, MoleculeScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 2508 2808 {"visible", 1, MoleculeVisibleOp, 3, 4, "bool ?dataSetName?"}, 2509 2809 {"wireframe", 1, MoleculeWireframeOp, 3, 4, "bool ?dataSetName?"} … … 2659 2959 static int 2660 2960 PolyDataOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 2661 2961 Tcl_Obj *const *objv) 2662 2962 { 2663 2963 double quat[4]; … … 2679 2979 static int 2680 2980 PolyDataPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 2681 2981 Tcl_Obj *const *objv) 2682 2982 { 2683 2983 double pos[3]; … … 2698 2998 static int 2699 2999 PolyDataScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 2700 3000 Tcl_Obj *const *objv) 2701 3001 { 2702 3002 double scale[3]; … … 2714 3014 return TCL_OK; 2715 3015 } 2716 2717 3016 2718 3017 static int … … 2761 3060 {"orient", 2, PolyDataOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 2762 3061 {"pos", 1, PolyDataPositionOp, 5, 6, "x y z ?dataSetName?"}, 2763 {"scale", 1, PolyDataScaleOp, 5, 6, "sx sy sz 3062 {"scale", 1, PolyDataScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 2764 3063 {"visible", 1, PolyDataVisibleOp, 3, 4, "bool ?dataSetName?"}, 2765 3064 {"wireframe", 1, PolyDataWireframeOp, 3, 4, "bool ?dataSetName?"} … … 2904 3203 } else { 2905 3204 g_renderer->setPseudoColorOpacity("all", opacity); 3205 } 3206 return TCL_OK; 3207 } 3208 3209 static int 3210 PseudoColorOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 3211 Tcl_Obj *const *objv) 3212 { 3213 double quat[4]; 3214 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 3215 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 3216 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 3217 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 3218 return TCL_ERROR; 3219 } 3220 if (objc == 7) { 3221 const char *name = Tcl_GetString(objv[6]); 3222 g_renderer->setPseudoColorOrientation(name, quat); 3223 } else { 3224 g_renderer->setPseudoColorOrientation("all", quat); 3225 } 3226 return TCL_OK; 3227 } 3228 3229 static int 3230 PseudoColorPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 3231 Tcl_Obj *const *objv) 3232 { 3233 double pos[3]; 3234 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 3235 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 3236 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 3237 return TCL_ERROR; 3238 } 3239 if (objc == 6) { 3240 const char *name = Tcl_GetString(objv[5]); 3241 g_renderer->setPseudoColorPosition(name, pos); 3242 } else { 3243 g_renderer->setPseudoColorPosition("all", pos); 3244 } 3245 return TCL_OK; 3246 } 3247 3248 static int 3249 PseudoColorScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 3250 Tcl_Obj *const *objv) 3251 { 3252 double scale[3]; 3253 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 3254 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 3255 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 3256 return TCL_ERROR; 3257 } 3258 if (objc == 6) { 3259 const char *name = Tcl_GetString(objv[5]); 3260 g_renderer->setPseudoColorScale(name, scale); 3261 } else { 3262 g_renderer->setPseudoColorScale("all", scale); 2906 3263 } 2907 3264 return TCL_OK; … … 2950 3307 {"linecolor", 5, PseudoColorLineColorOp, 5, 6, "r g b ?dataSetName?"}, 2951 3308 {"linewidth", 5, PseudoColorLineWidthOp, 3, 4, "width ?dataSetName?"}, 2952 {"opacity", 1, PseudoColorOpacityOp, 3, 4, "value ?dataSetName?"}, 3309 {"opacity", 2, PseudoColorOpacityOp, 3, 4, "value ?dataSetName?"}, 3310 {"orient", 2, PseudoColorOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 3311 {"pos", 1, PseudoColorPositionOp, 5, 6, "x y z ?dataSetName?"}, 3312 {"scale", 1, PseudoColorScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 2953 3313 {"visible", 1, PseudoColorVisibleOp, 3, 4, "bool ?dataSetName?"}, 2954 3314 {"wireframe", 1, PseudoColorWireframeOp, 3, 4, "bool ?dataSetName?"} … … 3258 3618 } else { 3259 3619 g_renderer->setStreamlinesOpacity("all", opacity); 3620 } 3621 return TCL_OK; 3622 } 3623 3624 static int 3625 StreamlinesOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 3626 Tcl_Obj *const *objv) 3627 { 3628 double quat[4]; 3629 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 3630 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 3631 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 3632 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 3633 return TCL_ERROR; 3634 } 3635 if (objc == 7) { 3636 const char *name = Tcl_GetString(objv[6]); 3637 g_renderer->setStreamlinesOrientation(name, quat); 3638 } else { 3639 g_renderer->setStreamlinesOrientation("all", quat); 3640 } 3641 return TCL_OK; 3642 } 3643 3644 static int 3645 StreamlinesPositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 3646 Tcl_Obj *const *objv) 3647 { 3648 double pos[3]; 3649 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 3650 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 3651 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 3652 return TCL_ERROR; 3653 } 3654 if (objc == 6) { 3655 const char *name = Tcl_GetString(objv[5]); 3656 g_renderer->setStreamlinesPosition(name, pos); 3657 } else { 3658 g_renderer->setStreamlinesPosition("all", pos); 3659 } 3660 return TCL_OK; 3661 } 3662 3663 static int 3664 StreamlinesScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 3665 Tcl_Obj *const *objv) 3666 { 3667 double scale[3]; 3668 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 3669 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 3670 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 3671 return TCL_ERROR; 3672 } 3673 if (objc == 6) { 3674 const char *name = Tcl_GetString(objv[5]); 3675 g_renderer->setStreamlinesScale(name, scale); 3676 } else { 3677 g_renderer->setStreamlinesScale("all", scale); 3260 3678 } 3261 3679 return TCL_OK; … … 3461 3879 {"lines", 5, StreamlinesLinesOp, 2, 3, "?dataSetName?"}, 3462 3880 {"linewidth", 5, StreamlinesLineWidthOp, 3, 4, "width ?dataSetName?"}, 3463 {"opacity", 1, StreamlinesOpacityOp, 3, 4, "val ?dataSetName?"}, 3881 {"opacity", 2, StreamlinesOpacityOp, 3, 4, "val ?dataSetName?"}, 3882 {"orient", 2, StreamlinesOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 3883 {"pos", 1, StreamlinesPositionOp, 5, 6, "x y z ?dataSetName?"}, 3464 3884 {"ribbons", 1, StreamlinesRibbonsOp, 4, 5, "width angle ?dataSetName?"}, 3465 {"seed", 1, StreamlinesSeedOp, 4, 11, "op params... ?dataSetName?"}, 3885 {"scale", 2, StreamlinesScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 3886 {"seed", 2, StreamlinesSeedOp, 4, 11, "op params... ?dataSetName?"}, 3466 3887 {"tubes", 1, StreamlinesTubesOp, 4, 5, "numSides radius ?dataSetName?"}, 3467 3888 {"visible", 1, StreamlinesVisibleOp, 3, 4, "bool ?dataSetName?"} … … 3553 3974 } else { 3554 3975 g_renderer->setVolumeOpacity("all", opacity); 3976 } 3977 return TCL_OK; 3978 } 3979 3980 static int 3981 VolumeOrientOp(ClientData clientData, Tcl_Interp *interp, int objc, 3982 Tcl_Obj *const *objv) 3983 { 3984 double quat[4]; 3985 if (Tcl_GetDoubleFromObj(interp, objv[2], &quat[0]) != TCL_OK || 3986 Tcl_GetDoubleFromObj(interp, objv[3], &quat[1]) != TCL_OK || 3987 Tcl_GetDoubleFromObj(interp, objv[4], &quat[2]) != TCL_OK || 3988 Tcl_GetDoubleFromObj(interp, objv[5], &quat[3]) != TCL_OK) { 3989 return TCL_ERROR; 3990 } 3991 if (objc == 7) { 3992 const char *name = Tcl_GetString(objv[6]); 3993 g_renderer->setVolumeOrientation(name, quat); 3994 } else { 3995 g_renderer->setVolumeOrientation("all", quat); 3996 } 3997 return TCL_OK; 3998 } 3999 4000 static int 4001 VolumePositionOp(ClientData clientData, Tcl_Interp *interp, int objc, 4002 Tcl_Obj *const *objv) 4003 { 4004 double pos[3]; 4005 if (Tcl_GetDoubleFromObj(interp, objv[2], &pos[0]) != TCL_OK || 4006 Tcl_GetDoubleFromObj(interp, objv[3], &pos[1]) != TCL_OK || 4007 Tcl_GetDoubleFromObj(interp, objv[4], &pos[2]) != TCL_OK) { 4008 return TCL_ERROR; 4009 } 4010 if (objc == 6) { 4011 const char *name = Tcl_GetString(objv[5]); 4012 g_renderer->setVolumePosition(name, pos); 4013 } else { 4014 g_renderer->setVolumePosition("all", pos); 4015 } 4016 return TCL_OK; 4017 } 4018 4019 static int 4020 VolumeScaleOp(ClientData clientData, Tcl_Interp *interp, int objc, 4021 Tcl_Obj *const *objv) 4022 { 4023 double scale[3]; 4024 if (Tcl_GetDoubleFromObj(interp, objv[2], &scale[0]) != TCL_OK || 4025 Tcl_GetDoubleFromObj(interp, objv[3], &scale[1]) != TCL_OK || 4026 Tcl_GetDoubleFromObj(interp, objv[4], &scale[2]) != TCL_OK) { 4027 return TCL_ERROR; 4028 } 4029 if (objc == 6) { 4030 const char *name = Tcl_GetString(objv[5]); 4031 g_renderer->setVolumeScale(name, scale); 4032 } else { 4033 g_renderer->setVolumeScale("all", scale); 3555 4034 } 3556 4035 return TCL_OK; … … 3655 4134 {"delete", 1, VolumeDeleteOp, 2, 3, "?dataSetName?"}, 3656 4135 {"lighting", 1, VolumeLightingOp, 3, 4, "bool ?dataSetName?"}, 3657 {"opacity", 1, VolumeOpacityOp, 3, 4, "val ?dataSetName?"}, 3658 {"shading", 1, VolumeShadingOp, 4, 6, "oper val ?dataSetName?"}, 4136 {"opacity", 2, VolumeOpacityOp, 3, 4, "val ?dataSetName?"}, 4137 {"orient", 2, VolumeOrientOp, 6, 7, "qw qx qy qz ?dataSetName?"}, 4138 {"pos", 1, VolumePositionOp, 5, 6, "x y z ?dataSetName?"}, 4139 {"scale", 2, VolumeScaleOp, 5, 6, "sx sy sz ?dataSetName?"}, 4140 {"shading", 2, VolumeShadingOp, 4, 6, "oper val ?dataSetName?"}, 3659 4141 {"visible", 1, VolumeVisibleOp, 3, 4, "bool ?dataSetName?"} 3660 4142 };
Note: See TracChangeset
for help on using the changeset viewer.