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

Method GetPointAttributeByteSize

Rendering/WebGPU/vtkWebGPUPolyDataMapper.cxx:1144–1195  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1142
1143//------------------------------------------------------------------------------
1144unsigned 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//------------------------------------------------------------------------------
1198unsigned long vtkWebGPUPolyDataMapper::GetCellAttributeByteSize(

Callers 2

Calls 7

GetDataSizeMethod · 0.80
GetTangentsMethod · 0.80
GetNumberOfPointsMethod · 0.45
GetNumberOfValuesMethod · 0.45
GetNormalsMethod · 0.45
GetPointDataMethod · 0.45
GetTCoordsMethod · 0.45

Tested by

no test coverage detected