From 0c3cc5a320f7a9ab2e26d7ea1d4ab3a3e8076d7b Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 11 Jun 2025 01:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0CoordinateSystem2DName?= =?UTF-8?q?=E5=92=8CGetCoordinateSystem2DName?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- inc/hgl/graph/CoordinateSystem.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/inc/hgl/graph/CoordinateSystem.h b/inc/hgl/graph/CoordinateSystem.h index 762a7979..9a28428f 100644 --- a/inc/hgl/graph/CoordinateSystem.h +++ b/inc/hgl/graph/CoordinateSystem.h @@ -11,4 +11,18 @@ namespace hgl::graph ENUM_CLASS_RANGE(NDC,Ortho) }; + + 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)]; + } }//namespace hgl::graph