------------------------------------------------------------------------------
| 1142 | |
| 1143 | //------------------------------------------------------------------------------ |
| 1144 | unsigned long vtkWebGPUPolyDataMapper::GetPointAttributeByteSize( |
| 1145 | vtkWebGPUPolyDataMapper::PointDataAttributes attribute) |
| 1146 | { |
| 1147 | switch (attribute) |
| 1148 | { |
| 1149 | case PointDataAttributes::POINT_POSITIONS: |
| 1150 | return this->CurrentInput->GetNumberOfPoints() * 3 * sizeof(vtkTypeFloat32); |
| 1151 | |
| 1152 | case PointDataAttributes::POINT_COLORS: |
| 1153 | return this->HasPointAttributes[POINT_COLORS] |
| 1154 | ? this->Colors->GetDataSize() * sizeof(vtkTypeFloat32) |
| 1155 | : 0; |
| 1156 | |
| 1157 | case PointDataAttributes::POINT_NORMALS: |
| 1158 | if (this->HasPointAttributes[attribute]) |
| 1159 | { |
| 1160 | return this->CurrentInput->GetPointData()->GetNormals()->GetNumberOfValues() * |
| 1161 | sizeof(vtkTypeFloat32); |
| 1162 | } |
| 1163 | |
| 1164 | break; |
| 1165 | |
| 1166 | case PointDataAttributes::POINT_TANGENTS: |
| 1167 | if (this->HasPointAttributes[attribute]) |
| 1168 | { |
| 1169 | return this->CurrentInput->GetPointData()->GetTangents()->GetNumberOfValues() * |
| 1170 | sizeof(vtkTypeFloat32); |
| 1171 | } |
| 1172 | |
| 1173 | break; |
| 1174 | |
| 1175 | case PointDataAttributes::POINT_UVS: |
| 1176 | if (this->HasPointAttributes[attribute]) |
| 1177 | { |
| 1178 | return this->CurrentInput->GetPointData()->GetTCoords()->GetNumberOfValues() * |
| 1179 | sizeof(vtkTypeFloat32); |
| 1180 | } |
| 1181 | break; |
| 1182 | |
| 1183 | case PointDataAttributes::POINT_COLOR_UVS: |
| 1184 | if (this->HasPointAttributes[attribute]) |
| 1185 | { |
| 1186 | return this->ColorCoordinates->GetNumberOfValues() * sizeof(vtkTypeFloat32); |
| 1187 | } |
| 1188 | break; |
| 1189 | |
| 1190 | default: |
| 1191 | break; |
| 1192 | } |
| 1193 | |
| 1194 | return 0; |
| 1195 | } |
| 1196 | |
| 1197 | //------------------------------------------------------------------------------ |
| 1198 | unsigned long vtkWebGPUPolyDataMapper::GetCellAttributeByteSize( |
no test coverage detected