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

Method BuildVBO

Rendering/ContextOpenGL2/vtkOpenGLContextDevice3D.cxx:145–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void vtkOpenGLContextDevice3D::BuildVBO(vtkOpenGLHelper* cellBO, const float* f, int nv,
146 const unsigned char* colors, int nc, float* tcoords)
147{
148 // build up temporary vtkDataArrays without copying the data.
149 vtkNew<vtkFloatArray> positionsArray;
150 vtkNew<vtkUnsignedCharArray> colorsArray;
151 vtkNew<vtkFloatArray> tcoordsArray;
152
153 positionsArray->SetNumberOfComponents(3);
154 positionsArray->SetNumberOfTuples(nv);
155 std::copy(f, f + nv * 3, positionsArray->Begin());
156
157 colorsArray->SetNumberOfComponents(nc);
158 colorsArray->SetNumberOfTuples(nv);
159 std::copy(colors, colors + nv * nc, colorsArray->Begin());
160
161 tcoordsArray->SetNumberOfComponents(2);
162 tcoordsArray->SetArray(tcoords, nv * 2, 1); // do not take ownership of 'tcoords'
163
164 // use 'anonymous' cache identifier because of raw typed array pointers.
165 this->Storage->BufferObjectBuilder.BuildVBO(
166 cellBO, positionsArray, colorsArray, tcoordsArray, /*cacheIdentifier=*/0, this->RenderWindow);
167}
168
169void vtkOpenGLContextDevice3D::ReadyVBOProgram()
170{

Callers 4

DrawPolyMethod · 0.95
DrawLinesMethod · 0.95
DrawPointsMethod · 0.45
DrawTriangleMeshMethod · 0.45

Calls 5

copyFunction · 0.50
SetNumberOfComponentsMethod · 0.45
SetNumberOfTuplesMethod · 0.45
BeginMethod · 0.45
SetArrayMethod · 0.45

Tested by

no test coverage detected