mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#ifndef _VIEW_H_
|
|
#define _VIEW_H_
|
|
|
|
#include "lc_glwidget.h"
|
|
|
|
class Project;
|
|
|
|
class View : public lcGLWidget
|
|
{
|
|
public:
|
|
View(Project *project);
|
|
virtual ~View();
|
|
|
|
void OnDraw();
|
|
void OnInitialUpdate();
|
|
void OnUpdateCursor();
|
|
void OnLeftButtonDown();
|
|
void OnLeftButtonUp();
|
|
void OnLeftButtonDoubleClick();
|
|
void OnMiddleButtonDown();
|
|
void OnMiddleButtonUp();
|
|
void OnRightButtonDown();
|
|
void OnRightButtonUp();
|
|
void OnMouseMove();
|
|
void OnMouseWheel(float Direction);
|
|
|
|
void SetCamera(Camera* camera, bool ForceCopy);
|
|
void SetDefaultCamera();
|
|
lcMatrix44 GetProjectionMatrix() const;
|
|
|
|
LC_CURSOR_TYPE GetCursor() const;
|
|
|
|
Project* m_Project;
|
|
Camera* mCamera;
|
|
float m_OverlayScale;
|
|
|
|
lcVector3 ProjectPoint(const lcVector3& Point) const
|
|
{
|
|
int Viewport[4] = { 0, 0, mWidth, mHeight };
|
|
return lcProjectPoint(Point, mCamera->mWorldView, GetProjectionMatrix(), Viewport);
|
|
}
|
|
|
|
lcVector3 UnprojectPoint(const lcVector3& Point) const
|
|
{
|
|
int Viewport[4] = { 0, 0, mWidth, mHeight };
|
|
return lcUnprojectPoint(Point, mCamera->mWorldView, GetProjectionMatrix(), Viewport);
|
|
}
|
|
|
|
void UnprojectPoints(lcVector3* Points, int NumPoints) const
|
|
{
|
|
int Viewport[4] = { 0, 0, mWidth, mHeight };
|
|
lcUnprojectPoints(Points, NumPoints, mCamera->mWorldView, GetProjectionMatrix(), Viewport);
|
|
}
|
|
};
|
|
|
|
#endif // _VIEW_H_
|