------------------------------------------------------------------------------
| 1235 | |
| 1236 | //------------------------------------------------------------------------------ |
| 1237 | unsigned long vtkWebGPUPolyDataMapper::GetPointAttributeElementSize( |
| 1238 | vtkWebGPUPolyDataMapper::PointDataAttributes attribute) |
| 1239 | { |
| 1240 | switch (attribute) |
| 1241 | { |
| 1242 | case PointDataAttributes::POINT_POSITIONS: |
| 1243 | return 3 * sizeof(vtkTypeFloat32); |
| 1244 | |
| 1245 | case PointDataAttributes::POINT_COLORS: |
| 1246 | if (this->HasPointAttributes[POINT_COLORS]) |
| 1247 | { |
| 1248 | return vtkDataArray::SafeDownCast(this->Colors)->GetNumberOfComponents() * |
| 1249 | sizeof(vtkTypeFloat32); |
| 1250 | } |
| 1251 | |
| 1252 | break; |
| 1253 | |
| 1254 | case PointDataAttributes::POINT_NORMALS: |
| 1255 | if (this->HasPointAttributes[attribute]) |
| 1256 | { |
| 1257 | return this->CurrentInput->GetPointData()->GetNormals()->GetNumberOfComponents() * |
| 1258 | sizeof(vtkTypeFloat32); |
| 1259 | } |
| 1260 | |
| 1261 | break; |
| 1262 | |
| 1263 | case PointDataAttributes::POINT_TANGENTS: |
| 1264 | if (this->HasPointAttributes[attribute]) |
| 1265 | { |
| 1266 | return this->CurrentInput->GetPointData()->GetTangents()->GetNumberOfComponents() * |
| 1267 | sizeof(vtkTypeFloat32); |
| 1268 | } |
| 1269 | |
| 1270 | break; |
| 1271 | |
| 1272 | case PointDataAttributes::POINT_UVS: |
| 1273 | if (this->HasPointAttributes[attribute]) |
| 1274 | { |
| 1275 | return this->CurrentInput->GetPointData()->GetTCoords()->GetNumberOfComponents() * |
| 1276 | sizeof(vtkTypeFloat32); |
| 1277 | } |
| 1278 | break; |
| 1279 | |
| 1280 | case PointDataAttributes::POINT_COLOR_UVS: |
| 1281 | if (this->HasPointAttributes[attribute]) |
| 1282 | { |
| 1283 | return this->ColorCoordinates->GetNumberOfComponents() * sizeof(vtkTypeFloat32); |
| 1284 | } |
| 1285 | break; |
| 1286 | |
| 1287 | default: |
| 1288 | break; |
| 1289 | } |
| 1290 | |
| 1291 | return 0; |
| 1292 | } |
| 1293 | |
| 1294 | //------------------------------------------------------------------------------ |
no test coverage detected