2023-05-15 21:52:57 +08:00
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include<hgl/TypeFunc.h>
|
2025-05-05 03:25:19 +08:00
|
|
|
|
namespace hgl::graph
|
2023-05-15 21:52:57 +08:00
|
|
|
|
{
|
2025-05-05 03:25:19 +08:00
|
|
|
|
enum class CoordinateSystem2D
|
2023-05-15 21:52:57 +08:00
|
|
|
|
{
|
2025-05-05 03:25:19 +08:00
|
|
|
|
NDC,
|
|
|
|
|
ZeroToOne, //左上角为0,0;右下角为1,1
|
|
|
|
|
Ortho, //左上角为0,0;右下角为(width-1),(height-1)
|
2023-05-15 21:52:57 +08:00
|
|
|
|
|
2025-05-05 03:25:19 +08:00
|
|
|
|
ENUM_CLASS_RANGE(NDC,Ortho)
|
|
|
|
|
};
|
2025-06-11 01:10:15 +08:00
|
|
|
|
|
|
|
|
|
constexpr const char *CoordinateSystem2DName[]=
|
|
|
|
|
{
|
|
|
|
|
"NDC",
|
|
|
|
|
"0to1",
|
|
|
|
|
"Ortho"
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
inline const char *GetCoordinateSystem2DName(const enum class CoordinateSystem2D &cs)
|
|
|
|
|
{
|
|
|
|
|
RANGE_CHECK_RETURN_NULLPTR(cs)
|
|
|
|
|
|
|
|
|
|
return CoordinateSystem2DName[size_t(cs)];
|
|
|
|
|
}
|
2025-05-05 03:25:19 +08:00
|
|
|
|
}//namespace hgl::graph
|