AGX Dynamics  2.35.0.1
Range6.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 
17 
18 #ifndef AGX_RANGE_6_H
19 #define AGX_RANGE_6_H
20 
21 #include <agx/Range.h>
22 #include <agxData/Type.h>
23 
24 namespace agx
25 {
26 
27  template <typename T>
28  class Range6T
29  {
30  public:
31  enum Direction {
35  };
36 
37  public:
38  Range<T>& operator[](Direction direction);
39  const Range<T>& operator[](Direction direction) const;
40 
41  Range<T>& operator[](UInt index);
42  const Range<T>& operator[](UInt index) const;
43 
44  Range<T> get(Direction direction);
45  void set(Direction direction, Range<T> newRange);
46  private:
47  Range<T> m_ranges[6];
48  };
49 
50 
51  template <typename T>
53  {
54  agxAssert(direction < 6);
55  return m_ranges[direction];
56  }
57 
58 
59  template <typename T>
60  const Range<T>& Range6T<T>::operator[](Direction direction) const
61  {
62  agxAssert(direction < 6);
63  return m_ranges[direction];
64  }
65 
66 
67  template <typename T>
69  {
70  agxAssert(index < 6);
71  return m_ranges[index];
72  }
73 
74 
75  template <typename T>
76  const Range<T>& Range6T<T>::operator[](UInt index) const
77  {
78  agxAssert(index < 6);
79  return m_ranges[index];
80  }
81 
82 
83  template <typename T>
85  {
86  agxAssert(direction < 6);
87  return m_ranges[direction];
88  }
89 
90 
91  template <typename T>
92  void Range6T<T>::set(Direction direction, Range<T> newRange)
93  {
94  agxAssert(direction < 6);
95  m_ranges[direction] = newRange;
96  }
97 
98 
99 
100 
104 
105 }
106 
107 #endif
@ Y_DIRECTION
Definition: Range6.h:32
@ X_DIRECTION
Definition: Range6.h:32
@ Y_ROTATION
Definition: Range6.h:33
@ Z_ROTATION
Definition: Range6.h:33
@ X_ROTATION
Definition: Range6.h:33
@ Z_DIRECTION
Definition: Range6.h:32
@ NUM_DIRECTIONS
Definition: Range6.h:34
void set(Direction direction, Range< T > newRange)
Definition: Range6.h:92
Range< T > get(Direction direction)
Definition: Range6.h:84
Range< T > & operator[](Direction direction)
Definition: Range6.h:52
A range object has a min and max value of a given type and provides services to tell whether a value ...
Definition: Range.h:80
#define agxAssert(expr)
Definition: debug.h:143
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
Range6T< Real > Range6
Definition: Range6.h:101
uint32_t UInt
Definition: Integer.h:34
Range6T< Real32 > Range6f
Definition: Range6.h:102
Range6T< Real64 > Range6d
Definition: Range6.h:103