AGXDynamics  2.35.0.2
Types.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 #pragma once
17 
18 
19 
20 #include <agx/agxCore_export.h>
21 #include <agx/version.h>
22 
23 #include <agx/String.h>
24 #include <agx/Vec2.h>
25 #include <agx/Vec3.h>
26 #include <agx/Quat.h>
27 #include <agx/Range.h>
28 #include <agx/Matrix3x3.h>
29 #include <agx/SPDMatrix3x3.h>
30 
31 
32 
33 namespace agxStream
34 {
35  namespace ElementTypes
36  {
37  enum Type {
39  };
40  inline agx::UInt32 getElementType(const float&)
41  {
42  return FLOAT;
43  }
44 
45  inline agx::UInt32 getElementType(const double&)
46  {
47  return DOUBLE;
48  }
49 
50  template <typename T>
52  {
53  if (sizeof(T) == sizeof(float))
54  return VEC2F;
55  else
56  return VEC2D;
57  }
58 
59  template <typename T>
61  {
62  if (sizeof(T) == sizeof(float))
63  return VEC3F;
64  else
65  return VEC3D;
66  }
67 
68  template <typename T>
70  {
71  if (sizeof(T) == sizeof(float))
72  return VEC4F;
73  else
74  return VEC4D;
75  }
76 
77  template <typename T>
79  {
80  if (sizeof(T) == sizeof(float))
81  return QUATF;
82  else
83  return QUATD;
84  }
85 
86  template <typename T>
88  {
89  return OTHER;
90  }
91  }
92 }
93 
SPDMatrix3x3.h
Matrix3x3.h
agxStream::ElementTypes::VEC2F
@ VEC2F
Definition: Types.h:38
agxStream::ElementTypes::FLOAT
@ FLOAT
Definition: Types.h:38
agxStream::ElementTypes::OTHER
@ OTHER
Definition: Types.h:38
agxStream::ElementTypes::VEC3D
@ VEC3D
Definition: Types.h:38
agx::Vec4T
A class holding 4 dimensional vectors and providing basic arithmetic.
Definition: Vec4Template.h:34
version.h
Vec2.h
Vec3.h
agxStream::ElementTypes::VEC4F
@ VEC4F
Definition: Types.h:38
agxStream::ElementTypes::VEC4D
@ VEC4D
Definition: Types.h:38
agxStream::ElementTypes::VEC3F
@ VEC3F
Definition: Types.h:38
Range.h
agx::Vec2T
Definition: Vec2Template.h:30
agxCore_export.h
agx::QuatT
The object holding quaternions and providing operations on these.
Definition: QuatTemplate.h:56
Quat.h
agxStream::ElementTypes::QUATD
@ QUATD
Definition: Types.h:38
agxStream::ElementTypes::VEC2D
@ VEC2D
Definition: Types.h:38
agxStream::ElementTypes::DOUBLE
@ DOUBLE
Definition: Types.h:38
agxStream::ElementTypes::QUATF
@ QUATF
Definition: Types.h:38
agxStream
This namespace contain classes for streaming classes into archives, ASCII, binary for storage (serial...
Definition: ElementaryConstraint.h:31
String.h
agx::Vec3T
A class holding 3 dimensional vectors and providing basic arithmetic.
Definition: Vec3Template.h:45
agx::UInt32
uint32_t UInt32
Definition: Integer.h:40
agxStream::ElementTypes::Type
Type
Definition: Types.h:37
agxStream::ElementTypes::getElementType
agx::UInt32 getElementType(const float &)
Definition: Types.h:40