AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
VoronoiGenerator.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2021. 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_VORONOIGENERATOR_H
18 #define AGXCOLLIDE_VORONOIGENERATOR_H
19 
20 #include <agx/agx.h>
21 #include <agx/agxPhysics_export.h>
22 #include <agx/Referenced.h>
23 #include <agx/debug.h>
24 #include <agx/Vec3.h>
25 #include <agx/Bound.h>
26 #include <agxCollide/Shape.h>
27 
28 namespace agxCollide
29 {
35  {
36  public:
38  {
39  public:
42  };
43 
45 
46  public:
51 
55  VoronoiDiagramData generateVoronoiDiagramInBound(const agx::Bound3& bound, const agx::Vec3Vector& voronoiPoints);
56 
60  VoronoiDiagramData generateVoronoiDiagramInBound( const agx::Bound3& bound, const agx::UInt numPoints );
61 
65  VoronoiDiagramData generateVoronoiDiagramInShape(const agxCollide::Shape* shape, const agx::Vec3Vector& voronoiPoints);
66 
70  VoronoiDiagramData generateVoronoiDiagramInShape(const agxCollide::Shape* shape, agx::UInt numPoints);
71 
85  VoronoiCell generateVoronoiPolyhedra(unsigned int seed = 0, agx::Real pointDistance=0.75, agx::Real boundSize=5);
86 
90  void setResolution(agx::Real resolution);
91 
95  agx::Real getResolution() const;
96 
97  protected:
98  virtual ~VoronoiGenerator();
99 
100  agx::Vec3Vector generateEquidistantPointsInBound( agx::Real distance, agx::Real boundHalfVec, unsigned int seed );
101 
103  // Variables
105  private:
106  agx::Real m_resolution;
107  };
108 
110  {
111  m_resolution = resolution;
112  }
113 
115  {
116  return m_resolution;
117  }
118 }
119 
120 #endif
Base class for a shape.
Definition: Shape.h:53
agx::Vector< VoronoiCell > VoronoiDiagramData
#define AGXPHYSICS_EXPORT
#define AGX_FORCE_INLINE
Definition: Object.h:62
agx::Real getResolution() const
Get resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres...
Base class providing referencing counted objects.
Definition: Referenced.h:113
Templated vector class.
Definition: Vector.h:52
uint32_t UInt
Definition: Integer.h:34
void setResolution(agx::Real resolution)
Set resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres...
double Real
Definition: Real.h:42
AGX_DECLARE_POINTER_TYPES(SpaceListener)