#pragma once
#include "..\..\include\WindowsViewer\WinGraphicContext.h"
#include "..\..\include\SceneMapping\OAGScene.h"
#include "..\..\..\Common\include\OAGVector3d.h"
#include "..\..\..\Common\include\OAGMatrix4x4.h"
#include "..\..\include\oag\OAGCamera.h"
namespace oag
{
class WinRenderer
{
public:
WinRenderer(void);
WinRenderer(oag::WinGraphicContext* Win32GC, bool b3DMode = false );
~WinRenderer(void);
//Attributes
protected:
std::vector<oag::OAGSceneObject*> m_listScene;
oag::WinGraphicContext* m_prglWinGC;
bool m_bIs3dMode;
oag::OAGVector3f m_VecTranslation;
oag::OAGVector3f m_VecScale;
oag::OAGVector3f m_VecRotation;
oag::OAGColor m_BackGroundColor;
public:
oag::OAGCamera m_Camera;
//Operations
public:
void DeleteAllScenes();
bool Is3DMode() { return m_bIs3dMode; };
void GetMatrices(GLdouble *gldModelview, GLdouble *gldProjection);
void GetOGLPos(const int nXScreenCoordinate, const int nYScreenCoordinate, oag::OAGVector3d* ptOut);
void GetTranslation(oag::OAGVector3f* vec) { vec->SetVertex(m_VecTranslation); };
void GetRotation(oag::OAGVector3f* vec) { vec->SetVertex(m_VecRotation); };
void GetScale(oag::OAGVector3f* vec) { vec->SetVertex(m_VecScale); };
void SetScene(oag::OAGSceneObject* pScene)
{
m_listScene.resize(0);
m_listScene.push_back(pScene);
}
void AddScene(oag::OAGSceneObject* pScene)
{
m_listScene.push_back(pScene);
}
void RemoveAllScenes()
{
m_listScene.resize(0);
}
void ScreenToWorld(oag::OAGVector3f ptIn[], oag::OAGVector3d* ptOut, int count);
void ScreenToWorld(const int nXScreenCoordinate, const int nYScreenCoordinate, double& fXWorldCoordinate, double& fYWorldCoordinate);
void RenderScene();
void ResetTransform();
void SetBackGroundColor(BYTE red, BYTE green, BYTE blue, BYTE alpha = 255){ m_BackGroundColor.SetColor(red, green, blue, alpha); }
void SetTranslation(float x, float y, float z){ m_VecTranslation.SetVertex(x, y, z); }
void SetScale(float x, float y, float z) { m_VecScale.SetVertex(x, y, z); }
void SetRotation(float x, float y, float z) { m_VecRotation.SetVertex(x, y, z); }
};
};