Atoms Crowd  7.0.0
MetadataTraits.h
1 #pragma once
2 
3 // ===========================================================================
4 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
5 //
6 // Use of this software is subject to the terms of the Toolchefs license
7 // agreement provided at the time of installation or download, or which
8 // otherwise accompanies this software in either electronic or hard copy form.
9 // ===========================================================================
10 
11 #include <AtomsUtils/Globals.h>
12 #include <AtomsUtils/AtomsMath.h>
13 #include <AtomsUtils/Curve.h>
14 #include <AtomsUtils/Mesh.h>
15 #include <AtomsUtils/Image.h>
16 #include <string>
17 
18 
19 namespace AtomsCore
20 {
21 
23  template< typename T >
25  {
27  static const void initialize(T &value) { };
28  };
29 
30  template<>
31  struct MetadataTraits<int>
32  {
33  static const void initialize(int &value) { value = 0; };
34  };
35 
36  template<>
37  struct MetadataTraits<long>
38  {
39  static const void initialize(long &value) { value = 0; };
40  };
41 
42  template<>
43  struct MetadataTraits<short>
44  {
45  static const void initialize(short &value) { value = 0; };
46  };
47 
48  template<>
49  struct MetadataTraits<float>
50  {
51  static const void initialize(float &value) { value = 0; };
52  };
53 
54  template<>
55  struct MetadataTraits<double>
56  {
57  static const void initialize(double &value) { value = 0; };
58  };
59 
60  template<>
62  {
63  static const void initialize(AtomsCore::Vector3 &value) { value.x = 0; value.y = 0; value.z = 0; };
64  };
65 
66  template<>
68  {
69  static const void initialize(AtomsCore::Vector3i &value) { value.x = 0; value.y = 0; value.z = 0; };
70  };
71 
72  template<>
74  {
75  static const void initialize(AtomsCore::Vector3f &value) { value.x = 0; value.y = 0; value.z = 0; };
76  };
77 
78  template<>
80  {
81  static const void initialize(AtomsCore::Vector2 &value) { value.x = 0; value.y = 0;};
82  };
83 
84  template<>
86  {
87  static const void initialize(AtomsCore::Vector2i &value) { value.x = 0; value.y = 0;};
88  };
89 
90  template<>
92  {
93  static const void initialize(AtomsCore::Vector2f &value) { value.x = 0; value.y = 0;};
94  };
95 
96  template<>
98  {
99  static const void initialize(AtomsCore::Vector4 &value) { value.x = 0; value.y = 0; value.z = 0; value.w = 0;};
100  };
101 
102  template<>
104  {
105  static const void initialize(AtomsCore::Vector4i &value) { value.x = 0; value.y = 0; value.z = 0; value.w = 0;};
106  };
107 
108  template<>
110  {
111  static const void initialize(AtomsCore::Vector4f &value) { value.x = 0; value.y = 0; value.z = 0; value.w = 0;};
112  };
113 
114 }
AtomsCore namespace.
Definition: Agent.h:344
AtomsMath::Vector4f Vector4f
Vector4 class.
Definition: AtomsMath.h:61
AtomsMath::Vector3i Vector3i
Vector3i class.
Definition: AtomsMath.h:59
AtomsMath::Vector2 Vector2
Vector2 class.
Definition: AtomsMath.h:54
AtomsMath::Vector4i Vector4i
Vector4 class.
Definition: AtomsMath.h:62
AtomsMath::Vector2i Vector2i
Vector2 class.
Definition: AtomsMath.h:56
AtomsMath::Vector4 Vector4
Vector4 class.
Definition: AtomsMath.h:60
AtomsMath::Vector2f Vector2f
Vector2 class.
Definition: AtomsMath.h:55
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Vector3f Vector3f
Vector3 class.
Definition: AtomsMath.h:58
metadata type trait
Definition: MetadataTraits.h:25
static const void initialize(T &value)
initializes the metadata value
Definition: MetadataTraits.h:27