<commit_before>#ifndef SRC_GRAPHICS_BUFFER_MANAGER_H_

#define SRC_GRAPHICS_BUFFER_MANAGER_H_

#include <Eigen/Core>
#include <vector>
#include <map>
#include <memory>
#include "./buffer_hole_manager.h"
#include "./attribute_buffer.h"

namespace Graphics
{

class Gl;

struct BufferInformation
{
  uint vertexBufferOffset;
  uint indexBufferOffset;
};

/**
 * \brief
 *
 *
 */
class BufferManager
{
 public:
  BufferManager();

  virtual ~BufferManager();
  void initialize(Gl *gl, uint maxObjectCount, uint bufferSize);

  BufferInformation addObject(const std::vector<float> &vertices,
                              const std::vector<float> &normals,
                              const std::vector<float> &colors,
                              const std::vector<float> &texCoords,
                              const std::vector<uint> &indices);

  void bind();
  void unbind();

 private:
  GLuint vertexArrayId;
  Gl *gl;

  AttributeBuffer positionBuffer;
  AttributeBuffer normalBuffer;
  AttributeBuffer colorBuffer;<commit_msg>Add docu for BufferManager and BufferInformation.<commit_after>#ifndef SRC_GRAPHICS_BUFFER_MANAGER_H_

#define SRC_GRAPHICS_BUFFER_MANAGER_H_

#include <Eigen/Core>
#include <vector>
#include <map>
#include <memory>
#include "./buffer_hole_manager.h"
#include "./attribute_buffer.h"

namespace Graphics
{

class Gl;

/**
 * \brief Stores offsets into index and vertex element buffers
 */
struct BufferInformation
{
  uint vertexBufferOffset;
  uint indexBufferOffset;
};

/**
 * \brief Holds all buffers and provides methods to add new objects
 *
 * The vertex data consists of:
 * - position (3 dimensions)
 * - normal (3 dimensions)
 * - color (4 dimensions; red, green, blue and alpha)
 * - texture coordinates (2 dimensions)
 * - internally also the draw id (1 dimension)
 *
 * Also indices are store separately.
 *
 * New objects can be add by calling #addObject().
 * 
 * All buffers can be bound with #bind() for usage
 * and unbound with #unbind() afterwards.
 */
class BufferManager
{
 public:
  BufferManager();

  virtual ~BufferManager();
  void initialize(Gl *gl, uint maxObjectCount, uint bufferSize);

  BufferInformation addObject(const std::vector<float> &vertices,
                              const std::vector<float> &normals,
                              const std::vector<float> &colors,
                              const std::vector<float> &texCoords,
                              const std::vector<uint> &indices);

  void bind();
  void unbind();

 private:
  GLuint vertexArrayId;
  Gl *gl;

  AttributeBuffer positionBuffer;
  AttributeBuffer normalBuffer;
  AttributeBuffer colorBuffer;
{'fraction_non_alphanumeric': 0.09905838041431261, 'fraction_numerical': 0.0018832391713747645, 'mean_word_length': 3.1958925750394944, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4014173', 'n_tokens_mistral': 771, 'n_tokens_neox': 749, 'n_words': 222}