AGX Dynamics  2.38.0.2
VoronoiGenerator.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_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
agxPhysics_export.h
Shape.h
agx::UInt
uint64_t UInt
Definition: Integer.h:27
agxCollide::VoronoiGenerator::VoronoiDiagramData
agx::Vector< VoronoiCell > VoronoiDiagramData
Definition: VoronoiGenerator.h:44
Referenced.h
agx::Real
double Real
Definition: Real.h:42
agx::Vector
Templated vector class.
Definition: Vector.h:52
agxCollide::VoronoiGenerator::VoronoiCell::center
agx::Vec3 center
Definition: VoronoiGenerator.h:40
agx::VectorPOD< Vec3 >
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agx::BoundT< Vec3 >
Vec3.h
agxCollide::Shape
Base class for a shape.
Definition: Shape.h:53
agxCollide::VoronoiGenerator
Definition: VoronoiGenerator.h:34
Bound.h
agxCollide::VoronoiGenerator::VoronoiCell::voronoiCellVertices
agx::Vec3Vector voronoiCellVertices
Definition: VoronoiGenerator.h:41
agx.h
agxCollide::VoronoiGenerator::getResolution
agx::Real getResolution() const
Get resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres,...
Definition: VoronoiGenerator.h:114
agxCollide::VoronoiGenerator::setResolution
void setResolution(agx::Real resolution)
Set resolution for plane tessellation in Voronoi diagram of basic primitives such as Spheres,...
Definition: VoronoiGenerator.h:109
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:119
agxCollide
This namespace consists of a set of classes for handling geometric intersection tests including boole...
Definition: ContactForceFilterParticipant.h:22
agxCollide::VoronoiGenerator::VoronoiCell
Definition: VoronoiGenerator.h:37
agxCollide::AGX_DECLARE_POINTER_TYPES
AGX_DECLARE_POINTER_TYPES(SpaceListener)
agx::Vec3T< Real >
AGX_FORCE_INLINE
#define AGX_FORCE_INLINE
Definition: macros.h:58
debug.h