FLImaging 6.5.8.1
GUIPropertyItemFigure.h
1#pragma once
10#include "GUIPropertyItemBase.h"
11#include "GUIDefinitions.h"
12
13#include <future>
14#include <deque>
15
17namespace FLImaging
18{
20 namespace GUI
21 {
22 class CGUIPropertyItemViewListBase;
23 class CGUIViewImageBase;
24
33 {
41
49
57
65
73
81
89
97
105
113
121
129
137
145
153
161
169
177
185
186
194
202
210
218 };
219
221 {
222 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
223 }
224
226 {
227 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
228 }
229
231 {
232 return a = a | b;
233 }
234
236 {
237 return a = a & b;
238 }
239
241 {
242 return static_cast<EAvailableFigureDeclType>(~static_cast<int64_t>(a));
243 }
244
245 inline bool operator!(EAvailableFigureDeclType a)
246 {
247 return static_cast<bool>(!static_cast<int64_t>(a));
248 }
249
258 {
266
274
282
290
298
306
314 };
315
317 {
318 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
319 }
320
322 {
323 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
324 }
325
327 {
328 return a = a | b;
329 }
330
332 {
333 return a = a & b;
334 }
335
337 {
338 return static_cast<EAvailableFigureTemplateType>(~static_cast<int64_t>(a));
339 }
340
341 inline bool operator!(EAvailableFigureTemplateType a)
342 {
343 return static_cast<bool>(!static_cast<int64_t>(a));
344 }
345
354 {
362
370
372 // Not supported yet
373
381
390
398
406
414
422
430 };
431
433 {
434 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
435 }
436
438 {
439 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
440 }
441
443 {
444 return a = a | b;
445 }
446
448 {
449 return a = a & b;
450 }
451
453 {
454 return static_cast<EAvailableFigureTransformType>(~static_cast<int64_t>(a));
455 }
456
457 inline bool operator!(EAvailableFigureTransformType a)
458 {
459 return static_cast<bool>(!static_cast<int64_t>(a));
460 }
461
470 {
471 public:
479
487
499
507
521
533
545
558 virtual bool SetAvailableFigureDeclType(EAvailableFigureDeclType eAvailableFigureDeclType);
559
571
584 virtual bool SetAvailableFigureTemplateType(EAvailableFigureTemplateType eAvailableFigureTemplateType);
585
597
610 virtual bool SetAvailableFigureTransformType(EAvailableFigureTransformType eAvailableFigureTransformType);
611
623
636 virtual bool IsValidValue(Base::CFLString<wchar_t> flstrValue) const;
637
650 virtual bool IsValidValue(const FLImaging::Foundation::CFLFigure* pFlf) const;
651
669
682 virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType) const;
683
696 virtual bool IsValidValue(FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const;
697
717 virtual const CResult MakeValidFigure(Base::CFLString<wchar_t> strValue, Base::CFLString<wchar_t>& strValidFigure, bool bMsgBox = false);
718
732
744
759 virtual bool SetRealtimeEventCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
760
771 virtual CPropertyCallback* GetRealtimeEventCallback() const;
772
787 virtual bool ShowCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
788
799 virtual CPropertyCallback* GetShowCallback() const;
800
815 virtual bool SetConfirmCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
816
827 virtual CPropertyCallback* GetConfirmCallback() const;
828
843 virtual bool SetCancelCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
844
855 virtual CPropertyCallback* GetCancelCallback() const;
856
871 virtual bool SetDeleteCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
872
883 virtual CPropertyCallback* GetDeleteCallback() const;
884
895 virtual void SetInstantApplyMode(bool bSet, bool bFixMode);
896
905 virtual bool IsInstantApplyMode() const;
906
915 virtual bool IsInstantApplyModeFixed() const;
916
929 virtual const CResult LoadFigure(const wchar_t* pWcsPath = nullptr);
930
943 virtual const CResult SaveFigure(const wchar_t* pWcsFileNameWithPath = nullptr) const;
944
953 virtual void SetFigureAutoHideMode(bool bAutoHide);
954
963 virtual bool GetFigureAutoHideMode() const;
964
975 virtual void ShowFigure(bool bShow, bool bCreate = true);
976
985 virtual bool IsFigureVisible() const;
986
995 virtual void SetView(const CGUIViewImageBase* pView);
996
1020
1030 virtual void ShowUnavailableContextMenu(bool bShow = false);
1031
1042
1043 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
1044 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
1045 virtual void Enable(bool bEnable) override;
1046
1047 protected:
1048 void InternalSetInstantApplyMode(bool bSet, bool bFixMode);
1049 virtual bool GetValidFigureType(Base::CFLString<wchar_t>& strValue);
1050 virtual const CResult CreateFigure(const Foundation::CFLFigure* pFlf, Foundation::EFigureTemplateType eTemplateType, Foundation::CFLFigure** ppFlfOut) const;
1051 Foundation::CFLFigure* GetValidFigure(const Foundation::CFLFigure* pFlf) const;
1052 const CResult InitializeThread();
1053 bool IsThreadInitialized();
1054 static void RunThread(CGUIPropertyItemFigure* pFigureProperty, std::future<void>** pContext);
1055
1056 public:
1057 const CResult TerminateThread();
1058
1059 enum ECallbackType
1060 {
1061 ECallbackType_None = 0,
1062 ECallbackType_Confirm,
1063 ECallbackType_Delete,
1064 ECallbackType_Cancel,
1065 ECallbackType_RealtimeEvent,
1066 ECallbackType_Show,
1067 };
1068
1069 protected:
1070 Base::CFLString<wchar_t> m_strLastOKValue;
1072 EAvailableFigureDeclType m_eAvailableFigureDeclType;
1073 EAvailableFigureTemplateType m_eAvailableFigureTemplateType;
1074 EAvailableFigureTransformType m_eAvailableFigureTransformType;
1075
1076 CPropertyCallback* m_pRealtimeCallback;
1077 bool m_bRealtimeCallbackAutoDestroy;
1078
1079 CPropertyCallback* m_pShowCallback;
1080 bool m_bShowCallbackAutoDestroy;
1081
1082 CPropertyCallback* m_pConfirmCallback;
1083 bool m_bConfirmCallbackAutoDestroy;
1084
1085 CPropertyCallback* m_pCancelCallback;
1086 bool m_bCancelCallbackAutoDestroy;
1087
1088 CPropertyCallback* m_pDeleteCallback;
1089 bool m_bDeleteCallbackAutoDestroy;
1090
1091 std::deque<Base::CFLString<wchar_t>>& m_deqProcedureParameterString;
1092 std::future<void>* m_pProcedureThread;
1093
1094 volatile bool m_bThreadRunning;
1095 volatile bool m_bThreadInitialized;
1096 volatile bool m_bThreadTerminated;
1097
1098 CGUIViewImageBase* m_pView;
1099
1100 bool m_bEnableInstantApplyMode;
1101 bool m_bFixInstantApplyMode;
1102 bool m_bFigureAutoHideMode;
1103 bool m_bShowUnavailableContextMenu;
1104
1105 friend class CGUIViewImage;
1106 };
1107 }
1108}
Template type string class.
Definition INIUtilities.h:20
FLImaging module execution result object.
Definition ResultsDef.h:1514
A base class of classes representing figures.
Definition FLFigure.h:27
Property item base class.
Definition GUIPropertyItemBase.h:37
A class of Figure property.
Definition GUIPropertyItemFigure.h:470
virtual bool SetAvailableFigureTransformType(EAvailableFigureTransformType eAvailableFigureTransformType)
Specifies the available Figure transform type.
virtual const CResult SaveFigure(const wchar_t *pWcsFileNameWithPath=nullptr) const
Save the value of the Figure Property as a .fig file. If nullptr, open filedialog on the GUI to speci...
virtual bool IsValidValue(Base::CFLString< wchar_t > flstrValue) const
Indicates whether the string in the parameter is a figure available on that object.
virtual ~CGUIPropertyItemFigure()
Default destructor.
virtual bool SetOrigValue(const Base::CFLString< wchar_t > &strValue) override
Sets the original value of this.
virtual EAvailableFigureDeclType GetAvailableFigureDeclType() const
Get the available declaration type of the figure.
virtual CPropertyCallback * GetShowCallback() const
Show the figure to get the function callback pointer that runs when it appears in View.
virtual EAvailableFigureTemplateType GetAvailableFigureTemplateType() const
Get the available Figure variable data type(template type).
virtual bool SetAvailableFigureTemplateType(EAvailableFigureTemplateType eAvailableFigureTemplateType)
Specifies the available variable data type(template type) in Figure.
virtual bool SetLastOKValue(Base::CFLString< wchar_t > strValue)
Specifies the most recently determined figure value as OK.
virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType, FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const
Indicates whether the value EFigureDeclType and EFigureTemplateType in the parameter is a figure avai...
virtual const CResult MakeValidFigure(Base::CFLString< wchar_t > strValue, Base::CFLString< wchar_t > &strValidFigure, bool bMsgBox=false)
Convert and return the value of the parameter's Figure string to the Figure String available on the o...
virtual bool IsUnavailableContextMenuVisible() const
Returns whether the disabled context menu is hidden or shown.
CGUIPropertyItemFigure(const CGUIPropertyItemFigure &rhs)
Copy constructor.
virtual CPropertyCallback * GetDeleteCallback() const
Gets the function callback pointer that runs when the figure is deleted.
virtual bool IsValidValue(FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const
Indicates whether the value EFigureTemplateType in the parameter is a figure available for that objec...
CGUIPropertyItemFigure()
Default constructor.
virtual CGUIViewImageBase * GetSelectedView() const
Gets the selected image view from the linked image view list.
virtual bool SetConfirmCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Figure Specifies the function callback that runs when you confirm the changes.
virtual CPropertyCallback * GetConfirmCallback() const
Figure Gets the function callback pointer that runs when you determine the changes.
virtual bool IsInstantApplyModeFixed() const
If you allow the Instant Apply Mode property to be changed in the view, it is true,...
virtual bool IsInstantApplyMode() const
true if set to Instant Apply mode, false if not set.
virtual void SetInstantApplyMode(bool bSet, bool bFixMode)
Specifies the Instant Apply mode in Figure. Default false. If the Instant Apply mode is set to true,...
virtual bool SetDeleteCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Specifies the function callback that runs when the figure is deleted.
virtual Base::CFLString< wchar_t > GetLastOKValue() const
Get the most recently confirmed Figure value as OK.
virtual void SetView(const CGUIViewImageBase *pView)
Sets the image view.
virtual void ShowFigure(bool bShow, bool bCreate=true)
virtual bool GetFigureAutoHideMode() const
Returns automatic hiding of the Figure object displayed above the image view when the parent property...
virtual CPropertyCallback * GetCancelCallback() const
Figure Gets the function callback pointer that runs when you cancel the change.
virtual bool SetRealtimeEventCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Specifies the function callback that runs whenever changes occur, such as movement,...
CGUIPropertyItemViewListBase * GetViewList()
Gets the image view list pointer to which the figure will be specified.
virtual void SetFigureAutoHideMode(bool bAutoHide)
Specifies whether to automatically hide the Figure object displayed above the image view when the par...
virtual bool SetViewList(CGUIPropertyItemViewListBase *pPIIVL)
Sets the list of image views to which the figure will be specified.
virtual bool ShowCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Specify the function callback that runs when you show the figure to View.
virtual void Enable(bool bEnable) override
Enables or disables the object.
virtual EAvailableFigureTransformType GetAvailableFigureTransformType() const
Get the available Figure transform type.
virtual const CResult UpdateFigureObjectOnView()
virtual bool IsFigureVisible() const
Returns whether the object is visible or hidden in the image view.
virtual CPropertyCallback * GetRealtimeEventCallback() const
Gets the function callback pointer that runs whenever changes such as movement, rotation,...
CGUIPropertyItemFigure(CGUIPropertyItemViewListBase *pPIIVL)
Constructor.
virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType) const
Indicates whether the EFigureDeclType value of the parameter is a figure available for that object.
virtual bool IsValidValue(const FLImaging::Foundation::CFLFigure *pFlf) const
Indicates whether the CFLFigure object in the parameter is a figure available for that object.
virtual bool SetValue(Base::CFLString< wchar_t > strValue, bool bInvokeCallback=true) override
Sets the value for this.
virtual const CResult LoadFigure(const wchar_t *pWcsPath=nullptr)
Loads a file with the .fig extension.
virtual bool SetCancelCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Figure Specifies the function callback that runs when you cancel changes.
virtual void ShowUnavailableContextMenu(bool bShow=false)
Sets whether to hide or show the disabled context menu.
virtual bool SetAvailableFigureDeclType(EAvailableFigureDeclType eAvailableFigureDeclType)
Specifies the available declaration type of the figure.
View list property item base class.
Definition GUIPropertyItemViewListBase.h:28
A class of view base.
Definition GUIViewImageBase.h:43
A class of image view.
Definition GUIViewImage.h:319
EFigureDeclType
Declare type of figure.
Definition DefinitionsFigure.h:33
EFigureTemplateType
Template type of figure.
Definition DefinitionsFigure.h:302
EAvailableFigureDeclType
Sets the declaration type of the available figure. The function CGUIPropertyItemFigure::SetAvailableF...
Definition GUIPropertyItemFigure.h:33
@ EAvailableFigureDeclType_ComplexRegion
ComplexRegion.
Definition GUIPropertyItemFigure.h:120
@ EAvailableFigureDeclType_PointArray
PointArray.
Definition GUIPropertyItemFigure.h:160
@ EAvailableFigureDeclType_Frustum
CFLFrustum (3D)
Definition GUIPropertyItemFigure.h:201
@ EAvailableFigureDeclType_Default_3D
EAvailableFigureDeclType_Default_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:217
@ EAvailableFigureDeclType_Point3
CFLPoint3 (3D)
Definition GUIPropertyItemFigure.h:193
@ EAvailableFigureDeclType_Doughnut
Doughnut.
Definition GUIPropertyItemFigure.h:136
@ EAvailableFigureDeclType_Circle
Circle.
Definition GUIPropertyItemFigure.h:72
@ EAvailableFigureDeclType_BezierQuarticCurve
BezierQuarticCurve.
Definition GUIPropertyItemFigure.h:112
@ EAvailableFigureDeclType_BezierCubicCurve
BezierCubicCurve.
Definition GUIPropertyItemFigure.h:104
@ EAvailableFigureDeclType_Array
FigureArray.
Definition GUIPropertyItemFigure.h:128
@ EAvailableFigureDeclType_Ellipse
Ellipse.
Definition GUIPropertyItemFigure.h:80
@ EAvailableFigureDeclType_Quad
Quad.
Definition GUIPropertyItemFigure.h:64
@ EAvailableFigureDeclType_Text
Text.
Definition GUIPropertyItemFigure.h:168
@ EAvailableFigureDeclType_All
All values are valid for all Figure DeclType.
Definition GUIPropertyItemFigure.h:176
@ EAvailableFigureDeclType_Rect
Rect.
Definition GUIPropertyItemFigure.h:56
@ EAvailableFigureDeclType_CubicSpline
CubicSpline.
Definition GUIPropertyItemFigure.h:88
@ EAvailableFigureDeclType_All_3D
EAvailableFigureDeclType_All_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:209
@ EAvailableFigureDeclType_BezierQuadraticCurve
BezierQuadraticCurve.
Definition GUIPropertyItemFigure.h:96
@ EAvailableFigureDeclType_Region
Region.
Definition GUIPropertyItemFigure.h:144
@ EAvailableFigureDeclType_Line
Line.
Definition GUIPropertyItemFigure.h:48
@ EAvailableFigureDeclType_RoundRect
RoundRect.
Definition GUIPropertyItemFigure.h:152
@ EAvailableFigureDeclType_Default
EAvailableFigureDeclType_Default includes all Figure DeclTypes except for 3D objects and Text.
Definition GUIPropertyItemFigure.h:184
@ EAvailableFigureDeclType_Point
Point.
Definition GUIPropertyItemFigure.h:40
EAvailableFigureTemplateType
Sets the template type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFigu...
Definition GUIPropertyItemFigure.h:258
@ EAvailableFigureTemplateType_Mixed
Mixed.
Definition GUIPropertyItemFigure.h:297
@ EAvailableFigureTemplateType_Default
Default.
Definition GUIPropertyItemFigure.h:313
@ EAvailableFigureTemplateType_All
All template type.
Definition GUIPropertyItemFigure.h:305
@ EAvailableFigureTemplateType_Float
Float.
Definition GUIPropertyItemFigure.h:281
@ EAvailableFigureTemplateType_Double
Double.
Definition GUIPropertyItemFigure.h:289
@ EAvailableFigureTemplateType_Int64
Int64.
Definition GUIPropertyItemFigure.h:273
@ EAvailableFigureTemplateType_Int32
Int32.
Definition GUIPropertyItemFigure.h:265
EAvailableFigureTransformType
Sets the transform type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFig...
Definition GUIPropertyItemFigure.h:354
@ EAvailableFigureTransformType_Inflate
Inflate (Not supported yet)
Definition GUIPropertyItemFigure.h:380
@ EAvailableFigureTransformType_Warp
A function to warp.
Definition GUIPropertyItemFigure.h:413
@ EAvailableFigureTransformType_All
All transform type.
Definition GUIPropertyItemFigure.h:421
@ EAvailableFigureTransformType_Reduce
The operation to approximate a Region and PointArray to reduce the number of points.
Definition GUIPropertyItemFigure.h:397
@ EAvailableFigureTransformType_Split
A function to split a Rect to FigureArray.
Definition GUIPropertyItemFigure.h:405
@ EAvailableFigureTransformType_None
None.
Definition GUIPropertyItemFigure.h:361
@ EAvailableFigureTransformType_Default
Default.
Definition GUIPropertyItemFigure.h:429
@ EAvailableFigureTransformType_Rotate
Rotate.
Definition GUIPropertyItemFigure.h:369
@ EAvailableFigureTransformType_Scale
Scale (Not supported yet)
Definition GUIPropertyItemFigure.h:388