AGX Dynamics  2.37.2.0
TriangleVoronoiRegion.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2024. 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 #ifndef AGXCOLLIDE_TRIANGLEVORONOIREGION_H
18 #define AGXCOLLIDE_TRIANGLEVORONOIREGION_H
19 
20 #include <agx/agx.h>
21 #include <agx/agxPhysics_export.h>
22 #include <agx/debug.h>
23 
24 namespace agxCollide
25 {
32  public:
34  enum Type {
35  VERTEX = 0,
37  FACE
38  };
39 
44  TriangleVoronoiRegion( uint8_t voronoiIndex );
45 
47  Type getType() const;
48 
49  static Type calculateType(unsigned index);
50 
55  uint8_t getVoronoiIndex() const;
56 
68  static const uint8_t edgeFlags[4]; // last one for padding
69  static const uint8_t edgeFlaggedToStandard[8]; // last one for padding
70 
71  private:
74 
75  uint8_t m_voronoiIndex;
76  };
77 
78 
79  //implementation
80  inline TriangleVoronoiRegion::TriangleVoronoiRegion( uint8_t voronoiIndex ) : m_voronoiIndex(voronoiIndex)
81  {
82  agxAssert( voronoiIndex <= 6);
83  }
84 
86  {
87  return (TriangleVoronoiRegion::Type( index / 3));
88  }
89 
91  {
92  return TriangleVoronoiRegion::calculateType(m_voronoiIndex);
93  }
94 
95 
97  {
98  return m_voronoiIndex;
99  }
100 
101 }
102 
103 #endif
104 
AGXCORE_EXPORT Type * getType(const agx::String &name)
This namespace consists of a set of classes for handling geometric intersection tests including boole...
#define AGXPHYSICS_EXPORT
#define agxAssert(expr)
Definition: debug.h:143
Type
The type of Voronoi region.
Class containing the Voronoi region of a triangle as an uint8_t.
static Type calculateType(unsigned index)