00001 //----------------------------------------------------------------------------- 00002 // Author: Jim Holmström 00003 // Date: 2002-02-13 00004 //----------------------------------------------------------------------------- 00005 00006 #ifndef __GNGGLUTREPRESENTATION_HH 00007 #define __GNGGLUTREPRESENTATION_HH 00008 00009 #include <GNGCore/GNGAlgorithm.hpp> 00010 #include <GNGCore/EdgeContainer.hpp> 00011 #include <GNGCore/NodeContainer.hpp> 00012 #include <GL/glut.h> 00013 #include "IGLInputRepresentation.hpp" 00014 00015 class IGNGContainer; 00016 class GNGNode; 00017 class GNGEdge; 00018 class Control; 00019 00029 class GNGGLUTRepresentation 00030 { 00031 public: 00032 GNGGLUTRepresentation(char ** argv, int argc); 00033 virtual ~GNGGLUTRepresentation() 00034 { 00035 delete m_inputRepresentation; 00036 } 00037 00038 static void OutputRepresentation(); 00039 void Run(); 00040 00041 void SetGNGContainer(IGNGContainer * c) { m_gngContainer = c; } 00042 void SetControlObject(Control * i) { m_control = i; } 00043 void SetUpdateInterval(unsigned int i) { m_representationUpdate = i; } 00044 void SetInputRepresentation(IGLInputRepresentation * i); 00045 00046 private: 00047 static void CallBackMouseFunc(int mouse, int state, int x, int y); 00048 static void CallBackDisplayFunc(void); 00049 static void CallBackReshapeFunc(int w, int h); 00050 static void CallBackIdleFunc(void); 00051 00052 static void OutputEdges(); 00053 static void OutputNodes(); 00054 static void OutputText(); 00055 static void OutputNode(GNGNode const & node); 00056 static void OutputEdge(GNGEdge const & edge); 00057 static void Output(); 00058 00059 private: 00060 static unsigned int m_counter; 00061 static Control * m_control; 00062 static unsigned int m_representationUpdate; 00063 static IGLInputRepresentation * m_inputRepresentation; 00064 static IGNGContainer * m_gngContainer; 00065 static double m_xMin; 00066 static double m_xMax; 00067 static double m_yMin; 00068 static double m_yMax; 00069 static bool m_paused; 00070 static bool m_stepOnce; 00071 static bool m_stepSequence; 00072 }; 00073 00074 #endif 00075 00076 00077