#ifndef DEF_TX_OBJECT
 #define DEF_TX_OBJECT

//------------------------------------------//
//		TKA4 Main Object Graph classes		//
//				26. 10. 2007				//
//------------------------------------------//


//--- Includes
#include "gl_add.h"

#include "TX_World.h"
//=== Includes 


//--- Direction of Execution ---//
enum EDirection { 
	d_for,	// Forward
	d_both,	// Forward & Bacward
	d_back,	// Never try to use it!

	d_for_super,	// Without glPushMatrix & glPopMatrix
	d_both_super,	// in Engine->Go()
	d_back_super,	

	d_nothing
	};

//------------------------------------

//--- OBJ Matrix ---//
	class ObjMatrix {
	public:
		GLfloat  s[3];
		GLfloat  t[3];
		GLfloat  r[3];

	public : 
		ObjMatrix(){ s[0]=s[1]=s[2]=t[0]=t[1]=t[2]=r[0]=r[1]=r[2]=1; };

		virtual inline void ZoomIn() { s[2] = s[1] = s[0]+=0.1; };
		virtual inline void ZoomOut() { s[2] = s[1] = s[0]-=0.1; };
	};
	//=== OBJ Matrix ===//


//--- txEngine
class txEngine;	

//---  Abstract Class Object TX  ---//
/*	Base for all Graph Objects.	   */
class txObject {
	friend txEngine;
	
	protected:
		EDirection dir;
		txObject *prev, *next;
		txWorld *World;

	public: 
		ObjMatrix  matrix;

	public:
		//--- Con-De-structers
		txObject() { prev = NULL; next = NULL; dir = d_for; };
		virtual ~txObject() { };
				
		//--- Executes
		virtual void  Execute_Init() {};
		virtual void  Execute_Forward() {};
		virtual void  Execute_Backward() {};
		
		//--- Other
		EDirection inline  GetDirection() { return dir; };
		void inline  SetDirection(EDirection d) { dir=d; };

		//--- Matrix Operations
		virtual inline void Zoom() {};

};


#endif