FLImaging 6.5.8.1
GUIViewImageLayerObjectBase.h
1#pragma once
2
3#include "GUIDefinitions.h"
4#include <d2d1.h>
5
6#define DAFAULT_FONTSIZE 12
7
8namespace FLImaging
9{
10 namespace GUI
11 {
12 class CD2DObject;
13
14 enum ELayerObjectType : uint32_t
15 {
16 ELayerObjectType_Base = 0x0000,
17 ELayerObjectType_Figure = 0x0001,
18 ELayerObjectType_Text = 0x0002,
19
20 ELayerObjectType_Figure_Gbr = 0x0011,
21 ELayerObjectType_Figure_Dxf = 0x0021,
22 };
23
24 // `CGUIViewImageLayerObjectFigureRef`, `CGUIViewImageLayerObjectTextRef` 객체에서 참조하는 객체의 타입
25 // The type of the object referenced in the `CGUIViewImageLayerObjectFigureRef`, `CGUIViewImageLayerObjectTextRef` object
26 enum EGUIVILOReferencedObjectType
27 {
28 EGUIVILOReferencedObjectType_Unknown = 0,
29 EGUIVILOReferencedObjectType_CGUIViewImageObjectFigure,
30 EGUIVILOReferencedObjectType_CGUIViewImageObjectImageFigure,
31 EGUIVILOReferencedObjectType_CFLBase,
32 };
33
34 class FL_EXPORT CGUIViewImageLayerObjectBase
35 {
36 public:
37 CGUIViewImageLayerObjectBase();
38 CGUIViewImageLayerObjectBase(const CGUIViewImageLayerObjectBase* pRhs);
39 CGUIViewImageLayerObjectBase(const CGUIViewImageLayerObjectBase& rhs);
40 virtual ~CGUIViewImageLayerObjectBase();
41
42 virtual const CResult Assign(const CGUIViewImageLayerObjectBase* pRhs);
43 virtual const CResult Assign(const CGUIViewImageLayerObjectBase& rhs);
44 virtual CGUIViewImageLayerObjectBase* DuplicateObject() const;
45 virtual CGUIViewImageLayerObjectBase* CreateObject() const;
46
47 virtual void Clear();
48 virtual void ClearFigure();
49
50 virtual bool SetFigure(const Foundation::CFLFigure& flfFigure);
51 virtual bool SetFigure(const Foundation::CFLFigure* pFlfFigure, bool bRefFigure = false);
52 Foundation::CFLFigure* GetFigure() const;
53
54 virtual void SetLineColor(COLORREF crLineColor);
55 COLORREF GetLineColor() const;
56 D2D1_COLOR_F GetLineColorD2D1() const;
57
58 virtual void SetFillColor(COLORREF crFillColor);
59 virtual void ClearFillColor();
60 COLORREF GetFillColor() const;
61 D2D1_COLOR_F GetFillColorD2D1() const;
62
63 virtual void SetLineColorAlphaBlendingRatio(float f32AlphaBlendingRatio);
64 float GetLineColorAlphaBlendingRatio() const;
65
66 virtual void SetFillColorAlphaBlendingRatio(float f32AlphaBlendingRatio);
67 float GetFillColorAlphaBlendingRatio() const;
68
69 void UseScreenCoord(bool bUse);
70 bool IsUsingScreenCoord() const;
71
72 void Show(bool bShow);
73 bool IsVisible() const;
74
75 void SetDirty(bool bDirty);
76 bool IsDirty() const;
77
78 // 이 값이 true 일 경우, `m_pFigure`는 깊은 복사로 생성된 객체의 포인터가 아닌 단순 참조만 하는 포인터입니다. 따라서 이 값이 true 이면 `m_pFigure`의 메모리 해제를 하지 않습니다.
79 bool IsRefFigure() const;
80
81 protected:
82 void SetLayerObjectType(ELayerObjectType eType);
83 public:
84 ELayerObjectType GetLayerObjectType() const;
85
86 public:
87 Foundation::CFLFigure* m_pFigure;
88 Foundation::CFLRect<double> m_rect;
89
90 bool m_bUseScreenCoord;
91 bool m_bShow;
92 bool m_bDirty;
93 ELayerObjectType m_eLayerObjectType;
94
95 protected:
96 COLORREF m_crLineColor;
97 D2D1_COLOR_F m_d2dcLineColor;
98 COLORREF m_crFillColor;
99 D2D1_COLOR_F m_d2dcFillColor;
100
101 float m_f32LineColorAlphaBlendingRatio;
102 float m_f32FillColorAlphaBlendingRatio;
103 bool m_bRefFigure;
104
105 protected:
106 void ConvertColorRefToD2DColor(const COLORREF& crColor, D2D1_COLOR_F& d2dcColor) const;
107
108 friend class CGUIViewImageLayer;
109 friend class CGUIViewImageLayerForDrawing;
110 friend class CGUIViewGraphLayer;
111 };
112 }
113}
114
@ Assign
CGUIPropertyItemView3DFigure 의 값을 해당 도형으로 설정하는 함수