Space Comps
 All Classes Files Functions Variables
sweepnprunealgorithmmulti.h
1 #ifndef SWEEPNPRUNEALGORITHMMULTI_H
2 #define SWEEPNPRUNEALGORITHMMULTI_H
3 
4 #include <math.h>
5 #include <unordered_map>
6 #include "algorithm.h"
7 #include "boundingbox.h"
8 #include "boundary.h"
9 
10 
26 {
27 public:
42  SweepNPruneAlgorithmMulti(int xIn, int yIn, int numParticles);
43 
59  SweepNPruneAlgorithmMulti(int xIn, int yIn, int zIn, int numParticles);
60 
78  SweepNPruneAlgorithmMulti(int xIn, int yIn, int zIn, double centerMassIn, int numParticles);
80 
81 private:
82  void calculateNextTimestep();
83  int maxDimension;
84 
85  std::vector<BoundingBox*> boundingBoxes;
86  void insertionSort(std::vector<BoundingBox*>& boxes, int dimension);
87  std::vector<Boundary*> boundariesX;
88  std::vector<Boundary*> boundariesY;
89  std::vector<Boundary*> boundariesZ;
90  void insertionSort(std::vector<Boundary*>& bounds);
91 
92  std::unordered_map<int, std::pair<BoundingBox*, BoundingBox*>*> possibleCollisions;
93  void buildMap();
94  void updateMap(int dimension);
95 };
96 
97 #endif // SWEEPNPRUNEALGORITHMMULTI_H
The Algorithm class is a parent to all the specific Algorithms we test.
Definition: algorithm.h:16
SweepNPruneAlgorithmMulti(int xIn, int yIn, int numParticles)
Constructs a 2d SweepNPruneAlgorithmMulti.
Definition: sweepnprunealgorithmmulti.cpp:3
The SweepNPruneAlgorithmMulti class executes the sweep and prune method of collision detection in mul...
Definition: sweepnprunealgorithmmulti.h:25