Changeset 2335 for trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
- Timestamp:
- Aug 8, 2011 9:34:06 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/vtkvis/RpVtkRenderer.cpp
r2332 r2335 1293 1293 1294 1294 /** 1295 * \brief Set the prop orientation with a quaternion 1296 */ 1297 void Renderer::setContour2DTransform(const DataSetId& id, vtkMatrix4x4 *trans) 1298 { 1299 Contour2DHashmap::iterator itr; 1300 1301 bool doAll = false; 1302 1303 if (id.compare("all") == 0) { 1304 itr = _contour2Ds.begin(); 1305 doAll = true; 1306 } else { 1307 itr = _contour2Ds.find(id); 1308 } 1309 if (itr == _contour2Ds.end()) { 1310 ERROR("Contour2D not found: %s", id.c_str()); 1311 return; 1312 } 1313 1314 do { 1315 itr->second->setTransform(trans); 1316 } while (doAll && ++itr != _contour2Ds.end()); 1317 1318 resetAxes(); 1319 _needsRedraw = true; 1320 } 1321 1322 /** 1323 * \brief Set the prop orientation with a quaternion 1324 */ 1325 void Renderer::setContour2DOrientation(const DataSetId& id, double quat[4]) 1326 { 1327 Contour2DHashmap::iterator itr; 1328 1329 bool doAll = false; 1330 1331 if (id.compare("all") == 0) { 1332 itr = _contour2Ds.begin(); 1333 doAll = true; 1334 } else { 1335 itr = _contour2Ds.find(id); 1336 } 1337 if (itr == _contour2Ds.end()) { 1338 ERROR("Contour2D not found: %s", id.c_str()); 1339 return; 1340 } 1341 1342 do { 1343 itr->second->setOrientation(quat); 1344 } while (doAll && ++itr != _contour2Ds.end()); 1345 1346 resetAxes(); 1347 _needsRedraw = true; 1348 } 1349 1350 /** 1351 * \brief Set the prop orientation with a rotation about an axis 1352 */ 1353 void Renderer::setContour2DOrientation(const DataSetId& id, double angle, double axis[3]) 1354 { 1355 Contour2DHashmap::iterator itr; 1356 1357 bool doAll = false; 1358 1359 if (id.compare("all") == 0) { 1360 itr = _contour2Ds.begin(); 1361 doAll = true; 1362 } else { 1363 itr = _contour2Ds.find(id); 1364 } 1365 if (itr == _contour2Ds.end()) { 1366 ERROR("Contour2D not found: %s", id.c_str()); 1367 return; 1368 } 1369 1370 do { 1371 itr->second->setOrientation(angle, axis); 1372 } while (doAll && ++itr != _contour2Ds.end()); 1373 1374 resetAxes(); 1375 _needsRedraw = true; 1376 } 1377 1378 /** 1379 * \brief Set the prop position in world coords 1380 */ 1381 void Renderer::setContour2DPosition(const DataSetId& id, double pos[3]) 1382 { 1383 Contour2DHashmap::iterator itr; 1384 1385 bool doAll = false; 1386 1387 if (id.compare("all") == 0) { 1388 itr = _contour2Ds.begin(); 1389 doAll = true; 1390 } else { 1391 itr = _contour2Ds.find(id); 1392 } 1393 if (itr == _contour2Ds.end()) { 1394 ERROR("Contour2D not found: %s", id.c_str()); 1395 return; 1396 } 1397 1398 do { 1399 itr->second->setPosition(pos); 1400 } while (doAll && ++itr != _contour2Ds.end()); 1401 1402 resetAxes(); 1403 _needsRedraw = true; 1404 } 1405 1406 /** 1407 * \brief Set the prop scaling 1408 */ 1409 void Renderer::setContour2DScale(const DataSetId& id, double scale[3]) 1410 { 1411 Contour2DHashmap::iterator itr; 1412 1413 bool doAll = false; 1414 1415 if (id.compare("all") == 0) { 1416 itr = _contour2Ds.begin(); 1417 doAll = true; 1418 } else { 1419 itr = _contour2Ds.find(id); 1420 } 1421 if (itr == _contour2Ds.end()) { 1422 ERROR("Contour2D not found: %s", id.c_str()); 1423 return; 1424 } 1425 1426 do { 1427 itr->second->setScale(scale); 1428 } while (doAll && ++itr != _contour2Ds.end()); 1429 1430 resetAxes(); 1431 _needsRedraw = true; 1432 } 1433 1434 /** 1295 1435 * \brief Set the number of equally spaced contour isolines for the given DataSet 1296 1436 */ … … 1558 1698 1559 1699 /** 1700 * \brief Set the prop orientation with a quaternion 1701 */ 1702 void Renderer::setContour3DTransform(const DataSetId& id, vtkMatrix4x4 *trans) 1703 { 1704 Contour3DHashmap::iterator itr; 1705 1706 bool doAll = false; 1707 1708 if (id.compare("all") == 0) { 1709 itr = _contour3Ds.begin(); 1710 doAll = true; 1711 } else { 1712 itr = _contour3Ds.find(id); 1713 } 1714 if (itr == _contour3Ds.end()) { 1715 ERROR("Contour3D not found: %s", id.c_str()); 1716 return; 1717 } 1718 1719 do { 1720 itr->second->setTransform(trans); 1721 } while (doAll && ++itr != _contour3Ds.end()); 1722 1723 resetAxes(); 1724 _needsRedraw = true; 1725 } 1726 1727 /** 1728 * \brief Set the prop orientation with a quaternion 1729 */ 1730 void Renderer::setContour3DOrientation(const DataSetId& id, double quat[4]) 1731 { 1732 Contour3DHashmap::iterator itr; 1733 1734 bool doAll = false; 1735 1736 if (id.compare("all") == 0) { 1737 itr = _contour3Ds.begin(); 1738 doAll = true; 1739 } else { 1740 itr = _contour3Ds.find(id); 1741 } 1742 if (itr == _contour3Ds.end()) { 1743 ERROR("Contour3D not found: %s", id.c_str()); 1744 return; 1745 } 1746 1747 do { 1748 itr->second->setOrientation(quat); 1749 } while (doAll && ++itr != _contour3Ds.end()); 1750 1751 resetAxes(); 1752 _needsRedraw = true; 1753 } 1754 1755 /** 1756 * \brief Set the prop orientation with a rotation about an axis 1757 */ 1758 void Renderer::setContour3DOrientation(const DataSetId& id, double angle, double axis[3]) 1759 { 1760 Contour3DHashmap::iterator itr; 1761 1762 bool doAll = false; 1763 1764 if (id.compare("all") == 0) { 1765 itr = _contour3Ds.begin(); 1766 doAll = true; 1767 } else { 1768 itr = _contour3Ds.find(id); 1769 } 1770 if (itr == _contour3Ds.end()) { 1771 ERROR("Contour3D not found: %s", id.c_str()); 1772 return; 1773 } 1774 1775 do { 1776 itr->second->setOrientation(angle, axis); 1777 } while (doAll && ++itr != _contour3Ds.end()); 1778 1779 resetAxes(); 1780 _needsRedraw = true; 1781 } 1782 1783 /** 1784 * \brief Set the prop position in world coords 1785 */ 1786 void Renderer::setContour3DPosition(const DataSetId& id, double pos[3]) 1787 { 1788 Contour3DHashmap::iterator itr; 1789 1790 bool doAll = false; 1791 1792 if (id.compare("all") == 0) { 1793 itr = _contour3Ds.begin(); 1794 doAll = true; 1795 } else { 1796 itr = _contour3Ds.find(id); 1797 } 1798 if (itr == _contour3Ds.end()) { 1799 ERROR("Contour3D not found: %s", id.c_str()); 1800 return; 1801 } 1802 1803 do { 1804 itr->second->setPosition(pos); 1805 } while (doAll && ++itr != _contour3Ds.end()); 1806 1807 resetAxes(); 1808 _needsRedraw = true; 1809 } 1810 1811 /** 1812 * \brief Set the prop scaling 1813 */ 1814 void Renderer::setContour3DScale(const DataSetId& id, double scale[3]) 1815 { 1816 Contour3DHashmap::iterator itr; 1817 1818 bool doAll = false; 1819 1820 if (id.compare("all") == 0) { 1821 itr = _contour3Ds.begin(); 1822 doAll = true; 1823 } else { 1824 itr = _contour3Ds.find(id); 1825 } 1826 if (itr == _contour3Ds.end()) { 1827 ERROR("Contour3D not found: %s", id.c_str()); 1828 return; 1829 } 1830 1831 do { 1832 itr->second->setScale(scale); 1833 } while (doAll && ++itr != _contour3Ds.end()); 1834 1835 resetAxes(); 1836 _needsRedraw = true; 1837 } 1838 1839 /** 1560 1840 * \brief Set the number of equally spaced isosurfaces for the given DataSet 1561 1841 */ … … 1960 2240 1961 2241 /** 2242 * \brief Set the prop orientation with a quaternion 2243 */ 2244 void Renderer::setGlyphsTransform(const DataSetId& id, vtkMatrix4x4 *trans) 2245 { 2246 GlyphsHashmap::iterator itr; 2247 2248 bool doAll = false; 2249 2250 if (id.compare("all") == 0) { 2251 itr = _glyphs.begin(); 2252 doAll = true; 2253 } else { 2254 itr = _glyphs.find(id); 2255 } 2256 if (itr == _glyphs.end()) { 2257 ERROR("Glyphs not found: %s", id.c_str()); 2258 return; 2259 } 2260 2261 do { 2262 itr->second->setTransform(trans); 2263 } while (doAll && ++itr != _glyphs.end()); 2264 2265 resetAxes(); 2266 _needsRedraw = true; 2267 } 2268 2269 /** 2270 * \brief Set the prop orientation with a quaternion 2271 */ 2272 void Renderer::setGlyphsOrientation(const DataSetId& id, double quat[4]) 2273 { 2274 GlyphsHashmap::iterator itr; 2275 2276 bool doAll = false; 2277 2278 if (id.compare("all") == 0) { 2279 itr = _glyphs.begin(); 2280 doAll = true; 2281 } else { 2282 itr = _glyphs.find(id); 2283 } 2284 if (itr == _glyphs.end()) { 2285 ERROR("Glyphs not found: %s", id.c_str()); 2286 return; 2287 } 2288 2289 do { 2290 itr->second->setOrientation(quat); 2291 } while (doAll && ++itr != _glyphs.end()); 2292 2293 resetAxes(); 2294 _needsRedraw = true; 2295 } 2296 2297 /** 2298 * \brief Set the prop orientation with a rotation about an axis 2299 */ 2300 void Renderer::setGlyphsOrientation(const DataSetId& id, double angle, double axis[3]) 2301 { 2302 GlyphsHashmap::iterator itr; 2303 2304 bool doAll = false; 2305 2306 if (id.compare("all") == 0) { 2307 itr = _glyphs.begin(); 2308 doAll = true; 2309 } else { 2310 itr = _glyphs.find(id); 2311 } 2312 if (itr == _glyphs.end()) { 2313 ERROR("Glyphs not found: %s", id.c_str()); 2314 return; 2315 } 2316 2317 do { 2318 itr->second->setOrientation(angle, axis); 2319 } while (doAll && ++itr != _glyphs.end()); 2320 2321 resetAxes(); 2322 _needsRedraw = true; 2323 } 2324 2325 /** 2326 * \brief Set the prop position in world coords 2327 */ 2328 void Renderer::setGlyphsPosition(const DataSetId& id, double pos[3]) 2329 { 2330 GlyphsHashmap::iterator itr; 2331 2332 bool doAll = false; 2333 2334 if (id.compare("all") == 0) { 2335 itr = _glyphs.begin(); 2336 doAll = true; 2337 } else { 2338 itr = _glyphs.find(id); 2339 } 2340 if (itr == _glyphs.end()) { 2341 ERROR("Glyphs not found: %s", id.c_str()); 2342 return; 2343 } 2344 2345 do { 2346 itr->second->setPosition(pos); 2347 } while (doAll && ++itr != _glyphs.end()); 2348 2349 resetAxes(); 2350 _needsRedraw = true; 2351 } 2352 2353 /** 2354 * \brief Set the prop scaling 2355 */ 2356 void Renderer::setGlyphsScale(const DataSetId& id, double scale[3]) 2357 { 2358 GlyphsHashmap::iterator itr; 2359 2360 bool doAll = false; 2361 2362 if (id.compare("all") == 0) { 2363 itr = _glyphs.begin(); 2364 doAll = true; 2365 } else { 2366 itr = _glyphs.find(id); 2367 } 2368 if (itr == _glyphs.end()) { 2369 ERROR("Glyphs not found: %s", id.c_str()); 2370 return; 2371 } 2372 2373 do { 2374 itr->second->setScale(scale); 2375 } while (doAll && ++itr != _glyphs.end()); 2376 2377 resetAxes(); 2378 _needsRedraw = true; 2379 } 2380 2381 /** 1962 2382 * \brief Associate an existing named color map with a Glyphs for the given DataSet 1963 2383 */ … … 2009 2429 } while (doAll && ++itr != _glyphs.end()); 2010 2430 2431 _needsRedraw = true; 2432 } 2433 2434 /** 2435 * \brief Controls the array used to color glyphs for the given DataSet 2436 */ 2437 void Renderer::setGlyphsColorMode(const DataSetId& id, Glyphs::ColorMode mode) 2438 { 2439 GlyphsHashmap::iterator itr; 2440 2441 bool doAll = false; 2442 2443 if (id.compare("all") == 0) { 2444 itr = _glyphs.begin(); 2445 doAll = true; 2446 } else { 2447 itr = _glyphs.find(id); 2448 } 2449 if (itr == _glyphs.end()) { 2450 ERROR("Glyphs not found: %s", id.c_str()); 2451 return; 2452 } 2453 2454 do { 2455 itr->second->setColorMode(mode); 2456 } while (doAll && ++itr != _glyphs.end()); 2457 2458 _needsRedraw = true; 2459 } 2460 2461 /** 2462 * \brief Controls the array used to scale glyphs for the given DataSet 2463 */ 2464 void Renderer::setGlyphsScalingMode(const DataSetId& id, Glyphs::ScalingMode mode) 2465 { 2466 GlyphsHashmap::iterator itr; 2467 2468 bool doAll = false; 2469 2470 if (id.compare("all") == 0) { 2471 itr = _glyphs.begin(); 2472 doAll = true; 2473 } else { 2474 itr = _glyphs.find(id); 2475 } 2476 if (itr == _glyphs.end()) { 2477 ERROR("Glyphs not found: %s", id.c_str()); 2478 return; 2479 } 2480 2481 do { 2482 itr->second->setScalingMode(mode); 2483 } while (doAll && ++itr != _glyphs.end()); 2484 2485 _renderer->ResetCameraClippingRange(); 2011 2486 _needsRedraw = true; 2012 2487 } … … 2945 3420 2946 3421 /** 3422 * \brief Set the prop orientation with a quaternion 3423 */ 3424 void Renderer::setLICTransform(const DataSetId& id, vtkMatrix4x4 *trans) 3425 { 3426 LICHashmap::iterator itr; 3427 3428 bool doAll = false; 3429 3430 if (id.compare("all") == 0) { 3431 itr = _lics.begin(); 3432 doAll = true; 3433 } else { 3434 itr = _lics.find(id); 3435 } 3436 if (itr == _lics.end()) { 3437 ERROR("LIC not found: %s", id.c_str()); 3438 return; 3439 } 3440 3441 do { 3442 itr->second->setTransform(trans); 3443 } while (doAll && ++itr != _lics.end()); 3444 3445 resetAxes(); 3446 _needsRedraw = true; 3447 } 3448 3449 /** 3450 * \brief Set the prop orientation with a quaternion 3451 */ 3452 void Renderer::setLICOrientation(const DataSetId& id, double quat[4]) 3453 { 3454 LICHashmap::iterator itr; 3455 3456 bool doAll = false; 3457 3458 if (id.compare("all") == 0) { 3459 itr = _lics.begin(); 3460 doAll = true; 3461 } else { 3462 itr = _lics.find(id); 3463 } 3464 if (itr == _lics.end()) { 3465 ERROR("LIC not found: %s", id.c_str()); 3466 return; 3467 } 3468 3469 do { 3470 itr->second->setOrientation(quat); 3471 } while (doAll && ++itr != _lics.end()); 3472 3473 resetAxes(); 3474 _needsRedraw = true; 3475 } 3476 3477 /** 3478 * \brief Set the prop orientation with a rotation about an axis 3479 */ 3480 void Renderer::setLICOrientation(const DataSetId& id, double angle, double axis[3]) 3481 { 3482 LICHashmap::iterator itr; 3483 3484 bool doAll = false; 3485 3486 if (id.compare("all") == 0) { 3487 itr = _lics.begin(); 3488 doAll = true; 3489 } else { 3490 itr = _lics.find(id); 3491 } 3492 if (itr == _lics.end()) { 3493 ERROR("LIC not found: %s", id.c_str()); 3494 return; 3495 } 3496 3497 do { 3498 itr->second->setOrientation(angle, axis); 3499 } while (doAll && ++itr != _lics.end()); 3500 3501 resetAxes(); 3502 _needsRedraw = true; 3503 } 3504 3505 /** 3506 * \brief Set the prop position in world coords 3507 */ 3508 void Renderer::setLICPosition(const DataSetId& id, double pos[3]) 3509 { 3510 LICHashmap::iterator itr; 3511 3512 bool doAll = false; 3513 3514 if (id.compare("all") == 0) { 3515 itr = _lics.begin(); 3516 doAll = true; 3517 } else { 3518 itr = _lics.find(id); 3519 } 3520 if (itr == _lics.end()) { 3521 ERROR("LIC not found: %s", id.c_str()); 3522 return; 3523 } 3524 3525 do { 3526 itr->second->setPosition(pos); 3527 } while (doAll && ++itr != _lics.end()); 3528 3529 resetAxes(); 3530 _needsRedraw = true; 3531 } 3532 3533 /** 3534 * \brief Set the prop scaling 3535 */ 3536 void Renderer::setLICScale(const DataSetId& id, double scale[3]) 3537 { 3538 LICHashmap::iterator itr; 3539 3540 bool doAll = false; 3541 3542 if (id.compare("all") == 0) { 3543 itr = _lics.begin(); 3544 doAll = true; 3545 } else { 3546 itr = _lics.find(id); 3547 } 3548 if (itr == _lics.end()) { 3549 ERROR("LIC not found: %s", id.c_str()); 3550 return; 3551 } 3552 3553 do { 3554 itr->second->setScale(scale); 3555 } while (doAll && ++itr != _lics.end()); 3556 3557 resetAxes(); 3558 _needsRedraw = true; 3559 } 3560 3561 /** 2947 3562 * \brief Set the volume slice used for mapping volumetric data 2948 3563 */ … … 4192 4807 } else 4193 4808 return itr->second; 4809 } 4810 4811 /** 4812 * \brief Set the prop orientation with a quaternion 4813 */ 4814 void Renderer::setPseudoColorTransform(const DataSetId& id, vtkMatrix4x4 *trans) 4815 { 4816 PseudoColorHashmap::iterator itr; 4817 4818 bool doAll = false; 4819 4820 if (id.compare("all") == 0) { 4821 itr = _pseudoColors.begin(); 4822 doAll = true; 4823 } else { 4824 itr = _pseudoColors.find(id); 4825 } 4826 if (itr == _pseudoColors.end()) { 4827 ERROR("PseudoColor not found: %s", id.c_str()); 4828 return; 4829 } 4830 4831 do { 4832 itr->second->setTransform(trans); 4833 } while (doAll && ++itr != _pseudoColors.end()); 4834 4835 resetAxes(); 4836 _needsRedraw = true; 4837 } 4838 4839 /** 4840 * \brief Set the prop orientation with a quaternion 4841 */ 4842 void Renderer::setPseudoColorOrientation(const DataSetId& id, double quat[4]) 4843 { 4844 PseudoColorHashmap::iterator itr; 4845 4846 bool doAll = false; 4847 4848 if (id.compare("all") == 0) { 4849 itr = _pseudoColors.begin(); 4850 doAll = true; 4851 } else { 4852 itr = _pseudoColors.find(id); 4853 } 4854 if (itr == _pseudoColors.end()) { 4855 ERROR("PseudoColor not found: %s", id.c_str()); 4856 return; 4857 } 4858 4859 do { 4860 itr->second->setOrientation(quat); 4861 } while (doAll && ++itr != _pseudoColors.end()); 4862 4863 resetAxes(); 4864 _needsRedraw = true; 4865 } 4866 4867 /** 4868 * \brief Set the prop orientation with a rotation about an axis 4869 */ 4870 void Renderer::setPseudoColorOrientation(const DataSetId& id, double angle, double axis[3]) 4871 { 4872 PseudoColorHashmap::iterator itr; 4873 4874 bool doAll = false; 4875 4876 if (id.compare("all") == 0) { 4877 itr = _pseudoColors.begin(); 4878 doAll = true; 4879 } else { 4880 itr = _pseudoColors.find(id); 4881 } 4882 if (itr == _pseudoColors.end()) { 4883 ERROR("PseudoColor not found: %s", id.c_str()); 4884 return; 4885 } 4886 4887 do { 4888 itr->second->setOrientation(angle, axis); 4889 } while (doAll && ++itr != _pseudoColors.end()); 4890 4891 resetAxes(); 4892 _needsRedraw = true; 4893 } 4894 4895 /** 4896 * \brief Set the prop position in world coords 4897 */ 4898 void Renderer::setPseudoColorPosition(const DataSetId& id, double pos[3]) 4899 { 4900 PseudoColorHashmap::iterator itr; 4901 4902 bool doAll = false; 4903 4904 if (id.compare("all") == 0) { 4905 itr = _pseudoColors.begin(); 4906 doAll = true; 4907 } else { 4908 itr = _pseudoColors.find(id); 4909 } 4910 if (itr == _pseudoColors.end()) { 4911 ERROR("PseudoColor not found: %s", id.c_str()); 4912 return; 4913 } 4914 4915 do { 4916 itr->second->setPosition(pos); 4917 } while (doAll && ++itr != _pseudoColors.end()); 4918 4919 resetAxes(); 4920 _needsRedraw = true; 4921 } 4922 4923 /** 4924 * \brief Set the prop scaling 4925 */ 4926 void Renderer::setPseudoColorScale(const DataSetId& id, double scale[3]) 4927 { 4928 PseudoColorHashmap::iterator itr; 4929 4930 bool doAll = false; 4931 4932 if (id.compare("all") == 0) { 4933 itr = _pseudoColors.begin(); 4934 doAll = true; 4935 } else { 4936 itr = _pseudoColors.find(id); 4937 } 4938 if (itr == _pseudoColors.end()) { 4939 ERROR("PseudoColor not found: %s", id.c_str()); 4940 return; 4941 } 4942 4943 do { 4944 itr->second->setScale(scale); 4945 } while (doAll && ++itr != _pseudoColors.end()); 4946 4947 resetAxes(); 4948 _needsRedraw = true; 4194 4949 } 4195 4950 … … 4517 5272 4518 5273 /** 5274 * \brief Set the prop orientation with a quaternion 5275 */ 5276 void Renderer::setStreamlinesTransform(const DataSetId& id, vtkMatrix4x4 *trans) 5277 { 5278 StreamlinesHashmap::iterator itr; 5279 5280 bool doAll = false; 5281 5282 if (id.compare("all") == 0) { 5283 itr = _streamlines.begin(); 5284 doAll = true; 5285 } else { 5286 itr = _streamlines.find(id); 5287 } 5288 if (itr == _streamlines.end()) { 5289 ERROR("Streamlines not found: %s", id.c_str()); 5290 return; 5291 } 5292 5293 do { 5294 itr->second->setTransform(trans); 5295 } while (doAll && ++itr != _streamlines.end()); 5296 5297 resetAxes(); 5298 _needsRedraw = true; 5299 } 5300 5301 /** 5302 * \brief Set the prop orientation with a quaternion 5303 */ 5304 void Renderer::setStreamlinesOrientation(const DataSetId& id, double quat[4]) 5305 { 5306 StreamlinesHashmap::iterator itr; 5307 5308 bool doAll = false; 5309 5310 if (id.compare("all") == 0) { 5311 itr = _streamlines.begin(); 5312 doAll = true; 5313 } else { 5314 itr = _streamlines.find(id); 5315 } 5316 if (itr == _streamlines.end()) { 5317 ERROR("Streamlines not found: %s", id.c_str()); 5318 return; 5319 } 5320 5321 do { 5322 itr->second->setOrientation(quat); 5323 } while (doAll && ++itr != _streamlines.end()); 5324 5325 resetAxes(); 5326 _needsRedraw = true; 5327 } 5328 5329 /** 5330 * \brief Set the prop orientation with a rotation about an axis 5331 */ 5332 void Renderer::setStreamlinesOrientation(const DataSetId& id, double angle, double axis[3]) 5333 { 5334 StreamlinesHashmap::iterator itr; 5335 5336 bool doAll = false; 5337 5338 if (id.compare("all") == 0) { 5339 itr = _streamlines.begin(); 5340 doAll = true; 5341 } else { 5342 itr = _streamlines.find(id); 5343 } 5344 if (itr == _streamlines.end()) { 5345 ERROR("Streamlines not found: %s", id.c_str()); 5346 return; 5347 } 5348 5349 do { 5350 itr->second->setOrientation(angle, axis); 5351 } while (doAll && ++itr != _streamlines.end()); 5352 5353 resetAxes(); 5354 _needsRedraw = true; 5355 } 5356 5357 /** 5358 * \brief Set the prop position in world coords 5359 */ 5360 void Renderer::setStreamlinesPosition(const DataSetId& id, double pos[3]) 5361 { 5362 StreamlinesHashmap::iterator itr; 5363 5364 bool doAll = false; 5365 5366 if (id.compare("all") == 0) { 5367 itr = _streamlines.begin(); 5368 doAll = true; 5369 } else { 5370 itr = _streamlines.find(id); 5371 } 5372 if (itr == _streamlines.end()) { 5373 ERROR("Streamlines not found: %s", id.c_str()); 5374 return; 5375 } 5376 5377 do { 5378 itr->second->setPosition(pos); 5379 } while (doAll && ++itr != _streamlines.end()); 5380 5381 resetAxes(); 5382 _needsRedraw = true; 5383 } 5384 5385 /** 5386 * \brief Set the prop scaling 5387 */ 5388 void Renderer::setStreamlinesScale(const DataSetId& id, double scale[3]) 5389 { 5390 StreamlinesHashmap::iterator itr; 5391 5392 bool doAll = false; 5393 5394 if (id.compare("all") == 0) { 5395 itr = _streamlines.begin(); 5396 doAll = true; 5397 } else { 5398 itr = _streamlines.find(id); 5399 } 5400 if (itr == _streamlines.end()) { 5401 ERROR("Streamlines not found: %s", id.c_str()); 5402 return; 5403 } 5404 5405 do { 5406 itr->second->setScale(scale); 5407 } while (doAll && ++itr != _streamlines.end()); 5408 5409 resetAxes(); 5410 _needsRedraw = true; 5411 } 5412 5413 /** 4519 5414 * \brief Set the streamlines seed to points distributed randomly inside 4520 5415 * cells of DataSet … … 5043 5938 } else 5044 5939 return itr->second; 5940 } 5941 5942 /** 5943 * \brief Set the prop orientation with a quaternion 5944 */ 5945 void Renderer::setVolumeTransform(const DataSetId& id, vtkMatrix4x4 *trans) 5946 { 5947 VolumeHashmap::iterator itr; 5948 5949 bool doAll = false; 5950 5951 if (id.compare("all") == 0) { 5952 itr = _volumes.begin(); 5953 doAll = true; 5954 } else { 5955 itr = _volumes.find(id); 5956 } 5957 if (itr == _volumes.end()) { 5958 ERROR("Volume not found: %s", id.c_str()); 5959 return; 5960 } 5961 5962 do { 5963 itr->second->setTransform(trans); 5964 } while (doAll && ++itr != _volumes.end()); 5965 5966 resetAxes(); 5967 _needsRedraw = true; 5968 } 5969 5970 /** 5971 * \brief Set the prop orientation with a quaternion 5972 */ 5973 void Renderer::setVolumeOrientation(const DataSetId& id, double quat[4]) 5974 { 5975 VolumeHashmap::iterator itr; 5976 5977 bool doAll = false; 5978 5979 if (id.compare("all") == 0) { 5980 itr = _volumes.begin(); 5981 doAll = true; 5982 } else { 5983 itr = _volumes.find(id); 5984 } 5985 if (itr == _volumes.end()) { 5986 ERROR("Volume not found: %s", id.c_str()); 5987 return; 5988 } 5989 5990 do { 5991 itr->second->setOrientation(quat); 5992 } while (doAll && ++itr != _volumes.end()); 5993 5994 resetAxes(); 5995 _needsRedraw = true; 5996 } 5997 5998 /** 5999 * \brief Set the prop orientation with a rotation about an axis 6000 */ 6001 void Renderer::setVolumeOrientation(const DataSetId& id, double angle, double axis[3]) 6002 { 6003 VolumeHashmap::iterator itr; 6004 6005 bool doAll = false; 6006 6007 if (id.compare("all") == 0) { 6008 itr = _volumes.begin(); 6009 doAll = true; 6010 } else { 6011 itr = _volumes.find(id); 6012 } 6013 if (itr == _volumes.end()) { 6014 ERROR("Volume not found: %s", id.c_str()); 6015 return; 6016 } 6017 6018 do { 6019 itr->second->setOrientation(angle, axis); 6020 } while (doAll && ++itr != _volumes.end()); 6021 6022 resetAxes(); 6023 _needsRedraw = true; 6024 } 6025 6026 /** 6027 * \brief Set the prop position in world coords 6028 */ 6029 void Renderer::setVolumePosition(const DataSetId& id, double pos[3]) 6030 { 6031 VolumeHashmap::iterator itr; 6032 6033 bool doAll = false; 6034 6035 if (id.compare("all") == 0) { 6036 itr = _volumes.begin(); 6037 doAll = true; 6038 } else { 6039 itr = _volumes.find(id); 6040 } 6041 if (itr == _volumes.end()) { 6042 ERROR("Volume not found: %s", id.c_str()); 6043 return; 6044 } 6045 6046 do { 6047 itr->second->setPosition(pos); 6048 } while (doAll && ++itr != _volumes.end()); 6049 6050 resetAxes(); 6051 _needsRedraw = true; 6052 } 6053 6054 /** 6055 * \brief Set the prop scaling 6056 */ 6057 void Renderer::setVolumeScale(const DataSetId& id, double scale[3]) 6058 { 6059 VolumeHashmap::iterator itr; 6060 6061 bool doAll = false; 6062 6063 if (id.compare("all") == 0) { 6064 itr = _volumes.begin(); 6065 doAll = true; 6066 } else { 6067 itr = _volumes.find(id); 6068 } 6069 if (itr == _volumes.end()) { 6070 ERROR("Volume not found: %s", id.c_str()); 6071 return; 6072 } 6073 6074 do { 6075 itr->second->setScale(scale); 6076 } while (doAll && ++itr != _volumes.end()); 6077 6078 resetAxes(); 6079 _needsRedraw = true; 5045 6080 } 5046 6081
Note: See TracChangeset
for help on using the changeset viewer.