ACF $AcfVersion:0$
TVisualObjects.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// ACF includes
6#include <imod/TModelWrap.h>
7#include <iview/CImageShape.h>
8
9
10namespace iview
11{
12
13
14// helper template for point shapes
15
16template<class Object, class Shape>
17struct TPointVisualObject : public Shape
18{
19 typedef Shape BaseClass;
20
21 TPointVisualObject(bool editable = false);
22
24
26};
27
28
29template<class Object, class Shape>
31{
32 model.SetPtr(new PositionModel);
33
34 BaseClass::SetEditablePosition(editable);
35
36 model->AttachObserver(this);
37}
38
39
40
41// helper template for circle shapes
42
43template<class Object, class Shape>
44struct TVisualObject: public Shape
45{
46 typedef Shape BaseClass;
47
48 TVisualObject(bool editable = false);
49
51
53};
54
55
56template<class Object, class Shape>
58{
59 model.SetPtr(new PositionModel);
60
61 BaseClass::SetEditablePosition(editable);
62 BaseClass::SetEditableRadius(editable);
63
64 model->AttachObserver(this);
65}
66
67
68// helper template for image shapes
69
70template<class Object, class BitmapShape = iview::CImageShape>
80
81
82template<class Object, class BitmapShape>
84{
85 model.SetPtr(new ImageModel);
86 if (imagePtr != NULL){
87 model->SetBaseObject(*imagePtr);
88 }
89
90 shape.SetPtr(new BitmapShape);
91
92 model->AttachObserver(shape.GetPtr());
93}
94
95
96} // namespace iview
97
98
This model wrapper provides a simple connection between a concrete istd::IChangeable implementation a...
Definition TModelWrap.h:24
Pointer wrapper providing automatic deleting pointed object during destruction.
Definition TDelPtr.h:21
#define NULL
Definition istd.h:74
In this library is defined 2D view concept and standard visualisation objects.
TBitmapVisualObject(const Object *imagePtr=NULL)
istd::TDelPtr< BitmapShape > shape
istd::TDelPtr< ImageModel > model
imod::TModelWrap< Object > ImageModel
TPointVisualObject(bool editable=false)
istd::TDelPtr< PositionModel > model
imod::TModelWrap< Object > PositionModel
imod::TModelWrap< Object > PositionModel
istd::TDelPtr< PositionModel > model
TVisualObject(bool editable=false)