Commit 7548fb25 authored by Sreekanth Arikatla's avatar Sreekanth Arikatla
Browse files

STYLE: Enforce style

parent 99b9f859
......@@ -236,10 +236,10 @@ int main()
// Collisions
auto colGraph = scene->getCollisionGraph();
auto CD = std::make_shared<MeshToMeshBruteForceCD>(fluidMesh, floorMeshColliding, nullptr);
auto CH = std::make_shared<PBDCollisionHandling>(CollisionHandling::Side::A,
CD->getCollisionData(), deformableObj, floor, pbdSolver);
colGraph->addInteractionPair(deformableObj, floor, CD, CH, nullptr);
auto CD = std::make_shared<MeshToMeshBruteForceCD>(fluidMesh, floorMeshColliding, nullptr);
auto CH = std::make_shared<PBDCollisionHandling>(CollisionHandling::Side::A,
CD->getCollisionData(), deformableObj, floor, pbdSolver);
colGraph->addInteractionPair(deformableObj, floor, CD, CH, nullptr);
// Light (white)
auto whiteLight = std::make_shared<DirectionalLight>("whiteLight");
......
......@@ -178,7 +178,7 @@ public:
NodePickData.clear();
}
CollisionData() {}
CollisionData() {}
std::vector<PositionDirectionCollisionData> PDColData; ///< Position Direction collision data
std::vector<VertexTriangleCollisionData> VTColData; ///< Vertex Triangle collision data
......
......@@ -46,7 +46,7 @@ public:
///
BidirectionalPlaneToSphere(std::shared_ptr<Plane> planeA,
std::shared_ptr<Sphere> sphereB,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::BidirectionalPlaneToSphere, colData),
m_planeA(planeA),
m_sphereB(sphereB)
......
......@@ -44,7 +44,7 @@ std::shared_ptr<CollisionDetection>
CollisionDetection::makeCollisionDetectionObject(const Type& type,
std::shared_ptr<CollidingObject> objA,
std::shared_ptr<CollidingObject> objB,
std::shared_ptr<CollisionData> colData)
std::shared_ptr<CollisionData> colData)
{
switch (type)
{
......
......@@ -65,7 +65,7 @@ public:
static std::shared_ptr<CollisionDetection> makeCollisionDetectionObject(const Type& type,
std::shared_ptr<CollidingObject> objA,
std::shared_ptr<CollidingObject> objB,
std::shared_ptr<CollisionData> colData);
std::shared_ptr<CollisionData> colData);
///
/// \brief Constructor
......@@ -74,11 +74,15 @@ public:
m_type(type)//,
//m_colData(colData)
{
if (colData == nullptr)
m_colData = std::make_shared<CollisionData>();
else
m_colData = colData;
}
if (colData == nullptr)
{
m_colData = std::make_shared<CollisionData>();
}
else
{
m_colData = colData;
}
}
CollisionDetection() = delete;
///
......
......@@ -47,7 +47,7 @@ public:
///
MeshToMeshBruteForceCD(std::shared_ptr<Geometry> obj1,
std::shared_ptr<SurfaceMesh> obj2,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::MeshToMeshBruteForce,
colData),
m_object1(obj1),
......
......@@ -29,7 +29,7 @@
namespace imstk {
MeshToMeshCD::MeshToMeshCD(std::shared_ptr<SurfaceMesh> meshA,
std::shared_ptr<SurfaceMesh> meshB,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::MeshToMesh, colData),
m_meshA(meshA),
m_meshB(meshB)
......
......@@ -46,7 +46,7 @@ public:
///
PointSetToCapsuleCD(std::shared_ptr<PointSet> pointSet,
std::shared_ptr<Capsule> capsule,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::PointSetToCapsule,
colData),
m_pointSet(pointSet),
......
......@@ -46,7 +46,7 @@ public:
///
PointSetToPlaneCD(std::shared_ptr<PointSet> pointSet,
std::shared_ptr<Plane> plane,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::PointSetToSphere,
colData),
m_pointSet(pointSet),
......
......@@ -46,7 +46,7 @@ public:
///
PointSetToSphereCD(std::shared_ptr<PointSet> pointSet,
std::shared_ptr<Sphere> sphere,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::PointSetToSphere,
colData),
m_pointSet(pointSet),
......
......@@ -47,7 +47,7 @@ public:
///
PointSetToSpherePickingCD(std::shared_ptr<PointSet> pointSet,
std::shared_ptr<Sphere> sphere,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::PointSetToSphere,
colData),
m_pointSet(pointSet),
......
......@@ -46,7 +46,7 @@ public:
///
SphereCylinderCD(std::shared_ptr<Sphere> sphere,
std::shared_ptr<Cylinder> cylinder,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::SphereToCylinder, colData),
m_cylinder(cylinder),
m_sphere(sphere)
......
......@@ -45,7 +45,7 @@ public:
///
SphereToSphereCD(std::shared_ptr<Sphere> sphereA,
std::shared_ptr<Sphere> sphereB,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::SphereToSphere, colData),
m_sphereA(sphereA),
m_sphereB(sphereB)
......
......@@ -29,7 +29,7 @@
namespace imstk {
TetraToTetraCD::TetraToTetraCD(std::shared_ptr<TetrahedralMesh> meshA,
std::shared_ptr<TetrahedralMesh> meshB,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::MeshToMesh, colData), //is TetrahedralMeshToTetrahedralMesh type needed?
m_meshA(meshA),
m_meshB(meshB)
......
......@@ -46,7 +46,7 @@ public:
///
UnidirectionalPlaneToSphereCD(std::shared_ptr<Plane> planeA,
std::shared_ptr<Sphere> sphereB,
std::shared_ptr<CollisionData> colData) :
std::shared_ptr<CollisionData> colData) :
CollisionDetection(CollisionDetection::Type::UnidirectionalPlaneToSphere, colData),
m_planeA(planeA),
m_sphereB(sphereB)
......
......@@ -50,10 +50,14 @@ PBDCollisionHandling::processCollisionData()
<< " (rigid mesh not yet supported).";
}*/
this->generatePBDConstraints();
if(m_PBDSolver)
m_PBDSolver->addCollisionConstraints(&m_PBDConstraints);
else
LOG(WARNING) << "Error: PBDCollisionHandling: no PbdSolver found to handle the Collision constraints...";
if(m_PBDSolver)
{
m_PBDSolver->addCollisionConstraints(&m_PBDConstraints);
}
else
{
LOG(WARNING) << "Error: PBDCollisionHandling: no PbdSolver found to handle the Collision constraints...";
}
}
void
......@@ -99,6 +103,6 @@ PBDCollisionHandling::generatePBDConstraints()
m_PBDConstraints.push_back(c);
}
//TODO: generating PbdPointTriangleConstraint from the VTColData should be added
//TODO: generating PbdPointTriangleConstraint from the VTColData should be added
}
}
\ No newline at end of file
......@@ -53,11 +53,11 @@ public:
const std::shared_ptr<CollisionData> colData,
std::shared_ptr<PbdObject> obj1,
std::shared_ptr<PbdObject> obj2,
std::shared_ptr<PbdSolver> PBDSolver = nullptr) :
std::shared_ptr<PbdSolver> PBDSolver = nullptr) :
CollisionHandling(Type::Penalty, side, colData),
m_pbdObject1(obj1),
m_pbdObject2(obj2),
m_PBDSolver(PBDSolver){}
m_PBDSolver(PBDSolver){}
PBDCollisionHandling() = delete;
......@@ -81,7 +81,7 @@ private:
std::shared_ptr<PbdObject> m_pbdObject1; ///> PBD object
std::shared_ptr<PbdObject> m_pbdObject2; ///> PBD object
PBDConstraintVector m_PBDConstraints; ///> List of PBD constraints
std::shared_ptr<PbdSolver> m_PBDSolver; /// The Solver for the collision constraints
std::shared_ptr<PbdSolver> m_PBDSolver; /// The Solver for the collision constraints
};
}
......
......@@ -59,7 +59,7 @@ TEST_F(imstkTetraToTetraCDTest, NoSelfIntersection)
std::shared_ptr<TetrahedralMesh> a = loadMesh("/asianDragon/asianDragon.veg");
auto b = std::make_shared<TetrahedralMesh>(TetrahedralMesh()); //empty mesh
auto cd = std::make_shared<CollisionData>();
auto cd = std::make_shared<CollisionData>();
m_CD = new TetraToTetraCD(a, b, cd);
m_CD->computeCollisionData();
......@@ -77,7 +77,7 @@ TEST_F(imstkTetraToTetraCDTest, IntersectionThenNoIntersection1T)
b->translateVertices(imstk::Vec3d(0.0, 1.0, 2.5));
auto cd = std::make_shared<CollisionData>();
auto cd = std::make_shared<CollisionData>();
m_CD = new TetraToTetraCD(a, b, cd);
m_CD->computeCollisionData();
EXPECT_EQ(cd->PTColData.size(), 1);
......@@ -111,7 +111,7 @@ TEST_F(imstkTetraToTetraCDTest, IntersectionThenNoIntersectionHuman)
b->translateVertices(imstk::Vec3d(16.0, 0.0, 1.0));
auto cd = std::make_shared<CollisionData>();
auto cd = std::make_shared<CollisionData>();
m_CD = new TetraToTetraCD(a, b, cd);
m_CD->computeCollisionData();
......@@ -150,7 +150,7 @@ TEST_F(imstkTetraToTetraCDTest, IntersectionOfDifferentMeshes)
std::shared_ptr<TetrahedralMesh> a = loadMesh("/asianDragon/asianDragon.veg");
std::shared_ptr<TetrahedralMesh> b = loadMesh("/human/human.veg");
auto cd = std::make_shared<CollisionData>();
auto cd = std::make_shared<CollisionData>();
m_CD = new TetraToTetraCD(a, b, cd);
m_CD->computeCollisionData();
EXPECT_EQ(cd->PTColData.size(), 595);
......
......@@ -104,7 +104,7 @@ protected:
ObjectsPair m_objects; ///< Colliding objects
std::shared_ptr<CollisionDetection> m_colDetect; ///< Collision detection algorithm
std::shared_ptr<CollisionData> m_colData; ///< Common Collision Data
std::shared_ptr<CollisionData> m_colData; ///< Common Collision Data
std::shared_ptr<CollisionHandling> m_colHandlingA; ///< Collision handling algorithm for A
std::shared_ptr<CollisionHandling> m_colHandlingB; ///< Collision handling algorithm for B
......
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