Unverified Commit 1947403d authored by Wolfgang Merkt's avatar Wolfgang Merkt Committed by GitHub
Browse files

Misc fixes - unused parameters, deprecated copy, sign/unsigned comparison (#223)

* CMake if clause

* Address unused parameters

* Transform: Add copy constructor

* Timings: Explicit cast

* BVHModel: Address comparison between signed and unsigned

* Add operator= to Plane and Halfspace
parent 09e83287
Pipeline #14568 passed with stage
in 55 minutes and 7 seconds
......@@ -83,11 +83,11 @@ IF(WIN32)
ELSE(WIN32)
ADD_PROJECT_DEPENDENCY(Boost REQUIRED chrono serialization)
ENDIF(WIN32)
if (BUILD_PYTHON_INTERFACE)
if(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
search_for_boost_python(REQUIRED)
find_package(Boost REQUIRED COMPONENTS system)
endif ()
endif(BUILD_PYTHON_INTERFACE)
# Optional dependencies
ADD_PROJECT_DEPENDENCY(octomap PKG_CONFIG_REQUIRES "octomap >= 1.6")
......
......@@ -453,7 +453,7 @@ public:
}
/// @brief BV culling test in one BVTT node
FCL_REAL BVDistanceLowerBound(int b1, int b2) const
FCL_REAL BVDistanceLowerBound(int /*b1*/, int b2) const
{
return model1_bv.distance(model2->getBV(b2).bv);
}
......@@ -708,7 +708,7 @@ public:
}
/// @brief Distance testing between leaves (one shape and one triangle)
void leafComputeDistance(int b1, int b2) const
void leafComputeDistance(int /*b1*/, int b2) const
{
if(this->enable_statistics) this->num_leaf_tests++;
......@@ -769,7 +769,7 @@ public:
{
}
FCL_REAL BVDistanceLowerBound(int b1, int b2) const
FCL_REAL BVDistanceLowerBound(int /*b1*/, int b2) const
{
if(this->enable_statistics) this->num_bv_tests++;
return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
......@@ -801,7 +801,7 @@ public:
{
}
FCL_REAL BVDistanceLowerBound(int b1, int b2) const
FCL_REAL BVDistanceLowerBound(int /*b1*/, int b2) const
{
if(this->enable_statistics) this->num_bv_tests++;
return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
......@@ -833,7 +833,7 @@ public:
{
}
FCL_REAL BVDistanceLowerBound(int b1, int b2) const
FCL_REAL BVDistanceLowerBound(int /*b1*/, int b2) const
{
if(this->enable_statistics) this->num_bv_tests++;
return distance(this->tf2.getRotation(), this->tf2.getTranslation(), this->model1_bv, this->model2->getBV(b2).bv);
......
......@@ -101,6 +101,11 @@ public:
T(T_)
{}
/// @brief Construct transform from other transform
Transform3f(const Transform3f& tf) : R(tf.R),
T(tf.T)
{}
/// @brief operator =
Transform3f& operator = (const Transform3f& tf)
{
......
......@@ -475,7 +475,15 @@ public:
, d(other.d)
{
}
/// @brief operator =
Halfspace& operator = (const Halfspace& other)
{
n = other.n;
d = other.d;
return *this;
}
/// @brief Clone *this into a new Halfspace
virtual Halfspace* clone() const { return new Halfspace(*this); };
......@@ -536,7 +544,15 @@ public:
, d(other.d)
{
}
/// @brief operator =
Plane& operator = (const Plane& other)
{
n = other.n;
d = other.d;
return *this;
}
/// @brief Clone *this into a new Plane
virtual Plane* clone() const { return new Plane(*this); };
......
......@@ -49,12 +49,11 @@ namespace hpp { namespace fcl {
{
if(m_is_stopped)
return m_times;
CPUTimes current(m_times);
#ifdef HPP_FCL_WITH_CXX11_SUPPORT
std::chrono::time_point<std::chrono::steady_clock> current_clock = std::chrono::steady_clock::now();
current.user += std::chrono::duration_cast<std::chrono::nanoseconds>(current_clock - m_start).count()*1e-3;
current.user += static_cast<double>(std::chrono::duration_cast<std::chrono::nanoseconds>(current_clock - m_start).count())*1e-3;
#endif
return current;
}
......@@ -80,7 +79,7 @@ namespace hpp { namespace fcl {
#ifdef HPP_FCL_WITH_CXX11_SUPPORT
m_end = std::chrono::steady_clock::now();
m_times.user += std::chrono::duration_cast<std::chrono::nanoseconds>(m_end - m_start).count()*1e-3;
m_times.user += static_cast<double>(std::chrono::duration_cast<std::chrono::nanoseconds>(m_end - m_start).count())*1e-3;
#endif
}
......
......@@ -107,17 +107,17 @@ bool BVHModelBase::operator==(const BVHModelBase & other) const
if(!result) return false;
for(size_t k = 0; k < num_tris; ++k)
for(size_t k = 0; k < static_cast<size_t>(num_tris); ++k)
if(tri_indices[k] != other.tri_indices[k])
return false;
for(size_t k = 0; k < num_vertices; ++k)
for(size_t k = 0; k < static_cast<size_t>(num_vertices); ++k)
if(vertices[k] != other.vertices[k])
return false;
if(prev_vertices != NULL && other.prev_vertices != NULL)
{
for(size_t k = 0; k < num_vertices; ++k)
for(size_t k = 0; k < static_cast<size_t>(num_vertices); ++k)
{
if(prev_vertices[k] != other.prev_vertices[k])
return false;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment