Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 26, 2024
1 parent 76fab91 commit a7afd25
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 63 deletions.
12 changes: 6 additions & 6 deletions python/collision.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ void exposeCollisionAPI() {
.def("clear", &CPUTimes::clear, arg("self"), "Reset the time values.");
}

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
if (!eigenpy::register_symbolic_link_to_registered_type<QueryRequest>()) {
class_<QueryRequest>("QueryRequest", doxygen::class_doc<QueryRequest>(),
no_init)
Expand Down Expand Up @@ -132,10 +132,10 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
.DEF_RW_CLASS_ATTRIB(QueryRequest, enable_timings)
.DEF_CLASS_FUNC(QueryRequest, updateGuess);
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP
HPP_FCL_COMPILER_DIAGNOSTIC_POP

HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
if (!eigenpy::register_symbolic_link_to_registered_type<CollisionRequest>()) {
class_<CollisionRequest, bases<QueryRequest> >(
"CollisionRequest", doxygen::class_doc<CollisionRequest>(), no_init)
Expand Down Expand Up @@ -174,7 +174,7 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
class_<std::vector<CollisionRequest> >("StdVec_CollisionRequest")
.def(vector_indexing_suite<std::vector<CollisionRequest> >());
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP
HPP_FCL_COMPILER_DIAGNOSTIC_POP

if (!eigenpy::register_symbolic_link_to_registered_type<Contact>()) {
class_<Contact>("Contact", doxygen::class_doc<Contact>(),
Expand Down
6 changes: 3 additions & 3 deletions python/distance.cc
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ struct DistanceResultWrapper {
};

void exposeDistanceAPI() {
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
HPP_FCL_COMPILER_DIAGNOSTIC_PUSH
HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
if (!eigenpy::register_symbolic_link_to_registered_type<DistanceRequest>()) {
class_<DistanceRequest, bases<QueryRequest> >(
"DistanceRequest", doxygen::class_doc<DistanceRequest>(),
Expand Down Expand Up @@ -110,7 +110,7 @@ HPP_FCL_COMPILER_DIAGNOSTIC_IGNORED_DEPRECECATED_DECLARATIONS
.DEF_RW_CLASS_ATTRIB(DistanceRequest, abs_err)
.def(SerializableVisitor<DistanceRequest>());
}
HPP_FCL_COMPILER_DIAGNOSTIC_POP
HPP_FCL_COMPILER_DIAGNOSTIC_POP

if (!eigenpy::register_symbolic_link_to_registered_type<
std::vector<DistanceRequest> >()) {
Expand Down
110 changes: 56 additions & 54 deletions src/narrowphase/support_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,13 @@ void getShapeSupport(const TriangleP* triangle, const Vec3f& dir,
}
// clang-format off
getShapeSupportTplInstantiation(TriangleP)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support,
int& /*unused*/, ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Box* box, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
// The inflate value is simply to make the specialized functions with box
// have a preferred side for edge cases.
static const FCL_REAL inflate = (dir.array() == 0).any() ? 1 + 1e-10 : 1.;
Expand All @@ -156,13 +157,13 @@ inline void getShapeSupport(const Box* box, const Vec3f& dir, Vec3f& support,
}
// clang-format off
getShapeSupportTplInstantiation(Box)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
if (_SupportOptions == SupportOptions::WithSweptSphere) {
support.noalias() =
(sphere->radius + sphere->getSweptSphereRadius()) * dir.normalized();
Expand All @@ -175,13 +176,13 @@ inline void getShapeSupport(const Sphere* sphere, const Vec3f& dir,
}
// clang-format off
getShapeSupportTplInstantiation(Sphere)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
FCL_REAL a2 = ellipsoid->radii[0] * ellipsoid->radii[0];
FCL_REAL b2 = ellipsoid->radii[1] * ellipsoid->radii[1];
FCL_REAL c2 = ellipsoid->radii[2] * ellipsoid->radii[2];
Expand All @@ -198,13 +199,13 @@ inline void getShapeSupport(const Ellipsoid* ellipsoid, const Vec3f& dir,
}
// clang-format off
getShapeSupportTplInstantiation(Ellipsoid)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
static const FCL_REAL dummy_precision =
Eigen::NumTraits<FCL_REAL>::dummy_precision();
support.setZero();
Expand All @@ -221,12 +222,12 @@ inline void getShapeSupport(const Capsule* capsule, const Vec3f& dir,
}
// clang-format off
getShapeSupportTplInstantiation(Capsule)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support,
int& /*unused*/, ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support,
int& /*unused*/, ShapeSupportData& /*unused*/) {
static const FCL_REAL dummy_precision =
Eigen::NumTraits<FCL_REAL>::dummy_precision();

Expand Down Expand Up @@ -273,12 +274,13 @@ void getShapeSupport(const Cone* cone, const Vec3f& dir, Vec3f& support,
}
// clang-format off
getShapeSupportTplInstantiation(Cone)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support,
int& /*unused*/, ShapeSupportData& /*unused*/) {
// ============================================================================
template <int _SupportOptions>
void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir,
Vec3f& support, int& /*unused*/,
ShapeSupportData& /*unused*/) {
static const FCL_REAL dummy_precision =
Eigen::NumTraits<FCL_REAL>::dummy_precision();

Expand Down Expand Up @@ -315,13 +317,13 @@ void getShapeSupport(const Cylinder* cylinder, const Vec3f& dir, Vec3f& support,
}
// clang-format off
getShapeSupportTplInstantiation(Cylinder)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
void getShapeSupportLog(const ConvexBase* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
// ============================================================================
template <int _SupportOptions>
void getShapeSupportLog(const ConvexBase* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
assert(convex->neighbors != nullptr && "Convex has no neighbors.");

// Use warm start if current support direction is distant from last support
Expand Down Expand Up @@ -435,26 +437,26 @@ void getShapeSupport(const ConvexBase* convex, const Vec3f& dir, Vec3f& support,
}
// clang-format off
getShapeSupportTplInstantiation(ConvexBase)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const SmallConvex* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
getShapeSupportLinear<_SupportOptions>(
reinterpret_cast<const ConvexBase*>(convex), dir, support, hint,
support_data);
}
// clang-format off
getShapeSupportTplInstantiation(SmallConvex)
// clang-format on
// clang-format on

// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
// ============================================================================
template <int _SupportOptions>
inline void getShapeSupport(const LargeConvex* convex, const Vec3f& dir,
Vec3f& support, int& hint,
ShapeSupportData& support_data) {
getShapeSupportLog<_SupportOptions>(
reinterpret_cast<const ConvexBase*>(convex), dir, support, hint,
support_data);
Expand All @@ -468,9 +470,9 @@ getShapeSupportTplInstantiation(LargeConvex)
getShapeSupportSet<_SupportOptions>(static_cast<const ShapeType*>(shape), \
support_set, hint, support_data, \
max_num_supports, tol)
template <int _SupportOptions>
void getSupportSet(const ShapeBase* shape, SupportSet& support_set, int& hint,
size_t max_num_supports, FCL_REAL tol) {
template <int _SupportOptions>
void getSupportSet(const ShapeBase* shape, SupportSet& support_set,
int& hint, size_t max_num_supports, FCL_REAL tol) {
ShapeSupportData support_data;
switch (shape->getNodeType()) {
case GEOM_TRIANGLE:
Expand Down

0 comments on commit a7afd25

Please sign in to comment.