Skip to content
Snippets Groups Projects
Commit bad23486 authored by Fabian Reister's avatar Fabian Reister
Browse files

changing parameter type from pointer to const ref

parent 92064007
No related branches found
No related tags found
No related merge requests found
......@@ -159,7 +159,7 @@ uniformDeviate(int seed)
return ran;
}
Eigen::Vector3f TriMeshUtils::sampleSurfacePoint(std::vector<float> *cumulativeAreas, double totalArea, const TriMeshModel& tri)
Eigen::Vector3f TriMeshUtils::sampleSurfacePoint(const std::vector<float>& cumulativeAreas, double totalArea, const TriMeshModel& tri)
{
if (tri.faces.empty())
{
......@@ -196,7 +196,7 @@ std::vector<Eigen::Vector3f> TriMeshUtils::uniformSampling(const TriMeshModel& t
unsigned int i = 0;
unsigned int counter = 0;
while (i < n) {
Eigen::Vector3f sampledPoint = sampleSurfacePoint(&cumulativeAreas, totalArea, tri);
Eigen::Vector3f sampledPoint = sampleSurfacePoint(cumulativeAreas, totalArea, tri);
if (!sampledPoint.isZero()) {
samples[i] = sampledPoint;
i++;
......
......@@ -39,10 +39,9 @@ public:
const VisualizationFactory::Color &color = VisualizationFactory::Color::Gray(),
const std::vector<VisualizationFactory::Color>& colors = {});
static Eigen::Vector3f sampleSurfacePoint(std::vector<float> *cumulativeAreas, double totalArea, const VirtualRobot::TriMeshModel& tri);
static Eigen::Vector3f sampleSurfacePoint(const std::vector<float>& cumulativeAreas, double totalArea, const VirtualRobot::TriMeshModel& tri);
//! Uniformly samples points on the surface of a trimesh model and can be used to create a point cloud of the model
static std::vector<Eigen::Vector3f> uniformSampling(const VirtualRobot::TriMeshModel& tri, unsigned int n = 1000);
};
} // namespace VirtualRobot
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