SMTK
@SMTK_VERSION@
Simulation Modeling Tool Kit
smtk
simulation
UserData.h
1
//=========================================================================
2
// Copyright (c) Kitware, Inc.
3
// All rights reserved.
4
// See LICENSE.txt for details.
5
//
6
// This software is distributed WITHOUT ANY WARRANTY; without even
7
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8
// PURPOSE. See the above copyright notice for more information.
9
//=========================================================================
10
// .NAME smtkAttribute.h - Represents a standalone piece of simulation information
11
// .SECTION Description
12
// .SECTION See Also
13
14
#ifndef smtk_simulation_UserData_h
15
#define smtk_simulation_UserData_h
16
17
#include "smtk/CoreExports.h"
18
#include "
smtk/PublicPointerDefs.h
"
19
20
namespace
smtk
21
{
22
namespace
simulation
23
{
24
//derive from this class to create custom user data.
25
class
SMTKCORE_EXPORT
UserData
26
{
27
public
:
28
static
smtk::simulation::UserDataPtr
New()
29
{
30
return
smtk::simulation::UserDataPtr
(
new
UserData
());
31
}
32
33
virtual
~
UserData
();
34
35
protected
:
36
UserData
();
37
};
38
39
// User Data Representing Integers
40
class
SMTKCORE_EXPORT
UserDataInt
:
public
UserData
41
{
42
public
:
43
static
smtk::simulation::UserDataPtr
New()
44
{
45
return
smtk::simulation::UserDataPtr
(
new
UserDataInt
());
46
}
47
48
int
value()
const
{
return
m_value; }
49
50
void
setValue(
int
val) { m_value = val; }
51
52
~
UserDataInt
()
override
;
53
54
protected
:
55
UserDataInt
();
56
int
m_value{ 0 };
57
};
58
59
// User Data Representing Doubles
60
class
SMTKCORE_EXPORT
UserDataDouble
:
public
UserData
61
{
62
public
:
63
static
smtk::simulation::UserDataPtr
New()
64
{
65
return
smtk::simulation::UserDataPtr
(
new
UserDataDouble
());
66
}
67
68
double
value()
const
{
return
m_value; }
69
70
void
setValue(
double
val) { m_value = val; }
71
72
~
UserDataDouble
()
override
;
73
74
protected
:
75
UserDataDouble
();
76
double
m_value{ 0.0 };
77
};
78
79
// User Data Representing Strings
80
class
SMTKCORE_EXPORT
UserDataString
:
public
UserData
81
{
82
public
:
83
static
smtk::simulation::UserDataPtr
New()
84
{
85
return
smtk::simulation::UserDataPtr
(
new
UserDataString
());
86
}
87
88
const
std::string& value()
const
{
return
m_value; }
89
90
void
setValue(
const
std::string& val) { m_value = val; }
91
92
~
UserDataString
()
override
;
93
94
protected
:
95
UserDataString
();
96
std::string m_value;
97
};
98
}
// namespace simulation
99
}
// namespace smtk
100
101
#endif // smtk_simulation_UserData_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition:
doc.h:33
PublicPointerDefs.h
smtk::simulation::UserDataPtr
smtk::shared_ptr< smtk::simulation::UserData > UserDataPtr
Definition:
PublicPointerDefs.h:678
smtk::simulation::UserDataDouble
Definition:
UserData.h:60
smtk::simulation::UserDataString
Definition:
UserData.h:80
smtk::simulation::UserDataInt
Definition:
UserData.h:40
smtk::simulation::UserData
Definition:
UserData.h:25
Generated by
1.8.17