FLImaging 6.9.12.2
GUIPropertyItemFigure.h
1#pragma once
9
10#include "GUIPropertyItemBase.h"
11#include "DefinitionsGUI.h"
12
13#include <future>
14#include <deque>
15
17namespace FLImaging
18{
20 namespace GUI
21 {
24
33 {
44
55
66
77
88
99
110
121
132
143
154
165
176
187
198
209
220
231
239
247
248
259
270
281
292
303
314
322
330 };
331
333 {
334 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
335 }
336
338 {
339 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
340 }
341
343 {
344 return a = a | b;
345 }
346
348 {
349 return a = a & b;
350 }
351
353 {
354 return static_cast<EAvailableFigureDeclType>(~static_cast<int64_t>(a));
355 }
356
357 inline bool operator!(EAvailableFigureDeclType a)
358 {
359 return static_cast<bool>(!static_cast<int64_t>(a));
360 }
361
370 {
378
386
394
402
410
418
426 };
427
429 {
430 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
431 }
432
434 {
435 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
436 }
437
439 {
440 return a = a | b;
441 }
442
444 {
445 return a = a & b;
446 }
447
449 {
450 return static_cast<EAvailableFigureTemplateType>(~static_cast<int64_t>(a));
451 }
452
453 inline bool operator!(EAvailableFigureTemplateType a)
454 {
455 return static_cast<bool>(!static_cast<int64_t>(a));
456 }
457
466 {
474
482
484 // Not supported yet
485
493
502
510
518
526
534
542 };
543
545 {
546 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
547 }
548
550 {
551 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
552 }
553
555 {
556 return a = a | b;
557 }
558
560 {
561 return a = a & b;
562 }
563
565 {
566 return static_cast<EAvailableFigureTransformType>(~static_cast<int64_t>(a));
567 }
568
569 inline bool operator!(EAvailableFigureTransformType a)
570 {
571 return static_cast<bool>(!static_cast<int64_t>(a));
572 }
573
582 {
583 public:
591
599
611
619
633
645
657
670 virtual bool SetAvailableFigureDeclType(EAvailableFigureDeclType eAvailableFigureDeclType);
671
683
696 virtual bool SetAvailableFigureTemplateType(EAvailableFigureTemplateType eAvailableFigureTemplateType);
697
709
722 virtual bool SetAvailableFigureTransformType(EAvailableFigureTransformType eAvailableFigureTransformType);
723
735
748 virtual bool IsValidValue(Base::CFLString<wchar_t> flstrValue) const;
749
762 virtual bool IsValidValue(const FLImaging::Foundation::CFLFigure* pFlf) const;
763
781
794 virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType) const;
795
808 virtual bool IsValidValue(FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const;
809
829 virtual const CResult MakeValidFigure(Base::CFLString<wchar_t> strValue, Base::CFLString<wchar_t>& strValidFigure, bool bMsgBox = false);
830
844
856
871 virtual bool SetRealtimeEventCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
872
883 virtual CPropertyCallback* GetRealtimeEventCallback() const;
884
899 virtual bool SetShowCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
900
911 virtual CPropertyCallback* GetShowCallback() const;
912
927 virtual bool SetConfirmCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
928
939 virtual CPropertyCallback* GetConfirmCallback() const;
940
955 virtual bool SetCancelCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
956
967 virtual CPropertyCallback* GetCancelCallback() const;
968
983 virtual bool SetDeleteCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
984
995 virtual CPropertyCallback* GetDeleteCallback() const;
996
1007 virtual void SetInstantApplyMode(bool bSet, bool bFixMode);
1008
1017 virtual bool IsInstantApplyMode() const;
1018
1027 virtual bool IsInstantApplyModeFixed() const;
1028
1041 virtual const CResult LoadFigure(const wchar_t* pWcsPath = nullptr);
1042
1055 virtual const CResult SaveFigure(const wchar_t* pWcsFileNameWithPath = nullptr) const;
1056
1065 virtual void SetFigureAutoHideMode(bool bAutoHide);
1066
1075 virtual bool GetFigureAutoHideMode() const;
1076
1087 virtual void ShowFigure(bool bShow, bool bCreate = true);
1088
1097 virtual bool IsFigureVisible() const;
1098
1107 virtual void SetView(const CGUIViewImageBase* pView);
1108
1132
1142 virtual void ShowUnavailableContextMenu(bool bShow = false);
1143
1154
1164 virtual void EnableValueEdit(bool bEnable);
1165
1175 virtual bool IsValueEditEnabled() const;
1176
1177 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
1178 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
1179 virtual void Enable(bool bEnable) override;
1180
1181 protected:
1182 void InternalSetInstantApplyMode(bool bSet, bool bFixMode);
1183 virtual bool GetValidFigureType(Base::CFLString<wchar_t>& strValue);
1184 virtual const CResult CreateFigure(const Foundation::CFLFigure* pFlf, Foundation::EFigureTemplateType eTemplateType, Foundation::CFLFigure** ppFlfOut) const;
1185 Foundation::CFLFigure* GetValidFigure(const Foundation::CFLFigure* pFlf) const;
1186 const CResult InitializeThread();
1187 bool IsThreadInitialized();
1188 static void RunThread(CGUIPropertyItemFigure* pFigureProperty, std::future<void>** pContext);
1189
1190 public:
1191 const CResult TerminateThread();
1192
1193 enum ECallbackType
1194 {
1195 ECallbackType_None = 0,
1196 ECallbackType_Confirm,
1197 ECallbackType_Delete,
1198 ECallbackType_Cancel,
1199 ECallbackType_RealtimeEvent,
1200 ECallbackType_Show,
1201 };
1202
1203 protected:
1204 Base::CFLString<wchar_t> m_strLastOKValue;
1206 EAvailableFigureDeclType m_eAvailableFigureDeclType;
1207 EAvailableFigureTemplateType m_eAvailableFigureTemplateType;
1208 EAvailableFigureTransformType m_eAvailableFigureTransformType;
1209
1210 CPropertyCallback* m_pRealtimeCallback;
1211 bool m_bRealtimeCallbackAutoDestroy;
1212
1213 CPropertyCallback* m_pShowCallback;
1214 bool m_bShowCallbackAutoDestroy;
1215
1216 CPropertyCallback* m_pConfirmCallback;
1217 bool m_bConfirmCallbackAutoDestroy;
1218
1219 CPropertyCallback* m_pCancelCallback;
1220 bool m_bCancelCallbackAutoDestroy;
1221
1222 CPropertyCallback* m_pDeleteCallback;
1223 bool m_bDeleteCallbackAutoDestroy;
1224
1225 std::deque<Base::CFLString<wchar_t>>& m_deqProcedureParameterString;
1226 std::future<void>* m_pProcedureThread;
1227
1228 volatile bool m_bThreadRunning;
1229 volatile bool m_bThreadInitialized;
1230 volatile bool m_bThreadTerminated;
1231
1232 CGUIViewImageBase* m_pView;
1233
1234 bool m_bEnableValueEdit;
1235 bool m_bEnableInstantApplyMode;
1236 bool m_bFixInstantApplyMode;
1237 bool m_bFigureAutoHideMode;
1238 bool m_bShowUnavailableContextMenu;
1239
1240 friend class CGUIViewImage;
1241 };
1242 }
1243}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1605
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...
virtual bool IsValueEditEnabled() const
Returns whether the value field is currently editable.
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 bool SetShowCallback(CPropertyCallback *pCallback, bool bAutoDestroy=true)
Specify the function callback that runs when you show the figure to View.
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 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 void EnableValueEdit(bool bEnable)
Sets whether the value field is editable, independently of the item's enabled or read-only state.
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:357
Definition D2DObject.h:12
EAvailableFigureDeclType
Sets the declaration type of the available figure. The function CGUIPropertyItemFigure::SetAvailableF...
Definition GUIPropertyItemFigure.h:33
@ EAvailableFigureDeclType_ComplexRegion
Complex Region.
Definition GUIPropertyItemFigure.h:153
@ EAvailableFigureDeclType_PointArray
Point Array.
Definition GUIPropertyItemFigure.h:208
@ EAvailableFigureDeclType_QuadrilateralSolid3
QuadrilateralSolid3.
Definition GUIPropertyItemFigure.h:313
@ EAvailableFigureDeclType_Default_3D
EAvailableFigureDeclType_Default_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:329
@ EAvailableFigureDeclType_Point3
3D Point
Definition GUIPropertyItemFigure.h:258
@ EAvailableFigureDeclType_Triangle3
3D Triangle
Definition GUIPropertyItemFigure.h:280
@ EAvailableFigureDeclType_Doughnut
Doughnut.
Definition GUIPropertyItemFigure.h:175
@ EAvailableFigureDeclType_Circle
Circle.
Definition GUIPropertyItemFigure.h:87
@ EAvailableFigureDeclType_BezierQuarticCurve
Quartic bezier curve.
Definition GUIPropertyItemFigure.h:142
@ EAvailableFigureDeclType_BezierCubicCurve
Cubic bezier curve.
Definition GUIPropertyItemFigure.h:131
@ EAvailableFigureDeclType_Array
Figure Array.
Definition GUIPropertyItemFigure.h:164
@ EAvailableFigureDeclType_Quad3
3D Quadrangle
Definition GUIPropertyItemFigure.h:291
@ EAvailableFigureDeclType_Ellipse
Ellipse.
Definition GUIPropertyItemFigure.h:98
@ EAvailableFigureDeclType_Quad
Quadrangle.
Definition GUIPropertyItemFigure.h:76
@ EAvailableFigureDeclType_Text
A figure that displays a string at a specific coordinate, typically used for annotations.
Definition GUIPropertyItemFigure.h:230
@ EAvailableFigureDeclType_All
All values are valid for all Figure DeclType.
Definition GUIPropertyItemFigure.h:238
@ EAvailableFigureDeclType_Rect
Rectangle.
Definition GUIPropertyItemFigure.h:65
@ EAvailableFigureDeclType_CubicSpline
Cubic spline.
Definition GUIPropertyItemFigure.h:109
@ EAvailableFigureDeclType_Triangle
2D Triangle
Definition GUIPropertyItemFigure.h:219
@ EAvailableFigureDeclType_TriangularSolid3
TriangularSolid3.
Definition GUIPropertyItemFigure.h:302
@ EAvailableFigureDeclType_All_3D
EAvailableFigureDeclType_All_3D includes all 3D objects and Rect.
Definition GUIPropertyItemFigure.h:321
@ EAvailableFigureDeclType_BezierQuadraticCurve
Quadratic bezier curve.
Definition GUIPropertyItemFigure.h:120
@ EAvailableFigureDeclType_Region
Region.
Definition GUIPropertyItemFigure.h:186
@ EAvailableFigureDeclType_Line
Line.
Definition GUIPropertyItemFigure.h:54
@ EAvailableFigureDeclType_RoundRect
Round Rectangle.
Definition GUIPropertyItemFigure.h:197
@ EAvailableFigureDeclType_Default
EAvailableFigureDeclType_Default includes all Figure DeclTypes except for 3D objects and Text.
Definition GUIPropertyItemFigure.h:246
@ EAvailableFigureDeclType_Frustum3
Frustum3.
Definition GUIPropertyItemFigure.h:269
@ EAvailableFigureDeclType_Point
Point.
Definition GUIPropertyItemFigure.h:43
EAvailableFigureTemplateType
Sets the template type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFigu...
Definition GUIPropertyItemFigure.h:370
@ EAvailableFigureTemplateType_Mixed
Mixed.
Definition GUIPropertyItemFigure.h:409
@ EAvailableFigureTemplateType_Default
Default.
Definition GUIPropertyItemFigure.h:425
@ EAvailableFigureTemplateType_All
All template type.
Definition GUIPropertyItemFigure.h:417
@ EAvailableFigureTemplateType_Float
Float.
Definition GUIPropertyItemFigure.h:393
@ EAvailableFigureTemplateType_Double
Double.
Definition GUIPropertyItemFigure.h:401
@ EAvailableFigureTemplateType_Int64
Int64.
Definition GUIPropertyItemFigure.h:385
@ EAvailableFigureTemplateType_Int32
Int32.
Definition GUIPropertyItemFigure.h:377
EAvailableFigureTransformType
Sets the transform type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFig...
Definition GUIPropertyItemFigure.h:466
@ EAvailableFigureTransformType_Inflate
Inflate (Not supported yet)
Definition GUIPropertyItemFigure.h:492
@ EAvailableFigureTransformType_Warp
A function to warp.
Definition GUIPropertyItemFigure.h:525
@ EAvailableFigureTransformType_All
All transform type.
Definition GUIPropertyItemFigure.h:533
@ EAvailableFigureTransformType_Reduce
The operation to approximate a Region and PointArray to reduce the number of points.
Definition GUIPropertyItemFigure.h:509
@ EAvailableFigureTransformType_Split
A function to split a Rect to FigureArray.
Definition GUIPropertyItemFigure.h:517
@ EAvailableFigureTransformType_None
None.
Definition GUIPropertyItemFigure.h:473
@ EAvailableFigureTransformType_Default
Default.
Definition GUIPropertyItemFigure.h:541
@ EAvailableFigureTransformType_Rotate
Rotate.
Definition GUIPropertyItemFigure.h:481
@ EAvailableFigureTransformType_Scale
Scale (Not supported yet)
Definition GUIPropertyItemFigure.h:500