-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathitomPlotHandle.h
108 lines (91 loc) · 3.47 KB
/
itomPlotHandle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
/* ********************************************************************
itom software
URL: http://www.uni-stuttgart.de/ito
Copyright (C) 2020, Institut für Technische Optik (ITO),
Universität Stuttgart, Germany
This file is part of itom and its software development toolkit (SDK).
itom is free software; you can redistribute it and/or modify it
under the terms of the GNU Library General Public Licence as published by
the Free Software Foundation; either version 2 of the Licence, or (at
your option) any later version.
In addition, as a special exception, the Institut für Technische
Optik (ITO) gives you certain additional rights.
These rights are described in the ITO LGPL Exception version 1.0,
which can be found in the file LGPL_EXCEPTION.txt in this package.
itom is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
General Public Licence for more details.
You should have received a copy of the GNU Library General Public License
along with itom. If not, see <http://www.gnu.org/licenses/>.
*********************************************************************** */
#ifndef ITOMPLOTHANDLE_H
#define ITOMPLOTHANDLE_H
#ifdef __APPLE__
extern "C++" {
#endif
/* includes */
#include "commonGlobal.h"
#include <string>
namespace ito
{
//----------------------------------------------------------------------------------------------------------------------------------
/** @class ItomPlotHandle
* @brief class for a interval type containing the plot handle / unique id and name.
*
* This class is used to allow a conversion between Py_uiItem and C++/Qt.
*/
class ItomPlotHandle
{
public:
ItomPlotHandle()
{
m_objectID = 0;
m_pObjName = "";
m_pWidgetClassName = "";
}
explicit ItomPlotHandle(const char* objName, const char* widgetClassName, const unsigned int objectID)
{
m_objectID = objectID;
if (objName)
{
m_pObjName = std::string(objName);
}
else
{
m_pObjName = "";
}
if (widgetClassName)
{
m_pWidgetClassName = std::string(widgetClassName);
}
else
{
m_pWidgetClassName = "";
}
}
ItomPlotHandle(const ItomPlotHandle &rhs)
{
m_objectID = rhs.m_objectID;
m_pObjName = rhs.m_pObjName;
m_pWidgetClassName = rhs.m_pWidgetClassName;
}
~ItomPlotHandle()
{
m_pObjName = "";
m_pWidgetClassName = "";
m_objectID = 0;
}
inline std::string getObjName() const { return m_pObjName; }
inline std::string getWidgetClassName() const { return m_pWidgetClassName; }
inline unsigned int getObjectID() const { return m_objectID; }
private:
std::string m_pObjName;
std::string m_pWidgetClassName;
unsigned int m_objectID;
};
} //end namespace ito
#ifdef __APPLE__
}
#endif
#endif