FLImaging 6.7.1.3
GUIPropertyItemFigure.h
1#pragma once
9
10#include "GUIPropertyItemBase.h"
11#include "GUIDefinitions.h"
12
13#include <future>
14#include <deque>
15
17namespace FLImaging
18{
20 namespace GUI
21 {
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
226
234
242
250 };
251
253 {
254 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
255 }
256
258 {
259 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
260 }
261
263 {
264 return a = a | b;
265 }
266
268 {
269 return a = a & b;
270 }
271
273 {
274 return static_cast<EAvailableFigureDeclType>(~static_cast<int64_t>(a));
275 }
276
277 inline bool operator!(EAvailableFigureDeclType a)
278 {
279 return static_cast<bool>(!static_cast<int64_t>(a));
280 }
281
290 {
298
306
314
322
330
338
346 };
347
349 {
350 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
351 }
352
354 {
355 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
356 }
357
359 {
360 return a = a | b;
361 }
362
364 {
365 return a = a & b;
366 }
367
369 {
370 return static_cast<EAvailableFigureTemplateType>(~static_cast<int64_t>(a));
371 }
372
373 inline bool operator!(EAvailableFigureTemplateType a)
374 {
375 return static_cast<bool>(!static_cast<int64_t>(a));
376 }
377
386 {
394
402
404 // Not supported yet
405
413
422
430
438
446
454
462 };
463
465 {
466 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
467 }
468
470 {
471 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
472 }
473
475 {
476 return a = a | b;
477 }
478
480 {
481 return a = a & b;
482 }
483
485 {
486 return static_cast<EAvailableFigureTransformType>(~static_cast<int64_t>(a));
487 }
488
489 inline bool operator!(EAvailableFigureTransformType a)
490 {
491 return static_cast<bool>(!static_cast<int64_t>(a));
492 }
493
502 {
503 public:
511
519
531
539
553
565
577
590 virtual bool SetAvailableFigureDeclType(EAvailableFigureDeclType eAvailableFigureDeclType);
591
603
616 virtual bool SetAvailableFigureTemplateType(EAvailableFigureTemplateType eAvailableFigureTemplateType);
617
629
642 virtual bool SetAvailableFigureTransformType(EAvailableFigureTransformType eAvailableFigureTransformType);
643
655
668 virtual bool IsValidValue(Base::CFLString<wchar_t> flstrValue) const;
669
682 virtual bool IsValidValue(const FLImaging::Foundation::CFLFigure* pFlf) const;
683
701
714 virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType) const;
715
728 virtual bool IsValidValue(FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const;
729
749 virtual const CResult MakeValidFigure(Base::CFLString<wchar_t> strValue, Base::CFLString<wchar_t>& strValidFigure, bool bMsgBox = false);
750
764
776
791 virtual bool SetRealtimeEventCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
792
803 virtual CPropertyCallback* GetRealtimeEventCallback() const;
804
819 virtual bool ShowCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
820
831 virtual CPropertyCallback* GetShowCallback() const;
832
847 virtual bool SetConfirmCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
848
859 virtual CPropertyCallback* GetConfirmCallback() const;
860
875 virtual bool SetCancelCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
876
887 virtual CPropertyCallback* GetCancelCallback() const;
888
903 virtual bool SetDeleteCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
904
915 virtual CPropertyCallback* GetDeleteCallback() const;
916
927 virtual void SetInstantApplyMode(bool bSet, bool bFixMode);
928
937 virtual bool IsInstantApplyMode() const;
938
947 virtual bool IsInstantApplyModeFixed() const;
948
961 virtual const CResult LoadFigure(const wchar_t* pWcsPath = nullptr);
962
975 virtual const CResult SaveFigure(const wchar_t* pWcsFileNameWithPath = nullptr) const;
976
985 virtual void SetFigureAutoHideMode(bool bAutoHide);
986
995 virtual bool GetFigureAutoHideMode() const;
996
1007 virtual void ShowFigure(bool bShow, bool bCreate = true);
1008
1017 virtual bool IsFigureVisible() const;
1018
1027 virtual void SetView(const CGUIViewImageBase* pView);
1028
1052
1062 virtual void ShowUnavailableContextMenu(bool bShow = false);
1063
1074
1075 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
1076 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
1077 virtual void Enable(bool bEnable) override;
1078
1079 protected:
1080 void InternalSetInstantApplyMode(bool bSet, bool bFixMode);
1081 virtual bool GetValidFigureType(Base::CFLString<wchar_t>& strValue);
1082 virtual const CResult CreateFigure(const Foundation::CFLFigure* pFlf, Foundation::EFigureTemplateType eTemplateType, Foundation::CFLFigure** ppFlfOut) const;
1083 Foundation::CFLFigure* GetValidFigure(const Foundation::CFLFigure* pFlf) const;
1084 const CResult InitializeThread();
1085 bool IsThreadInitialized();
1086 static void RunThread(CGUIPropertyItemFigure* pFigureProperty, std::future<void>** pContext);
1087
1088 public:
1089 const CResult TerminateThread();
1090
1091 enum ECallbackType
1092 {
1093 ECallbackType_None = 0,
1094 ECallbackType_Confirm,
1095 ECallbackType_Delete,
1096 ECallbackType_Cancel,
1097 ECallbackType_RealtimeEvent,
1098 ECallbackType_Show,
1099 };
1100
1101 protected:
1102 Base::CFLString<wchar_t> m_strLastOKValue;
1104 EAvailableFigureDeclType m_eAvailableFigureDeclType;
1105 EAvailableFigureTemplateType m_eAvailableFigureTemplateType;
1106 EAvailableFigureTransformType m_eAvailableFigureTransformType;
1107
1108 CPropertyCallback* m_pRealtimeCallback;
1109 bool m_bRealtimeCallbackAutoDestroy;
1110
1111 CPropertyCallback* m_pShowCallback;
1112 bool m_bShowCallbackAutoDestroy;
1113
1114 CPropertyCallback* m_pConfirmCallback;
1115 bool m_bConfirmCallbackAutoDestroy;
1116
1117 CPropertyCallback* m_pCancelCallback;
1118 bool m_bCancelCallbackAutoDestroy;
1119
1120 CPropertyCallback* m_pDeleteCallback;
1121 bool m_bDeleteCallbackAutoDestroy;
1122
1123 std::deque<Base::CFLString<wchar_t>>& m_deqProcedureParameterString;
1124 std::future<void>* m_pProcedureThread;
1125
1126 volatile bool m_bThreadRunning;
1127 volatile bool m_bThreadInitialized;
1128 volatile bool m_bThreadTerminated;
1129
1130 CGUIViewImageBase* m_pView;
1131
1132 bool m_bEnableInstantApplyMode;
1133 bool m_bFixInstantApplyMode;
1134 bool m_bFigureAutoHideMode;
1135 bool m_bShowUnavailableContextMenu;
1136
1137 friend class CGUIViewImage;
1138 };
1139 }
1140}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1596
A base class of classes representing figures.
Definition FLFigure.h:27
CGUIPropertyItemBase()
Default constructor.
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:335
Definition D2DObject.h:12
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_QuadrilateralSolid3
CFLQuadrilateralSolid3 (3D)
Definition GUIPropertyItemFigure.h:233
@ EAvailableFigureDeclType_Default_3D
EAvailableFigureDeclType_Default_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:249
@ EAvailableFigureDeclType_Point3
CFLPoint3 (3D)
Definition GUIPropertyItemFigure.h:193
@ EAvailableFigureDeclType_Triangle3
CFLTriangle3 (3D)
Definition GUIPropertyItemFigure.h:209
@ 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_Quad3
CFLQuad3 (3D)
Definition GUIPropertyItemFigure.h:217
@ 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_TriangularSolid3
CFLTriangularSolid3 (3D)
Definition GUIPropertyItemFigure.h:225
@ EAvailableFigureDeclType_All_3D
EAvailableFigureDeclType_All_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:241
@ 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_Frustum3
CFLFrustum3 (3D)
Definition GUIPropertyItemFigure.h:201
@ EAvailableFigureDeclType_Point
Point.
Definition GUIPropertyItemFigure.h:40
EAvailableFigureTemplateType
Sets the template type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFigu...
Definition GUIPropertyItemFigure.h:290
@ EAvailableFigureTemplateType_Mixed
Mixed.
Definition GUIPropertyItemFigure.h:329
@ EAvailableFigureTemplateType_Default
Default.
Definition GUIPropertyItemFigure.h:345
@ EAvailableFigureTemplateType_All
All template type.
Definition GUIPropertyItemFigure.h:337
@ EAvailableFigureTemplateType_Float
Float.
Definition GUIPropertyItemFigure.h:313
@ EAvailableFigureTemplateType_Double
Double.
Definition GUIPropertyItemFigure.h:321
@ EAvailableFigureTemplateType_Int64
Int64.
Definition GUIPropertyItemFigure.h:305
@ EAvailableFigureTemplateType_Int32
Int32.
Definition GUIPropertyItemFigure.h:297
EAvailableFigureTransformType
Sets the transform type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFig...
Definition GUIPropertyItemFigure.h:386
@ EAvailableFigureTransformType_Inflate
Inflate (Not supported yet)
Definition GUIPropertyItemFigure.h:412
@ EAvailableFigureTransformType_Warp
A function to warp.
Definition GUIPropertyItemFigure.h:445
@ EAvailableFigureTransformType_All
All transform type.
Definition GUIPropertyItemFigure.h:453
@ EAvailableFigureTransformType_Reduce
The operation to approximate a Region and PointArray to reduce the number of points.
Definition GUIPropertyItemFigure.h:429
@ EAvailableFigureTransformType_Split
A function to split a Rect to FigureArray.
Definition GUIPropertyItemFigure.h:437
@ EAvailableFigureTransformType_None
None.
Definition GUIPropertyItemFigure.h:393
@ EAvailableFigureTransformType_Default
Default.
Definition GUIPropertyItemFigure.h:461
@ EAvailableFigureTransformType_Rotate
Rotate.
Definition GUIPropertyItemFigure.h:401
@ EAvailableFigureTransformType_Scale
Scale (Not supported yet)
Definition GUIPropertyItemFigure.h:420