00001 #ifndef X3DTK_GL_SCENEGRAPHTYPES_H 00002 #define X3DTK_GL_SCENEGRAPHTYPES_H 00003 00004 #include "X3DTypes.h" 00005 00006 #include <GL/gl.h> 00007 #include <list> 00008 #include <vector> 00009 00010 namespace X3DTK { 00011 namespace GL { 00012 00013 class X3DNode; 00014 00020 typedef X3DNode *SFNode; 00021 00028 typedef std::list<SFNode> MFNode; 00029 00036 struct N3F_V3F 00037 { 00038 SFVec3f normal; 00039 SFVec3f vertex; 00040 00041 friend bool operator== (const N3F_V3F &v1, const N3F_V3F &v2); 00042 }; 00043 00050 struct C4F_N3F_V3F 00051 { 00052 SFColorRGBA color; 00053 SFVec3f normal; 00054 SFVec3f vertex; 00055 00056 friend bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2); 00057 }; 00058 00065 struct T2F_C4F_N3F_V3F 00066 { 00067 SFVec2f texCoord; 00068 SFColorRGBA color; 00069 SFVec3f normal; 00070 SFVec3f vertex; 00071 00072 friend bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2); 00073 }; 00074 00081 struct T2F_N3F_V3F 00082 { 00083 SFVec2f texCoord; 00084 SFVec3f normal; 00085 SFVec3f vertex; 00086 00087 friend bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2); 00088 }; 00089 00096 typedef struct 00097 { 00098 unsigned char r, g, b, a; 00099 SFVec3f vertex; 00100 } C4UB_V3F; 00101 00102 00108 inline bool operator== (const N3F_V3F &v1, const N3F_V3F &v2) 00109 { 00110 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal)); 00111 } 00112 00118 inline bool operator== (const C4F_N3F_V3F &v1, const C4F_N3F_V3F &v2) 00119 { 00120 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color)); 00121 } 00122 00128 inline bool operator== (const T2F_N3F_V3F &v1, const T2F_N3F_V3F &v2) 00129 { 00130 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.texCoord == v2.texCoord)); 00131 } 00132 00138 inline bool operator== (const T2F_C4F_N3F_V3F &v1, const T2F_C4F_N3F_V3F &v2) 00139 { 00140 return ((v1.vertex == v2.vertex) && (v1.normal == v2.normal) && (v1.color == v2.color) && (v1.texCoord == v2.texCoord)); 00141 } 00142 00143 } 00144 } 00145 00146 #endif