Commit 838ff725 authored by Dženan Zukić's avatar Dženan Zukić
Browse files

STYLE: running uncrustify on sources

parent cb300700
......@@ -29,7 +29,6 @@
namespace imstk
{
///
/// \struct PositionDirectionCollisionData
///
......@@ -118,7 +117,8 @@ struct EdgeEdgeCollisionData
///
struct PointTetrahedronCollisionData
{
enum CollisionType {
enum CollisionType
{
aPenetratingA = 0, // A self-penetration
aPenetratingB = 1, // vertex is from mesh A, tetrahedron is from mesh B
bPenetratingA = 2, // vertex is from mesh B, tetrahedron is from mesh A
......@@ -166,7 +166,6 @@ public:
std::vector<PointTetrahedronCollisionData> PTColData; ///< Point Tetrahedron collision data
std::vector<PickingCollisionData> NodePickData; ///< List of points that are picked
};
}
#endif // ifndef imstkCollisionData_h
......@@ -23,12 +23,10 @@
namespace imstk
{
SpatialHashTable::SpatialHashTable()
{
m_cellSize[0] = 0.1;
m_cellSize[1] = 0.1;
m_cellSize[2] = 0.1;
}
}
......@@ -26,7 +26,6 @@
namespace imstk
{
///
/// \class SpatialHashTable
///
......@@ -54,7 +53,6 @@ protected:
double m_cellSize[3];
};
}
#endif
......@@ -23,7 +23,6 @@
namespace imstk
{
SpatialHashTableSeparateChaining::SpatialHashTableSeparateChaining()
: SpatialHashTable()
{
......@@ -72,24 +71,28 @@ SpatialHashTableSeparateChaining::getPointsInAABB(const Vec3d& corner1, const Ve
auto max_z = std::fmax(corner1.z(), corner2.z());
std::unordered_set<PointEntry> tempPoints(0);
// Coarse iteration (false positives may exist)
for (double x = min_x; x < max_x + m_cellSize[0]; x += m_cellSize[0])
for (double y = min_y; y < max_y + m_cellSize[1]; y += m_cellSize[1])
for (double z = min_z; z < max_z + m_cellSize[2]; z += m_cellSize[2])
{
PointEntry point;
point.point = Vec3d(x, y, z);
point.cellSize = m_cellSize;
auto bucket = m_table->bucket(point);
auto first = m_table->begin(bucket);
auto last = m_table->end(bucket);
for (auto p = first; p != last; ++p)
for (double y = min_y; y < max_y + m_cellSize[1]; y += m_cellSize[1])
{
tempPoints.insert(*p);
for (double z = min_z; z < max_z + m_cellSize[2]; z += m_cellSize[2])
{
PointEntry point;
point.point = Vec3d(x, y, z);
point.cellSize = m_cellSize;
auto bucket = m_table->bucket(point);
auto first = m_table->begin(bucket);
auto last = m_table->end(bucket);
for (auto p = first; p != last; ++p)
{
tempPoints.insert(*p);
}
}
}
}
......@@ -135,6 +138,4 @@ SpatialHashTableSeparateChaining::rehash()
{
m_table->rehash(m_table->bucket_count());
}
}
......@@ -30,19 +30,16 @@
namespace imstk
{
struct PointEntry
{
Vec3d point;
unsigned long ID;
double * cellSize;
};
}
namespace std
{
template<> struct hash<imstk::PointEntry>
{
size_t operator()(const imstk::PointEntry& point) const
......@@ -70,14 +67,12 @@ template<> struct equal_to<imstk::PointEntry>
}
return true;
}
}
};
}
namespace imstk
{
///
/// \class SpatialHashTableSeparateChaining
///
......@@ -139,7 +134,6 @@ protected:
std::shared_ptr<std::unordered_set<PointEntry>> m_table;
};
}
#endif
......@@ -29,7 +29,6 @@
#include <g3log/g3log.hpp>
namespace imstk {
void
BidirectionalPlaneToSphere::computeCollisionData()
{
......@@ -67,5 +66,4 @@ BidirectionalPlaneToSphere::computeCollisionData()
// Set collisionData
m_colData.PDColData.push_back({planeAColPt, sphereBColPt, dirAToB, penetrationDepth});
}
}
......@@ -28,7 +28,6 @@
namespace imstk
{
class Plane;
class Sphere;
class CollisionData;
......@@ -46,8 +45,8 @@ public:
/// \brief Constructor
///
BidirectionalPlaneToSphere(std::shared_ptr<Plane> planeA,
std::shared_ptr<Sphere> sphereB,
CollisionData& colData) :
std::shared_ptr<Sphere> sphereB,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::BidirectionalPlaneToSphere, colData),
m_planeA(planeA),
m_sphereB(sphereB)
......@@ -68,7 +67,6 @@ private:
std::shared_ptr<Plane> m_planeA; ///>
std::shared_ptr<Sphere> m_sphereB; ///>
};
}
#endif // ifndef imstkBidirectionalPlaneToSphereCD_h
......@@ -38,7 +38,6 @@
namespace imstk
{
std::shared_ptr<CollisionDetection>
CollisionDetection::make_collision_detection(const Type& type,
std::shared_ptr<CollidingObject> objA,
......@@ -101,7 +100,7 @@ CollisionDetection::make_collision_detection(const Type& type,
if (mesh == nullptr || sphere == nullptr)
{
LOG(WARNING) << "CollisionDetection::make_collision_detection error: "
<< "invalid object geometries for SphereToSphere collision detection.";
<< "invalid object geometries for SphereToSphere collision detection.";
return nullptr;
}
return std::make_shared<MeshToSphereCD>(mesh, sphere, colData);
......@@ -116,7 +115,7 @@ CollisionDetection::make_collision_detection(const Type& type,
if (mesh == nullptr || plane == nullptr)
{
LOG(WARNING) << "CollisionDetection::make_collision_detection error: "
<< "invalid object geometries for SphereToSphere collision detection.";
<< "invalid object geometries for SphereToSphere collision detection.";
return nullptr;
}
return std::make_shared<MeshToPlaneCD>(mesh, plane, colData);
......@@ -146,7 +145,7 @@ CollisionDetection::make_collision_detection(const Type& type,
if (mesh == nullptr || sphere == nullptr)
{
LOG(WARNING) << "CollisionDetection::make_collision_detection error: "
<< "invalid object geometries for SphereToSphere collision detection.";
<< "invalid object geometries for SphereToSphere collision detection.";
return nullptr;
}
return std::make_shared<MeshToSpherePickingCD>(mesh, sphere, colData);
......
......@@ -26,7 +26,6 @@
namespace imstk
{
class CollidingObject;
class CollisionData;
......@@ -58,9 +57,9 @@ public:
/// \brief Static factory for collision detection sub classes
///
static std::shared_ptr<CollisionDetection> make_collision_detection(const Type& type,
std::shared_ptr<CollidingObject> objA,
std::shared_ptr<CollidingObject> objB,
CollisionData& colData);
std::shared_ptr<CollidingObject> objA,
std::shared_ptr<CollidingObject> objB,
CollisionData& colData);
///
/// \brief Constructor
......@@ -95,9 +94,7 @@ protected:
Type m_type; ///< Collision detection algorithm type
CollisionData& m_colData; ///< Collision data
};
}
#endif // ifndef imstkCollisionDetection_h
......@@ -26,7 +26,6 @@
namespace imstk
{
///
/// \brief Do ranges [a,b] and [c,d] intersect?
///
......@@ -158,7 +157,6 @@ testPointToTriAABB(const double& x1, const double& y1, const double& z1,
z1 - prox1, z1 + prox1, min_x - prox2, max_x + prox2,
min_y - prox2, max_y + prox2, min_z - prox2, max_z + prox2);
}
}
#endif // ifndef imstkIntersectionTestUtils_h
......@@ -30,7 +30,6 @@
namespace imstk
{
void
MeshToCapsuleCD::computeCollisionData()
{
......@@ -76,5 +75,4 @@ MeshToCapsuleCD::computeCollisionData()
nodeId++;
}
}
} // imstk
......@@ -28,7 +28,6 @@
namespace imstk
{
class Mesh;
class Capsule;
class CollisionData;
......@@ -46,12 +45,12 @@ public:
/// \brief Constructor
///
MeshToCapsuleCD(std::shared_ptr<Mesh> mesh,
std::shared_ptr<Capsule> capsule,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToCapsule,
colData),
m_mesh(mesh),
m_capsule(capsule){}
std::shared_ptr<Capsule> capsule,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToCapsule,
colData),
m_mesh(mesh),
m_capsule(capsule){}
///
/// \brief Destructor
......@@ -68,7 +67,6 @@ private:
std::shared_ptr<Mesh> m_mesh; ///> Mesh
std::shared_ptr<Capsule> m_capsule; ///> Capsule
};
}
#endif // ifndef imstkMeshToCapsuleCD_h
\ No newline at end of file
......@@ -27,7 +27,6 @@
#include <g3log/g3log.hpp>
namespace imstk {
MeshToMeshCD::MeshToMeshCD(std::shared_ptr<SurfaceMesh> meshA,
std::shared_ptr<SurfaceMesh> meshB,
CollisionData& colData) :
......@@ -113,5 +112,4 @@ MeshToMeshCD::VFCallbackB(unsigned int fidB, unsigned int vidA,
colData.VTColData.push_back(VertexTriangleCollisionData(vidA, fidB, t));
//LOG(INFO) <<"VF: vA("<<vidA<<"), fB("<<fidB<<") \t\t@ t="<<t;
}
}
......@@ -31,7 +31,6 @@
namespace imstk
{
class SurfaceMesh;
class CollisionData;
......@@ -85,7 +84,6 @@ private:
std::shared_ptr<DeformModel> m_modelA; ///>
std::shared_ptr<DeformModel> m_modelB; ///>
};
}
#endif // ifndef imstkMeshToMeshCD_h
......@@ -30,7 +30,6 @@
namespace imstk
{
void
MeshToPlaneCD::computeCollisionData()
{
......@@ -53,7 +52,5 @@ MeshToPlaneCD::computeCollisionData()
}
nodeId++;
}
}
} // imstk
......@@ -28,7 +28,6 @@
namespace imstk
{
class Mesh;
class Plane;
class CollisionData;
......@@ -48,10 +47,10 @@ public:
MeshToPlaneCD(std::shared_ptr<Mesh> mesh,
std::shared_ptr<Plane> plane,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_plane(plane){}
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_plane(plane){}
///
/// \brief Destructor
......@@ -68,7 +67,6 @@ private:
std::shared_ptr<Mesh> m_mesh; ///> Mesh
std::shared_ptr<Plane> m_plane; ///> Plane
};
}
#endif // ifndef imstkMeshToPlaneCD_h
......@@ -30,7 +30,6 @@
namespace imstk
{
void
MeshToSphereCD::computeCollisionData()
{
......@@ -53,7 +52,5 @@ MeshToSphereCD::computeCollisionData()
}
nodeId++;
}
}
} // imstk
......@@ -28,7 +28,6 @@
namespace imstk
{
class Mesh;
class Sphere;
class CollisionData;
......@@ -46,12 +45,12 @@ public:
/// \brief Constructor
///
MeshToSphereCD(std::shared_ptr<Mesh> mesh,
std::shared_ptr<Sphere> sphere,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_sphere(sphere){}
std::shared_ptr<Sphere> sphere,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_sphere(sphere){}
///
/// \brief Destructor
......@@ -68,7 +67,6 @@ private:
std::shared_ptr<Mesh> m_mesh; ///> Mesh
std::shared_ptr<Sphere> m_sphere; ///> Sphere
};
}
#endif // ifndef imstkMeshToSphereCD_h
......@@ -26,7 +26,6 @@ limitations under the License.
namespace imstk
{
void
MeshToSpherePickingCD::computeCollisionData()
{
......@@ -53,5 +52,4 @@ MeshToSpherePickingCD::computeCollisionData()
nodeId++;
}
}
}
\ No newline at end of file
......@@ -29,7 +29,6 @@
namespace imstk
{
class Mesh;
class Sphere;
class CollisionData;
......@@ -47,12 +46,12 @@ public:
/// \brief Constructor
///
MeshToSpherePickingCD(std::shared_ptr<Mesh> mesh,
std::shared_ptr<Sphere> sphere,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_sphere(sphere){}
std::shared_ptr<Sphere> sphere,
CollisionData& colData) :
CollisionDetection(CollisionDetection::Type::MeshToSphere,
colData),
m_mesh(mesh),
m_sphere(sphere){}
///
/// \brief Destructor
......@@ -77,7 +76,6 @@ private:
std::shared_ptr<imstk::DeviceTracker> m_deviceTracker; ///> Device tracker to get the button status
unsigned int m_buttonId = 0; ///> button id
};
}
#endif // ifndef imstkMeshToSphereCD_h
Markdown is supported
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