00001
00002
00004
00005 #ifndef GLSCENEGRAPHTYPES_H
00006 #define GLSCENEGRAPHTYPES_H
00007
00008 #include "X3DTypes.h"
00009
00010 #include <GL/gl.h>
00011 #include <list>
00012 #include <vector>
00013
00014 namespace X3DTK {
00015 namespace GL {
00016
00017 class X3DNode;
00019 typedef X3DNode *SFNode;
00021 typedef std::list<SFNode> MFNode;
00022
00024 struct N3F_V3F
00025 {
00026 SFVec3f normal;
00027 SFVec3f vertex;
00028
00029 friend bool operator== (const N3F_V3F &v1, const N3F_V3F &v2);
00030 };
00031
00033 struct C4F_N3F_V3F
00034 {
00035 SFColorRGBA color;
00036 SFVec3f normal;
00037 SFVec3f vertex;
00038
00039 friend bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2);
00040 };
00041
00043 struct T2F_C4F_N3F_V3F
00044 {
00045 SFVec2f texCoord;
00046 SFColorRGBA color;
00047 SFVec3f normal;
00048 SFVec3f vertex;
00049
00050 friend bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2);
00051 };
00052
00054 struct T2F_N3F_V3F
00055 {
00056 SFVec2f texCoord;
00057 SFVec3f normal;
00058 SFVec3f vertex;
00059
00060 friend bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2);
00061 };
00062
00064 typedef struct
00065 {
00066 unsigned char r, g, b, a;
00067 SFVec3f vertex;
00068 } C4UB_V3F;
00069
00070 inline bool operator== (const N3F_V3F &v1, const N3F_V3F &v2)
00071 {
00072 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal));
00073 }
00074
00075 inline bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2)
00076 {
00077 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color));
00078 }
00079
00080 inline bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2)
00081 {
00082 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.texCoord == v2.texCoord));
00083 }
00084
00085 inline bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2)
00086 {
00087 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color) && (v1.texCoord == v2.texCoord));
00088 }
00089
00090 }
00091 }
00092
00093 #endif