// Author: Juan Carlos De Abreu (jcabreur@gmail.com)
//
// This file define a class that contain a common properties for a geometry
// group.

#ifndef MODEL_GROUP_H__
#define MODEL_GROUP_H__

#include "Face.h"
#include "../Material/Material.h"
#include "../Base/Memory/SmartPointer.h"

BEGIN_TEG_NAMESPACE();

class Group {
 public:
  // Render Modes.
  enum { OPAQUE_ = 1, TRANSLUCENT = 2, MATERIAL = 4, TEXTURE = 8 };

  // Group constructor and destructor.
  Group();
  ~Group();

  // Attributes
  std::vector< SmartPointer<Material> > mat;
  std::vector< int > matIndex;			// indices para los que aplica el material

  std::vector<Vec3f> vertexList;		// List of vextexs of the model
  std::vector<Vec3f> normalList;		// List of normals of the model
  std::vector<Vec2f> textureList;		// List of the texture coord of the model
  std::vector< Face > faceList;		// List of the faces of the model

  // Methods
  void drawGrid(void) const;		// Method to render the model like a grid
  void drawPoint(void) const;		// Method to render the model like points
  void drawSurface(void);			// Method to render the model like a surface

  //////////
  std::vector<GLuint> dl;			// Display lists of each material
  void createDL();
  void drawDL(int renderMode);
  /////////
};

END_TEG_NAMESPACE();

#endif  // MODEL_GROUP_H__
