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

Method AppendDataArray

Rendering/OpenGL2/vtkOpenGLVertexBufferObjectGroup.cxx:221–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221void vtkOpenGLVertexBufferObjectGroup::AppendDataArray(
222 const char* attribute, vtkDataArray* da, int destType)
223{
224 if (!da)
225 {
226 return;
227 }
228
229 std::vector<vtkDataArray*>& arrays = this->UsedDataArrays[attribute];
230 da->Register(this);
231 arrays.push_back(da);
232 this->UsedDataArrayMaps[attribute][da] = this->UsedDataArraySizes[attribute];
233 this->UsedDataArraySizes[attribute] += da->GetNumberOfTuples();
234
235 // make sure we have a VBO for this array
236 // we do not use the cache when appending
237 if (this->UsedVBOs.find(attribute) == this->UsedVBOs.end())
238 {
239 vtkOpenGLVertexBufferObject* vbo = vtkOpenGLVertexBufferObject::New();
240 vbo->SetDataType(destType);
241 this->UsedVBOs[attribute] = vbo;
242 }
243}
244
245void vtkOpenGLVertexBufferObjectGroup::ReleaseGraphicsResources(vtkWindow*)
246{

Callers 1

BuildAllVBOsMethod · 0.45

Calls 7

NewFunction · 0.50
RegisterMethod · 0.45
push_backMethod · 0.45
GetNumberOfTuplesMethod · 0.45
findMethod · 0.45
endMethod · 0.45
SetDataTypeMethod · 0.45

Tested by

no test coverage detected