AGX Dynamics  2.35.0.1
VoronoiGenerator.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 #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 
56 
61 
66 
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
#define AGXPHYSICS_EXPORT
Base class for a shape.
Definition: Shape.h:54
VoronoiDiagramData generateVoronoiDiagramInShape(const agxCollide::Shape *shape, agx::UInt numPoints)
Generate the 3D Voronoi diagram in a shape from a set of specified points generated inside the specif...
VoronoiGenerator()
Default constructor.
agx::Vec3Vector generateEquidistantPointsInBound(agx::Real distance, agx::Real boundHalfVec, unsigned int seed)
void setResolution(agx::Real resolution)
Set resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres,...
agx::Real getResolution() const
Get resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres,...
VoronoiDiagramData generateVoronoiDiagramInBound(const agx::Bound3 &bound, const agx::UInt numPoints)
Generate the 3D Voronoi diagram inside a 3 dimensional bound from a specified point,...
VoronoiCell generateVoronoiPolyhedra(unsigned int seed=0, agx::Real pointDistance=0.75, agx::Real boundSize=5)
Create a polyhedra from a randomly generated Voronoi Diagram by using the method described in: https:...
VoronoiDiagramData generateVoronoiDiagramInBound(const agx::Bound3 &bound, const agx::Vec3Vector &voronoiPoints)
Generate the 3D Voronoi diagram inside a 3 dimensional bound from a specified point,...
VoronoiDiagramData generateVoronoiDiagramInShape(const agxCollide::Shape *shape, const agx::Vec3Vector &voronoiPoints)
Generate the 3D Voronoi diagram in a shape from a set of specified points, generated in the LOCAL coo...
agx::Vector< VoronoiCell > VoronoiDiagramData
Base class providing referencing counted objects.
Definition: Referenced.h:114
Templated vector class.
Definition: agx/Vector.h:53
#define AGX_FORCE_INLINE
Definition: macros.h:58
This namespace consists of a set of classes for handling geometric intersection tests including boole...
AGX_DECLARE_POINTER_TYPES(SpaceListener)
uint32_t UInt
Definition: Integer.h:34
double Real
Definition: Real.h:42