(array, context)
| 333 | |
| 334 | |
| 335 | def getArrayDescription(array, context): |
| 336 | if not array: |
| 337 | return None |
| 338 | |
| 339 | pMd5 = digest(array) |
| 340 | context.cacheDataArray( |
| 341 | pMd5, {"array": array, "mTime": array.GetMTime(), "ts": time.time()} |
| 342 | ) |
| 343 | |
| 344 | root = {} |
| 345 | root["hash"] = pMd5 |
| 346 | root["vtkClass"] = "vtkDataArray" |
| 347 | root["name"] = array.GetName() |
| 348 | root["dataType"] = getJSArrayType(array) |
| 349 | root["numberOfComponents"] = array.GetNumberOfComponents() |
| 350 | root["size"] = array.GetNumberOfComponents() * array.GetNumberOfTuples() |
| 351 | root["ranges"] = [] |
| 352 | if root["numberOfComponents"] > 1: |
| 353 | for i in range(root["numberOfComponents"]): |
| 354 | root["ranges"].append(getRangeInfo(array, i)) |
| 355 | root["ranges"].append(getRangeInfo(array, -1)) |
| 356 | else: |
| 357 | root["ranges"].append(getRangeInfo(array, 0)) |
| 358 | |
| 359 | return root |
| 360 | |
| 361 | |
| 362 | # ----------------------------------------------------------------------------- |
no test coverage detected