FLImaging 7.6.11.1
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
240
249
258
267
276
285
294
302
310
311
322
333
344
355
366
377
388
399
410
421
429
437 };
438
440 {
441 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
442 }
443
445 {
446 return static_cast<EAvailableFigureDeclType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
447 }
448
450 {
451 return a = a | b;
452 }
453
455 {
456 return a = a & b;
457 }
458
460 {
461 return static_cast<EAvailableFigureDeclType>(~static_cast<int64_t>(a));
462 }
463
464 inline bool operator!(EAvailableFigureDeclType a)
465 {
466 return static_cast<bool>(!static_cast<int64_t>(a));
467 }
468
477 {
485
493
501
509
517
525
533 };
534
536 {
537 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
538 }
539
541 {
542 return static_cast<EAvailableFigureTemplateType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
543 }
544
546 {
547 return a = a | b;
548 }
549
551 {
552 return a = a & b;
553 }
554
556 {
557 return static_cast<EAvailableFigureTemplateType>(~static_cast<int64_t>(a));
558 }
559
560 inline bool operator!(EAvailableFigureTemplateType a)
561 {
562 return static_cast<bool>(!static_cast<int64_t>(a));
563 }
564
573 {
581
589
591 // Not supported yet
592
600
608
617
625
633
641
649
657 };
658
660 {
661 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) | static_cast<int64_t>(b));
662 }
663
665 {
666 return static_cast<EAvailableFigureTransformType>(static_cast<int64_t>(a) & static_cast<int64_t>(b));
667 }
668
670 {
671 return a = a | b;
672 }
673
675 {
676 return a = a & b;
677 }
678
680 {
681 return static_cast<EAvailableFigureTransformType>(~static_cast<int64_t>(a));
682 }
683
684 inline bool operator!(EAvailableFigureTransformType a)
685 {
686 return static_cast<bool>(!static_cast<int64_t>(a));
687 }
688
697 {
698 public:
706
714
726
734
748
760
772
785 virtual bool SetAvailableFigureDeclType(EAvailableFigureDeclType eAvailableFigureDeclType);
786
798
811 virtual bool SetAvailableFigureTemplateType(EAvailableFigureTemplateType eAvailableFigureTemplateType);
812
824
837 virtual bool SetAvailableFigureTransformType(EAvailableFigureTransformType eAvailableFigureTransformType);
838
850
863 virtual bool IsValidValue(Base::CFLString<wchar_t> flstrValue) const;
864
877 virtual bool IsValidValue(const FLImaging::Foundation::CFLFigure* pFlf) const;
878
896
909 virtual bool IsValidValue(FLImaging::Foundation::EFigureDeclType eFigureDeclType) const;
910
923 virtual bool IsValidValue(FLImaging::Foundation::EFigureTemplateType eFigureTemplateType) const;
924
944 virtual const CResult MakeValidFigure(Base::CFLString<wchar_t> strValue, Base::CFLString<wchar_t>& strValidFigure, bool bMsgBox = false);
945
959
971
986 virtual bool SetRealtimeEventCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
987
999
1014 virtual bool SetShowCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
1015
1027
1042 virtual bool SetConfirmCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
1043
1055
1070 virtual bool SetCancelCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
1071
1083
1098 virtual bool SetDeleteCallback(CPropertyCallback* pCallback, bool bAutoDestroy = true);
1099
1111
1122 virtual void SetInstantApplyMode(bool bSet, bool bFixMode);
1123
1132 virtual bool IsInstantApplyMode() const;
1133
1142 virtual bool IsInstantApplyModeFixed() const;
1143
1156 virtual const CResult LoadFigure(const wchar_t* pWcsPath = nullptr);
1157
1170 virtual const CResult SaveFigure(const wchar_t* pWcsFileNameWithPath = nullptr) const;
1171
1180 virtual void SetFigureAutoHideMode(bool bAutoHide);
1181
1190 virtual bool GetFigureAutoHideMode() const;
1191
1202 virtual void ShowFigure(bool bShow, bool bCreate = true);
1203
1212 virtual bool IsFigureVisible() const;
1213
1222 virtual void SetView(const CGUIViewImageBase* pView);
1223
1247
1257 virtual void ShowUnavailableContextMenu(bool bShow = false);
1258
1269
1279 virtual void EnableValueEdit(bool bEnable);
1280
1290 virtual bool IsValueEditEnabled() const;
1291
1292 virtual bool SetOrigValue(const Base::CFLString<wchar_t>& strValue) override;
1293 virtual bool SetValue(Base::CFLString<wchar_t> strValue, bool bInvokeCallback = true) override;
1294 virtual void Enable(bool bEnable) override;
1295
1296 protected:
1297 void InternalSetInstantApplyMode(bool bSet, bool bFixMode);
1298 virtual bool GetValidFigureType(Base::CFLString<wchar_t>& strValue);
1299 virtual const CResult CreateFigure(const Foundation::CFLFigure* pFlf, Foundation::EFigureTemplateType eTemplateType, Foundation::CFLFigure** ppFlfOut) const;
1300 Foundation::CFLFigure* GetValidFigure(const Foundation::CFLFigure* pFlf) const;
1301 const CResult InitializeThread();
1302 bool IsThreadInitialized();
1303 static void RunThread(CGUIPropertyItemFigure* pFigureProperty, std::future<void>** pContext);
1304
1305 public:
1306 const CResult TerminateThread();
1307
1308 enum ECallbackType
1309 {
1310 ECallbackType_None = 0,
1311 ECallbackType_Confirm,
1312 ECallbackType_Delete,
1313 ECallbackType_Cancel,
1314 ECallbackType_RealtimeEvent,
1315 ECallbackType_Show,
1316 };
1317
1318 protected:
1319 Base::CFLString<wchar_t> m_strLastOKValue;
1321 EAvailableFigureDeclType m_eAvailableFigureDeclType;
1322 EAvailableFigureTemplateType m_eAvailableFigureTemplateType;
1323 EAvailableFigureTransformType m_eAvailableFigureTransformType;
1324
1325 CPropertyCallback* m_pRealtimeCallback;
1326 bool m_bRealtimeCallbackAutoDestroy;
1327
1328 CPropertyCallback* m_pShowCallback;
1329 bool m_bShowCallbackAutoDestroy;
1330
1331 CPropertyCallback* m_pConfirmCallback;
1332 bool m_bConfirmCallbackAutoDestroy;
1333
1334 CPropertyCallback* m_pCancelCallback;
1335 bool m_bCancelCallbackAutoDestroy;
1336
1337 CPropertyCallback* m_pDeleteCallback;
1338 bool m_bDeleteCallbackAutoDestroy;
1339
1340 std::deque<Base::CFLString<wchar_t>>& m_deqProcedureParameterString;
1341 std::future<void>* m_pProcedureThread;
1342
1343 volatile bool m_bThreadRunning;
1344 volatile bool m_bThreadInitialized;
1345 volatile bool m_bThreadTerminated;
1346
1347 CGUIViewImageBase* m_pView;
1348
1349 bool m_bEnableValueEdit;
1350 bool m_bEnableInstantApplyMode;
1351 bool m_bFixInstantApplyMode;
1352 bool m_bFigureAutoHideMode;
1353 bool m_bShowUnavailableContextMenu;
1354
1355 friend class CGUIViewImage;
1356 friend class CGUIView3DToolManagerROI;
1357 };
1358 }
1359}
Template type string class.
Definition FLString.h:34
FLImaging module execution result object.
Definition ResultsDef.h:1676
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:44
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:423
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_Circle_Segment
Circle Segment.
Definition GUIPropertyItemFigure.h:257
@ EAvailableFigureDeclType_QuadrilateralSolid3
QuadrilateralSolid3.
Definition GUIPropertyItemFigure.h:376
@ EAvailableFigureDeclType_Ellipse_Sector
Ellipse Sector.
Definition GUIPropertyItemFigure.h:275
@ EAvailableFigureDeclType_Default_3D
EAvailableFigureDeclType_Default_3D includes all 3D objects, Line, Rect and Circle.
Definition GUIPropertyItemFigure.h:436
@ EAvailableFigureDeclType_Point3
3D Point
Definition GUIPropertyItemFigure.h:321
@ EAvailableFigureDeclType_Triangle3
3D Triangle
Definition GUIPropertyItemFigure.h:343
@ 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_Ellipse_Segment
Ellipse Segment.
Definition GUIPropertyItemFigure.h:284
@ EAvailableFigureDeclType_Quad3
3D Quadrangle
Definition GUIPropertyItemFigure.h:354
@ 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_Circle_Arc
Circle Arc.
Definition GUIPropertyItemFigure.h:239
@ EAvailableFigureDeclType_All
All values are valid for all Figure DeclType.
Definition GUIPropertyItemFigure.h:301
@ EAvailableFigureDeclType_Doughnut_Sector
Doughnut Sector.
Definition GUIPropertyItemFigure.h:293
@ EAvailableFigureDeclType_Rect
Rectangle.
Definition GUIPropertyItemFigure.h:65
@ EAvailableFigureDeclType_Polyline3
Polyline3.
Definition GUIPropertyItemFigure.h:420
@ EAvailableFigureDeclType_Line3
Line3.
Definition GUIPropertyItemFigure.h:409
@ EAvailableFigureDeclType_Circle_Sector
Circle Sector.
Definition GUIPropertyItemFigure.h:248
@ EAvailableFigureDeclType_CubicSpline
Cubic spline.
Definition GUIPropertyItemFigure.h:109
@ EAvailableFigureDeclType_Triangle
2D Triangle
Definition GUIPropertyItemFigure.h:219
@ EAvailableFigureDeclType_TriangularSolid3
TriangularSolid3.
Definition GUIPropertyItemFigure.h:365
@ EAvailableFigureDeclType_Sphere3
Sphere3.
Definition GUIPropertyItemFigure.h:398
@ EAvailableFigureDeclType_All_3D
EAvailableFigureDeclType_All_3D includes all 3D objects, Line, Circle and Rect.
Definition GUIPropertyItemFigure.h:428
@ EAvailableFigureDeclType_BezierQuadraticCurve
Quadratic bezier curve.
Definition GUIPropertyItemFigure.h:120
@ EAvailableFigureDeclType_Region
Region.
Definition GUIPropertyItemFigure.h:186
@ EAvailableFigureDeclType_Line
Line.
Definition GUIPropertyItemFigure.h:54
@ EAvailableFigureDeclType_Ellipse_Arc
Ellipse Arc.
Definition GUIPropertyItemFigure.h:266
@ EAvailableFigureDeclType_RoundRect
Round Rectangle.
Definition GUIPropertyItemFigure.h:197
@ EAvailableFigureDeclType_Cone3
Cone3.
Definition GUIPropertyItemFigure.h:387
@ EAvailableFigureDeclType_Default
EAvailableFigureDeclType_Default includes all Figure DeclTypes except for 3D objects and Text.
Definition GUIPropertyItemFigure.h:309
@ EAvailableFigureDeclType_Frustum3
Frustum3.
Definition GUIPropertyItemFigure.h:332
@ EAvailableFigureDeclType_Point
Point.
Definition GUIPropertyItemFigure.h:43
EAvailableFigureTemplateType
Sets the template type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFigu...
Definition GUIPropertyItemFigure.h:477
@ EAvailableFigureTemplateType_Mixed
Mixed.
Definition GUIPropertyItemFigure.h:516
@ EAvailableFigureTemplateType_Default
Default.
Definition GUIPropertyItemFigure.h:532
@ EAvailableFigureTemplateType_All
All template type.
Definition GUIPropertyItemFigure.h:524
@ EAvailableFigureTemplateType_Float
Float.
Definition GUIPropertyItemFigure.h:500
@ EAvailableFigureTemplateType_Double
Double.
Definition GUIPropertyItemFigure.h:508
@ EAvailableFigureTemplateType_Int64
Int64.
Definition GUIPropertyItemFigure.h:492
@ EAvailableFigureTemplateType_Int32
Int32.
Definition GUIPropertyItemFigure.h:484
std::function< void(CGUIPropertyItemBase *, Base::CFLString< wchar_t > &, const Base::CFLString< wchar_t > &)> CPropertyCallback
Value-change callback invoked from within SetValue().
Definition GUIPropertyItemBase.h:193
EAvailableFigureTransformType
Sets the transform type of the available figure. The function CGUIPropertyItemFigure::SetAvailableFig...
Definition GUIPropertyItemFigure.h:573
@ EAvailableFigureTransformType_Inflate
Inflate (Not supported yet).
Definition GUIPropertyItemFigure.h:599
@ EAvailableFigureTransformType_Warp
A function to warp.
Definition GUIPropertyItemFigure.h:640
@ EAvailableFigureTransformType_Extend
Extend (Not supported yet).
Definition GUIPropertyItemFigure.h:607
@ EAvailableFigureTransformType_All
All transform type.
Definition GUIPropertyItemFigure.h:648
@ EAvailableFigureTransformType_Reduce
The operation to approximate a Region and PointArray to reduce the number of points.
Definition GUIPropertyItemFigure.h:624
@ EAvailableFigureTransformType_Split
A function to split a Rect to FigureArray.
Definition GUIPropertyItemFigure.h:632
@ EAvailableFigureTransformType_None
None.
Definition GUIPropertyItemFigure.h:580
@ EAvailableFigureTransformType_Default
Default.
Definition GUIPropertyItemFigure.h:656
@ EAvailableFigureTransformType_Rotate
Rotate.
Definition GUIPropertyItemFigure.h:588
@ EAvailableFigureTransformType_Scale
Scale (Not supported yet).
Definition GUIPropertyItemFigure.h:615