ufe  3.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
types.h
Go to the documentation of this file.
1 #line 1 "S:/jenkins/workspace/ECP/ufe/ufe-full-python3.9-windows/ufe/include/types.h"
2 #ifndef _ufe_types
3 #define _ufe_types
4 
5 // =======================================================================
6 // Copyright 2019 Autodesk, Inc. All rights reserved.
7 //
8 // This computer source code and related instructions and comments are the
9 // unpublished confidential and proprietary information of Autodesk, Inc.
10 // and are protected under applicable copyright and trade secret law. They
11 // may not be disclosed to, copied or used by any third party without the
12 // prior written consent of Autodesk, Inc.
13 // =======================================================================
14 
15 #include "common/ufeExport.h"
16 
17 #include <array>
18 #include <limits>
19 
20 UFE_NS_DEF {
21 
23 template<typename T>
25 {
27  {
28  set(0, 0, 0);
29  }
30 
31  TypedVector3(T x, T y, T z)
32  {
33  set(x, y, z);
34  }
35 
36  T x() const { return std::get<0>(vector); }
37  T y() const { return std::get<1>(vector); }
38  T z() const { return std::get<2>(vector); }
39  void set(T x, T y, T z) { std::get<0>(vector) = x; std::get<1>(vector) = y; std::get<2>(vector) = z; }
40 
41  bool operator==(const TypedVector3<T>& rhs) const
42  {
43  return vector == rhs.vector;
44  }
45 
46  bool operator!=(const TypedVector3<T>& rhs) const
47  {
48  return vector != rhs.vector;
49  }
50 
51  std::array<T, 3> vector;
52 };
53 
57 
59 template<typename T>
61 {
63  {
64  set(0, 0, 0);
65  }
66 
67  TypedColor3(T r, T g, T b)
68  {
69  set(r, g, b);
70  }
71 
72  T r() const { return std::get<0>(color); }
73  T g() const { return std::get<1>(color); }
74  T b() const { return std::get<2>(color); }
75  void set(T r, T g, T b) { std::get<0>(color) = r; std::get<1>(color) = g; std::get<2>(color) = b; }
76 
77  bool operator==(const TypedColor3<T>& rhs) const
78  {
79  return color == rhs.color;
80  }
81 
82  bool operator!=(const TypedColor3<T>& rhs) const
83  {
84  return color != rhs.color;
85  }
86 
87  std::array<T, 3> color;
88 };
89 
91 
93 
98 {
101 
103  BBox3d() {
104  min.vector.fill(std::numeric_limits<double>::max());
105  max.vector.fill(std::numeric_limits<double>::lowest());
106  }
107 
108  BBox3d(const Vector3d& aMin, const Vector3d& aMax) : min(aMin), max(aMax) {}
109 
110  bool empty() const {
111  return min.x() > max.x() || min.y() > max.y() || min.z() > max.z();
112  }
113 };
114 
116 
120 {
121  std::array<std::array<double, 4>, 4> matrix;
122 
124  Matrix4d operator*(const Matrix4d& rhs) const;
125 };
126 
127 
128 } // end namespace
129 
130 #endif /* _ufe_types */
bool operator!=(const TypedVector3< T > &rhs) const
Definition: types.h:46
TypedVector3< double > Vector3d
Definition: types.h:56
TypedVector3(T x, T y, T z)
Definition: types.h:31
bool operator==(const TypedVector3< T > &rhs) const
Definition: types.h:41
TypedColor3(T r, T g, T b)
Definition: types.h:67
Definition of macros for symbol visibility.
BBox3d()
Create an empty bounding box.
Definition: types.h:103
Typed color template for creating a specialized color.
Definition: types.h:60
TypedColor3< float > Color3f
Definition: types.h:90
T r() const
Definition: types.h:72
T b() const
Definition: types.h:74
Vector3d min
Definition: types.h:99
bool operator!=(const TypedColor3< T > &rhs) const
Definition: types.h:82
BBox3d(const Vector3d &aMin, const Vector3d &aMax)
Definition: types.h:108
TypedVector3< int > Vector3i
Definition: types.h:54
bool operator==(const TypedColor3< T > &rhs) const
Definition: types.h:77
Vector3d max
Definition: types.h:100
std::array< T, 3 > vector
Definition: types.h:51
#define UFE_NS_DEF
Definition: ufe.h:35
Typed vector template for creating a specialized vector.
Definition: types.h:24
T g() const
Definition: types.h:73
std::array< std::array< double, 4 >, 4 > matrix
Definition: types.h:121
bool empty() const
Definition: types.h:110
Matrix class for 3D transforms.
Definition: types.h:119
T x() const
Definition: types.h:36
TypedVector3< float > Vector3f
Definition: types.h:55
3D bounding box class.
Definition: types.h:97
std::array< T, 3 > color
Definition: types.h:87
T z() const
Definition: types.h:38
#define UFE_SDK_DECL
Definition: ufeExport.h:36
T y() const
Definition: types.h:37