Sleeping Wombat GUI  0.100
swGUI
TestClasses.h
Go to the documentation of this file.
1 #pragma once
2 
3 
5 
9 
10 
11 #include <DirectXMath.h>
12 #include <DirectXPackedVector.h>
13 #include <string>
14 
15 
16 
17 struct Nested2
18 {
19  float SomeValue;
20  int IntValue;
21  std::string Name;
22 };
23 
24 struct Nested
25 {
26  float SomeValue;
27  int IntValue;
28  std::string Name;
30 };
31 
32 
33 
34 enum Methods
35 {
39 };
40 
41 
43 class TestAnim : public EngineObject
44 {
47 public:
48  float m_energy;
49  float m_mass;
50  float m_power;
51  float m_shit;
52 
54 
55 protected:
56 public:
60 
61 public:
62  explicit TestAnim();
63  ~TestAnim() { };
64 
65 };
66 
67 
69 {
72 public:
73 
74  double DoubleField;
75  float FloatField;
76 
85 
86  char CharField;
87  bool BoolField;
88 
89  std::string StringField;
90  std::wstring WStringField;
91 
93 
94  DirectX::XMFLOAT4 Color4F;
95  DirectX::XMFLOAT3 Position3F;
96  DirectX::PackedVector::XMCOLOR Color;
97 
98 public:
99  explicit TestInterpolators();
101 
102  template< typename FieldType >
103  FieldType& GetField();
104 
105 #define DEFINE_GET_FIELD( type, name ) \
106 template<> \
107 type& GetField< type >() { return name; }
108 
109  DEFINE_GET_FIELD( uint64, UIntField64 );
110  DEFINE_GET_FIELD( int64, IntField64 );
111  DEFINE_GET_FIELD( uint32, UIntField32 );
112  DEFINE_GET_FIELD( int32, IntField32 );
113  DEFINE_GET_FIELD( uint16, UIntField16 );
114  DEFINE_GET_FIELD( int16, IntField16 );
115  DEFINE_GET_FIELD( uint8, UIntField8 );
116  DEFINE_GET_FIELD( int8, IntField8 );
117 
118  DEFINE_GET_FIELD( char, CharField );
119  DEFINE_GET_FIELD( bool, BoolField );
120  DEFINE_GET_FIELD( std::string, StringField );
121  DEFINE_GET_FIELD( std::wstring, WStringField );
122 
123  DEFINE_GET_FIELD( double, DoubleField );
124  DEFINE_GET_FIELD( float, FloatField );
125  DEFINE_GET_FIELD( Methods, EnumField );
126 
127  DEFINE_GET_FIELD( DirectX::XMFLOAT4, Color4F );
128  DEFINE_GET_FIELD( DirectX::XMFLOAT3, Position3F );
129  DEFINE_GET_FIELD( DirectX::PackedVector::XMCOLOR, Color );
130 
131 #undef DEFINE_GET_FIELD
132 };
133 
134 
135 
136 
137 
138 
139 //====================================================================================//
140 // Impl
141 //====================================================================================//
142 
144 {
145  m_energy = 1.0f;
146  m_mass = 2.0f;
147  m_power = 3.0f;
148  m_shit = 4.0f;
149  m_otherData.SomeValue = 5.0f;
150  m_otherData.IntValue = 6;
151  m_otherData.Name = "Nested other data";
153  m_otherData.Additional.Name = "Nested2 additional data";
155 }
156 
157 
158 
160 {
161  DoubleField = 1.0;
162  FloatField = 2.0;
163 
164  UIntField64 = 4;
165  IntField64 = 4;
166  UIntField32 = 4;
167  IntField32 = 4;
168  UIntField16 = 4;
169  IntField16 = 4;
170  UIntField8 = 4;
171  IntField8 = 4;
172 
173  CharField = 4;
174  BoolField = false;
175 
176  StringField = "To jest string";
177  WStringField = L"To jest wstring";
178 
180 }
181 
182 
uint16_t uint16
Definition: TypesDefinitions.h:29
float m_shit
Definition: TestClasses.h:51
int8 IntField8
Definition: TestClasses.h:84
std::string StringField
Definition: TestClasses.h:89
std::wstring WStringField
Definition: TestClasses.h:90
float FloatField
Definition: TestClasses.h:75
RTTR_REGISTRATION_FRIEND
Definition: TestClasses.h:46
char CharField
Definition: TestClasses.h:86
uint16 UIntField16
Definition: TestClasses.h:81
Nested m_otherData
Definition: TestClasses.h:53
DirectX::XMFLOAT4 Color4F
Definition: TestClasses.h:94
float m_power
Definition: TestClasses.h:50
~TestAnim()
Definition: TestClasses.h:63
std::string Name
Definition: TestClasses.h:28
bool BoolField
Definition: TestClasses.h:87
float SomeValue
Definition: TestClasses.h:26
int8_t int8
Definition: TypesDefinitions.h:26
int IntValue
Definition: TestClasses.h:27
Definition: TestClasses.h:68
TestAnim()
Definition: TestClasses.h:143
DirectX::PackedVector::XMCOLOR Color
Definition: TestClasses.h:96
uint64_t uint64
Definition: TypesDefinitions.h:33
int64_t int64
Definition: TypesDefinitions.h:32
Ptr< FloatAnimation< DirectProperty > > FloatAnimDirect
Definition: TestClasses.h:59
Ptr< FloatAnimation< PropertyPath > > FloatAnimProperty
Definition: TestClasses.h:58
uint32_t uint32
Definition: TypesDefinitions.h:31
Methods EnumField
Definition: TestClasses.h:92
TestInterpolators()
Definition: TestClasses.h:159
DirectX::XMFLOAT3 Position3F
Definition: TestClasses.h:95
RTTR_ENABLE(EngineObject)
int IntValue
Definition: TestClasses.h:20
FieldType & GetField()
Nested2 Additional
Definition: TestClasses.h:29
double DoubleField
Definition: TestClasses.h:74
RTTR_REGISTRATION_FRIEND
Definition: TestClasses.h:71
uint32 UIntField32
Definition: TestClasses.h:79
float m_mass
Definition: TestClasses.h:49
function L
Definition: jquery.js:16
uint8_t uint8
Definition: TypesDefinitions.h:27
DEFINE_GET_FIELD(uint64, UIntField64)
Klasa bazowa dla obiektów, które mają być dostępne w edytorze poprzez rttr. Należy po niej odziedzicz...
Definition: EngineObject.h:22
Definition: TestClasses.h:38
int64 IntField64
Definition: TestClasses.h:78
std::shared_ptr< PtrType > Ptr
Definition: TypesDefinitions.h:55
float m_energy
Definition: TestClasses.h:48
Ptr< FloatAnimation< StringPropertyPath > > FloatAnimString
Definition: TestClasses.h:57
RTTR_ENABLE(EngineObject)
uint8 UIntField8
Definition: TestClasses.h:83
int16 IntField16
Definition: TestClasses.h:82
Definition: TestClasses.h:43
float SomeValue
Definition: TestClasses.h:19
Definition: TestClasses.h:24
Definition: TestClasses.h:37
~TestInterpolators()
Definition: TestClasses.h:100
int32 IntField32
Definition: TestClasses.h:80
int32_t int32
Definition: TypesDefinitions.h:30
int16_t int16
Definition: TypesDefinitions.h:28
Definition: TestClasses.h:36
uint64 UIntField64
Definition: TestClasses.h:77
Definition: TestClasses.h:17
Methods
Definition: TestClasses.h:34
std::string Name
Definition: TestClasses.h:21