Skip to content
Snippets Groups Projects
Commit 2708a1e5 authored by Nicholas Milef's avatar Nicholas Milef
Browse files

STYLE: Renamed clearTable() method to clear() and fixed some parameter passing

parent 356ca585
No related branches found
No related tags found
No related merge requests found
......@@ -32,7 +32,7 @@ SpatialHashTableSeparateChaining::SpatialHashTableSeparateChaining()
}
void
SpatialHashTableSeparateChaining::insertPoints(StdVectorOfVec3d points)
SpatialHashTableSeparateChaining::insertPoints(const StdVectorOfVec3d& points)
{
// TODO: make more efficient
for (auto i = 0; i < points.size(); i++)
......@@ -42,7 +42,7 @@ SpatialHashTableSeparateChaining::insertPoints(StdVectorOfVec3d points)
}
void
SpatialHashTableSeparateChaining::insertPoint(Vec3d point)
SpatialHashTableSeparateChaining::insertPoint(const Vec3d& point)
{
PointEntry entry;
entry.point = point;
......@@ -55,14 +55,14 @@ SpatialHashTableSeparateChaining::insertPoint(Vec3d point)
}
void
SpatialHashTableSeparateChaining::clearTable()
SpatialHashTableSeparateChaining::clear()
{
m_table->clear();
m_currentID = 0;
}
std::vector<Vec3d>
SpatialHashTableSeparateChaining::getPointsInAABB(Vec3d corner1, Vec3d corner2)
SpatialHashTableSeparateChaining::getPointsInAABB(const Vec3d& corner1, const Vec3d& corner2)
{
auto min_x = std::fmin(corner1.x(), corner2.x());
auto max_x = std::fmax(corner1.x(), corner2.x());
......
......@@ -95,13 +95,13 @@ public:
/// \brief Insert an array of points
/// \param points An array of point
///
void insertPoints(StdVectorOfVec3d points);
void insertPoints(const StdVectorOfVec3d& points);
///
/// \brief Insert an array of points
/// \param point A point
///
void insertPoint(Vec3d point);
void insertPoint(const Vec3d& point);
///
/// \brief Sets the max load factor
......@@ -114,12 +114,12 @@ public:
/// \param corner1 One corner to the box
/// \param corner2 The other corner to the box
///
std::vector<Vec3d> getPointsInAABB(Vec3d corner1, Vec3d corner2);
std::vector<Vec3d> getPointsInAABB(const Vec3d& corner1, const Vec3d& corner2);
///
/// \brief Clears the table
///
void clearTable();
void clear();
///
/// \brief Protected constructor
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment