/// This file is part of the X3DToolKit library
/// Copyright (C) 2002-2004  Yannick Le Goc (legoc@imag.fr)

/// http://artis.imag.fr/Members/Yannick.Legoc/X3D/

/// This library is free software; you can redistribute it and/or
/// modify it under the terms of the GNU Lesser General Public
/// License as published by the Free Software Foundation; either
/// version 2.1 of the License, or (at your option) any later version.

/// This library is distributed in the hope that it will be useful,
/// but WITHOUT ANY WARRANTY; without even the implied warranty of
/// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
/// Lesser General Public License for more details.

/// You should have received a copy of the GNU Lesser General Public
/// License along with this library; if not, write to the Free Software
/// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#ifndef X3DTK_GL_SCENEGRAPHTYPES_H
#define X3DTK_GL_SCENEGRAPHTYPES_H

#include "X3DTypes.h"

#include <list>
#include <vector>

namespace X3DTK {
namespace GL {

class X3DNode;

/*! \brief Type declared in <b><X3DTK/GL/scenegraph.h></b> providing a structure equivalent
 *  to GL_N3F_V3F
 *
 *  \ingroup GLSceneGraph
 */
 
struct N3F_V3F
{
  SFVec3f normal;
  SFVec3f vertex;
  
  friend bool operator== (const N3F_V3F &v1, const N3F_V3F &v2);
};

/*! \brief Type declared in <b><X3DTK/GL/scenegraph.h></b> providing a structure equivalent
 *  to GL_C4F_N3F_V3F
 *
 *  \ingroup GLSceneGraph
 */
 
struct C4F_N3F_V3F
{
  SFColorRGBA color;
  SFVec3f normal;
  SFVec3f vertex;
  
  friend bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2);
};

/*! \brief Type declared in <b><X3DTK/GL/scenegraph.h></b> providing a structure equivalent
 *  to GL_T2F_C4F_N3F_V3F
 *
 *  \ingroup GLSceneGraph
 */
 
struct T2F_C4F_N3F_V3F
{
  SFVec2f texCoord;
  SFColorRGBA color;
  SFVec3f normal;
  SFVec3f vertex;
  
  friend bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2);
};

/*! \brief Type declared in <b><X3DTK/GL/scenegraph.h></b> providing a structure equivalent
 *  to GL_T2F_N3F_V3F
 *
 *  \ingroup GLSceneGraph
 */
 
struct T2F_N3F_V3F
{
  SFVec2f texCoord;
  SFVec3f normal;
  SFVec3f vertex;
  
  friend bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2);
};

/*! \brief Type declared in <b><X3DTK/GL/scenegraph.h></b> providing a structure equivalent
 *  to GL_C4UB_V3F
 *
 *  \ingroup GLSceneGraph
 */
 
typedef struct
{
  unsigned char r, g, b, a;
  SFVec3f vertex;
} C4UB_V3F;


/*! \brief Equality operator declared in <b><X3DTK/GL/scenegraph.h></b>.
 *
 *  \ingroup GLSceneGraph
 */
 
inline bool operator== (const N3F_V3F &v1, const N3F_V3F &v2)
{
  return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal));
}

/*! \brief Equality operator declared in <b><X3DTK/GL/scenegraph.h></b>.
 *
 *  \ingroup GLSceneGraph
 */

inline bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2)
{
  return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color));
}

/*! \brief Equality operator declared in <b><X3DTK/GL/scenegraph.h></b>.
 *
 *  \ingroup GLSceneGraph
 */
 
inline bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2)
{
  return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.texCoord == v2.texCoord));
}

/*! \brief Equality operator declared in <b><X3DTK/GL/scenegraph.h></b>.
 *
 *  \ingroup GLSceneGraph
 */
 
inline bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2)
{
  return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color) && (v1.texCoord == v2.texCoord));
}

}
}

#endif
