MCPcopy Create free account
hub / github.com/Kitware/VTK / GetCellAttributeByteSize

Method GetCellAttributeByteSize

Rendering/WebGPU/vtkWebGPUPolyDataMapper.cxx:1198–1234  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1196
1197//------------------------------------------------------------------------------
1198unsigned long vtkWebGPUPolyDataMapper::GetCellAttributeByteSize(
1199 vtkWebGPUPolyDataMapper::CellDataAttributes attribute)
1200{
1201 switch (attribute)
1202 {
1203 case CellDataAttributes::CELL_COLORS:
1204 if (this->HasCellAttributes[attribute])
1205 {
1206 // are we using a single color value replicated over all cells?
1207 if (this->FieldDataTupleId > -1 && this->ScalarMode == VTK_SCALAR_MODE_USE_FIELD_DATA)
1208 {
1209 return this->CurrentInput->GetNumberOfCells() * this->Colors->GetNumberOfComponents() *
1210 sizeof(vtkTypeFloat32);
1211 }
1212 else
1213 {
1214 return this->Colors->GetDataSize() * sizeof(vtkTypeFloat32);
1215 }
1216 }
1217
1218 break;
1219
1220 case CellDataAttributes::CELL_NORMALS:
1221 if (this->HasCellAttributes[attribute])
1222 {
1223 return this->CurrentInput->GetCellData()->GetNormals()->GetDataSize() *
1224 sizeof(vtkTypeFloat32);
1225 }
1226
1227 break;
1228
1229 default:
1230 break;
1231 }
1232
1233 return 0;
1234}
1235
1236//------------------------------------------------------------------------------
1237unsigned long vtkWebGPUPolyDataMapper::GetPointAttributeElementSize(

Callers 2

Calls 5

GetDataSizeMethod · 0.80
GetNumberOfCellsMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetNormalsMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected