diff --git a/Examples/DeformableBody/DeformableBodyExample.cpp b/Examples/DeformableBody/DeformableBodyExample.cpp index 430fcf4034d7f35214875c18ecccad6c53bcb6c6..9765896108b2fbc91e9dab3be0b07fdaf47c1fb0 100644 --- a/Examples/DeformableBody/DeformableBodyExample.cpp +++ b/Examples/DeformableBody/DeformableBodyExample.cpp @@ -152,8 +152,8 @@ makeFEDeformableObject(std::shared_ptr<TetrahedralMesh> tetMesh) std::shared_ptr<SurfaceMesh> surfMesh = tetMesh->extractSurfaceMesh(); // Configure dynamic model - imstkNew<FEMDeformableBodyModel> dynaModel; - imstkNew<FEMModelConfig> config; + imstkNew<FemDeformableBodyModel> dynaModel; + imstkNew<FemModelConfig> config; config->m_fixedNodeIds = input.fixedNodeIds; dynaModel->configure(config); //dynaModel->configure(iMSTK_DATA_ROOT "/asianDragon/asianDragon.config"); diff --git a/Examples/PBD/PBDInjection/InflatableObject.cpp b/Examples/PBD/PBDInjection/InflatableObject.cpp index 8f46a94dd2c5a428a6c54f784834fdcc1c54f04c..6152cabd09341f7c4e23c46790ecadd2a693eb9d 100644 --- a/Examples/PBD/PBDInjection/InflatableObject.cpp +++ b/Examples/PBD/PBDInjection/InflatableObject.cpp @@ -240,7 +240,7 @@ InflatableObject::findAffectedConstraint(const Vec3d& toolTip, const double radi Vec3d min, max; m_objectTetMesh->computeBoundingBox(min, max); - if (!CollisionUtils::testAABBToAABB(toolTip[0], toolTip[0], toolTip[1], toolTip[1], toolTip[2], toolTip[2], + if (!CollisionUtils::testAabbToAabb(toolTip[0], toolTip[0], toolTip[1], toolTip[1], toolTip[2], toolTip[2], min[0], max[0], min[1], max[1], min[2], max[2])) { return; diff --git a/Examples/RenderingVolume/RenderingVolumeExample.cpp b/Examples/RenderingVolume/RenderingVolumeExample.cpp index c3935191644bf89c7fc1dd69f178dbc1a0dc01b5..8f7cdd496d7ecb5bc56f918738676c17bf7c32a6 100644 --- a/Examples/RenderingVolume/RenderingVolumeExample.cpp +++ b/Examples/RenderingVolume/RenderingVolumeExample.cpp @@ -94,12 +94,12 @@ main() // Change view background to black every other frame std::cout << "Displaying with volume material preset: " << currMatId << std::endl; // Query for a volume material preset - std::shared_ptr<VolumeRenderMaterial> volumeMaterial = VolumeRenderMaterialPresets::getPreset(currMatId); + std::shared_ptr<VolumeRenderMaterial> volumeMaterial = VolumeRenderMaterialPresets::getPreset(static_cast<VolumeRenderMaterialPresets::Presets>(currMatId)); // Apply the preset to the visual object volumeObj->getVisualModel(0)->setRenderMaterial(volumeMaterial); std::ostringstream ss; - ss << "Volume Material Preset: " << imstk::VolumeRenderMaterialPresets::getPresetName(currMatId); + ss << "Volume Material Preset: " << imstk::VolumeRenderMaterialPresets::getPresetName(static_cast<VolumeRenderMaterialPresets::Presets>(currMatId)); statusManager->setCustomStatus(ss.str()); } }; diff --git a/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp b/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp index 1468eeb651c125f4c4bad55405d169916f402878..dfc4d88696c036216eebe9e573f1d92539c90f29 100644 --- a/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp +++ b/Examples/SPH-FEM-PBD/sphFemPbdExample.cpp @@ -96,11 +96,11 @@ generateBoxShapeFluid(const double particleRadius, const Vec3d& boxCenter, const /// \param shift/position of the fluid box /// \parma dimensions of the fluid box /// -std::shared_ptr<SPHObject> +std::shared_ptr<SphObject> makeSPHBoxObject(const std::string& name, const double particleRadius, const Vec3d& boxShift, const Vec3d& boxSize) { // Create the sph object - imstkNew<SPHObject> fluidObj(name); + imstkNew<SphObject> fluidObj(name); // Setup the Geometry std::shared_ptr<VecDataArray<double, 3>> particles = generateBoxShapeFluid(particleRadius, boxShift, boxSize); @@ -109,13 +109,13 @@ makeSPHBoxObject(const std::string& name, const double particleRadius, const Vec fluidGeometry->initialize(particles); // Setup the Parameters - imstkNew<SPHModelConfig> sphParams(particleRadius); + imstkNew<SphModelConfig> sphParams(particleRadius); sphParams->m_bNormalizeDensity = true; sphParams->m_kernelOverParticleRadiusRatio = 6.0; sphParams->m_surfaceTensionStiffness = 5.0; // Setup the Model - imstkNew<SPHModel> sphModel; + imstkNew<SphModel> sphModel; sphModel->setModelGeometry(fluidGeometry); sphModel->configure(sphParams); sphModel->setTimeStepSizeType(TimeSteppingType::RealTime); @@ -154,11 +154,11 @@ makeFEDragonObject(const std::string& name, const Vec3d& position) std::shared_ptr<SurfaceMesh> surfMesh = tetMesh->extractSurfaceMesh(); // Setup the Parameters - imstkNew<FEMModelConfig> config; + imstkNew<FemModelConfig> config; config->m_fixedNodeIds = { 50, 126, 177 }; // Setup the Model - imstkNew<FEMDeformableBodyModel> dynaModel; + imstkNew<FemDeformableBodyModel> dynaModel; dynaModel->configure(config); dynaModel->setTimeStepSizeType(TimeSteppingType::Fixed); dynaModel->setModelGeometry(tetMesh); @@ -256,7 +256,7 @@ main() scene->addSceneObject(feDragon); // SPH fluid box overtop the dragon - std::shared_ptr<SPHObject> sphFluidBox = makeSPHBoxObject("Box", 0.1, Vec3d(5.0, 7.0, 0.0), Vec3d(3.0, 7.0, 3.0)); + std::shared_ptr<SphObject> sphFluidBox = makeSPHBoxObject("Box", 0.1, Vec3d(5.0, 7.0, 0.0), Vec3d(3.0, 7.0, 3.0)); scene->addSceneObject(sphFluidBox); // Light diff --git a/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp b/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp index 8697bb4e46edc28047d924ff84b34a04530b06a1..a921048bbc4b250a3544ebc0ab73f26c67e14534 100644 --- a/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp +++ b/Examples/SPH-Obj-SDF/SPH-Obj-SDFInteractionExample.cpp @@ -81,11 +81,11 @@ generateBoxShapeFluid(const double particleRadius, const Vec3d& boxCenter, const return particles; } -std::shared_ptr<SPHObject> +std::shared_ptr<SphObject> makeSPHBoxObject(const std::string& name, const double particleRadius, const Vec3d& boxShift, const Vec3d& boxSize) { // Create the sph object - imstkNew<SPHObject> fluidObj(name); + imstkNew<SphObject> fluidObj(name); // Setup the Geometry std::shared_ptr<VecDataArray<double, 3>> particles = generateBoxShapeFluid(particleRadius, boxShift, boxSize); @@ -94,7 +94,7 @@ makeSPHBoxObject(const std::string& name, const double particleRadius, const Vec fluidGeometry->initialize(particles); // Setup the Parameters - imstkNew<SPHModelConfig> sphParams(particleRadius); + imstkNew<SphModelConfig> sphParams(particleRadius); sphParams->m_bNormalizeDensity = true; sphParams->m_kernelOverParticleRadiusRatio = 6.0; //sphParams->m_viscosityCoeff = 0.5; @@ -102,7 +102,7 @@ makeSPHBoxObject(const std::string& name, const double particleRadius, const Vec sphParams->m_gravity = Vec3d(0.0, -70.0, 0.0); // Setup the Model - imstkNew<SPHModel> sphModel; + imstkNew<SphModel> sphModel; sphModel->setModelGeometry(fluidGeometry); sphModel->configure(sphParams); sphModel->setTimeStepSizeType(TimeSteppingType::RealTime); @@ -173,7 +173,7 @@ main() scene->addSceneObject(dragonObj); // SPH fluid box overtop the dragon - std::shared_ptr<SPHObject> sphFluidBox = makeSPHBoxObject("Box", 0.1, Vec3d(0.0, 7.0, 0.0), Vec3d(3.0, 7.0, 3.0)); + std::shared_ptr<SphObject> sphFluidBox = makeSPHBoxObject("Box", 0.1, Vec3d(0.0, 7.0, 0.0), Vec3d(3.0, 7.0, 3.0)); scene->addSceneObject(sphFluidBox); // Interaction diff --git a/Examples/SPHFluid/Fluid.hpp b/Examples/SPHFluid/Fluid.hpp index b7a2f3ae3ea0b9c8500986b6cb765a964a692346..eadeaa8e2ea213fe7689cb4fb92f13f9c84eb69f 100644 --- a/Examples/SPHFluid/Fluid.hpp +++ b/Examples/SPHFluid/Fluid.hpp @@ -159,7 +159,7 @@ initializeNonZeroVelocities(const int numParticles) return initVelocitiesPtr; } -std::shared_ptr<SPHObject> +std::shared_ptr<SphObject> generateFluid(const double particleRadius) { std::shared_ptr<VecDataArray<double, 3>> particles = std::make_shared<VecDataArray<double, 3>>(); @@ -185,7 +185,7 @@ generateFluid(const double particleRadius) geometry->initialize(particles); // Create a fluids object - imstkNew<SPHObject> fluidObj("SPHSphere"); + imstkNew<SphObject> fluidObj("SPHSphere"); // Create a visual model imstkNew<VisualModel> visualModel(geometry.get()); @@ -205,11 +205,11 @@ generateFluid(const double particleRadius) visualModel->setRenderMaterial(material); // Create a physics model - imstkNew<SPHModel> sphModel; + imstkNew<SphModel> sphModel; sphModel->setModelGeometry(geometry); // Configure model - imstkNew<SPHModelConfig> sphParams(particleRadius); + imstkNew<SphModelConfig> sphParams(particleRadius); sphParams->m_bNormalizeDensity = true; if (SCENE_ID == 2) // highly viscous fluid { diff --git a/Examples/SPHFluid/SPHFluidExample.hpp b/Examples/SPHFluid/SPHFluidExample.hpp index c7fc1c464f67bda21ccc0e77700c9a50bb5525be..323fa09feb1ea45f79d751b638284f02929ecab5 100644 --- a/Examples/SPHFluid/SPHFluidExample.hpp +++ b/Examples/SPHFluid/SPHFluidExample.hpp @@ -74,7 +74,7 @@ main(int argc, char* argv[]) imstkNew<Scene> scene("SPH Fluid"); // Generate fluid and solid objects - std::shared_ptr<SPHObject> fluidObj = generateFluid(particleRadius); + std::shared_ptr<SphObject> fluidObj = generateFluid(particleRadius); std::vector<std::shared_ptr<CollidingObject>> solids = generateSolids(scene); scene->addSceneObject(fluidObj); @@ -113,7 +113,7 @@ main(int argc, char* argv[]) [&](Event*) { statusManager->setCustomStatus("Number of particles: " + - std::to_string(fluidObj->getSPHModel()->getCurrentState()->getNumParticles()) + + std::to_string(fluidObj->getSphModel()->getCurrentState()->getNumParticles()) + "\nNumber of solids: " + std::to_string(solids.size())); }); diff --git a/Examples/Vessel/vesselExample.cpp b/Examples/Vessel/vesselExample.cpp index 97269fd236ed620dc5f7a93a277c91756edc7bb9..0751e18c40bb7fafbe6ec2be4c6782bebf9ac5a5 100644 --- a/Examples/Vessel/vesselExample.cpp +++ b/Examples/Vessel/vesselExample.cpp @@ -94,11 +94,11 @@ generateFluidVolume(const double particleRadius, std::shared_ptr<SurfaceMesh> sp return particles; } -static std::shared_ptr<SPHObject> +static std::shared_ptr<SphObject> makeSPHObject(const std::string& name, const double particleRadius, const double particleSpacing) { // Create the sph object - imstkNew<SPHObject> fluidObj(name); + imstkNew<SphObject> fluidObj(name); // Setup the Geometry auto spawnMesh = MeshIO::read<SurfaceMesh>(iMSTK_DATA_ROOT "/legs/femoralArteryCut.stl"); @@ -109,14 +109,14 @@ makeSPHObject(const std::string& name, const double particleRadius, const double fluidGeometry->initialize(particles); // Setup the Parameters - imstkNew<SPHModelConfig> sphParams(particleRadius); + imstkNew<SphModelConfig> sphParams(particleRadius); sphParams->m_bNormalizeDensity = true; sphParams->m_kernelOverParticleRadiusRatio = 6.0; sphParams->m_surfaceTensionStiffness = 5.0; sphParams->m_frictionBoundary = 0.1; // Setup the Model - imstkNew<SPHModel> sphModel; + imstkNew<SphModel> sphModel; sphModel->setModelGeometry(fluidGeometry); sphModel->configure(sphParams); sphModel->setTimeStepSizeType(TimeSteppingType::RealTime); @@ -227,7 +227,7 @@ main() scene->getActiveCamera()->setViewUp(-0.66, 0.01, 0.75); // SPH fluid box overtop the dragon - std::shared_ptr<SPHObject> sphObj = makeSPHObject("Fluid", 0.004, 0.0035); + std::shared_ptr<SphObject> sphObj = makeSPHObject("Fluid", 0.004, 0.0035); scene->addSceneObject(sphObj); // Interaction diff --git a/Source/CollisionDetection/CollisionData/imstkCollisionData.h b/Source/CollisionDetection/CollisionData/imstkCollisionData.h index 65285c6faac033cd153bfad988b313beeb12f7de..a1b82abb0842bdad01e9b522e55264ce0e2919a0 100644 --- a/Source/CollisionDetection/CollisionData/imstkCollisionData.h +++ b/Source/CollisionDetection/CollisionData/imstkCollisionData.h @@ -35,7 +35,7 @@ enum class CollisionElementType CellVertex, CellIndex, PointDirection, - PointIndexDirection, + PointIndexDirection }; // iMSTK collision data (not contacts) are broken down into the following: diff --git a/Source/CollisionDetection/CollisionDetection/imstkCollisionDetectionAlgorithm.cpp b/Source/CollisionDetection/CollisionDetection/imstkCollisionDetectionAlgorithm.cpp index 253989856182723ef29fc8e52d0e9b6700d2f209..dc53c4c017d20c095aa3959a7f27af59d5e8dd31 100644 --- a/Source/CollisionDetection/CollisionDetection/imstkCollisionDetectionAlgorithm.cpp +++ b/Source/CollisionDetection/CollisionDetection/imstkCollisionDetectionAlgorithm.cpp @@ -29,7 +29,7 @@ namespace imstk CollisionDetectionAlgorithm::CollisionDetectionAlgorithm() : GeometryAlgorithm(), m_colData(std::make_shared<CollisionData>()) { - setNumberOfInputPorts(2); + setNumInputPorts(2); } bool diff --git a/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.cpp b/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.cpp index 77f3de9f48f1529e48f4d58081fa7335f40818d7..26f7f012211b373fe66643b949629a9dbf3f91f3 100644 --- a/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.cpp +++ b/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.cpp @@ -26,7 +26,7 @@ namespace imstk namespace CollisionUtils { bool -testLineToLineAABB(const double x1, const double y1, const double z1, +testLineToLineAabb(const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x3, const double y3, const double z3, const double x4, const double y4, const double z4, @@ -102,7 +102,7 @@ testLineToLineAABB(const double x1, const double y1, const double z1, max2_z = z3; } - return testAABBToAABB(min1_x - prox1, max1_x + prox1, min1_y - prox1, max1_y + prox1, + return testAabbToAabb(min1_x - prox1, max1_x + prox1, min1_y - prox1, max1_y + prox1, min1_z - prox1, max1_z + prox1, min2_x - prox2, max2_x + prox2, min2_y - prox2, max2_y + prox2, min2_z - prox2, max2_z + prox2); } diff --git a/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.h b/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.h index fe8c971b63a4546d9f06174f2efc5095a1635271..67c2818c415cd5cc6a08223e754b117bee0e23aa 100644 --- a/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.h +++ b/Source/CollisionDetection/CollisionDetection/imstkCollisionUtils.h @@ -45,7 +45,7 @@ isIntersect(const double a, const double b, const double c, const double d) /// \brief Check if two AABBs are intersecting /// inline bool -testAABBToAABB(const double min1_x, const double max1_x, +testAabbToAabb(const double min1_x, const double max1_x, const double min1_y, const double max1_y, const double min1_z, const double max1_z, const double min2_x, const double max2_x, @@ -61,7 +61,7 @@ testAABBToAABB(const double min1_x, const double max1_x, /// \brief Check if triangle and point are intersecting with AABB test /// inline bool -testPointToTriAABB(const double x1, const double y1, const double z1, +testPointToTriAabb(const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x3, const double y3, const double z3, const double x4, const double y4, const double z4, @@ -74,7 +74,7 @@ testPointToTriAABB(const double x1, const double y1, const double z1, const auto min_z = std::min({ z2, z3, z4 }); const auto max_z = std::max({ z2, z3, z4 }); - return testAABBToAABB(x1 - prox1, x1 + prox1, y1 - prox1, y1 + prox1, + return testAabbToAabb(x1 - prox1, x1 + prox1, y1 - prox1, y1 + prox1, z1 - prox1, z1 + prox1, min_x - prox2, max_x + prox2, min_y - prox2, max_y + prox2, min_z - prox2, max_z + prox2); } @@ -88,7 +88,7 @@ testPointToTriAABB(const double x1, const double y1, const double z1, /// \param prox1 Round-off precision for the test /// \param prox2 Round-off precision for the test /// -bool testLineToLineAABB(const double x1, const double y1, const double z1, +bool testLineToLineAabb(const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x3, const double y3, const double z3, const double x4, const double y4, const double z4, @@ -104,7 +104,7 @@ bool testLineToLineAABB(const double x1, const double y1, const double z1, /// \param prox2 Round-off precision for the test /// inline bool -testLineToLineAABB(const Vec3d& p1A, const Vec3d& p1B, +testLineToLineAabb(const Vec3d& p1A, const Vec3d& p1B, const Vec3d& p2A, const Vec3d& p2B, const double prox1 = VERY_SMALL_EPSILON_D, const double prox2 = VERY_SMALL_EPSILON_D) { @@ -112,7 +112,7 @@ testLineToLineAABB(const Vec3d& p1A, const Vec3d& p1B, const double* p1Bptr = &p1B[0]; const double* p2Aptr = &p2A[0]; const double* p2Bptr = &p2B[0]; - return testLineToLineAABB(p1Aptr[0], p1Aptr[1], p1Aptr[2], + return testLineToLineAabb(p1Aptr[0], p1Aptr[1], p1Aptr[2], p1Bptr[0], p1Bptr[1], p1Bptr[2], p2Aptr[0], p2Aptr[1], p2Aptr[2], p2Bptr[0], p2Bptr[1], p2Bptr[2], diff --git a/Source/CollisionDetection/CollisionDetection/imstkMeshToMeshBruteForceCD.cpp b/Source/CollisionDetection/CollisionDetection/imstkMeshToMeshBruteForceCD.cpp index df2a76c60d1d79c5bee84446068f6e5dbbefc22e..4ff0187f4874c85856fcfab3f69430399efbbad1 100644 --- a/Source/CollisionDetection/CollisionDetection/imstkMeshToMeshBruteForceCD.cpp +++ b/Source/CollisionDetection/CollisionDetection/imstkMeshToMeshBruteForceCD.cpp @@ -656,7 +656,7 @@ MeshToMeshBruteForceCD::doBroadPhaseCollisionCheck( min2 -= m_padding; max2 += m_padding; - return CollisionUtils::testAABBToAABB( + return CollisionUtils::testAabbToAabb( min1[0], max1[0], min1[1], max1[1], min1[2], max1[2], diff --git a/Source/CollisionHandling/imstkPenaltyCH.cpp b/Source/CollisionHandling/imstkPenaltyCH.cpp index 27f6420444391a7587b6967dc8576b4368d88d9d..c413365942f0ff3bbd4ae7d99214ea6ea6197b31 100644 --- a/Source/CollisionHandling/imstkPenaltyCH.cpp +++ b/Source/CollisionHandling/imstkPenaltyCH.cpp @@ -114,7 +114,7 @@ PenaltyCH::computeContactForcesDiscreteDeformable( } // Get current force vector - std::shared_ptr<FEMDeformableBodyModel> model = deformableObj->getFEMModel(); + std::shared_ptr<FemDeformableBodyModel> model = deformableObj->getFEMModel(); Vectord& force = model->getContactForce(); const Vectord& velVector = model->getCurrentState()->getQDot(); diff --git a/Source/CollisionHandling/imstkSPHCollisionHandling.cpp b/Source/CollisionHandling/imstkSPHCollisionHandling.cpp index abf9ff4da63ba28530692eeb9a5487f32b87e226..5bf55e2a9718dee8bb3ef61987ce8f21c1c8fe27 100644 --- a/Source/CollisionHandling/imstkSPHCollisionHandling.cpp +++ b/Source/CollisionHandling/imstkSPHCollisionHandling.cpp @@ -29,18 +29,18 @@ namespace imstk { void -SPHCollisionHandling::setInputSPHObject(std::shared_ptr<SPHObject> sphObj) +SphCollisionHandling::setInputSphObject(std::shared_ptr<SphObject> sphObj) { setInputObjectA(sphObj); } void -SPHCollisionHandling::handle( +SphCollisionHandling::handle( const std::vector<CollisionElement>& elementsA, const std::vector<CollisionElement>& imstkNotUsed(elementsB)) { - std::shared_ptr<SPHObject> obj = std::dynamic_pointer_cast<SPHObject>(getInputObjectA()); - std::shared_ptr<SPHModel> sphModel = obj->getSPHModel(); + std::shared_ptr<SphObject> obj = std::dynamic_pointer_cast<SphObject>(getInputObjectA()); + std::shared_ptr<SphModel> sphModel = obj->getSphModel(); #if defined(DEBUG) || defined(_DEBUG) || !defined(NDEBUG) LOG_IF(FATAL, (!sphModel)) << "SPH model was not initialized"; #endif @@ -51,7 +51,7 @@ SPHCollisionHandling::handle( << "Invalid boundary friction coefficient (value must be in [0, 1])"; #endif - std::shared_ptr<SPHState> state = sphModel->getCurrentState(); + std::shared_ptr<SphState> state = sphModel->getCurrentState(); std::shared_ptr<VecDataArray<double, 3>> positionsPtr = state->getPositions(); std::shared_ptr<VecDataArray<double, 3>> velocitiesPtr = state->getVelocities(); VecDataArray<double, 3>& positions = *positionsPtr; @@ -84,7 +84,7 @@ SPHCollisionHandling::handle( } void -SPHCollisionHandling::solve(Vec3d& pos, Vec3d& velocity, const Vec3d& penetrationVector) +SphCollisionHandling::solve(Vec3d& pos, Vec3d& velocity, const Vec3d& penetrationVector) { // Correct particle position pos -= penetrationVector; diff --git a/Source/CollisionHandling/imstkSPHCollisionHandling.h b/Source/CollisionHandling/imstkSPHCollisionHandling.h index eb49a701beb25ea6e66313753edb5a32c2ba5815..fa00d1052c72f71f13c56b367df6f02df15f11ae 100644 --- a/Source/CollisionHandling/imstkSPHCollisionHandling.h +++ b/Source/CollisionHandling/imstkSPHCollisionHandling.h @@ -27,7 +27,7 @@ namespace imstk { class CollisionData; class CollisionDetectionAlgorithm; -class SPHObject; +class SphObject; /// /// \class SPHCollisionHandling @@ -36,16 +36,16 @@ class SPHObject; /// to resolve positions and correct velocities of SPH particles. It does /// not correct pressures/densities. /// -class SPHCollisionHandling : public CollisionHandling +class SphCollisionHandling : public CollisionHandling { public: - SPHCollisionHandling() = default; - virtual ~SPHCollisionHandling() override = default; + SphCollisionHandling() = default; + virtual ~SphCollisionHandling() override = default; virtual const std::string getTypeName() const override { return "SPHCollisionHandling"; } public: - void setInputSPHObject(std::shared_ptr<SPHObject> sphObj); + void setInputSphObject(std::shared_ptr<SphObject> sphObj); /// /// \brief How many times to resolve and correct position. This is useful when colliding diff --git a/Source/Common/imstkLogger.cpp b/Source/Common/imstkLogger.cpp index 8722036efcf539d853db999c2709ce3de5b0f394..c659f4412a66c22f82a97999e11dcdc3a0f7da8b 100644 --- a/Source/Common/imstkLogger.cpp +++ b/Source/Common/imstkLogger.cpp @@ -32,17 +32,17 @@ stdSink::GetColor(const LEVELS level) const { if (level.value == WARNING.value) { - return Yellow; + return FontColor::Yellow; } if (level.value == DEBUG.value) { - return Green; + return FontColor::Green; } if (level.value == FATAL.value) { - return Red; + return FontColor::Red; } - return White; + return FontColor::White; } #ifdef WIN32 @@ -67,7 +67,7 @@ stdSink::ReceiveLogMessage(g3::LogMessageMover logEntry) const auto message = logEntry.get().message(); #ifndef WIN32 - auto color = GetColor(level); + auto color = static_cast<int>(GetColor(level)); std::cout << "\033[" << color << "m" << message << "\033[m" << std::endl; diff --git a/Source/Common/imstkLogger.h b/Source/Common/imstkLogger.h index ff6778116bfd2f23bf8e8c031b3a27dfbd4772e0..6667cc7e163f376097e5195368d75f9dba010c10 100644 --- a/Source/Common/imstkLogger.h +++ b/Source/Common/imstkLogger.h @@ -36,7 +36,7 @@ struct stdSink { // Linux xterm color // http://stackoverflow.com/questions/2616906/how-do-i-output-coloured-text-to-a-linux-terminal - enum FontColor + enum class FontColor { Yellow = 33, Red = 31, diff --git a/Source/Controllers/imstkLaparoscopicToolController.cpp b/Source/Controllers/imstkLaparoscopicToolController.cpp index 04940d55b63f15961f556bd34cb68692f3f08c97..c51ab980b91cb0634425aaa96f01628880d54da6 100644 --- a/Source/Controllers/imstkLaparoscopicToolController.cpp +++ b/Source/Controllers/imstkLaparoscopicToolController.cpp @@ -105,7 +105,7 @@ LaparoscopicToolController::update(const double dt) m_upperJaw->getVisualGeometry()->postModified(); // Check for transition closed/open - if (m_jawState == JawState::Open && m_jawAngle <= 0.0) + if (m_jawState == JawState::Opened && m_jawAngle <= 0.0) { m_jawState = JawState::Closed; this->postEvent(Event(JawClosed())); @@ -114,7 +114,7 @@ LaparoscopicToolController::update(const double dt) const double openingDegree = 5.0; if (m_jawState == JawState::Closed && m_jawAngle >= openingDegree * PI / 180.0) { - m_jawState = JawState::Open; + m_jawState = JawState::Opened; this->postEvent(Event(JawOpened())); } } diff --git a/Source/Controllers/imstkLaparoscopicToolController.h b/Source/Controllers/imstkLaparoscopicToolController.h index be08bbc0e0e337596caaca2f657984de368ddb31..1689eb3cda3ad327d3bed776232d3bc1c325c50b 100644 --- a/Source/Controllers/imstkLaparoscopicToolController.h +++ b/Source/Controllers/imstkLaparoscopicToolController.h @@ -41,7 +41,7 @@ public: enum class JawState { Closed, - Open + Opened }; public: @@ -110,7 +110,7 @@ protected: double m_jawAngle = PI / 6.0; ///< Angle of the jaws double m_change = 6.0e-5; ///< Amount of change in jaw angle per frame double m_maxJawAngle = PI / 6.0; ///< Maximum angle of the jaws - JawState m_jawState = JawState::Open; + JawState m_jawState = JawState::Opened; Vec3d m_jawRotationAxis; ///< Angle of the jaws diff --git a/Source/Controllers/imstkRigidObjectController.h b/Source/Controllers/imstkRigidObjectController.h index 215bd5a01c8291a2beb603d86042f142796aa365..1f2791411c846bef062e1c9bc65a58c11ea723d9 100644 --- a/Source/Controllers/imstkRigidObjectController.h +++ b/Source/Controllers/imstkRigidObjectController.h @@ -58,13 +58,13 @@ public: /// \brief Set/Get the linear damping coefficient. Default 10000.0 /// double getLinearKd() const { return m_linearKd; } - void setLinearKd(double kd) { m_linearKd = kd; } + void setLinearKd(const double kd) { m_linearKd = kd; } /// /// \brief Set/Get the angular damping coefficient. Default 10000.0 /// double getAngularKd() const { return m_angularKd; } - void setAngularKd(double kd) { m_angularKd = kd; } + void setAngularKd(const double kd) { m_angularKd = kd; } /// /// \brief Set/Get the linear spring coefficient. Default (8000000.0, 8000000.0, 8000000.0) @@ -135,8 +135,8 @@ protected: Vec3d m_linearKs = Vec3d(8000000.0, 8000000.0, 8000000.0); ///> Spring coefficient, linear Vec3d m_angularKs = Vec3d(10000.0, 10000.0, 10000.0); ///> Spring coefficient, rotational - Vec3d fS = Vec3d(0.0, 0.0, 0.0); - Vec3d tS = Vec3d(0.0, 0.0, 0.0); + Vec3d fS = Vec3d::Zero(); + Vec3d tS = Vec3d::Zero(); double m_forceScaling = 0.0000075; bool m_useSpring = true; ///> Controller has ability to toggle to from springs diff --git a/Source/Controllers/imstkSceneObjectController.h b/Source/Controllers/imstkSceneObjectController.h index 77e1c89d6cca7ec4dca02515a0ef1ecd4a484cb2..87a8fb4c43fb2f3691496c1de861dc7fa97e4c18 100644 --- a/Source/Controllers/imstkSceneObjectController.h +++ b/Source/Controllers/imstkSceneObjectController.h @@ -41,7 +41,6 @@ public: SceneObjectController() = delete; virtual ~SceneObjectController() override = default; -public: /// /// \brief Update controlled scene object using latest tracking information /// diff --git a/Source/Controllers/imstkTrackingDeviceControl.h b/Source/Controllers/imstkTrackingDeviceControl.h index 4dde886cdae8f197a5dba261b6d2525606e7a223..16f0d502bdc84c8b0b14ff2486086b24ba23dff2 100644 --- a/Source/Controllers/imstkTrackingDeviceControl.h +++ b/Source/Controllers/imstkTrackingDeviceControl.h @@ -52,7 +52,6 @@ protected: public: virtual ~TrackingDeviceControl() override = default; -public: /// /// \brief Apply forces to the haptic device /// diff --git a/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.cpp b/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.cpp index 7963abda2d35b815ba86d31874f20957c4953b8a..4d5908ebaa8f5895643096ebc11c627d2309b6ae 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.cpp +++ b/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.cpp @@ -32,49 +32,49 @@ namespace imstk { -CorotationalFEMForceModel::CorotationalFEMForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const int warp) : InternalForceModel(), m_warp(warp) +CorotationalFemForceModel::CorotationalFemForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const int warp) : InternalForceModel(), m_warp(warp) { auto tetMesh = std::dynamic_pointer_cast<vega::TetMesh>(mesh); - m_corotationalLinearFEM = std::make_shared<vega::CorotationalLinearFEM>(tetMesh.get()); + m_corotationalLinearFem = std::make_shared<vega::CorotationalLinearFEM>(tetMesh.get()); } void -CorotationalFEMForceModel::getInternalForce(const Vectord& u, Vectord& internalForce) +CorotationalFemForceModel::getInternalForce(const Vectord& u, Vectord& internalForce) { double* data = const_cast<double*>(u.data()); - m_corotationalLinearFEM->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, internalForce.data(), nullptr, m_warp); + m_corotationalLinearFem->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, internalForce.data(), nullptr, m_warp); } void -CorotationalFEMForceModel::getTangentStiffnessMatrix(const Vectord& u, SparseMatrixd& tangentStiffnessMatrix) +CorotationalFemForceModel::getTangentStiffnessMatrix(const Vectord& u, SparseMatrixd& tangentStiffnessMatrix) { double* data = const_cast<double*>(u.data()); - m_corotationalLinearFEM->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, nullptr, m_vegaTangentStiffnessMatrix.get(), m_warp); + m_corotationalLinearFem->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, nullptr, m_vegaTangentStiffnessMatrix.get(), m_warp); InternalForceModel::updateValuesFromMatrix(m_vegaTangentStiffnessMatrix, tangentStiffnessMatrix.valuePtr()); } void -CorotationalFEMForceModel::getTangentStiffnessMatrixTopology(vega::SparseMatrix** tangentStiffnessMatrix) +CorotationalFemForceModel::getTangentStiffnessMatrixTopology(vega::SparseMatrix** tangentStiffnessMatrix) { - m_corotationalLinearFEM->GetStiffnessMatrixTopology(tangentStiffnessMatrix); + m_corotationalLinearFem->GetStiffnessMatrixTopology(tangentStiffnessMatrix); } void -CorotationalFEMForceModel::getForceAndMatrix(const Vectord& u, Vectord& internalForce, SparseMatrixd& tangentStiffnessMatrix) +CorotationalFemForceModel::getForceAndMatrix(const Vectord& u, Vectord& internalForce, SparseMatrixd& tangentStiffnessMatrix) { double* data = const_cast<double*>(u.data()); - m_corotationalLinearFEM->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, internalForce.data(), m_vegaTangentStiffnessMatrix.get(), m_warp); + m_corotationalLinearFem->ComputeEnergyAndForceAndStiffnessMatrix(data, nullptr, internalForce.data(), m_vegaTangentStiffnessMatrix.get(), m_warp); InternalForceModel::updateValuesFromMatrix(m_vegaTangentStiffnessMatrix, tangentStiffnessMatrix.valuePtr()); } void -CorotationalFEMForceModel::setWarp(const int warp) +CorotationalFemForceModel::setWarp(const int warp) { m_warp = warp; } void -CorotationalFEMForceModel::setTangentStiffness(std::shared_ptr<vega::SparseMatrix> K) +CorotationalFemForceModel::setTangentStiffness(std::shared_ptr<vega::SparseMatrix> K) { m_vegaTangentStiffnessMatrix = K; } diff --git a/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.h b/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.h index 075e289d8cfdc990574e80c668f68fbf36243252..f1e19d7ab03c5cd3e39967b42c63673bf2d6e9dd 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.h +++ b/Source/DynamicalModels/InternalForceModel/imstkCorotationalFEMForceModel.h @@ -37,20 +37,20 @@ namespace imstk /// /// \brief Force model for corotational based finite elements formulation /// -class CorotationalFEMForceModel : public InternalForceModel +class CorotationalFemForceModel : public InternalForceModel { public: /// /// \brief Constructor using \p mesh /// \param warp if use warp /// - explicit CorotationalFEMForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const int warp = 1); - CorotationalFEMForceModel() = delete; + explicit CorotationalFemForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const int warp = 1); + CorotationalFemForceModel() = delete; /// /// \brief /// - virtual ~CorotationalFEMForceModel() = default; + virtual ~CorotationalFemForceModel() = default; /// /// \brief Compute internal force \p internalForce at state \p u @@ -83,7 +83,7 @@ public: void setTangentStiffness(std::shared_ptr<vega::SparseMatrix> K) override; protected: - std::shared_ptr<vega::CorotationalLinearFEM> m_corotationalLinearFEM; + std::shared_ptr<vega::CorotationalLinearFEM> m_corotationalLinearFem; std::shared_ptr<vega::SparseMatrix> m_vegaTangentStiffnessMatrix; int m_warp; }; diff --git a/Source/DynamicalModels/InternalForceModel/imstkInternalForceModel.h b/Source/DynamicalModels/InternalForceModel/imstkInternalForceModel.h index 23434cf24ed746eadbd51e65a51742a8095a9b3c..208884c9be46cd0a6f0f37a1d5af9d8940d783ed 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkInternalForceModel.h +++ b/Source/DynamicalModels/InternalForceModel/imstkInternalForceModel.h @@ -39,7 +39,7 @@ namespace imstk /// /// \class InternalForceModel /// -/// \brief Base class for internal force model within the following context: +/// \brief Base class for internal force model within the following context /// /// class InternalForceModel diff --git a/Source/DynamicalModels/InternalForceModel/imstkInternalForceModelTypes.h b/Source/DynamicalModels/InternalForceModel/imstkInternalForceModelTypes.h index 2889185fd72a34d93ddc123c583457362a7ee6a3..dc4928bc8165d6b5d038d3ea679a270e3993f080 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkInternalForceModelTypes.h +++ b/Source/DynamicalModels/InternalForceModel/imstkInternalForceModelTypes.h @@ -25,9 +25,9 @@ namespace imstk { /// /// \enum class -/// \brief Finite element material type +/// \brief Finite element method type /// -enum class FEMMethodType +enum class FeMethodType { StVK, Corotational, diff --git a/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.cpp b/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.cpp index cd89622445176b7cb502441abba5505157b67b65..7bc7c21dbaf7d067d16033aa6ee6c1035ff1e28a 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.cpp +++ b/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.cpp @@ -28,7 +28,7 @@ limitations under the License. namespace imstk { -IsotropicHyperelasticFEForceModel::IsotropicHyperelasticFEForceModel(const HyperElasticMaterialType materialType, +IsotropicHyperelasticFeForceModel::IsotropicHyperelasticFeForceModel(const HyperElasticMaterialType materialType, std::shared_ptr<vega::VolumetricMesh> mesh, const double inversionThreshold, const bool withGravity, const double gravity) : InternalForceModel() { @@ -64,7 +64,7 @@ IsotropicHyperelasticFEForceModel::IsotropicHyperelasticFEForceModel(const Hyper break; } - m_isotropicHyperelasticFEM = std::make_shared<vega::IsotropicHyperelasticFEM>( + m_isotropicHyperelasticFem = std::make_shared<vega::IsotropicHyperelasticFEM>( tetMesh.get(), m_isotropicMaterial.get(), inversionThreshold, diff --git a/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.h b/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.h index 1c5dad668c433f2784e4da8c50c36b7c29328e5e..0d29504462687863636b66b3b6332a16d94ec5e7 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.h +++ b/Source/DynamicalModels/InternalForceModel/imstkIsotropicHyperelasticFEMForceModel.h @@ -39,13 +39,13 @@ namespace imstk /// /// \brief Force model for the isotropic hyperelastic material /// -class IsotropicHyperelasticFEForceModel : public InternalForceModel +class IsotropicHyperelasticFeForceModel : public InternalForceModel { public: /// /// \brief Constructor /// - IsotropicHyperelasticFEForceModel(const HyperElasticMaterialType materialType, + IsotropicHyperelasticFeForceModel(const HyperElasticMaterialType materialType, std::shared_ptr<vega::VolumetricMesh> mesh, const double inversionThreshold, const bool withGravity = true, @@ -54,12 +54,12 @@ public: /// /// \brief Constructor type that is not allowed /// - IsotropicHyperelasticFEForceModel() = delete; + IsotropicHyperelasticFeForceModel() = delete; /// /// \brief Destructor /// - virtual ~IsotropicHyperelasticFEForceModel() override = default; + virtual ~IsotropicHyperelasticFeForceModel() override = default; /// /// \brief Get the internal force @@ -67,7 +67,7 @@ public: inline void getInternalForce(const Vectord& u, Vectord& internalForce) override { double* data = const_cast<double*>(u.data()); - m_isotropicHyperelasticFEM->ComputeForces(data, internalForce.data()); + m_isotropicHyperelasticFem->ComputeForces(data, internalForce.data()); } /// @@ -76,7 +76,7 @@ public: inline void getTangentStiffnessMatrix(const Vectord& u, SparseMatrixd& tangentStiffnessMatrix) override { double* data = const_cast<double*>(u.data()); - m_isotropicHyperelasticFEM->GetTangentStiffnessMatrix(data, m_vegaTangentStiffnessMatrix.get()); + m_isotropicHyperelasticFem->GetTangentStiffnessMatrix(data, m_vegaTangentStiffnessMatrix.get()); InternalForceModel::updateValuesFromMatrix(m_vegaTangentStiffnessMatrix, tangentStiffnessMatrix.valuePtr()); } @@ -85,7 +85,7 @@ public: /// inline void getTangentStiffnessMatrixTopology(vega::SparseMatrix** tangentStiffnessMatrix) override { - m_isotropicHyperelasticFEM->GetStiffnessMatrixTopology(tangentStiffnessMatrix); + m_isotropicHyperelasticFem->GetStiffnessMatrixTopology(tangentStiffnessMatrix); } /// @@ -94,7 +94,7 @@ public: inline void getForceAndMatrix(const Vectord& u, Vectord& internalForce, SparseMatrixd& tangentStiffnessMatrix) override { double* data = const_cast<double*>(u.data()); - m_isotropicHyperelasticFEM->GetForceAndTangentStiffnessMatrix(data, internalForce.data(), m_vegaTangentStiffnessMatrix.get()); + m_isotropicHyperelasticFem->GetForceAndTangentStiffnessMatrix(data, internalForce.data(), m_vegaTangentStiffnessMatrix.get()); InternalForceModel::updateValuesFromMatrix(m_vegaTangentStiffnessMatrix, tangentStiffnessMatrix.valuePtr()); } @@ -107,7 +107,7 @@ public: } protected: - std::shared_ptr<vega::IsotropicHyperelasticFEM> m_isotropicHyperelasticFEM; ///> + std::shared_ptr<vega::IsotropicHyperelasticFEM> m_isotropicHyperelasticFem; ///> std::shared_ptr<vega::IsotropicMaterial> m_isotropicMaterial; ///> std::shared_ptr<vega::SparseMatrix> m_vegaTangentStiffnessMatrix; ///> }; diff --git a/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.cpp b/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.cpp index c0a71ade9ba366a9b4c07640cd2ceb90cc371d96..35bf93a606abe87d96a905371bf832fb84730f25 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.cpp +++ b/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.cpp @@ -34,7 +34,7 @@ DISABLE_WARNING_POP namespace imstk { -LinearFEMForceModel::LinearFEMForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, +LinearFemForceModel::LinearFemForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const bool withGravity, const double gravity) : InternalForceModel() { auto tetMesh = std::dynamic_pointer_cast<vega::TetMesh>(mesh); @@ -55,7 +55,7 @@ LinearFEMForceModel::LinearFEMForceModel(std::shared_ptr<vega::VolumetricMesh> m free(zero); }; -LinearFEMForceModel::~LinearFEMForceModel() +LinearFemForceModel::~LinearFemForceModel() { if (m_stiffnessMatrixRawPtr) { diff --git a/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.h b/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.h index f1cc31f3236729a674a328c56c9d35146562f61a..e83dccb36618b99fe631fb9bd6ea4e62755265b5 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.h +++ b/Source/DynamicalModels/InternalForceModel/imstkLinearFEMForceModel.h @@ -32,23 +32,23 @@ class VolumetricMesh; namespace imstk { /// -/// \class LinearFEMForceModel +/// \class LinearFemForceModel /// /// \brief Force model for linear finite element formulation /// -class LinearFEMForceModel : public InternalForceModel +class LinearFemForceModel : public InternalForceModel { public: /// /// \brief Constructor /// - LinearFEMForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, + LinearFemForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const bool withGravity = true, const double gravity = -9.81); /// /// \brief Destructor /// - virtual ~LinearFEMForceModel() override; + virtual ~LinearFemForceModel() override; /// /// \brief Compute the internal force diff --git a/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.cpp b/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.cpp index 2aaa26bc4910f1890e824b31ff15b45c2afdd6a2..aab37cb0301925f9915460240feb3e21bb887b04 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.cpp +++ b/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.cpp @@ -33,7 +33,7 @@ DISABLE_WARNING_POP namespace imstk { -StVKForceModel::StVKForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, +StvkForceModel::StvkForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const bool withGravity, const double gravity) : InternalForceModel() { auto tetMesh = std::dynamic_pointer_cast<vega::TetMesh>(mesh); diff --git a/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.h b/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.h index b70ba6c867f0d1782497495b985d4f28c1300ba9..42e5a1d7b1a0b6d809daccad6fde72d9a8511e2b 100644 --- a/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.h +++ b/Source/DynamicalModels/InternalForceModel/imstkStVKForceModel.h @@ -27,25 +27,25 @@ namespace vega { -class StVKInternalForces; +class StvkInternalForces; class VolumetricMesh; } namespace imstk { -class StVKForceModel : public InternalForceModel +class StvkForceModel : public InternalForceModel { public: /// /// \brief Constructor /// - StVKForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, + StvkForceModel(std::shared_ptr<vega::VolumetricMesh> mesh, const bool withGravity = true, const double gravity = 10.0); /// /// \brief Destructor /// - virtual ~StVKForceModel() override = default; + virtual ~StvkForceModel() override = default; /// /// \brief Get the internal force diff --git a/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.cpp b/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.cpp index 1f60354223d5540b41dbde0eca8a5a4494937c2e..72d5437cc4635e36d02d5ea89c3608395c65768e 100644 --- a/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.cpp +++ b/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.cpp @@ -26,7 +26,7 @@ namespace imstk { AbstractDynamicalModel::AbstractDynamicalModel(DynamicalModelType type) : - m_type(type), m_numDOF(0), m_taskGraph(std::make_shared<TaskGraph>("AbstractDynamicalModel_Source", "AbstractDynamicalModel_Sink")) + m_type(type), m_numDof(0), m_taskGraph(std::make_shared<TaskGraph>("AbstractDynamicalModel_Source", "AbstractDynamicalModel_Sink")) { } diff --git a/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.h b/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.h index a92ad6d699a097aa882819cdd1b5ef42625019a5..5d50ac3f77c155b3f9e11cb699589ab094f761c6 100644 --- a/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.h +++ b/Source/DynamicalModels/ObjectModels/imstkAbstractDynamicalModel.h @@ -78,7 +78,6 @@ protected: public: virtual ~AbstractDynamicalModel() = default; -public: /// /// \brief Reset the current state to the initial state /// @@ -87,8 +86,8 @@ public: /// /// \brief Returns the number of degrees of freedom /// - std::size_t getNumDegreeOfFreedom() const { return m_numDOF; } - void setNumDegreeOfFreedom(const size_t nDof) { m_numDOF = nDof; } + std::size_t getNumDegreeOfFreedom() const { return m_numDof; } + void setNumDegreeOfFreedom(const size_t nDof) { m_numDof = nDof; } std::shared_ptr<TaskGraph> getTaskGraph() const { return m_taskGraph; } @@ -149,10 +148,9 @@ protected: /// virtual void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink); -protected: DynamicalModelType m_type; ///> Mathematical model type - std::size_t m_numDOF; ///> Total number of degree of freedom + std::size_t m_numDof; ///> Total number of degree of freedom std::shared_ptr<Geometry> m_geometry = nullptr; ///> Physics geometry of the model std::set<std::string> m_validGeometryTypes; ///> Valid geometry types of this model diff --git a/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.cpp b/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.cpp index e521017b1449f469d04658d26f5bbca74c5787b6..242130fe5ddb3a408e58db4c35dbcc38a656f3ee 100644 --- a/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.cpp +++ b/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.cpp @@ -46,7 +46,7 @@ DISABLE_WARNING_POP namespace imstk { -FEMDeformableBodyModel::FEMDeformableBodyModel() : +FemDeformableBodyModel::FemDeformableBodyModel() : DynamicalModel(DynamicalModelType::ElastoDynamics) { m_fixedNodeIds.reserve(1000); @@ -56,17 +56,17 @@ FEMDeformableBodyModel::FEMDeformableBodyModel() : m_solveNode = m_taskGraph->addFunction("FEMModel_Solve", [&]() { getSolver()->solve(); }); } -FEMDeformableBodyModel::~FEMDeformableBodyModel() +FemDeformableBodyModel::~FemDeformableBodyModel() { // Get vega to destruct first (before the shared pointer to the vega mesh is cleaned up) m_internalForceModel = nullptr; } void -FEMDeformableBodyModel::configure(const std::string& configFileName) +FemDeformableBodyModel::configure(const std::string& configFileName) { // Configure the FEMModelConfig - m_FEModelConfig = std::make_shared<FEMModelConfig>(); + m_FEModelConfig = std::make_shared<FemModelConfig>(); char femMethod[256]; char invertibleMaterial[256]; @@ -101,24 +101,24 @@ FEMDeformableBodyModel::configure(const std::string& configFileName) // Set fem method if (std::strcmp(femMethod, "StVK") == 0) { - m_FEModelConfig->m_femMethod = FEMMethodType::StVK; + m_FEModelConfig->m_femMethod = FeMethodType::StVK; } else if (std::strcmp(femMethod, "CLFEM") == 0) { - m_FEModelConfig->m_femMethod = FEMMethodType::Corotational; + m_FEModelConfig->m_femMethod = FeMethodType::Corotational; } else if (std::strcmp(femMethod, "Linear") == 0) { - m_FEModelConfig->m_femMethod = FEMMethodType::Linear; + m_FEModelConfig->m_femMethod = FeMethodType::Linear; } else if (std::strcmp(femMethod, "InvertibleFEM") == 0) { - m_FEModelConfig->m_femMethod = FEMMethodType::Invertible; + m_FEModelConfig->m_femMethod = FeMethodType::Invertible; } else { LOG(WARNING) << "FE method not assigned; will default to StVK"; - m_FEModelConfig->m_femMethod = FEMMethodType::StVK; + m_FEModelConfig->m_femMethod = FeMethodType::StVK; } // Set up hyperelastic material type @@ -145,13 +145,13 @@ FEMDeformableBodyModel::configure(const std::string& configFileName) } void -FEMDeformableBodyModel::configure(std::shared_ptr<FEMModelConfig> config) +FemDeformableBodyModel::configure(std::shared_ptr<FemModelConfig> config) { m_FEModelConfig = config; } bool -FEMDeformableBodyModel::initialize() +FemDeformableBodyModel::initialize() { // prerequisite of for successfully initializing CHECK(m_geometry != nullptr && m_FEModelConfig != nullptr) << "DeformableBodyModel::initialize: Physics mesh or force model configuration not set yet!"; @@ -206,33 +206,33 @@ FEMDeformableBodyModel::initialize() this->loadInitialStates(); - m_Feff.resize(m_numDOF); - m_Finternal.resize(m_numDOF); + m_Feff.resize(m_numDof); + m_Finternal.resize(m_numDof); m_Finternal.setConstant(0.0); - m_Fcontact.resize(m_numDOF); + m_Fcontact.resize(m_numDof); m_Fcontact.setConstant(0.0); - m_qSol.resize(m_numDOF); + m_qSol.resize(m_numDof); m_qSol.setConstant(0.0); return true; } void -FEMDeformableBodyModel::loadInitialStates() +FemDeformableBodyModel::loadInitialStates() { - if (m_numDOF == 0) + if (m_numDof == 0) { LOG(WARNING) << "Number of degree of freedom is zero!"; } // For now the initial states are set to zero - m_initialState = std::make_shared<kinematicState>(m_numDOF); - m_previousState = std::make_shared<kinematicState>(m_numDOF); - m_currentState = std::make_shared<kinematicState>(m_numDOF); + m_initialState = std::make_shared<kinematicState>(m_numDof); + m_previousState = std::make_shared<kinematicState>(m_numDof); + m_currentState = std::make_shared<kinematicState>(m_numDof); } bool -FEMDeformableBodyModel::loadBoundaryConditions() +FemDeformableBodyModel::loadBoundaryConditions() { auto fileName = m_FEModelConfig->m_fixedDOFFilename; @@ -284,35 +284,35 @@ FEMDeformableBodyModel::loadBoundaryConditions() } bool -FEMDeformableBodyModel::initializeForceModel() +FemDeformableBodyModel::initializeForceModel() { const double g = m_FEModelConfig->m_gravity; // Since vega 4.0 doesn't add gravity correcntly in all cases, we do it ourselves; see \ref initializeGravityForce // const bool isGravityPresent = (g > 0) ? true : false; const bool isGravityPresent = false; - m_numDOF = (size_t)m_vegaPhysicsMesh->getNumVertices() * 3; + m_numDof = (size_t)m_vegaPhysicsMesh->getNumVertices() * 3; switch (m_FEModelConfig->m_femMethod) { - case FEMMethodType::StVK: + case FeMethodType::StVK: - m_internalForceModel = std::make_shared<StVKForceModel>(m_vegaPhysicsMesh, isGravityPresent, g); + m_internalForceModel = std::make_shared<StvkForceModel>(m_vegaPhysicsMesh, isGravityPresent, g); break; - case FEMMethodType::Linear: + case FeMethodType::Linear: - m_internalForceModel = std::make_shared<LinearFEMForceModel>(m_vegaPhysicsMesh, isGravityPresent, g); + m_internalForceModel = std::make_shared<LinearFemForceModel>(m_vegaPhysicsMesh, isGravityPresent, g); break; - case FEMMethodType::Corotational: + case FeMethodType::Corotational: - m_internalForceModel = std::make_shared<CorotationalFEMForceModel>(m_vegaPhysicsMesh); + m_internalForceModel = std::make_shared<CorotationalFemForceModel>(m_vegaPhysicsMesh); break; - case FEMMethodType::Invertible: + case FeMethodType::Invertible: - m_internalForceModel = std::make_shared<IsotropicHyperelasticFEForceModel>( + m_internalForceModel = std::make_shared<IsotropicHyperelasticFeForceModel>( m_FEModelConfig->m_hyperElasticMaterialType, m_vegaPhysicsMesh, -MAX_D, @@ -329,7 +329,7 @@ FEMDeformableBodyModel::initializeForceModel() } bool -FEMDeformableBodyModel::initializeMassMatrix() +FemDeformableBodyModel::initializeMassMatrix() { CHECK(m_geometry != nullptr) << "Force model geometry not set!"; @@ -346,7 +346,7 @@ FEMDeformableBodyModel::initializeMassMatrix() } bool -FEMDeformableBodyModel::initializeDampingMatrix() +FemDeformableBodyModel::initializeDampingMatrix() { auto dampingLaplacianCoefficient = m_FEModelConfig->m_dampingLaplacianCoefficient; auto dampingMassCoefficient = m_FEModelConfig->m_dampingMassCoefficient; @@ -396,7 +396,7 @@ FEMDeformableBodyModel::initializeDampingMatrix() } bool -FEMDeformableBodyModel::initializeTangentStiffness() +FemDeformableBodyModel::initializeTangentStiffness() { CHECK(m_internalForceModel != nullptr) << "Tangent stiffness cannot be initialized without force model"; @@ -433,9 +433,9 @@ FEMDeformableBodyModel::initializeTangentStiffness() } bool -FEMDeformableBodyModel::initializeGravityForce() +FemDeformableBodyModel::initializeGravityForce() { - m_Fgravity.resize(m_numDOF); + m_Fgravity.resize(m_numDof); m_Fgravity.setZero(); const double gravity = m_FEModelConfig->m_gravity; @@ -445,7 +445,7 @@ FEMDeformableBodyModel::initializeGravityForce() } void -FEMDeformableBodyModel::computeImplicitSystemRHS(kinematicState& stateAtT, +FemDeformableBodyModel::computeImplicitSystemRHS(kinematicState& stateAtT, kinematicState& newState, const StateUpdateType updateType) { @@ -484,7 +484,7 @@ FEMDeformableBodyModel::computeImplicitSystemRHS(kinematicState& stateAtT, } void -FEMDeformableBodyModel::computeSemiImplicitSystemRHS(kinematicState& stateAtT, +FemDeformableBodyModel::computeSemiImplicitSystemRHS(kinematicState& stateAtT, kinematicState& newState, const StateUpdateType updateType) { @@ -523,7 +523,7 @@ FEMDeformableBodyModel::computeSemiImplicitSystemRHS(kinematicState& state } void -FEMDeformableBodyModel::computeImplicitSystemLHS(const kinematicState& imstkNotUsed(stateAtT), +FemDeformableBodyModel::computeImplicitSystemLHS(const kinematicState& imstkNotUsed(stateAtT), kinematicState& newState, const StateUpdateType updateType) { @@ -551,7 +551,7 @@ FEMDeformableBodyModel::computeImplicitSystemLHS(const kinematicState& imstkNotU } void -FEMDeformableBodyModel::computeSemiImplicitSystemRHSAndLHS(kinematicState& stateAtT, +FemDeformableBodyModel::computeSemiImplicitSystemRHSAndLHS(kinematicState& stateAtT, kinematicState& newState, const StateUpdateType updateType) { @@ -595,7 +595,7 @@ FEMDeformableBodyModel::computeSemiImplicitSystemRHSAndLHS(kinematicState& } void -FEMDeformableBodyModel::computeImplicitSystemRHSAndLHS(kinematicState& stateAtT, +FemDeformableBodyModel::computeImplicitSystemRHSAndLHS(kinematicState& stateAtT, kinematicState& newState, const StateUpdateType updateType) { @@ -642,16 +642,16 @@ FEMDeformableBodyModel::computeImplicitSystemRHSAndLHS(kinematicState& sta } bool -FEMDeformableBodyModel::initializeExplicitExternalForces() +FemDeformableBodyModel::initializeExplicitExternalForces() { - m_FexplicitExternal.resize(m_numDOF); + m_FexplicitExternal.resize(m_numDof); m_FexplicitExternal.setZero(); return true; } void -FEMDeformableBodyModel::updateDampingMatrix() +FemDeformableBodyModel::updateDampingMatrix() { if (m_damped) { @@ -675,7 +675,7 @@ FEMDeformableBodyModel::updateDampingMatrix() } void -FEMDeformableBodyModel::applyBoundaryConditions(SparseMatrixd& M, const bool withCompliance) const +FemDeformableBodyModel::applyBoundaryConditions(SparseMatrixd& M, const bool withCompliance) const { double compliance = withCompliance ? 1.0 : 0.0; @@ -706,7 +706,7 @@ FEMDeformableBodyModel::applyBoundaryConditions(SparseMatrixd& M, const bool wit } void -FEMDeformableBodyModel::applyBoundaryConditions(Vectord& x) const +FemDeformableBodyModel::applyBoundaryConditions(Vectord& x) const { for (auto& index : m_fixedNodeIds) { @@ -716,13 +716,13 @@ FEMDeformableBodyModel::applyBoundaryConditions(Vectord& x) const } void -FEMDeformableBodyModel::updateMassMatrix() +FemDeformableBodyModel::updateMassMatrix() { // Do nothing for now as topology changes are not supported yet! } void -FEMDeformableBodyModel::updatePhysicsGeometry() +FemDeformableBodyModel::updatePhysicsGeometry() { auto volMesh = std::static_pointer_cast<VolumetricMesh>(m_geometry); auto& u = m_currentState->getQ(); @@ -740,21 +740,21 @@ FEMDeformableBodyModel::updatePhysicsGeometry() } void -FEMDeformableBodyModel::updateBodyPreviousStates() +FemDeformableBodyModel::updateBodyPreviousStates() { m_previousState->setU(m_currentState->getQ()); m_previousState->setV(m_currentState->getQDot()); } void -FEMDeformableBodyModel::updateBodyStates(const Vectord& solution, const StateUpdateType updateType) +FemDeformableBodyModel::updateBodyStates(const Vectord& solution, const StateUpdateType updateType) { this->updateBodyPreviousStates(); this->updateBodyIntermediateStates(solution, updateType); } void -FEMDeformableBodyModel::updateBodyIntermediateStates( +FemDeformableBodyModel::updateBodyIntermediateStates( const Vectord& solution, const StateUpdateType updateType) { @@ -784,7 +784,7 @@ FEMDeformableBodyModel::updateBodyIntermediateStates( } NonLinearSystem<SparseMatrixd>::VectorFunctionType -FEMDeformableBodyModel::getFunction() +FemDeformableBodyModel::getFunction() { #ifdef WIN32 #pragma warning( push ) @@ -809,7 +809,7 @@ FEMDeformableBodyModel::getFunction() } NonLinearSystem<SparseMatrixd>::MatrixFunctionType -FEMDeformableBodyModel::getFunctionGradient() +FemDeformableBodyModel::getFunctionGradient() { #ifdef WIN32 #pragma warning( push ) @@ -832,7 +832,7 @@ FEMDeformableBodyModel::getFunctionGradient() } NonLinearSystem<SparseMatrixd>::VectorMatrixFunctionType -FEMDeformableBodyModel::getFunctionAndGradient() +FemDeformableBodyModel::getFunctionAndGradient() { #ifdef WIN32 #pragma warning( push ) @@ -859,7 +859,7 @@ FEMDeformableBodyModel::getFunctionAndGradient() } NonLinearSystem<SparseMatrixd>::UpdateFunctionType -FEMDeformableBodyModel::getUpdateFunction() +FemDeformableBodyModel::getUpdateFunction() { // Function to evaluate the nonlinear objective function given the current state return [&, this](const Vectord& q, const bool fullyImplicit) -> void @@ -871,7 +871,7 @@ FEMDeformableBodyModel::getUpdateFunction() } NonLinearSystem<SparseMatrixd>::UpdatePrevStateFunctionType -FEMDeformableBodyModel::getUpdatePrevStateFunction() +FemDeformableBodyModel::getUpdatePrevStateFunction() { // Function to evaluate the nonlinear objective function given the current state return [&, this]() -> void @@ -881,7 +881,7 @@ FEMDeformableBodyModel::getUpdatePrevStateFunction() } void -FEMDeformableBodyModel::initializeEigenMatrixFromVegaMatrix(const vega::SparseMatrix& vegaMatrix, +FemDeformableBodyModel::initializeEigenMatrixFromVegaMatrix(const vega::SparseMatrix& vegaMatrix, SparseMatrixd& eigenMatrix) { auto rowLengths = vegaMatrix.GetRowLengths(); @@ -903,26 +903,26 @@ FEMDeformableBodyModel::initializeEigenMatrixFromVegaMatrix(const vega::SparseMa } void -FEMDeformableBodyModel::setFixedSizeTimeStepping() +FemDeformableBodyModel::setFixedSizeTimeStepping() { m_timeStepSizeType = TimeSteppingType::Fixed; m_timeIntegrator->setTimestepSizeToDefault(); } void -FEMDeformableBodyModel::setTimeStep(const double timeStep) +FemDeformableBodyModel::setTimeStep(const double timeStep) { m_timeIntegrator->setTimestepSize(timeStep); } double -FEMDeformableBodyModel::getTimeStep() const +FemDeformableBodyModel::getTimeStep() const { return m_timeIntegrator->getTimestepSize(); }; void -FEMDeformableBodyModel::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) +FemDeformableBodyModel::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) { // Setup graph connectivity m_taskGraph->addEdge(source, m_solveNode); diff --git a/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.h b/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.h index 59b13df204fdfdd43abed29e4aaffa859b15494c..cbf26eac306b2dbf2b78a5d764ad7685f141eb2f 100644 --- a/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.h +++ b/Source/DynamicalModels/ObjectModels/imstkFEMDeformableBodyModel.h @@ -44,9 +44,9 @@ template<typename T, int N> class VecDataArray; /// /// \strut FEMModelConfig /// \brief Parameters for finite element model -struct FEMModelConfig +struct FemModelConfig { - FEMMethodType m_femMethod = FEMMethodType::Invertible; + FeMethodType m_femMethod = FeMethodType::Invertible; HyperElasticMaterialType m_hyperElasticMaterialType = HyperElasticMaterialType::StVK; // file names (remove from here?) @@ -69,7 +69,7 @@ struct FEMModelConfig /// \note Vega specifics will removed in future when the inertial and damping calculations /// are done with in-house code /// -class FEMDeformableBodyModel : public DynamicalModel<FeDeformBodyState> +class FemDeformableBodyModel : public DynamicalModel<FeDeformBodyState> { public: using kinematicState = FeDeformBodyState; @@ -79,19 +79,19 @@ public: /// /// \brief Constructor /// - FEMDeformableBodyModel(); + FemDeformableBodyModel(); /// /// \brief Destructor /// - ~FEMDeformableBodyModel() override; + ~FemDeformableBodyModel() override; public: /// /// \brief Configure the force model from external file /// void configure(const std::string& configFileName); - void configure(std::shared_ptr<FEMModelConfig> config = std::make_shared<FEMModelConfig>()); + void configure(std::shared_ptr<FemModelConfig> config = std::make_shared<FemModelConfig>()); /// /// \brief Initialize the deformable body model @@ -101,8 +101,8 @@ public: /// /// \brief Set/Get force model configuration /// - void setForceModelConfiguration(std::shared_ptr<FEMModelConfig> fmConfig) { this->m_FEModelConfig = fmConfig; } - std::shared_ptr<FEMModelConfig> getForceModelConfiguration() const { return m_FEModelConfig; } + void setForceModelConfiguration(std::shared_ptr<FemModelConfig> fmConfig) { this->m_FEModelConfig = fmConfig; } + std::shared_ptr<FemModelConfig> getForceModelConfiguration() const { return m_FEModelConfig; } /// /// \brief Set/Get internal force model @@ -299,13 +299,12 @@ protected: /// void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override; -protected: std::shared_ptr<SolverBase> m_solver = nullptr; std::shared_ptr<InternalForceModel> m_internalForceModel = nullptr; ///> Mathematical model for intenal forces std::shared_ptr<TimeIntegrator> m_timeIntegrator = nullptr; ///> Time integrator std::shared_ptr<NonLinearSystem<SparseMatrixd>> m_nonLinearSystem = nullptr; ///> Nonlinear system resulting from TI and force model - std::shared_ptr<FEMModelConfig> m_FEModelConfig = nullptr; + std::shared_ptr<FemModelConfig> m_FEModelConfig = nullptr; /// Matrices typical to a elastodynamics and 2nd order analogous systems SparseMatrixd m_M; ///> Mass matrix diff --git a/Source/DynamicalModels/ObjectModels/imstkLevelSetModel.h b/Source/DynamicalModels/ObjectModels/imstkLevelSetModel.h index 358345f73d250535cd761699383e2b9c9adc53a0..f2c62168131f9cd4a357aef30945c19bf10d380f 100644 --- a/Source/DynamicalModels/ObjectModels/imstkLevelSetModel.h +++ b/Source/DynamicalModels/ObjectModels/imstkLevelSetModel.h @@ -61,7 +61,6 @@ public: /// virtual ~LevelSetModel() override = default; -public: /// /// \brief Set the time step size /// @@ -108,7 +107,6 @@ protected: /// void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override; -protected: std::shared_ptr<ImplicitGeometry> m_mesh = nullptr; ///> Geometry on which the levelset evolves with std::vector<std::shared_ptr<TaskNode>> m_evolveQuantitiesNodes; diff --git a/Source/DynamicalModels/ObjectModels/imstkPbdConstraintFunctor.h b/Source/DynamicalModels/ObjectModels/imstkPbdConstraintFunctor.h index 498032d47bc8e7770f7bd70af1309b72e6c4ef51..0856165a21c78317862fad3e54659242d6da5c48 100644 --- a/Source/DynamicalModels/ObjectModels/imstkPbdConstraintFunctor.h +++ b/Source/DynamicalModels/ObjectModels/imstkPbdConstraintFunctor.h @@ -54,7 +54,6 @@ struct PbdConstraintFunctor PbdConstraintFunctor() = default; virtual ~PbdConstraintFunctor() = default; - public: /// /// \brief Appends a set of constraint to the container given a geometry /// @@ -70,7 +69,6 @@ struct PbdConstraintFunctor void setGeometry(std::shared_ptr<PointSet> geom) { m_geom = geom; } - public: std::shared_ptr<PointSet> m_geom = nullptr; }; @@ -86,7 +84,6 @@ struct PbdDistanceConstraintFunctor : public PbdConstraintFunctor PbdDistanceConstraintFunctor() = default; ~PbdDistanceConstraintFunctor() override = default; - public: /// /// \brief Create the distance constraint /// @@ -251,7 +248,6 @@ struct PbdFemTetConstraintFunctor : public PbdConstraintFunctor PbdFemTetConstraintFunctor() = default; ~PbdFemTetConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type @@ -298,7 +294,6 @@ struct PbdVolumeConstraintFunctor : public PbdConstraintFunctor PbdVolumeConstraintFunctor() = default; ~PbdVolumeConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type @@ -341,7 +336,6 @@ struct PbdAreaConstraintFunctor : public PbdConstraintFunctor PbdAreaConstraintFunctor() = default; ~PbdAreaConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type @@ -436,7 +430,6 @@ struct PbdBendConstraintFunctor : public PbdConstraintFunctor PbdBendConstraintFunctor() = default; ~PbdBendConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type @@ -503,7 +496,6 @@ struct PbdDihedralConstraintFunctor : public PbdConstraintFunctor PbdDihedralConstraintFunctor() = default; ~PbdDihedralConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type @@ -702,7 +694,6 @@ struct PbdConstantDensityConstraintFunctor : public PbdConstraintFunctor PbdConstantDensityConstraintFunctor() = default; ~PbdConstantDensityConstraintFunctor() override = default; - public: virtual void operator()(PbdConstraintContainer& constraints) override { // Check for correct mesh type diff --git a/Source/DynamicalModels/ObjectModels/imstkPbdModel.h b/Source/DynamicalModels/ObjectModels/imstkPbdModel.h index 1a30eb7ebc2a7a235ff1068fd0330aec455afbc2..e7a72b7f911609a2503e46117d1f8172e01c50ad 100644 --- a/Source/DynamicalModels/ObjectModels/imstkPbdModel.h +++ b/Source/DynamicalModels/ObjectModels/imstkPbdModel.h @@ -137,7 +137,6 @@ public: /// virtual ~PbdModel() override = default; -public: /// /// \brief Set simulation parameters /// @@ -235,21 +234,18 @@ protected: /// void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override; -protected: - size_t m_partitionThreshold = 16; ///> Threshold for constraint partitioning + size_t m_partitionThreshold = 16; ///> Threshold for constraint partitioning - std::shared_ptr<PbdSolver> m_pbdSolver = nullptr; ///> PBD solver - std::shared_ptr<PointSet> m_mesh = nullptr; ///> PointSet on which the pbd model operates on - std::shared_ptr<DataArray<double>> m_mass = nullptr; ///> Mass of nodes - std::shared_ptr<DataArray<double>> m_invMass = nullptr; ///> Inverse of mass of nodes - std::shared_ptr<std::unordered_map<size_t, double>> m_fixedNodeInvMass = nullptr; ///> Map for archiving fixed nodes' mass. + std::shared_ptr<PbdSolver> m_pbdSolver = nullptr; ///> PBD solver + std::shared_ptr<PointSet> m_mesh = nullptr; ///> PointSet on which the pbd model operates on + std::shared_ptr<DataArray<double>> m_mass = nullptr; ///> Mass of nodes + std::shared_ptr<DataArray<double>> m_invMass = nullptr; ///> Inverse of mass of nodes + std::shared_ptr<std::unordered_map<size_t, double>> m_fixedNodeInvMass = nullptr; ///> Map for archiving fixed nodes' mass. - std::shared_ptr<PbdModelConfig> m_config = nullptr; ///> Model parameters, must be set before simulation + std::shared_ptr<PbdModelConfig> m_config = nullptr; ///> Model parameters, must be set before simulation -protected: - std::shared_ptr<PbdConstraintContainer> m_constraints; ///> The set of constraints to update/use + std::shared_ptr<PbdConstraintContainer> m_constraints; ///> The set of constraints to update/use -protected: // Computational Nodes std::shared_ptr<TaskNode> m_integrationPositionNode = nullptr; std::shared_ptr<TaskNode> m_solveConstraintsNode = nullptr; diff --git a/Source/DynamicalModels/ObjectModels/imstkRigidBodyModel2.h b/Source/DynamicalModels/ObjectModels/imstkRigidBodyModel2.h index 13cd35df851dd520d7cc8b60c81911a25d34661b..9e3bbc0fc1c0c6edd2feb93d07f1289ee75c2e04 100644 --- a/Source/DynamicalModels/ObjectModels/imstkRigidBodyModel2.h +++ b/Source/DynamicalModels/ObjectModels/imstkRigidBodyModel2.h @@ -56,7 +56,6 @@ class RigidBodyModel2 : public DynamicalModel<RigidBodyState2> public: using StorageIndex = Eigen::SparseMatrix<double>::StorageIndex; -public: /// /// \brief Constructor /// @@ -67,7 +66,6 @@ public: /// virtual ~RigidBodyModel2() override = default; -public: /// /// \brief Set the time step size /// @@ -140,14 +138,12 @@ protected: /// void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override; -protected: std::shared_ptr<RigidBodyModel2Config> m_config; std::shared_ptr<TaskNode> m_computeTentativeVelocities; std::shared_ptr<TaskNode> m_solveNode; std::shared_ptr<TaskNode> m_integrateNode; -protected: std::shared_ptr<ProjectedGaussSeidelSolver<double>> m_pgsSolver; Eigen::SparseMatrix<double> m_Minv; std::list<std::shared_ptr<RbdConstraint>> m_constraints; diff --git a/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.cpp b/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.cpp index e8ce8be97c6ee349e3cc0ba3c76fdd58c1d748d4..57ef69c472656fd5689c20a37090617fd91fb8a1 100644 --- a/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.cpp +++ b/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.cpp @@ -25,7 +25,7 @@ limitations under the License. namespace imstk { -SPHBoundaryConditions::SPHBoundaryConditions(std::pair<Vec3d, Vec3d>& inletCoords, std::vector<std::pair<Vec3d, Vec3d>>& outletCoords, std::pair<Vec3d, Vec3d>& fluidCoords, +SphBoundaryConditions::SphBoundaryConditions(std::pair<Vec3d, Vec3d>& inletCoords, std::vector<std::pair<Vec3d, Vec3d>>& outletCoords, std::pair<Vec3d, Vec3d>& fluidCoords, const Vec3d& inletNormal, const StdVectorOfVec3d&, const double inletRadius, const Vec3d& inletCenterPt, const double inletFlowRate, StdVectorOfVec3d& mainParticlePositions, const StdVectorOfVec3d& wallParticlePositions) : m_inletDomain(inletCoords), m_outletDomain(outletCoords), @@ -43,7 +43,7 @@ SPHBoundaryConditions::SPHBoundaryConditions(std::pair<Vec3d, Vec3d>& inletCoord } bool -SPHBoundaryConditions::isInInletDomain(const Vec3d& position) +SphBoundaryConditions::isInInletDomain(const Vec3d& position) { if (position.x() >= m_inletDomain.first.x() && position.y() >= m_inletDomain.first.y() && position.z() >= m_inletDomain.first.z() && position.x() <= m_inletDomain.second.x() && position.y() <= m_inletDomain.second.y() && position.z() <= m_inletDomain.second.z()) @@ -55,7 +55,7 @@ SPHBoundaryConditions::isInInletDomain(const Vec3d& position) } bool -SPHBoundaryConditions::isInOutletDomain(const Vec3d& position) +SphBoundaryConditions::isInOutletDomain(const Vec3d& position) { for (const auto& i : m_outletDomain) { @@ -70,7 +70,7 @@ SPHBoundaryConditions::isInOutletDomain(const Vec3d& position) } bool -SPHBoundaryConditions::isInFluidDomain(const Vec3d& position) +SphBoundaryConditions::isInFluidDomain(const Vec3d& position) { const double error = 0.1; if (position.x() >= m_fluidDomain.first.x() - error && position.y() >= m_fluidDomain.first.y() - error && position.z() >= m_fluidDomain.first.z() - error @@ -86,7 +86,7 @@ SPHBoundaryConditions::isInFluidDomain(const Vec3d& position) /// \brief set particle type (fluid, wall, inlet, outlet, buffer) /// void -SPHBoundaryConditions::setParticleTypes(const StdVectorOfVec3d& mainParticlePositions, const size_t numWallParticles) +SphBoundaryConditions::setParticleTypes(const StdVectorOfVec3d& mainParticlePositions, const size_t numWallParticles) { m_particleTypes.reserve(mainParticlePositions.size() + numWallParticles + m_numBufferParticles); @@ -115,7 +115,7 @@ SPHBoundaryConditions::setParticleTypes(const StdVectorOfVec3d& mainParticlePosi } Vec3d -SPHBoundaryConditions::computeParabolicInletVelocity(const Vec3d& particlePosition) +SphBoundaryConditions::computeParabolicInletVelocity(const Vec3d& particlePosition) { // compute distance of point const Vec3d inletRegionCenterPoint = (Vec3d(1.0, 1.0, 1.0) + m_inletNormal).array() * m_inletCenterPoint.array() + particlePosition.dot(m_inletNormal) * m_inletNormal.array(); @@ -133,20 +133,20 @@ SPHBoundaryConditions::computeParabolicInletVelocity(const Vec3d& particlePositi } void -SPHBoundaryConditions::addBoundaryParticles(StdVectorOfVec3d& mainParticlePositions, const StdVectorOfVec3d& wallParticlePositions) +SphBoundaryConditions::addBoundaryParticles(StdVectorOfVec3d& mainParticlePositions, const StdVectorOfVec3d& wallParticlePositions) { mainParticlePositions.insert(mainParticlePositions.end(), wallParticlePositions.begin(), wallParticlePositions.end()); mainParticlePositions.insert(mainParticlePositions.end(), m_numBufferParticles, Vec3d(100.0, 0.0, 0.0)); } void -SPHBoundaryConditions::setInletVelocity(const double flowRate) +SphBoundaryConditions::setInletVelocity(const double flowRate) { m_inletVelocity = -m_inletNormal * (flowRate / m_inletCrossSectionalArea * 2.0); } Vec3d -SPHBoundaryConditions::placeParticleAtInlet(const Vec3d& position) +SphBoundaryConditions::placeParticleAtInlet(const Vec3d& position) { const Vec3d inletPosition = (Vec3d(1.0, 1.0, 1.0) + m_inletNormal).cwiseProduct(position) - m_inletCenterPoint.cwiseProduct(m_inletNormal); return inletPosition; diff --git a/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.h b/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.h index a7501738617fde13704fc500ee1d2842fdbb655d..f67fc66eb1ae626f2c87f66e664939614f80db8e 100644 --- a/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.h +++ b/Source/DynamicalModels/ObjectModels/imstkSPHBoundaryConditions.h @@ -29,7 +29,7 @@ namespace imstk /// \class SPHBoundaryConditions /// \brief Class that holds methods and members for boundary conditions /// -class SPHBoundaryConditions +class SphBoundaryConditions { public: enum class ParticleType @@ -42,7 +42,7 @@ public: }; public: - SPHBoundaryConditions(std::pair<Vec3d, Vec3d>& inletCoords, std::vector<std::pair<Vec3d, Vec3d>>& outletCoords, std::pair<Vec3d, Vec3d>& fluidCoords, + SphBoundaryConditions(std::pair<Vec3d, Vec3d>& inletCoords, std::vector<std::pair<Vec3d, Vec3d>>& outletCoords, std::pair<Vec3d, Vec3d>& fluidCoords, const Vec3d& inletNormal, const StdVectorOfVec3d& outletNormals, const double inletRadius, const Vec3d& inletCenterPt, const double inletFlowRate, StdVectorOfVec3d& mainParticlePositions, const StdVectorOfVec3d& wallParticlePositions); diff --git a/Source/DynamicalModels/ObjectModels/imstkSPHKernels.h b/Source/DynamicalModels/ObjectModels/imstkSPHKernels.h index b991c095272ba6f8cc6ccb602e84e3643be2c9de..2cf11f768768d2d2180f47ea7d50e6a2cc4669bf 100644 --- a/Source/DynamicalModels/ObjectModels/imstkSPHKernels.h +++ b/Source/DynamicalModels/ObjectModels/imstkSPHKernels.h @@ -26,7 +26,7 @@ namespace imstk { -namespace SPH +namespace sph { /// /// \class Poly6Kernel @@ -48,8 +48,8 @@ public: /// void setRadius(const double radius) { - m_radius = radius; - m_radius2 = m_radius * m_radius; + m_radius = radius; + m_radiusSquared = m_radius * m_radius; #ifdef WIN32 #pragma warning(push) @@ -79,8 +79,8 @@ public: double W(const double r) const { const double r2 = r * r; - const double rd = m_radius2 - r2; - return (r2 <= m_radius2) ? rd * rd * rd * m_k : 0.0; + const double rd = m_radiusSquared - r2; + return (r2 <= m_radiusSquared) ? rd * rd * rd * m_k : 0.0; } /// @@ -90,8 +90,8 @@ public: double W(const VecXd& r) const { const double r2 = r.squaredNorm(); - const double rd = m_radius2 - r2; - return (r2 <= m_radius2) ? rd * rd * rd * m_k : 0.0; + const double rd = m_radiusSquared - r2; + return (r2 <= m_radiusSquared) ? rd * rd * rd * m_k : 0.0; } /// @@ -107,9 +107,9 @@ public: { VecXd res = VecXd::Zero(); const double r2 = r.squaredNorm(); - if (r2 <= m_radius2 && r2 > 1.0e-12) + if (r2 <= m_radiusSquared && r2 > 1.0e-12) { - double tmp = m_radius2 - r2; + double tmp = m_radiusSquared - r2; res = m_l * tmp * tmp * r; } @@ -124,10 +124,10 @@ public: { double res = 0.; const double r2 = r.squaredNorm(); - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { - double tmp = m_radius2 - r2; - double tmp2 = 3.0 * m_radius2 - 7.0 * r2; + double tmp = m_radiusSquared - r2; + double tmp2 = 3.0 * m_radiusSquared - 7.0 * r2; res = m_m * tmp * tmp2; } @@ -135,12 +135,12 @@ public: } protected: - double m_radius; ///> Kernel radius - double m_radius2; ///> Kernel radius squared - double m_k; ///> Kernel coefficient for W() - double m_l; ///> Kernel coefficient for gradW() - double m_m; ///> Kernel coefficient for laplacian() - double m_W0; ///> Precomputed W(0) + double m_radius; ///> Kernel radius + double m_radiusSquared; ///> Kernel radius squared + double m_k; ///> Kernel coefficient for W() + double m_l; ///> Kernel coefficient for gradW() + double m_m; ///> Kernel coefficient for laplacian() + double m_W0; ///> Precomputed W(0) }; /// @@ -163,8 +163,8 @@ public: /// void setRadius(const double radius) { - m_radius = radius; - m_radius2 = m_radius * m_radius; + m_radius = radius; + m_radiusSquared = m_radius * m_radius; #ifdef WIN32 #pragma warning(push) @@ -206,7 +206,7 @@ public: { const double r2 = r.squaredNorm(); const double rd = m_radius - std::sqrt(r2); - return (r2 <= m_radius2) ? rd * rd * rd * m_k : 0.0; + return (r2 <= m_radiusSquared) ? rd * rd * rd * m_k : 0.0; } /// @@ -222,7 +222,7 @@ public: { VecXd res = VecXd::Zero(); const auto r2 = r.squaredNorm(); - if (r2 <= m_radius2 && r2 > 1.0e-12) + if (r2 <= m_radiusSquared && r2 > 1.0e-12) { const double rl = std::sqrt(r2); const double hr = m_radius - rl; @@ -234,11 +234,11 @@ public: } protected: - double m_radius; ///> Kernel radius - double m_radius2; ///> Kernel radius squared - double m_k; ///> Kernel coefficient for W() - double m_l; ///> Kernel coefficient for gradW() - double m_W0; ///> Precomputed W(0) + double m_radius; ///> Kernel radius + double m_radiusSquared; ///> Kernel radius squared + double m_k; ///> Kernel coefficient for W() + double m_l; ///> Kernel coefficient for gradW() + double m_W0; ///> Precomputed W(0) }; /// @@ -261,8 +261,8 @@ public: /// void setRadius(const double radius) { - m_radius = radius; - m_radius2 = m_radius * m_radius; + m_radius = radius; + m_radiusSquared = m_radius * m_radius; #ifdef WIN32 #pragma warning(push) @@ -286,7 +286,7 @@ public: { double res = 0.; const double r2 = r * r; - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { const double r1 = std::sqrt(r2); const double r3 = r2 * r1; @@ -312,7 +312,7 @@ public: { double res = 0.; const double r2 = r.squaredNorm(); - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { const double r1 = std::sqrt(r2); const double r3 = r2 * r1; @@ -336,11 +336,11 @@ public: double W0() const { return m_W0; } protected: - double m_radius; ///> Kernel radius - double m_radius2; ///> Kernel radius squared - double m_k; ///> Kernel coefficient for W() - double m_c; ///> Kernel coefficient for W() - double m_W0; ///> Precomputed W(0) + double m_radius; ///> Kernel radius + double m_radiusSquared; ///> Kernel radius squared + double m_k; ///> Kernel coefficient for W() + double m_c; ///> Kernel coefficient for W() + double m_W0; ///> Precomputed W(0) }; /// @@ -363,8 +363,8 @@ public: /// void setRadius(const double radius) { - m_radius = radius; - m_radius2 = m_radius * m_radius; + m_radius = radius; + m_radiusSquared = m_radius * m_radius; CHECK(N != 2) << "Unimplemented function"; @@ -380,7 +380,7 @@ public: { double res = 0.; const double r2 = r * r; - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { const double r = std::sqrt(r2); if (r > 0.5 * m_radius) @@ -399,7 +399,7 @@ public: { double res = 0.; const double r2 = r.squaredNorm(); - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { const double r = std::sqrt(r2); if (r > 0.5 * m_radius) @@ -416,10 +416,10 @@ public: double W0() const { return m_W0; } protected: - double m_radius; ///> Kernel radius - double m_radius2; ///> Kernel radius squared - double m_k; ///> Kernel coefficient for W() - double m_W0; ///> Precomputed W(0) + double m_radius; ///> Kernel radius + double m_radiusSquared; ///> Kernel radius squared + double m_k; ///> Kernel coefficient for W() + double m_W0; ///> Precomputed W(0) }; /// @@ -442,9 +442,9 @@ public: /// void setRadius(const double radius) { - m_radius = radius; - m_radius2 = radius * radius; - m_k = (45.0 / PI) / (m_radius2 * m_radius2 * m_radius2); + m_radius = radius; + m_radiusSquared = radius * radius; + m_k = (45.0 / PI) / (m_radiusSquared * m_radiusSquared * m_radiusSquared); } /// @@ -455,7 +455,7 @@ public: { double res = 0.; const double r2 = r.squaredNorm(); - if (r2 <= m_radius2) + if (r2 <= m_radiusSquared) { const double d = std::sqrt(r2); res = m_k * (m_radius - d); @@ -464,9 +464,9 @@ public: } protected: - double m_radius; ///> Kernel radius - double m_radius2; ///> Kernel radius squared - double m_k; ///> Kernel coefficient for laplacian() + double m_radius; ///> Kernel radius + double m_radiusSquared; ///> Kernel radius squared + double m_k; ///> Kernel coefficient for laplacian() }; } // end namespace SPH @@ -474,7 +474,7 @@ protected: /// \brief Class contains SPH kernels for time integration, /// using different kernel for different purposes /// -class SPHSimulationKernels +class SphSimulationKernels { public: /// @@ -514,9 +514,9 @@ public: double cohesionW(const Vec3d& r) const { return m_cohesion.W(r); } protected: - SPH::Poly6Kernel<3> m_poly6; - SPH::SpikyKernel<3> m_spiky; - SPH::ViscosityKernel<3> m_viscosity; - SPH::CohesionKernel<3> m_cohesion; + sph::Poly6Kernel<3> m_poly6; + sph::SpikyKernel<3> m_spiky; + sph::ViscosityKernel<3> m_viscosity; + sph::CohesionKernel<3> m_cohesion; }; } // end namespace imstk diff --git a/Source/DynamicalModels/ObjectModels/imstkSPHModel.cpp b/Source/DynamicalModels/ObjectModels/imstkSPHModel.cpp index 70bd74b3a70c40746d9caebe08bec9f770e4c18d..28142a9c98141615e5aef25d0138dead3332e92a 100644 --- a/Source/DynamicalModels/ObjectModels/imstkSPHModel.cpp +++ b/Source/DynamicalModels/ObjectModels/imstkSPHModel.cpp @@ -27,7 +27,7 @@ limitations under the License. namespace imstk { -SPHModelConfig::SPHModelConfig(const double particleRadius) +SphModelConfig::SphModelConfig(const double particleRadius) { // \todo Warning in all paths? if (std::abs(particleRadius) > 1.0e-6) @@ -43,7 +43,7 @@ SPHModelConfig::SPHModelConfig(const double particleRadius) initialize(); } -SPHModelConfig::SPHModelConfig(const double particleRadius, const double speedOfSound, const double restDensity) +SphModelConfig::SphModelConfig(const double particleRadius, const double speedOfSound, const double restDensity) { if (std::abs(particleRadius) > 1.0e-6) { @@ -77,7 +77,7 @@ SPHModelConfig::SPHModelConfig(const double particleRadius, const double speedOf } void -SPHModelConfig::initialize() +SphModelConfig::initialize() { // Compute the derived quantities m_particleRadiusSqr = m_particleRadius * m_particleRadius; @@ -92,35 +92,35 @@ SPHModelConfig::initialize() m_pressureStiffness = m_restDensity * m_speedOfSound * m_speedOfSound / 7.0; } -SPHModel::SPHModel() : DynamicalModel<SPHState>(DynamicalModelType::SmoothedParticleHydrodynamics) +SphModel::SphModel() : DynamicalModel<SphState>(DynamicalModelType::SmoothedParticleHydrodynamics) { m_validGeometryTypes = { "PointSet" }; - m_findParticleNeighborsNode = m_taskGraph->addFunction("SPHModel_Partition", std::bind(&SPHModel::findParticleNeighbors, this)); + m_findParticleNeighborsNode = m_taskGraph->addFunction("SPHModel_Partition", std::bind(&SphModel::findParticleNeighbors, this)); m_computeDensityNode = m_taskGraph->addFunction("SPHModel_ComputeDensity", [&]() { computeNeighborRelativePositions(); computeDensity(); }); - m_normalizeDensityNode = m_taskGraph->addFunction("SPHModel_NormalizeDensity", std::bind(&SPHModel::normalizeDensity, this)); + m_normalizeDensityNode = m_taskGraph->addFunction("SPHModel_NormalizeDensity", std::bind(&SphModel::normalizeDensity, this)); - m_collectNeighborDensityNode = m_taskGraph->addFunction("SPHModel_CollectNeighborDensity", std::bind(&SPHModel::collectNeighborDensity, this)); + m_collectNeighborDensityNode = m_taskGraph->addFunction("SPHModel_CollectNeighborDensity", std::bind(&SphModel::collectNeighborDensity, this)); m_computeTimeStepSizeNode = - m_taskGraph->addFunction("SPHModel_ComputeTimestep", std::bind(&SPHModel::computeTimeStepSize, this)); + m_taskGraph->addFunction("SPHModel_ComputeTimestep", std::bind(&SphModel::computeTimeStepSize, this)); m_computePressureAccelNode = - m_taskGraph->addFunction("SPHModel_ComputePressureAccel", std::bind(&SPHModel::computePressureAcceleration, this)); + m_taskGraph->addFunction("SPHModel_ComputePressureAccel", std::bind(&SphModel::computePressureAcceleration, this)); m_computeSurfaceTensionNode = - m_taskGraph->addFunction("SPHModel_ComputeSurfaceTensionAccel", std::bind(&SPHModel::computeSurfaceTension, this)); + m_taskGraph->addFunction("SPHModel_ComputeSurfaceTensionAccel", std::bind(&SphModel::computeSurfaceTension, this)); m_computeViscosityNode = - m_taskGraph->addFunction("SPHModel_ComputeViscosity", std::bind(&SPHModel::computeViscosity, this)); + m_taskGraph->addFunction("SPHModel_ComputeViscosity", std::bind(&SphModel::computeViscosity, this)); m_integrateNode = - m_taskGraph->addFunction("SPHModel_Integrate", std::bind(&SPHModel::sumAccels, this)); + m_taskGraph->addFunction("SPHModel_Integrate", std::bind(&SphModel::sumAccels, this)); m_updateVelocityNode = m_taskGraph->addFunction("SPHModel_UpdateVelocity", [&]() @@ -142,15 +142,15 @@ SPHModel::SPHModel() : DynamicalModel<SPHState>(DynamicalModelType::SmoothedPart } bool -SPHModel::initialize() +SphModel::initialize() { LOG_IF(FATAL, (!this->getModelGeometry())) << "Model geometry is not yet set! Cannot initialize without model geometry."; m_pointSetGeometry = std::dynamic_pointer_cast<PointSet>(m_geometry); const int numParticles = m_pointSetGeometry->getNumVertices(); // Allocate init and current state - m_initialState = std::make_shared<SPHState>(numParticles); - m_currentState = std::make_shared<SPHState>(numParticles); + m_initialState = std::make_shared<SphState>(numParticles); + m_currentState = std::make_shared<SphState>(numParticles); // If there were initial velocities (set them) if (m_initialVelocities != nullptr) @@ -169,7 +169,7 @@ SPHModel::initialize() m_kernels.initialize(m_modelParameters->m_kernelRadius); // Initialize neighbor searcher - m_neighborSearcher = std::make_shared<NeighborSearch>(m_modelParameters->m_NeighborSearchMethod, + m_neighborSearcher = std::make_shared<NeighborSearch>(m_modelParameters->m_neighborSearchMethod, m_modelParameters->m_kernelRadius); m_pressureAccels = std::make_shared<VecDataArray<double, 3>>(numParticles); @@ -202,7 +202,7 @@ SPHModel::initialize() } void -SPHModel::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) +SphModel::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) { // Setup graph connectivity m_taskGraph->addEdge(source, m_findParticleNeighborsNode); @@ -227,19 +227,19 @@ SPHModel::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskN } void -SPHModel::computeTimeStepSize() +SphModel::computeTimeStepSize() { m_dt = (this->m_timeStepSizeType == TimeSteppingType::Fixed) ? m_defaultDt : computeCFLTimeStepSize(); } double -SPHModel::computeCFLTimeStepSize() +SphModel::computeCFLTimeStepSize() { auto maxVel = ParallelUtils::findMaxL2Norm(*getCurrentState()->getFullStepVelocities()); // dt = CFL * 2r / (speed of sound + max{|| v ||}) double timestep = maxVel > 1.0e-6 ? - m_modelParameters->m_CFLFactor * (2.0 * m_modelParameters->m_particleRadius / (m_modelParameters->m_speedOfSound + maxVel)) : + m_modelParameters->m_cflFactor * (2.0 * m_modelParameters->m_particleRadius / (m_modelParameters->m_speedOfSound + maxVel)) : m_modelParameters->m_maxTimestep; // clamp the time step size to be within a given range @@ -255,7 +255,7 @@ SPHModel::computeCFLTimeStepSize() } void -SPHModel::findParticleNeighbors() +SphModel::findParticleNeighbors() { m_neighborSearcher->getNeighbors(getCurrentState()->getFluidNeighborLists(), *getCurrentState()->getPositions()); @@ -268,7 +268,7 @@ SPHModel::findParticleNeighbors() } void -SPHModel::computeNeighborRelativePositions() +SphModel::computeNeighborRelativePositions() { auto computeRelativePositions = [&](const Vec3d& ppos, const std::vector<size_t>& neighborList, const VecDataArray<double, 3>& allPositions, std::vector<NeighborInfo>& neighborInfo) @@ -290,7 +290,7 @@ SPHModel::computeNeighborRelativePositions() [&](const size_t p) { if (m_sphBoundaryConditions - && m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer) + && m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -310,7 +310,7 @@ SPHModel::computeNeighborRelativePositions() } void -SPHModel::collectNeighborDensity() +SphModel::collectNeighborDensity() { // After computing particle densities, cache them into neighborInfo variable, next to relative positions // this is useful because relative positions and densities are accessed together multiple times @@ -319,12 +319,12 @@ SPHModel::collectNeighborDensity() DataArray<double>& densities = *densitiesPtr; const std::vector<std::vector<size_t>>& neighborLists = getCurrentState()->getFluidNeighborLists(); - const std::vector<SPHBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); + const std::vector<SphBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); ParallelUtils::parallelFor(getCurrentState()->getNumParticles(), [&](const size_t p) { - if (m_sphBoundaryConditions && particleTypes[p] == SPHBoundaryConditions::ParticleType::Buffer) + if (m_sphBoundaryConditions && particleTypes[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -345,7 +345,7 @@ SPHModel::collectNeighborDensity() } void -SPHModel::computeDensity() +SphModel::computeDensity() { std::shared_ptr<DataArray<double>> densitiesPtr = getCurrentState()->getDensities(); DataArray<double>& densities = *densitiesPtr; @@ -355,7 +355,7 @@ SPHModel::computeDensity() ParallelUtils::parallelFor(getCurrentState()->getNumParticles(), [&](const size_t p) { - if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer) + if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -369,7 +369,7 @@ SPHModel::computeDensity() double pdensity = 0.0; for (const auto& qInfo : neighborInfo) { - pdensity += m_kernels.W(qInfo.xpq); + pdensity += m_kernels.W(qInfo.relativePos); } pdensity *= m_modelParameters->m_particleMass; densities[p] = pdensity; @@ -389,7 +389,7 @@ SPHModel::computeDensity() //} void -SPHModel::normalizeDensity() +SphModel::normalizeDensity() { if (!m_modelParameters->m_bNormalizeDensity) { @@ -401,12 +401,12 @@ SPHModel::normalizeDensity() const std::vector<std::vector<size_t>>& neighborLists = getCurrentState()->getFluidNeighborLists(); const std::vector<std::vector<NeighborInfo>>& neighborInfos = getCurrentState()->getNeighborInfo(); - const std::vector<SPHBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); + const std::vector<SphBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); ParallelUtils::parallelFor(getCurrentState()->getNumParticles(), [&](const size_t p) { - if (m_sphBoundaryConditions && particleTypes[p] == SPHBoundaryConditions::ParticleType::Buffer) + if (m_sphBoundaryConditions && particleTypes[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -427,7 +427,7 @@ SPHModel::normalizeDensity() // because we're not done with density computation, qInfo does not contain desity of particle q yet const auto q = fluidNeighborList[i]; const auto qdensity = densities[q]; - tmp += m_kernels.W(qInfo.xpq) / qdensity; + tmp += m_kernels.W(qInfo.relativePos) / qdensity; } densities[p] /= (tmp * m_modelParameters->m_particleMass); @@ -435,19 +435,19 @@ SPHModel::normalizeDensity() } void -SPHModel::computePressureAcceleration() +SphModel::computePressureAcceleration() { std::shared_ptr<DataArray<double>> densitiesPtr = getCurrentState()->getDensities(); const DataArray<double>& densities = *densitiesPtr; VecDataArray<double, 3>& pressureAccels = *m_pressureAccels; const std::vector<std::vector<NeighborInfo>>& neighborInfos = getCurrentState()->getNeighborInfo(); - const std::vector<SPHBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); + const std::vector<SphBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); ParallelUtils::parallelFor(getCurrentState()->getNumParticles(), [&](const size_t p) { - if (m_sphBoundaryConditions && particleTypes[p] == SPHBoundaryConditions::ParticleType::Buffer) + if (m_sphBoundaryConditions && particleTypes[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -461,14 +461,14 @@ SPHModel::computePressureAcceleration() } const auto pdensity = densities[p]; - const auto ppressure = particlePressure(pdensity); + const auto ppressure = getParticlePressure(pdensity); for (size_t idx = 0; idx < neighborInfo.size(); ++idx) { const auto& qInfo = neighborInfo[idx]; - const auto r = qInfo.xpq; + const auto r = qInfo.relativePos; const auto qdensity = qInfo.density; - const auto qpressure = particlePressure(qdensity); + const auto qpressure = getParticlePressure(qdensity); // pressure forces accel += -(ppressure / (pdensity * pdensity) + qpressure / (qdensity * qdensity)) * m_kernels.gradW(r); } @@ -481,7 +481,7 @@ SPHModel::computePressureAcceleration() } void -SPHModel::computeViscosity() +SphModel::computeViscosity() { VecDataArray<double, 3>& viscousAccels = *m_viscousAccels; VecDataArray<double, 3>& neighborVelContr = *m_neighborVelContr; @@ -495,8 +495,8 @@ SPHModel::computeViscosity() [&](const size_t p) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { return; } @@ -522,7 +522,7 @@ SPHModel::computeViscosity() const auto q = fluidNeighborList[i]; const auto& qvel = halfStepVelocities[q]; const auto& qInfo = neighborInfo[i]; - const auto r = qInfo.xpq; + const auto r = qInfo.relativePos; const auto qdensity = qInfo.density; diffuseFluid += (1.0 / qdensity) * m_kernels.laplace(r) * (qvel - pvel); @@ -543,7 +543,7 @@ SPHModel::computeViscosity() } void -SPHModel::computeSurfaceTension() +SphModel::computeSurfaceTension() { VecDataArray<double, 3>& surfaceNormals = *getCurrentState()->getNormals(); @@ -553,7 +553,7 @@ SPHModel::computeSurfaceTension() ParallelUtils::parallelFor(getCurrentState()->getNumParticles(), [&](const size_t p) { - if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer) + if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer) { return; } @@ -569,7 +569,7 @@ SPHModel::computeSurfaceTension() for (size_t i = 0; i < neighborInfo.size(); ++i) { const auto& qInfo = neighborInfo[i]; - const auto r = qInfo.xpq; + const auto r = qInfo.relativePos; const auto qdensity = qInfo.density; n += (1.0 / qdensity) * m_kernels.gradW(r); } @@ -588,8 +588,8 @@ SPHModel::computeSurfaceTension() [&](const size_t p) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { return; } @@ -619,7 +619,7 @@ SPHModel::computeSurfaceTension() const double K_ij = 2.0 * m_modelParameters->m_restDensity / (pdensity + qdensity); // Cohesion acc - const Vec3d& r = qInfo.xpq; + const Vec3d& r = qInfo.relativePos; const double d2 = r.squaredNorm(); if (d2 > 1.0e-20) { @@ -638,7 +638,7 @@ SPHModel::computeSurfaceTension() } void -SPHModel::sumAccels() +SphModel::sumAccels() { const VecDataArray<double, 3>& pressureAccels = *m_pressureAccels; const VecDataArray<double, 3>& surfaceTensionAccels = *m_surfaceTensionAccels; @@ -649,8 +649,8 @@ SPHModel::sumAccels() [&](const size_t p) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { return; } @@ -660,7 +660,7 @@ SPHModel::sumAccels() } void -SPHModel::updateVelocity(const double timestep) +SphModel::updateVelocity(const double timestep) { VecDataArray<double, 3>& halfStepVelocities = *getCurrentState()->getHalfStepVelocities(); VecDataArray<double, 3>& fullStepVelocities = *getCurrentState()->getFullStepVelocities(); @@ -671,8 +671,8 @@ SPHModel::updateVelocity(const double timestep) [&](const size_t p) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { return; } @@ -688,7 +688,7 @@ SPHModel::updateVelocity(const double timestep) halfStepVelocities[p] += (m_modelParameters->m_gravity + accels[p]) * timestep; fullStepVelocities[p] = halfStepVelocities[p] + (m_modelParameters->m_gravity + accels[p]) * timestep * 0.5; } - if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Inlet) + if (m_sphBoundaryConditions && m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Inlet) { halfStepVelocities[p] = m_sphBoundaryConditions->computeParabolicInletVelocity(positions[p]); fullStepVelocities[p] = m_sphBoundaryConditions->computeParabolicInletVelocity(positions[p]); @@ -697,7 +697,7 @@ SPHModel::updateVelocity(const double timestep) } void -SPHModel::moveParticles(const double timestep) +SphModel::moveParticles(const double timestep) { //ParallelUtils::parallelFor(getState().getNumParticles(), // [&](const size_t p) { @@ -711,8 +711,8 @@ SPHModel::moveParticles(const double timestep) for (int p = 0; p < static_cast<int>(getCurrentState()->getNumParticles()); p++) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { continue; } @@ -724,40 +724,40 @@ SPHModel::moveParticles(const double timestep) if (m_sphBoundaryConditions) { - std::vector<SPHBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); - if (particleTypes[p] == SPHBoundaryConditions::ParticleType::Inlet + std::vector<SphBoundaryConditions::ParticleType>& particleTypes = m_sphBoundaryConditions->getParticleTypes(); + if (particleTypes[p] == SphBoundaryConditions::ParticleType::Inlet && !m_sphBoundaryConditions->isInInletDomain(newPosition)) { // change particle type to fluid - particleTypes[p] = SPHBoundaryConditions::ParticleType::Fluid; + particleTypes[p] = SphBoundaryConditions::ParticleType::Fluid; // insert particle into inlet domain from buffer domain // todo: come up with a better way to find buffer indices // right now, the buffer index is limiting the parallel ability of this function const size_t bufferParticleIndex = m_sphBoundaryConditions->getBufferIndices().back(); m_sphBoundaryConditions->getBufferIndices().pop_back(); - particleTypes[bufferParticleIndex] = SPHBoundaryConditions::ParticleType::Inlet; + particleTypes[bufferParticleIndex] = SphBoundaryConditions::ParticleType::Inlet; positions[bufferParticleIndex] = m_sphBoundaryConditions->placeParticleAtInlet(oldPosition); halfStepVelocities[bufferParticleIndex] = m_sphBoundaryConditions->computeParabolicInletVelocity(positions[bufferParticleIndex]); fullStepVelocities[bufferParticleIndex] = m_sphBoundaryConditions->computeParabolicInletVelocity(positions[bufferParticleIndex]); } - else if (particleTypes[p] == SPHBoundaryConditions::ParticleType::Outlet + else if (particleTypes[p] == SphBoundaryConditions::ParticleType::Outlet && !m_sphBoundaryConditions->isInOutletDomain(newPosition)) { - particleTypes[p] = SPHBoundaryConditions::ParticleType::Buffer; + particleTypes[p] = SphBoundaryConditions::ParticleType::Buffer; // insert particle into buffer domain after it leaves outlet domain positions[p] = m_sphBoundaryConditions->getBufferCoord(); m_sphBoundaryConditions->getBufferIndices().push_back(p); } - else if (particleTypes[p] == SPHBoundaryConditions::ParticleType::Fluid + else if (particleTypes[p] == SphBoundaryConditions::ParticleType::Fluid && m_sphBoundaryConditions->isInOutletDomain(newPosition)) { - particleTypes[p] = SPHBoundaryConditions::ParticleType::Outlet; + particleTypes[p] = SphBoundaryConditions::ParticleType::Outlet; } - else if (particleTypes[p] == SPHBoundaryConditions::ParticleType::Fluid + else if (particleTypes[p] == SphBoundaryConditions::ParticleType::Fluid && !m_sphBoundaryConditions->isInFluidDomain(newPosition)) { - particleTypes[p] = SPHBoundaryConditions::ParticleType::Buffer; + particleTypes[p] = SphBoundaryConditions::ParticleType::Buffer; positions[p] = m_sphBoundaryConditions->getBufferCoord(); m_sphBoundaryConditions->getBufferIndices().push_back(p); } @@ -767,7 +767,7 @@ SPHModel::moveParticles(const double timestep) } double -SPHModel::particlePressure(const double density) +SphModel::getParticlePressure(const double density) { const double d = density / m_modelParameters->m_restDensity; const double d2 = d * d; @@ -778,15 +778,15 @@ SPHModel::particlePressure(const double density) } void -SPHModel::setInitialVelocities(const size_t numParticles, const Vec3d& initialVelocity) +SphModel::setInitialVelocities(const size_t numParticles, const Vec3d& initialVelocity) { m_initialVelocities->clear(); m_initialVelocities->reserve(static_cast<int>(numParticles)); for (size_t p = 0; p < numParticles; p++) { if (m_sphBoundaryConditions - && (m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Buffer - || m_sphBoundaryConditions->getParticleTypes()[p] == SPHBoundaryConditions::ParticleType::Wall)) + && (m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Buffer + || m_sphBoundaryConditions->getParticleTypes()[p] == SphBoundaryConditions::ParticleType::Wall)) { m_initialVelocities->push_back(Vec3d::Zero()); } @@ -798,7 +798,7 @@ SPHModel::setInitialVelocities(const size_t numParticles, const Vec3d& initialVe } void -SPHModel::findNearestParticleToVertex(const VecDataArray<double, 3>& points, const std::vector<std::vector<size_t>>& indices) +SphModel::findNearestParticleToVertex(const VecDataArray<double, 3>& points, const std::vector<std::vector<size_t>>& indices) { const VecDataArray<double, 3>& positions = *getCurrentState()->getPositions(); for (size_t i = 0; i < static_cast<size_t>(points.size()); i++) diff --git a/Source/DynamicalModels/ObjectModels/imstkSPHModel.h b/Source/DynamicalModels/ObjectModels/imstkSPHModel.h index a8775664c468c854e6aafa13585d903e1b116c8d..a7446ecd445022e0f4067584230ebc7dead7464f 100644 --- a/Source/DynamicalModels/ObjectModels/imstkSPHModel.h +++ b/Source/DynamicalModels/ObjectModels/imstkSPHModel.h @@ -32,22 +32,22 @@ namespace imstk class PointSet; /// -/// \class SPHModelConfig +/// \class SphModelConfig /// \brief Class that holds the SPH model parameters /// -class SPHModelConfig +class SphModelConfig { private: void initialize(); public: - explicit SPHModelConfig(const double particleRadius); - explicit SPHModelConfig(const double particleRadius, const double speedOfSound, const double restDensity); + explicit SphModelConfig(const double particleRadius); + explicit SphModelConfig(const double particleRadius, const double speedOfSound, const double restDensity); /// \todo Move this to solver or time integrator in the future double m_minTimestep = 1.0e-6; double m_maxTimestep = 1.0e-3; - double m_CFLFactor = 1.0; + double m_cflFactor = 1.0; // particle parameters double m_particleRadius = 0.0; @@ -85,31 +85,30 @@ public: double m_speedOfSound = 18.7; // neighbor search - NeighborSearch::Method m_NeighborSearchMethod = NeighborSearch::Method::UniformGridBasedSearch; + NeighborSearch::Method m_neighborSearchMethod = NeighborSearch::Method::UniformGridBasedSearch; }; /// /// \class SPHModel /// \brief SPH fluid model /// -class SPHModel : public DynamicalModel<SPHState> +class SphModel : public DynamicalModel<SphState> { public: /// /// \brief Constructor /// - SPHModel(); + SphModel(); /// /// \brief Destructor /// - virtual ~SPHModel() override = default; + virtual ~SphModel() override = default; -public: /// /// \brief Set simulation parameters /// - void configure(const std::shared_ptr<SPHModelConfig>& params) { m_modelParameters = params; } + void configure(const std::shared_ptr<SphModelConfig>& params) { m_modelParameters = params; } /// /// \brief Initialize the dynamical model @@ -124,7 +123,7 @@ public: /// /// \brief Get the simulation parameters /// - const std::shared_ptr<SPHModelConfig>& getParameters() const + const std::shared_ptr<SphModelConfig>& getParameters() const { assert(m_modelParameters); return m_modelParameters; @@ -149,7 +148,7 @@ public: void setInitialVelocities(const size_t numParticles, const Vec3d& initialVelocities); - double particlePressure(const double density); + double getParticlePressure(const double density); /// /// \brief Write the state to external file @@ -157,8 +156,8 @@ public: /// void findNearestParticleToVertex(const VecDataArray<double, 3>& points, const std::vector<std::vector<size_t>>& indices); - void setBoundaryConditions(std::shared_ptr<SPHBoundaryConditions> sphBoundaryConditions) { m_sphBoundaryConditions = sphBoundaryConditions; } - std::shared_ptr<SPHBoundaryConditions> getBoundaryConditions() { return m_sphBoundaryConditions; } + void setBoundaryConditions(std::shared_ptr<SphBoundaryConditions> sphBoundaryConditions) { m_sphBoundaryConditions = sphBoundaryConditions; } + std::shared_ptr<SphBoundaryConditions> getBoundaryConditions() { return m_sphBoundaryConditions; } void setRestDensity(const double restDensity) { m_modelParameters->m_restDensity = restDensity; } @@ -270,8 +269,8 @@ private: double m_dt = 0.0; ///> time step size double m_defaultDt; ///> default time step size - SPHSimulationKernels m_kernels; ///> SPH kernels (must be initialized during model initialization) - std::shared_ptr<SPHModelConfig> m_modelParameters; ///> SPH Model parameters (must be set before simulation) + SphSimulationKernels m_kernels; ///> SPH kernels (must be initialized during model initialization) + std::shared_ptr<SphModelConfig> m_modelParameters; ///> SPH Model parameters (must be set before simulation) std::shared_ptr<NeighborSearch> m_neighborSearcher; ///> Neighbor Search (must be initialized during model initialization) std::shared_ptr<VecDataArray<double, 3>> m_pressureAccels = nullptr; @@ -285,7 +284,7 @@ private: int m_timeStepCount = 0; - std::shared_ptr<SPHBoundaryConditions> m_sphBoundaryConditions = nullptr; + std::shared_ptr<SphBoundaryConditions> m_sphBoundaryConditions = nullptr; std::vector<size_t> m_minIndices; }; diff --git a/Source/DynamicalModels/ObjectStates/imstkPbdState.h b/Source/DynamicalModels/ObjectStates/imstkPbdState.h index f9ec8ef532a95beb5e745d2e8e07779ca7ddd4f1..4f0fc7b10ac9d262465192821cbf94a912258b69 100644 --- a/Source/DynamicalModels/ObjectStates/imstkPbdState.h +++ b/Source/DynamicalModels/ObjectStates/imstkPbdState.h @@ -43,9 +43,9 @@ public: m_vel(std::make_shared<VecDataArray<double, 3>>(numElements)), m_acc(std::make_shared<VecDataArray<double, 3>>(numElements)) { - std::fill_n(m_pos->getPointer(), numElements, Vec3d(0.0, 0.0, 0.0)); - std::fill_n(m_vel->getPointer(), numElements, Vec3d(0.0, 0.0, 0.0)); - std::fill_n(m_acc->getPointer(), numElements, Vec3d(0.0, 0.0, 0.0)); + std::fill_n(m_pos->getPointer(), numElements, Vec3d::Zero()); + std::fill_n(m_vel->getPointer(), numElements, Vec3d::Zero()); + std::fill_n(m_acc->getPointer(), numElements, Vec3d::Zero()); } virtual ~PbdState() = default; diff --git a/Source/DynamicalModels/ObjectStates/imstkSPHState.cpp b/Source/DynamicalModels/ObjectStates/imstkSPHState.cpp index d850bebcad48475a710fb443ad30430a303a9e13..5aeaf91cbc5cc8abb4d5dd0c1cb1d8f64c422023 100644 --- a/Source/DynamicalModels/ObjectStates/imstkSPHState.cpp +++ b/Source/DynamicalModels/ObjectStates/imstkSPHState.cpp @@ -25,50 +25,50 @@ namespace imstk { -SPHState::SPHState(const int numElements) : +SphState::SphState(const int numElements) : m_positions(std::make_shared<VecDataArray<double, 3>>(numElements)), m_fullStepVelocities(std::make_shared<VecDataArray<double, 3>>(numElements)), m_halfStepVelocities(std::make_shared<VecDataArray<double, 3>>(numElements)), m_velocities(std::make_shared<VecDataArray<double, 3>>(numElements)), - m_BDPositions(std::make_shared<VecDataArray<double, 3>>()), - m_Densities(std::make_shared<DataArray<double>>(numElements)), - m_Normals(std::make_shared<VecDataArray<double, 3>>(numElements)), - m_Accels(std::make_shared<VecDataArray<double, 3>>(numElements)), - m_DiffuseVelocities(std::make_shared<VecDataArray<double, 3>>(numElements)) + m_boundaryParticlePositions(std::make_shared<VecDataArray<double, 3>>()), + m_densities(std::make_shared<DataArray<double>>(numElements)), + m_normals(std::make_shared<VecDataArray<double, 3>>(numElements)), + m_acceleration(std::make_shared<VecDataArray<double, 3>>(numElements)), + m_diffuseVelocities(std::make_shared<VecDataArray<double, 3>>(numElements)) { - std::fill_n(m_Densities->getPointer(), m_Densities->size(), 1.0); - std::fill_n(m_Accels->getPointer(), m_Accels->size(), Vec3d(0, 0, 0)); - std::fill_n(m_DiffuseVelocities->getPointer(), m_DiffuseVelocities->size(), Vec3d(0, 0, 0)); + std::fill_n(m_densities->getPointer(), m_densities->size(), 1.0); + std::fill_n(m_acceleration->getPointer(), m_acceleration->size(), Vec3d(0, 0, 0)); + std::fill_n(m_diffuseVelocities->getPointer(), m_diffuseVelocities->size(), Vec3d(0, 0, 0)); std::fill_n(m_velocities->getPointer(), m_velocities->size(), Vec3d(0.0, 0.0, 0.0)); std::fill_n(m_halfStepVelocities->getPointer(), m_halfStepVelocities->size(), Vec3d(0.0, 0.0, 0.0)); std::fill_n(m_fullStepVelocities->getPointer(), m_fullStepVelocities->size(), Vec3d(0.0, 0.0, 0.0)); - m_NeighborInfo.resize(static_cast<size_t>(numElements)); - m_NeighborLists.resize(static_cast<size_t>(numElements)); + m_neighborInfo.resize(static_cast<size_t>(numElements)); + m_neighborLists.resize(static_cast<size_t>(numElements)); } void -SPHState::setState(std::shared_ptr<SPHState> rhs) +SphState::setState(std::shared_ptr<SphState> rhs) { *m_positions = *rhs->getPositions(); *m_velocities = *rhs->getVelocities(); *m_halfStepVelocities = *rhs->getHalfStepVelocities(); *m_fullStepVelocities = *rhs->getFullStepVelocities(); - *m_BDPositions = *rhs->getBoundaryParticlePositions(); - *m_Densities = *rhs->getDensities(); - *m_Normals = *rhs->getNormals(); - *m_Accels = *rhs->getAccelerations(); - *m_DiffuseVelocities = *rhs->getDiffuseVelocities(); + *m_boundaryParticlePositions = *rhs->getBoundaryParticlePositions(); + *m_densities = *rhs->getDensities(); + *m_normals = *rhs->getNormals(); + *m_acceleration = *rhs->getAccelerations(); + *m_diffuseVelocities = *rhs->getDiffuseVelocities(); - m_NeighborLists = rhs->getFluidNeighborLists(); - m_BDNeighborLists = rhs->getBoundaryNeighborLists(); - m_NeighborInfo = rhs->getNeighborInfo(); + m_neighborLists = rhs->getFluidNeighborLists(); + m_boundaryParticleNeighborLists = rhs->getBoundaryNeighborLists(); + m_neighborInfo = rhs->getNeighborInfo(); m_positions->postModified(); } size_t -SPHState::getNumParticles() const +SphState::getNumParticles() const { return m_positions->size(); } diff --git a/Source/DynamicalModels/ObjectStates/imstkSPHState.h b/Source/DynamicalModels/ObjectStates/imstkSPHState.h index fbb8a625caa5ccea04b2e0937b337a430d1d6a84..755f4ce1f166f38e2735d52c301e38c3dfefb9f9 100644 --- a/Source/DynamicalModels/ObjectStates/imstkSPHState.h +++ b/Source/DynamicalModels/ObjectStates/imstkSPHState.h @@ -34,28 +34,28 @@ template<typename T, int N> class VecDataArray; /// struct NeighborInfo { - Vec3d xpq; ///> relative position: xpq = x_p - x_q - double density; ///> density of neighbor particle q + Vec3d relativePos; ///> relative position + double density; ///> density of neighbor particle }; /// -/// \class SPHSimulationState +/// \class SphSimulationState /// \brief Simulation states of SPH particles /// -class SPHState +class SphState { public: /// /// \brief Default constructor/destructor /// - SPHState(const int numElements); - virtual ~SPHState() = default; + SphState(const int numElements); + virtual ~SphState() = default; public: /// /// \brief Set positions of the boundary (solid) particles /// - void setBoundaryParticlePositions(std::shared_ptr<VecDataArray<double, 3>> positions) { m_BDPositions = positions; } + void setBoundaryParticlePositions(std::shared_ptr<VecDataArray<double, 3>> positions) { m_boundaryParticlePositions = positions; } /// /// \brief Get number of particles @@ -87,50 +87,50 @@ public: /// /// \brief Returns the vector of all particle positions /// - std::shared_ptr<VecDataArray<double, 3>> getBoundaryParticlePositions() const { return m_BDPositions; } + std::shared_ptr<VecDataArray<double, 3>> getBoundaryParticlePositions() const { return m_boundaryParticlePositions; } /// /// \brief Returns the vector of all particle surface normals /// - std::shared_ptr<VecDataArray<double, 3>> getNormals() const { return m_Normals; } + std::shared_ptr<VecDataArray<double, 3>> getNormals() const { return m_normals; } /// /// \brief Returns the vector of all particle densities /// - std::shared_ptr<DataArray<double>> getDensities() const { return m_Densities; } + std::shared_ptr<DataArray<double>> getDensities() const { return m_densities; } /// /// \brief Returns the vector of all particle accelerations /// - std::shared_ptr<VecDataArray<double, 3>> getAccelerations() const { return m_Accels; } + std::shared_ptr<VecDataArray<double, 3>> getAccelerations() const { return m_acceleration; } /// /// \brief Returns the vector of all velocity diffusion /// - std::shared_ptr<VecDataArray<double, 3>> getDiffuseVelocities() const { return m_DiffuseVelocities; } + std::shared_ptr<VecDataArray<double, 3>> getDiffuseVelocities() const { return m_diffuseVelocities; } /// /// \brief Returns the vector of neighbor fluid particles /// - std::vector<std::vector<size_t>>& getFluidNeighborLists() { return m_NeighborLists; } - const std::vector<std::vector<size_t>>& getFluidNeighborLists() const { return m_NeighborLists; } + std::vector<std::vector<size_t>>& getFluidNeighborLists() { return m_neighborLists; } + const std::vector<std::vector<size_t>>& getFluidNeighborLists() const { return m_neighborLists; } /// /// \brief Returns the vector of neighbor of boundary particles /// - std::vector<std::vector<size_t>>& getBoundaryNeighborLists() { return m_BDNeighborLists; } - const std::vector<std::vector<size_t>>& getBoundaryNeighborLists() const { return m_BDNeighborLists; } + std::vector<std::vector<size_t>>& getBoundaryNeighborLists() { return m_boundaryParticleNeighborLists; } + const std::vector<std::vector<size_t>>& getBoundaryNeighborLists() const { return m_boundaryParticleNeighborLists; } /// /// \brief Returns the vector of neighbor information ( {relative position, density} ), which is cached for other computation /// - std::vector<std::vector<NeighborInfo>>& getNeighborInfo() { return m_NeighborInfo; } - const std::vector<std::vector<NeighborInfo>>& getNeighborInfo() const { return m_NeighborInfo; } + std::vector<std::vector<NeighborInfo>>& getNeighborInfo() { return m_neighborInfo; } + const std::vector<std::vector<NeighborInfo>>& getNeighborInfo() const { return m_neighborInfo; } /// /// \brief Set the state to a given one /// - void setState(std::shared_ptr<SPHState> rhs); + void setState(std::shared_ptr<SphState> rhs); private: std::shared_ptr<VecDataArray<double, 3>> m_positions; @@ -138,15 +138,15 @@ private: std::shared_ptr<VecDataArray<double, 3>> m_halfStepVelocities; std::shared_ptr<VecDataArray<double, 3>> m_velocities; - std::shared_ptr<VecDataArray<double, 3>> m_BDPositions; ///> positions of boundary particles, if generated + std::shared_ptr<VecDataArray<double, 3>> m_boundaryParticlePositions; ///> positions of boundary particles, if generated - std::shared_ptr<DataArray<double>> m_Densities; ///> particle densities - std::shared_ptr<VecDataArray<double, 3>> m_Normals; ///> surface normals - std::shared_ptr<VecDataArray<double, 3>> m_Accels; ///> acceleration - std::shared_ptr<VecDataArray<double, 3>> m_DiffuseVelocities; ///> velocity diffusion, used for computing viscosity + std::shared_ptr<DataArray<double>> m_densities; ///> particle densities + std::shared_ptr<VecDataArray<double, 3>> m_normals; ///> surface normals + std::shared_ptr<VecDataArray<double, 3>> m_acceleration; ///> acceleration + std::shared_ptr<VecDataArray<double, 3>> m_diffuseVelocities; ///> velocity diffusion, used for computing viscosity - std::vector<std::vector<size_t>> m_NeighborLists; ///> store a list of neighbors for each particle, updated each time step - std::vector<std::vector<size_t>> m_BDNeighborLists; ///> store a list of boundary particle neighbors for each particle, updated each time step - std::vector<std::vector<NeighborInfo>> m_NeighborInfo; ///> store a list of Vec4d(Vec3d(relative position), density) for neighbors, including boundary particle + std::vector<std::vector<size_t>> m_neighborLists; ///> store a list of neighbors for each particle, updated each time step + std::vector<std::vector<size_t>> m_boundaryParticleNeighborLists; ///> store a list of boundary particle neighbors for each particle, updated each time step + std::vector<std::vector<NeighborInfo>> m_neighborInfo; ///> store a list of Vec4d(Vec3d(relative position), density) for neighbors, including boundary particle }; } // end namespace imstk diff --git a/Source/Filtering/imstkAppendMesh.cpp b/Source/Filtering/imstkAppendMesh.cpp index 1728b87764c0915df6ce758696bffa8861eee4c3..0408e581a0f869867b2275211d4dd563f8acca5c 100644 --- a/Source/Filtering/imstkAppendMesh.cpp +++ b/Source/Filtering/imstkAppendMesh.cpp @@ -30,16 +30,16 @@ namespace imstk { AppendMesh::AppendMesh() { - setNumberOfInputPorts(1); - setNumberOfOutputPorts(1); + setNumInputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } void AppendMesh::addInputMesh(std::shared_ptr<SurfaceMesh> inputMesh) { - setNumberOfInputPorts(getNumberOfInputPorts() + 1); - setInput(inputMesh, getNumberOfInputPorts() - 1); + setNumInputPorts(getNumInputPorts() + 1); + setInput(inputMesh, getNumInputPorts() - 1); } std::shared_ptr<SurfaceMesh> @@ -52,7 +52,7 @@ void AppendMesh::requestUpdate() { vtkNew<vtkAppendPolyData> filter; - for (size_t i = 0; i < getNumberOfInputPorts(); i++) + for (size_t i = 0; i < getNumInputPorts(); i++) { std::shared_ptr<SurfaceMesh> inputMesh = std::dynamic_pointer_cast<SurfaceMesh>(getInput(0)); if (inputMesh == nullptr) diff --git a/Source/Filtering/imstkAppendMesh.h b/Source/Filtering/imstkAppendMesh.h index f97c0307585fd5b00e5718ee321fe4695aa6d1ef..19b90d2efc8e7d3717e2b2e1e4efced68e7d8b82 100644 --- a/Source/Filtering/imstkAppendMesh.h +++ b/Source/Filtering/imstkAppendMesh.h @@ -37,7 +37,6 @@ public: AppendMesh(); virtual ~AppendMesh() override = default; -public: void addInputMesh(std::shared_ptr<SurfaceMesh> inputMesh); std::shared_ptr<SurfaceMesh> getOutputMesh() const; diff --git a/Source/Filtering/imstkCleanMesh.cpp b/Source/Filtering/imstkCleanMesh.cpp index 55a40d8955c99361617b02807d6404d807f36ead..51d7a037083e9e459dae02d88967141eb9cbfad5 100644 --- a/Source/Filtering/imstkCleanMesh.cpp +++ b/Source/Filtering/imstkCleanMesh.cpp @@ -31,10 +31,10 @@ namespace imstk { CleanMesh::CleanMesh() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } diff --git a/Source/Filtering/imstkCleanMesh.h b/Source/Filtering/imstkCleanMesh.h index 1f1156c20badc82966bd3dfd8be740ed68923e31..42334ca35ad56a46e39c5092e18734f447a0d09f 100644 --- a/Source/Filtering/imstkCleanMesh.h +++ b/Source/Filtering/imstkCleanMesh.h @@ -39,7 +39,6 @@ public: CleanMesh(); virtual ~CleanMesh() override = default; -public: std::shared_ptr<SurfaceMesh> getOutputMesh() const; /// diff --git a/Source/Filtering/imstkExtractEdges.cpp b/Source/Filtering/imstkExtractEdges.cpp index 01d76e5f6b0d60c72ea28974092ec075f88eb271..f4b4d03954a6e87bda7974684e42ee48e034bfb4 100644 --- a/Source/Filtering/imstkExtractEdges.cpp +++ b/Source/Filtering/imstkExtractEdges.cpp @@ -32,10 +32,10 @@ namespace imstk { ExtractEdges::ExtractEdges() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<LineMesh>()); } diff --git a/Source/Filtering/imstkExtractEdges.h b/Source/Filtering/imstkExtractEdges.h index b2d8c031787551e0af1c4a5b872b7c0119df4cea..fa00370f736912c1cb1c18998388da1e42a993d5 100644 --- a/Source/Filtering/imstkExtractEdges.h +++ b/Source/Filtering/imstkExtractEdges.h @@ -38,7 +38,6 @@ public: ExtractEdges(); virtual ~ExtractEdges() override = default; -public: std::shared_ptr<LineMesh> getOutputMesh() const; void setInputMesh(std::shared_ptr<SurfaceMesh> inputMesh); diff --git a/Source/Filtering/imstkImageDistanceTransform.cpp b/Source/Filtering/imstkImageDistanceTransform.cpp index cae9e0fba0646f1eaf77d139741438cb88fb688b..6c22d53f335f7c51d5110e0b045e12941913af8c 100644 --- a/Source/Filtering/imstkImageDistanceTransform.cpp +++ b/Source/Filtering/imstkImageDistanceTransform.cpp @@ -34,10 +34,10 @@ namespace imstk { ImageDistanceTransform::ImageDistanceTransform() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>(), 0); } diff --git a/Source/Filtering/imstkImageGradient.cpp b/Source/Filtering/imstkImageGradient.cpp index 4095e2d1e749f30a0716b623d71dde61b4068aa6..b901ad2bf7fdef5884db75c8619a8f04074796d0 100644 --- a/Source/Filtering/imstkImageGradient.cpp +++ b/Source/Filtering/imstkImageGradient.cpp @@ -32,10 +32,10 @@ namespace imstk { ImageGradient::ImageGradient() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<PointSet>()); } diff --git a/Source/Filtering/imstkImageResample.cpp b/Source/Filtering/imstkImageResample.cpp index ab647500127c83e490e7887d97661d260b169a87..c52a24d4a9929a4d571ebfc3dde9cdc3dda5b398 100644 --- a/Source/Filtering/imstkImageResample.cpp +++ b/Source/Filtering/imstkImageResample.cpp @@ -33,10 +33,10 @@ namespace imstk { ImageResample::ImageResample() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>()); } diff --git a/Source/Filtering/imstkImageReslice.cpp b/Source/Filtering/imstkImageReslice.cpp index 97d5a5cdd7a3b31df9aa46918abf362144d6f770..b2c43b9b871d750bbcb73789b5ef82e9751e18a9 100644 --- a/Source/Filtering/imstkImageReslice.cpp +++ b/Source/Filtering/imstkImageReslice.cpp @@ -32,10 +32,10 @@ namespace imstk { ImageReslice::ImageReslice() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>()); } diff --git a/Source/Filtering/imstkImplicitGeometryToImageData.cpp b/Source/Filtering/imstkImplicitGeometryToImageData.cpp index 1f8aa74697226e021bfef7cad612dcb9631544d5..f00a64408f3dc75d4a5580296d30a8e7e5f7232f 100644 --- a/Source/Filtering/imstkImplicitGeometryToImageData.cpp +++ b/Source/Filtering/imstkImplicitGeometryToImageData.cpp @@ -30,10 +30,10 @@ namespace imstk { ImplicitGeometryToImageData::ImplicitGeometryToImageData() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImplicitGeometry>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>()); } diff --git a/Source/Filtering/imstkLocalMarchingCubes.cpp b/Source/Filtering/imstkLocalMarchingCubes.cpp index 97bed7704edab9f12b10f0337018427fc64570b6..4edf3897c3a973abe33e217f37bbdd41219a35f0 100644 --- a/Source/Filtering/imstkLocalMarchingCubes.cpp +++ b/Source/Filtering/imstkLocalMarchingCubes.cpp @@ -360,10 +360,10 @@ lerp(double val1, double val2, double isovalue, double spacing) LocalMarchingCubes::LocalMarchingCubes() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(0); + setNumOutputPorts(0); } std::shared_ptr<SurfaceMesh> @@ -392,7 +392,7 @@ LocalMarchingCubes::setNumberOfChunks(const Vec3i& numChunks) { m_chunkCount = numChunks[0] * numChunks[1] * numChunks[2]; m_numChunks = numChunks; - setNumberOfOutputPorts(m_chunkCount); + setNumOutputPorts(m_chunkCount); for (size_t i = 0; i < m_chunkCount; i++) { setOutput(std::make_shared<SurfaceMesh>(), i); diff --git a/Source/Filtering/imstkLocalMarchingCubes.h b/Source/Filtering/imstkLocalMarchingCubes.h index 9f6325af6ebacf10197163a7d01421f9b9887985..9feaa99c37da851c944fe11992df07b03dbb28b2 100644 --- a/Source/Filtering/imstkLocalMarchingCubes.h +++ b/Source/Filtering/imstkLocalMarchingCubes.h @@ -50,7 +50,6 @@ public: LocalMarchingCubes(); virtual ~LocalMarchingCubes() override = default; -public: std::shared_ptr<SurfaceMesh> getOutputMesh(const int i) const; void setInputImage(std::shared_ptr<ImageData> inputImage); diff --git a/Source/Filtering/imstkQuadricDecimate.cpp b/Source/Filtering/imstkQuadricDecimate.cpp index bf09650906bd939411624cdcf48d7953b7c10a85..91d2a67041d3e6e0cc0072d7203cb62f2d3b8541 100644 --- a/Source/Filtering/imstkQuadricDecimate.cpp +++ b/Source/Filtering/imstkQuadricDecimate.cpp @@ -33,8 +33,8 @@ QuadricDecimate::QuadricDecimate() : { setRequiredInputType<SurfaceMesh>(0); - setNumberOfInputPorts(1); - setNumberOfOutputPorts(1); + setNumInputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } diff --git a/Source/Filtering/imstkSelectEnclosedPoints.cpp b/Source/Filtering/imstkSelectEnclosedPoints.cpp index 4d708db960939c50c189f2084e7d043c01fda130..ee5d8ec0f8aa0b518fb4b134a940b92af346dbfa 100644 --- a/Source/Filtering/imstkSelectEnclosedPoints.cpp +++ b/Source/Filtering/imstkSelectEnclosedPoints.cpp @@ -32,11 +32,11 @@ namespace imstk { SelectEnclosedPoints::SelectEnclosedPoints() { - setNumberOfInputPorts(2); + setNumInputPorts(2); setRequiredInputType<SurfaceMesh>(0); setRequiredInputType<PointSet>(1); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<PointSet>()); } diff --git a/Source/Filtering/imstkSurfaceMeshCut.cpp b/Source/Filtering/imstkSurfaceMeshCut.cpp index 03c0b96899756dc2627ac12b74db16192b117fc9..43c229c9c6b3dc6b17f719b44df878ed8749e867 100644 --- a/Source/Filtering/imstkSurfaceMeshCut.cpp +++ b/Source/Filtering/imstkSurfaceMeshCut.cpp @@ -32,10 +32,10 @@ namespace imstk { SurfaceMeshCut::SurfaceMeshCut() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); m_CutGeometry = std::make_shared<Plane>(); diff --git a/Source/Filtering/imstkSurfaceMeshDistanceTransform.cpp b/Source/Filtering/imstkSurfaceMeshDistanceTransform.cpp index ec8c954023348ba554b3fac37bdc25a52286a617..ed60837a86547ba443af2190041e58b95ba23448 100644 --- a/Source/Filtering/imstkSurfaceMeshDistanceTransform.cpp +++ b/Source/Filtering/imstkSurfaceMeshDistanceTransform.cpp @@ -202,10 +202,10 @@ computeFullDT(std::shared_ptr<ImageData> imageData, std::shared_ptr<SurfaceMesh> SurfaceMeshDistanceTransform::SurfaceMeshDistanceTransform() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>(), 0); } diff --git a/Source/Filtering/imstkSurfaceMeshFlyingEdges.cpp b/Source/Filtering/imstkSurfaceMeshFlyingEdges.cpp index 5fd963444deea57583c5d5f1ea1b5daa45ea0576..ed87bf02527df8da988b454370b6b3e2d131a01c 100644 --- a/Source/Filtering/imstkSurfaceMeshFlyingEdges.cpp +++ b/Source/Filtering/imstkSurfaceMeshFlyingEdges.cpp @@ -32,10 +32,10 @@ namespace imstk { SurfaceMeshFlyingEdges::SurfaceMeshFlyingEdges() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<ImageData>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } diff --git a/Source/Filtering/imstkSurfaceMeshImageMask.cpp b/Source/Filtering/imstkSurfaceMeshImageMask.cpp index 251cc4e353f77ac9b78168e6aae0fca2c86eb709..400212053c6a27b9a2ed594e8d5ea06913affa55 100644 --- a/Source/Filtering/imstkSurfaceMeshImageMask.cpp +++ b/Source/Filtering/imstkSurfaceMeshImageMask.cpp @@ -35,11 +35,11 @@ namespace imstk { SurfaceMeshImageMask::SurfaceMeshImageMask() { - setNumberOfInputPorts(2); + setNumInputPorts(2); setRequiredInputType<SurfaceMesh>(0); setOptionalInputType<ImageData>(1); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<ImageData>(), 0); } diff --git a/Source/Filtering/imstkSurfaceMeshSmoothen.cpp b/Source/Filtering/imstkSurfaceMeshSmoothen.cpp index 48d9cafc8261581e388e1d0c368125983897b404..cd8c09781bfabd1b9fcec2e1cb6fa97c7ad4d671 100644 --- a/Source/Filtering/imstkSurfaceMeshSmoothen.cpp +++ b/Source/Filtering/imstkSurfaceMeshSmoothen.cpp @@ -30,10 +30,10 @@ namespace imstk { SurfaceMeshSmoothen::SurfaceMeshSmoothen() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } diff --git a/Source/Filtering/imstkSurfaceMeshSubdivide.cpp b/Source/Filtering/imstkSurfaceMeshSubdivide.cpp index 393540127bbfcea085de8007ae76602f7f5cb1a6..b95531b345af4eadc69c0d9b0aad1357439762fc 100644 --- a/Source/Filtering/imstkSurfaceMeshSubdivide.cpp +++ b/Source/Filtering/imstkSurfaceMeshSubdivide.cpp @@ -32,10 +32,10 @@ namespace imstk { SurfaceMeshSubdivide::SurfaceMeshSubdivide() { - setNumberOfInputPorts(1); + setNumInputPorts(1); setRequiredInputType<SurfaceMesh>(0); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>()); } diff --git a/Source/Filtering/imstkSurfaceMeshTextureProject.cpp b/Source/Filtering/imstkSurfaceMeshTextureProject.cpp index 720f2fdc12b2e70746d1b061e9e87ff4ba6ae464..87a73af8692e8bb3a4dd984ae6ece0331040d5c7 100644 --- a/Source/Filtering/imstkSurfaceMeshTextureProject.cpp +++ b/Source/Filtering/imstkSurfaceMeshTextureProject.cpp @@ -105,11 +105,11 @@ baryInterpolate(T v1, T v2, T v3, Vec3d uvw) SurfaceMeshTextureProject::SurfaceMeshTextureProject() { - setNumberOfInputPorts(2); + setNumInputPorts(2); setRequiredInputType<SurfaceMesh>(0); setRequiredInputType<SurfaceMesh>(1); - setNumberOfOutputPorts(1); + setNumOutputPorts(1); setOutput(std::make_shared<SurfaceMesh>(), 0); } diff --git a/Source/FilteringCore/Testing/GeometryAlgorithmTest.cpp b/Source/FilteringCore/Testing/GeometryAlgorithmTest.cpp index 9dbf5c9b00a14669f69c724c234b2532810773d9..b469ce023ecd437b5769b1a2e39cdc25fcb504a6 100644 --- a/Source/FilteringCore/Testing/GeometryAlgorithmTest.cpp +++ b/Source/FilteringCore/Testing/GeometryAlgorithmTest.cpp @@ -47,7 +47,7 @@ class EmptyAlgorithm : public MockAlgorithm public: EmptyAlgorithm() { - setNumberOfInputPorts(4); + setNumInputPorts(4); } }; @@ -56,7 +56,7 @@ class ExpectingAlgorithm : public MockAlgorithm public: ExpectingAlgorithm() { - setNumberOfInputPorts(4); + setNumInputPorts(4); setRequiredInputType<SurfaceMesh>(1); } }; @@ -66,7 +66,7 @@ class ExpectingOptional : public MockAlgorithm public: ExpectingOptional() { - setNumberOfInputPorts(4); + setNumInputPorts(4); setOptionalInputType<SurfaceMesh>(1); } }; @@ -76,7 +76,7 @@ class ExpectingAllKinds : public MockAlgorithm public: ExpectingAllKinds() { - setNumberOfInputPorts(5); + setNumInputPorts(5); setRequiredInputType<SurfaceMesh>(1); setRequiredInputType<Sphere>(2); setOptionalInputType<SurfaceMesh>(3); diff --git a/Source/FilteringCore/imstkGeometryAlgorithm.cpp b/Source/FilteringCore/imstkGeometryAlgorithm.cpp index fbb3ebafb06dc425dea6cb8fe471d91b5762b79e..5be822d76a2efc2a9585a8dd47ebbb758cb90ae5 100644 --- a/Source/FilteringCore/imstkGeometryAlgorithm.cpp +++ b/Source/FilteringCore/imstkGeometryAlgorithm.cpp @@ -30,26 +30,26 @@ GeometryAlgorithm::setInput(std::shared_ptr<Geometry> inputGeometry, size_t port { if (m_inputs.count(port) == 0) { - LOG(WARNING) << "Tried to set input " << port << " on filter with " << m_NumberOfInputPorts << " ports"; + LOG(WARNING) << "Tried to set input " << port << " on filter with " << m_NumInputPorts << " ports"; } m_inputs[port] = inputGeometry; } void -GeometryAlgorithm::setOutput(std::shared_ptr<Geometry> outputGeometry, size_t port) +GeometryAlgorithm::setOutput(std::shared_ptr<Geometry> outputGeometry, const size_t port) { if (m_outputs.count(port) == 0) { - LOG(WARNING) << "Tried to set output " << port << " on filter with " << m_NumberOfOutputPorts << " ports"; + LOG(WARNING) << "Tried to set output " << port << " on filter with " << m_NumOutputPorts << " ports"; } m_outputs[port] = outputGeometry; } void -GeometryAlgorithm::setNumberOfInputPorts(size_t numPorts) +GeometryAlgorithm::setNumInputPorts(const size_t numPorts) { - this->m_NumberOfInputPorts = numPorts; + this->m_NumInputPorts = numPorts; // Add entries in the map for it for (size_t i = 0; i < numPorts; i++) { @@ -61,9 +61,9 @@ GeometryAlgorithm::setNumberOfInputPorts(size_t numPorts) } void -GeometryAlgorithm::setNumberOfOutputPorts(size_t numPorts) +GeometryAlgorithm::setNumOutputPorts(const size_t numPorts) { - this->m_NumberOfOutputPorts = numPorts; + this->m_NumOutputPorts = numPorts; // Add entries in the map for it for (size_t i = 0; i < numPorts; i++) { diff --git a/Source/FilteringCore/imstkGeometryAlgorithm.h b/Source/FilteringCore/imstkGeometryAlgorithm.h index f1acfd6b5d643cb3b8e9036f7978a82dbecf249f..59b9edcbf52e60003350f4f05b5dcc4deb06422c 100644 --- a/Source/FilteringCore/imstkGeometryAlgorithm.h +++ b/Source/FilteringCore/imstkGeometryAlgorithm.h @@ -99,27 +99,27 @@ protected: /// /// \brief Set the output at the port /// - void setOutput(std::shared_ptr<Geometry> inputGeometry, size_t port = 0); + void setOutput(std::shared_ptr<Geometry> inputGeometry, const size_t port = 0); - imstkGetMacro(NumberOfInputPorts, size_t); - imstkGetMacro(NumberOfOutputPorts, size_t); + imstkGetMacro(NumInputPorts, size_t); + imstkGetMacro(NumOutputPorts, size_t); /// /// \brief Sets the amount of input ports /// - void setNumberOfInputPorts(size_t numPorts); + void setNumInputPorts(const size_t numPorts); /// /// \brief Sets the amount of output ports /// - void setNumberOfOutputPorts(size_t numPorts); + void setNumOutputPorts(const size_t numPorts); /// /// \brief Declares the type for the port with the given number, also defines that /// the give port is required for the filter to run correctly /// template<typename T> - void setRequiredInputType(size_t port) + void setRequiredInputType(const size_t port) { CHECK(m_optionalTypeChecks.find(port) == m_optionalTypeChecks.end()) << "There is already an optional type for this port " << port << ", can't assign another one."; @@ -131,7 +131,7 @@ protected: /// for this port is optional and may be omitted /// template<typename T> - void setOptionalInputType(size_t port) + void setOptionalInputType(const size_t port) { CHECK(m_requiredTypeChecks.find(port) == m_requiredTypeChecks.end()) << "There is already a required type for port " << port << " , can't assign another one."; @@ -152,8 +152,8 @@ protected: using GeometryCheck = std::function<bool (Geometry*)>; using TypeCheckContainer = std::unordered_map<size_t, GeometryCheck>; - std::unordered_map<size_t, GeometryCheck> m_requiredTypeChecks; - std::unordered_map<size_t, GeometryCheck> m_optionalTypeChecks; + TypeCheckContainer m_requiredTypeChecks; + TypeCheckContainer m_optionalTypeChecks; private: @@ -161,7 +161,7 @@ private: std::unordered_map<size_t, std::shared_ptr<Geometry>> m_outputs; //bool m_modified = true; - size_t m_NumberOfInputPorts = 1; - size_t m_NumberOfOutputPorts = 1; + size_t m_NumInputPorts = 1; + size_t m_NumOutputPorts = 1; }; } \ No newline at end of file diff --git a/Source/Geometry/Analytic/imstkAnalyticalGeometry.h b/Source/Geometry/Analytic/imstkAnalyticalGeometry.h index 33a3ea90a907c2adaaf612b5e611be499c0200a3..c6e5647eec2dd0d2fd247405ab5468df165fb8a8 100644 --- a/Source/Geometry/Analytic/imstkAnalyticalGeometry.h +++ b/Source/Geometry/Analytic/imstkAnalyticalGeometry.h @@ -35,7 +35,6 @@ class AnalyticalGeometry : public ImplicitGeometry public: virtual ~AnalyticalGeometry() override = default; -public: /// /// \brief Print /// diff --git a/Source/Geometry/Analytic/imstkCapsule.h b/Source/Geometry/Analytic/imstkCapsule.h index 1100bdc841b57e9767ebb8c3d32c69c056de67e4..b38b28de88f3d54cb45207fa4581d60290a49c81 100644 --- a/Source/Geometry/Analytic/imstkCapsule.h +++ b/Source/Geometry/Analytic/imstkCapsule.h @@ -56,7 +56,6 @@ public: /// virtual const std::string getTypeName() const override { return "Capsule"; } -public: /// /// \brief Print the capsule info /// diff --git a/Source/Geometry/Analytic/imstkCylinder.h b/Source/Geometry/Analytic/imstkCylinder.h index c914abff337f8d18c9c724b11824e01ebecc82c7..5d20ba5f6e9493652e49ff91decfe078e30d56ad 100644 --- a/Source/Geometry/Analytic/imstkCylinder.h +++ b/Source/Geometry/Analytic/imstkCylinder.h @@ -54,7 +54,6 @@ public: /// virtual const std::string getTypeName() const override { return "Cylinder"; } -public: /// /// \brief Print the cylinder info /// diff --git a/Source/Geometry/Analytic/imstkOrientedBox.h b/Source/Geometry/Analytic/imstkOrientedBox.h index af9737dec04224db9df21f3eb6b09694f0c67faa..d48511364def7ec063e725590f9523de70c08e45 100644 --- a/Source/Geometry/Analytic/imstkOrientedBox.h +++ b/Source/Geometry/Analytic/imstkOrientedBox.h @@ -33,8 +33,10 @@ namespace imstk class OrientedBox : public AnalyticalGeometry { public: - OrientedBox(const Vec3d& pos = Vec3d(0.0, 0.0, 0.0), const Vec3d extents = Vec3d(0.5, 0.5, 0.5), const Quatd& orientation = Quatd::Identity(), - const std::string& name = std::string("defaultOrientedBox")) : AnalyticalGeometry(name) + OrientedBox(const Vec3d& pos = Vec3d::Zero(), + const Vec3d extents = Vec3d(0.5, 0.5, 0.5), + const Quatd& orientation = Quatd::Identity(), + const std::string& name = std::string("defaultOrientedBox")) : AnalyticalGeometry(name) { setPosition(pos); setOrientation(orientation); @@ -48,7 +50,6 @@ public: /// virtual const std::string getTypeName() const override { return "OrientedBox"; } -public: /// /// \brief Print the cube info /// diff --git a/Source/Geometry/Analytic/imstkPlane.h b/Source/Geometry/Analytic/imstkPlane.h index 84fc9efdb87f8163546f4fc118f4b99c268d9879..b92d8bd2cd357f951a82e9fda3713e227da96b73 100644 --- a/Source/Geometry/Analytic/imstkPlane.h +++ b/Source/Geometry/Analytic/imstkPlane.h @@ -55,7 +55,6 @@ public: /// virtual const std::string getTypeName() const override { return "Plane"; } -public: /// /// \brief Returns the normal of the plane /// @@ -95,7 +94,6 @@ public: protected: void applyTransform(const Mat4d& m) override; -protected: Vec3d m_normal; mutable Vec3d m_normalPostTransform; double m_width; ///> Width of plane, only used for visual purposes diff --git a/Source/Geometry/Analytic/imstkSphere.h b/Source/Geometry/Analytic/imstkSphere.h index de22ad328d40aeed94474c174b18d7a2a1f07883..0fc5d7930d97f2ddbd272e029f63340f34299e1c 100644 --- a/Source/Geometry/Analytic/imstkSphere.h +++ b/Source/Geometry/Analytic/imstkSphere.h @@ -50,7 +50,6 @@ public: /// virtual const std::string getTypeName() const override { return "Sphere"; } -public: /// /// \brief Print the sphere info /// diff --git a/Source/Geometry/Implicit/imstkCompositeImplicitGeometry.h b/Source/Geometry/Implicit/imstkCompositeImplicitGeometry.h index 6c28aef182d8bbb222ecf19d369f4aa233266aab..2710163e7636514025c04452c6192420e8b7d9de 100644 --- a/Source/Geometry/Implicit/imstkCompositeImplicitGeometry.h +++ b/Source/Geometry/Implicit/imstkCompositeImplicitGeometry.h @@ -43,7 +43,6 @@ public: using GeometryBoolPair = std::pair<std::shared_ptr<ImplicitGeometry>, GeometryBoolType>; -public: /// /// \brief Constructor /// @@ -59,7 +58,6 @@ public: /// virtual const std::string getTypeName() const override { return "CompositeImplicitGeometry"; } -public: /// /// \brief Returns signed distance to surface at pos /// diff --git a/Source/Geometry/Implicit/imstkImplicitGeometry.h b/Source/Geometry/Implicit/imstkImplicitGeometry.h index a1fee16d362a0de95ba3f845c79bfe2bbb84bbd2..652a006ea3e83c4a7655b03a7fd2fdf8e84a84ea 100644 --- a/Source/Geometry/Implicit/imstkImplicitGeometry.h +++ b/Source/Geometry/Implicit/imstkImplicitGeometry.h @@ -33,13 +33,12 @@ namespace imstk /// class ImplicitGeometry : public Geometry { -public: - virtual ~ImplicitGeometry() override = default; - protected: ImplicitGeometry(std::string name = "") : Geometry(name) { } public: + virtual ~ImplicitGeometry() override = default; + /// /// \brief Returns function value given position /// diff --git a/Source/Geometry/Implicit/imstkSignedDistanceField.h b/Source/Geometry/Implicit/imstkSignedDistanceField.h index ba7712d0e6ecd9ee14f66f4daaebaf174a02a783..4392e3e1698ae300a969261771413f4bd97179c5 100644 --- a/Source/Geometry/Implicit/imstkSignedDistanceField.h +++ b/Source/Geometry/Implicit/imstkSignedDistanceField.h @@ -58,7 +58,6 @@ public: /// virtual const std::string getTypeName() const override { return "SignedDistanceField"; } -public: /// /// \brief Returns signed distance to surface at pos, returns clamped/nearest if out of bounds /// diff --git a/Source/Geometry/Mesh/imstkHexahedralMesh.h b/Source/Geometry/Mesh/imstkHexahedralMesh.h index 9c8f2eae8a0c84728b4ccffa49b616705a182420..8f2ac98c7b3a3171e922d69f00c4850a4c1793c2 100644 --- a/Source/Geometry/Mesh/imstkHexahedralMesh.h +++ b/Source/Geometry/Mesh/imstkHexahedralMesh.h @@ -48,7 +48,6 @@ public: /// virtual const std::string getTypeName() const override { return "HexahedralMesh"; } -public: /// /// \brief Initializes the rest of the data structures given vertex positions and /// hexahedra connectivity @@ -76,7 +75,6 @@ public: bool isMesh() const override { return true; } // Accessors -public: /// /// \brief Sets/Returns the hexahedral connectivity /// diff --git a/Source/Geometry/Mesh/imstkImageData.h b/Source/Geometry/Mesh/imstkImageData.h index 3190d3411dac7224c582e8bc08e8e809b86a0084..07ed6aa6a511910db7c069b1c38de600ed9b7635 100644 --- a/Source/Geometry/Mesh/imstkImageData.h +++ b/Source/Geometry/Mesh/imstkImageData.h @@ -51,7 +51,6 @@ public: /// virtual const std::string getTypeName() const override { return "ImageData"; } -public: /// /// \brief Print the image data info /// diff --git a/Source/Geometry/Mesh/imstkLineMesh.h b/Source/Geometry/Mesh/imstkLineMesh.h index c2b88b5b89904b1f99af700c45940555c8092f88..b08b7148a85c99c748f878a5de0b6b289ffa2035 100644 --- a/Source/Geometry/Mesh/imstkLineMesh.h +++ b/Source/Geometry/Mesh/imstkLineMesh.h @@ -52,7 +52,6 @@ public: /// virtual const std::string getTypeName() const override { return "LineMesh"; } -public: /// /// \brief Initializes the rest of the data structures given vertex positions and /// line connectivity @@ -75,7 +74,6 @@ public: bool isMesh() const override { return true; } // Accessors -public: /// /// \brief Get the number of segments/cells /// @@ -98,7 +96,6 @@ public: Vec2i& getLineIndices(const size_t pos); // Attributes -public: /// /// \brief Set a data array holding some per cell data /// @@ -136,7 +133,6 @@ protected: void setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, const int expectedNumComponents, const ScalarTypeId expectedScalarType); -protected: std::shared_ptr<VecDataArray<int, 2>> m_segmentIndices; ///> line connectivity std::unordered_map<std::string, std::shared_ptr<AbstractDataArray>> m_cellAttributes; diff --git a/Source/Geometry/Mesh/imstkPointSet.h b/Source/Geometry/Mesh/imstkPointSet.h index 753e556338df3a3f5fa2d37240155d3a0f78d505..bb02a6c95aad6adb8515baa928299b07e90f9f44 100644 --- a/Source/Geometry/Mesh/imstkPointSet.h +++ b/Source/Geometry/Mesh/imstkPointSet.h @@ -55,7 +55,6 @@ public: /// virtual const std::string getTypeName() const override { return "PointSet"; } -public: /// /// \brief Initializes the data structure given vertex positions /// @@ -77,7 +76,6 @@ public: virtual void computeBoundingBox(Vec3d& lowerCorner, Vec3d& upperCorner, const double paddingPercent = 0.0) override; // Accessors -public: /// /// \brief Sets initial positions from an array /// @@ -132,7 +130,6 @@ public: int getMaxNumVertices() const { return m_maxNumVertices; } // Attributes -public: /// /// \brief Set a data array holding some per vertex data /// diff --git a/Source/Geometry/Mesh/imstkSurfaceMesh.h b/Source/Geometry/Mesh/imstkSurfaceMesh.h index b4a4fb08a3867462c17fa4f9adf21ff08e5ad3d0..0d12ca31200f50b361371fb50f4cee8fac6de9e9 100644 --- a/Source/Geometry/Mesh/imstkSurfaceMesh.h +++ b/Source/Geometry/Mesh/imstkSurfaceMesh.h @@ -76,7 +76,6 @@ class SurfaceMesh : public PointSet public: using NeighborsType = std::set<size_t>; -public: /// /// \brief Constructor /// @@ -92,7 +91,6 @@ public: /// virtual const std::string getTypeName() const override { return "SurfaceMesh"; } -public: /// /// \brief Initializes the rest of the data structures given vertex positions and /// triangle connectivity @@ -185,7 +183,6 @@ public: bool isMesh() const override { return true; } // Accessors -public: /// /// \brief Get/Set triangle connectivity /// @@ -221,7 +218,6 @@ public: const std::vector<NeighborsType>& getVertexNeighborVertices() { return m_vertexNeighborVertices; } // Attributes -public: /// /// \brief Set a data array holding some per cell data /// @@ -274,8 +270,6 @@ public: protected: void setCellActiveAttribute(std::string& activeAttributeName, std::string attributeName, const int expectedNumComponents, const ScalarTypeId expectedScalarType); - -protected: std::shared_ptr<VecDataArray<int, 3>> m_triangleIndices; std::vector<NeighborsType> m_vertexNeighborTriangles; ///> Neighbor triangles to vertices std::vector<NeighborsType> m_vertexNeighborVertices; ///> Neighbor vertices to vertices diff --git a/Source/Geometry/Mesh/imstkTetrahedralMesh.h b/Source/Geometry/Mesh/imstkTetrahedralMesh.h index 3336de87d9868851cb4059b107b7a7c66e0237b1..e51c42fe0a4d6a673d6910cf69292c6aa4e75159 100644 --- a/Source/Geometry/Mesh/imstkTetrahedralMesh.h +++ b/Source/Geometry/Mesh/imstkTetrahedralMesh.h @@ -52,7 +52,6 @@ public: /// virtual const std::string getTypeName() const override { return "TetrahedralMesh"; } -public: /// /// \brief Initializes the rest of the data structures given vertex positions and /// tetrahedra connectivity @@ -91,7 +90,6 @@ public: bool isMesh() const override { return true; } // Accessors -public: /// /// \brief set the vector of array of IDs for the mesh /// diff --git a/Source/Geometry/Mesh/imstkVolumetricMesh.h b/Source/Geometry/Mesh/imstkVolumetricMesh.h index 2b4c3e3968e02317911eb169c27a1962f1bf2073..44c41f2164fdf58a23d7af35cbcc8b3a470d1e87 100644 --- a/Source/Geometry/Mesh/imstkVolumetricMesh.h +++ b/Source/Geometry/Mesh/imstkVolumetricMesh.h @@ -40,7 +40,6 @@ public: /// virtual ~VolumetricMesh() override = default; -public: /// /// \brief Compute the conforming surface mesh /// diff --git a/Source/Geometry/Particles/imstkRenderParticles.h b/Source/Geometry/Particles/imstkRenderParticles.h index eeda8a32b7267b6ad3bebb5a2f433be0c871d034..4ccd8bfe171c03f20aada19f92549a7f640c1508 100644 --- a/Source/Geometry/Particles/imstkRenderParticles.h +++ b/Source/Geometry/Particles/imstkRenderParticles.h @@ -77,7 +77,6 @@ public: /// virtual const std::string getTypeName() const override { return "RenderParticles"; } -public: /// /// \brief Set size of particle /// \param size Particle size, this determines how much each keyframe diff --git a/Source/Geometry/imstkGeometry.h b/Source/Geometry/imstkGeometry.h index ef52463a861f74550d246f08dc74c6e97113b7c3..f713bf290824b27144f2fb75fba065190b30ac9a 100644 --- a/Source/Geometry/imstkGeometry.h +++ b/Source/Geometry/imstkGeometry.h @@ -81,11 +81,10 @@ public: /// virtual const std::string getTypeName() const = 0; -public: // *INDENT-OFF* SIGNAL(Geometry, modified); // *INDENT-ON* -public: + /// /// \brief Print /// diff --git a/Source/GeometryMappers/imstkGeometryMap.h b/Source/GeometryMappers/imstkGeometryMap.h index e54ee05097868b4449d08a4f0cf65c1a7e01cd24..a0c27429e32fe0a99b233691d2ff5f5914886556 100644 --- a/Source/GeometryMappers/imstkGeometryMap.h +++ b/Source/GeometryMappers/imstkGeometryMap.h @@ -43,7 +43,6 @@ public: /// virtual const std::string getTypeName() const = 0; -public: /// /// \brief Compute the map /// diff --git a/Source/GeometryMappers/imstkIdentityMap.h b/Source/GeometryMappers/imstkIdentityMap.h index 0c2bd5353a2369d89d8c259c92f73a90d725faad..b4bda7011b1d7b7f25c04d5730f96981776760df 100644 --- a/Source/GeometryMappers/imstkIdentityMap.h +++ b/Source/GeometryMappers/imstkIdentityMap.h @@ -39,7 +39,6 @@ public: virtual const std::string getTypeName() const override { return "IdentityMap"; } -public: /// /// \brief Compute the map /// diff --git a/Source/GeometryMappers/imstkIsometricMap.h b/Source/GeometryMappers/imstkIsometricMap.h index bbe58c9654db37bb090f6ddd8ad9c764872b76c7..a89b2d8d93e40ae74261c423ae9e86595f5dc511 100644 --- a/Source/GeometryMappers/imstkIsometricMap.h +++ b/Source/GeometryMappers/imstkIsometricMap.h @@ -45,7 +45,6 @@ public: virtual const std::string getTypeName() const override { return "IsometricMap"; } -public: /// /// \brief Compute the map /// diff --git a/Source/GeometryMappers/imstkOneToOneMap.h b/Source/GeometryMappers/imstkOneToOneMap.h index 05a18a84ea7f607f28b07d97a4582a42ffd90bed..d1eff29d503d370f918f9662093b9bdd5ac41263 100644 --- a/Source/GeometryMappers/imstkOneToOneMap.h +++ b/Source/GeometryMappers/imstkOneToOneMap.h @@ -45,7 +45,6 @@ public: virtual const std::string getTypeName() const override { return "OneToOneMap"; } -public: /// /// \brief Compute the tetra-triangle mesh map /// diff --git a/Source/GeometryMappers/imstkTetraTriangleMap.h b/Source/GeometryMappers/imstkTetraTriangleMap.h index d38e42b4bc6020aca69186c47bd32dbfd43b0fd4..f4aa22ac0f93a97577661dfc212ac77949d81275 100644 --- a/Source/GeometryMappers/imstkTetraTriangleMap.h +++ b/Source/GeometryMappers/imstkTetraTriangleMap.h @@ -50,7 +50,6 @@ public: virtual const std::string getTypeName() const override { return "TetraTriangleMap"; } -public: /// /// \brief Compute the tetra-triangle mesh map /// diff --git a/Source/Materials/imstkRenderMaterial.h b/Source/Materials/imstkRenderMaterial.h index 7ed25c7a98ef2b04688ad24a118d14c06baa5f7c..90bff73004df16a233d84d326226d1aa028acfa7 100644 --- a/Source/Materials/imstkRenderMaterial.h +++ b/Source/Materials/imstkRenderMaterial.h @@ -72,11 +72,9 @@ public: MinimumIntensity }; -public: RenderMaterial(); virtual ~RenderMaterial() = default; -public: // *INDENT-OFF* /// /// \brief Posted when material parameters are modified @@ -89,7 +87,6 @@ public: SIGNAL(RenderMaterial, texturesModified); // *INDENT-ON* -public: /// /// \brief Get/Set the material name /// diff --git a/Source/Materials/imstkTexture.h b/Source/Materials/imstkTexture.h index c31fd99ceaff5f78d494182338940f3c73ac90e2..61b70a2de6676e023a22051445ef3f1fa0ef37a2 100644 --- a/Source/Materials/imstkTexture.h +++ b/Source/Materials/imstkTexture.h @@ -100,14 +100,12 @@ public: /// virtual ~Texture() = default; -public: // *INDENT-OFF* SIGNAL(Texture, modified); // *INDENT-ON* void postModified() { this->postEvent(Event(modified())); } -public: /// /// \brief Get type /// diff --git a/Source/RenderingCore/imstkRenderer.h b/Source/RenderingCore/imstkRenderer.h index 7f1f5f81e56f5d09fdb2087d441a713cca95c70d..623cc03f2f0c110c419be2780805d772dbd3f815 100644 --- a/Source/RenderingCore/imstkRenderer.h +++ b/Source/RenderingCore/imstkRenderer.h @@ -67,7 +67,6 @@ public: Renderer() : m_config(std::make_shared<RendererConfig>()) { } virtual ~Renderer() = default; -public: /// /// \brief Set rendering mode /// diff --git a/Source/RenderingCore/imstkTextureManager.h b/Source/RenderingCore/imstkTextureManager.h index 2394b511afe59d9c24a519464b56def9c49caf5f..256ff29b04a504d50f8f226b01a489b087dae600 100644 --- a/Source/RenderingCore/imstkTextureManager.h +++ b/Source/RenderingCore/imstkTextureManager.h @@ -45,7 +45,6 @@ public: /// TextureManager() = default; -public: /// /// \brief Add texture /// diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKFluidRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKFluidRenderDelegate.h index 068edfad760fe80d77f6ad0e5dcd9346c59e46db..553dd2a3cde5b2fd7003ba6b742422cd103ab7ed 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKFluidRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKFluidRenderDelegate.h @@ -66,7 +66,6 @@ protected: virtual void updateRenderProperties() override; -protected: std::shared_ptr<VecDataArray<double, 3>> m_vertices; vtkSmartPointer<vtkPolyData> m_polydata; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKImageDataRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKImageDataRenderDelegate.h index 0cf0c604ec0e315ec7e1992155f1575d3bac5738..a6cf167dd0d934ee6cea96889ed9e5a2c73a2fce 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKImageDataRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKImageDataRenderDelegate.h @@ -47,7 +47,6 @@ public: /// virtual ~VTKImageDataRenderDelegate() override = default; -public: /// /// \brief Update render delegate source based on the internal data /// @@ -64,7 +63,6 @@ protected: /// void imageScalarsModified(Event* e); -protected: std::shared_ptr<AbstractDataArray> m_scalarArray; vtkSmartPointer<vtkImageData> imageDataVtk; }; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKLineMeshRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKLineMeshRenderDelegate.h index a9e4e7910c765bc1a57b4b525f9eb8bd5dde5f6b..9f1503b23fb58eedadeab4ae3bcf6b755b98ae3f 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKLineMeshRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKLineMeshRenderDelegate.h @@ -67,13 +67,11 @@ protected: /// void geometryModified(Event* e); -protected: void setVertexBuffer(std::shared_ptr<VecDataArray<double, 3>> vertices); void setIndexBuffer(std::shared_ptr<VecDataArray<int, 2>> indices); void setVertexScalarBuffer(std::shared_ptr<AbstractDataArray> scalars); void setCellScalarBuffer(std::shared_ptr<AbstractDataArray> scalars); -protected: std::shared_ptr<LineMesh> m_geometry; std::shared_ptr<VecDataArray<double, 3>> m_vertices; std::shared_ptr<VecDataArray<int, 2>> m_indices; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKPointSetRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKPointSetRenderDelegate.h index bd469e4aa93ea4880497f9e57f0c1155c31b71fa..89b33bc32b4ad0242a262686e9f13bc0489d65ab 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKPointSetRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKPointSetRenderDelegate.h @@ -65,11 +65,9 @@ protected: /// void geometryModified(Event* e); -protected: void setVertexBuffer(std::shared_ptr<VecDataArray<double, 3>> vertices); void setVertexScalarBuffer(std::shared_ptr<AbstractDataArray> scalars); -protected: std::shared_ptr<PointSet> m_geometry; std::shared_ptr<VecDataArray<double, 3>> m_vertices; std::shared_ptr<AbstractDataArray> m_vertexScalars; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKRenderDelegate.h index 44c698a2c43727cf64972c273f230dbc8be669a6..6414e85f2b9128beb892002f91bad0ee99126bfd 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKRenderDelegate.h @@ -49,7 +49,6 @@ class VTKRenderDelegate : public EventObject public: virtual ~VTKRenderDelegate() override = default; -public: /// /// \brief Instantiate proper render delegate /// @@ -104,7 +103,6 @@ protected: vtkSmartPointer<vtkTexture> getVTKTexture(std::shared_ptr<Texture> texture); -protected: vtkSmartPointer<vtkTransform> m_transform; // VTK data members used to create the rendering pipeline diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceMeshRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceMeshRenderDelegate.h index 3a4b4493b45ccc519bfaf21b9d04562b1c0a0032..85097b968ae987ee8ef2396c6d133a850c4bc36a 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceMeshRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceMeshRenderDelegate.h @@ -80,7 +80,6 @@ protected: /// void texturesModified(Event* e); -protected: void setVertexBuffer(std::shared_ptr<VecDataArray<double, 3>> vertices); void setNormalBuffer(std::shared_ptr<VecDataArray<double, 3>> normals); void setIndexBuffer(std::shared_ptr<VecDataArray<int, 3>> indices); @@ -88,7 +87,6 @@ protected: void setCellScalarBuffer(std::shared_ptr<AbstractDataArray> scalars); void setTextureCoordinateBuffer(std::shared_ptr<AbstractDataArray> textureCoordinates); -protected: std::shared_ptr<SurfaceMesh> m_geometry; std::shared_ptr<VecDataArray<double, 3>> m_vertices; std::shared_ptr<VecDataArray<double, 3>> m_normals; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceNormalRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceNormalRenderDelegate.h index 4dec41a235b1ea6163c00760b38d61145710fbe4..466a2769485751c895462d8f349b8be047b2adcc 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceNormalRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKSurfaceNormalRenderDelegate.h @@ -81,7 +81,6 @@ protected: std::shared_ptr<VecDataArray<double, 3>> verticesPtr, std::shared_ptr<VecDataArray<int, 3>> indicesPtr); -protected: std::shared_ptr<VecDataArray<double, 3>> m_surfMeshVertices; std::shared_ptr<VecDataArray<int, 3>> m_surfMeshIndices; diff --git a/Source/RenderingVTK/RenderDelegate/imstkVTKTetrahedralMeshRenderDelegate.h b/Source/RenderingVTK/RenderDelegate/imstkVTKTetrahedralMeshRenderDelegate.h index 28d65a1eb85f1eb5be1767fe7feb41bb5c6c12f6..bc1bc19214729449f3fd36fa91ed0279ea6fcb82 100644 --- a/Source/RenderingVTK/RenderDelegate/imstkVTKTetrahedralMeshRenderDelegate.h +++ b/Source/RenderingVTK/RenderDelegate/imstkVTKTetrahedralMeshRenderDelegate.h @@ -68,11 +68,9 @@ protected: /// void geometryModified(Event* e); -protected: void setVertexBuffer(std::shared_ptr<VecDataArray<double, 3>> vertices); void setIndexBuffer(std::shared_ptr<VecDataArray<int, 4>> indices); -protected: std::shared_ptr<VecDataArray<double, 3>> m_vertices; std::shared_ptr<VecDataArray<int, 4>> m_indices; diff --git a/Source/RenderingVTK/imstkVTKRenderer.h b/Source/RenderingVTK/imstkVTKRenderer.h index 57ae81e888ed354fcdd4c726bbf424257aeccb52..66c1f55d6d896da1d5fb0fd91203006bd444ba39 100644 --- a/Source/RenderingVTK/imstkVTKRenderer.h +++ b/Source/RenderingVTK/imstkVTKRenderer.h @@ -64,7 +64,6 @@ public: VTKRenderer(std::shared_ptr<Scene> scene, const bool enableVR); virtual ~VTKRenderer() override = default; -public: /// /// \brief Set the rendering mode to display debug actors or not /// @@ -145,7 +144,6 @@ protected: /// void setConfig(std::shared_ptr<RendererConfig> config) override; -protected: /// /// \brief Adds a SceneObject to be rendered /// @@ -162,7 +160,6 @@ protected: /// void sceneModifed(Event* e); -protected: /// /// \brief Add a VisualModel to be rendered, creates a delegate for it /// @@ -184,7 +181,6 @@ protected: /// void sceneObjectModified(std::shared_ptr<SceneObject> sceneObject); -protected: vtkSmartPointer<vtkRenderer> m_vtkRenderer; // Camera diff --git a/Source/RenderingVTK/imstkVTKTextureDelegate.h b/Source/RenderingVTK/imstkVTKTextureDelegate.h index d28338d831c6d6ff5d4637008546dc85b0626db2..24303f8ff6331ab87d2d5340814f33b48c2b9de0 100644 --- a/Source/RenderingVTK/imstkVTKTextureDelegate.h +++ b/Source/RenderingVTK/imstkVTKTextureDelegate.h @@ -46,7 +46,6 @@ public: virtual ~VTKTextureDelegate() override = default; -public: /// /// \brief Gets the VTK texture coupled to the imstk texture /// @@ -69,7 +68,6 @@ public: protected: void textureModified(Event* e); -protected: vtkSmartPointer<vtkTexture> m_vtkTexture; ///< VTK texture std::shared_ptr<Texture> m_texture; ///< iMSTK texture std::string m_textureName; ///< VTK texture unique name diff --git a/Source/RenderingVTK/imstkVolumeRenderMaterial.h b/Source/RenderingVTK/imstkVolumeRenderMaterial.h index 22025b41f2853cc63fa4c18a1342171f7d5a2fb8..453eb8752117884728fd30b6d060276727169d20 100644 --- a/Source/RenderingVTK/imstkVolumeRenderMaterial.h +++ b/Source/RenderingVTK/imstkVolumeRenderMaterial.h @@ -35,7 +35,6 @@ public: VolumeRenderMaterial(); ~VolumeRenderMaterial() override = default; -public: /// /// \brief Get the volume property /// diff --git a/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.cpp b/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.cpp index fc54d29eefeb51ab792fa8eb719f4cebca43aa4c..fc39a0eb3dd77b9d80b7876ec8e51c4caf57938a 100644 --- a/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.cpp +++ b/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.cpp @@ -33,7 +33,7 @@ namespace imstk { std::shared_ptr<VolumeRenderMaterial> -VolumeRenderMaterialPresets::getPreset(const int p) +VolumeRenderMaterialPresets::getPreset(Presets p) { auto mat = std::make_shared<VolumeRenderMaterial>(); auto volProp = mat->getVolumeProperty(); @@ -46,7 +46,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) switch (p) { - case VolumeRenderMaterialPresets::CT_AAA: + case Presets::CT_AAA: { // color ctf->AddRGBPoint(-3024, 0.0, 0.0, 0.0); @@ -81,7 +81,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_AAA2: + case Presets::CT_AAA2: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -120,7 +120,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_BONE: + case Presets::CT_BONE: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -151,7 +151,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_BONES: + case Presets::CT_BONES: { // color ctf->AddRGBPoint(-1000, 0.3, 0.3, 1); @@ -182,7 +182,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CARDIAC: + case Presets::CT_CARDIAC: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -217,7 +217,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CARDIAC2: + case Presets::CT_CARDIAC2: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -252,7 +252,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CARDIAC3: + case Presets::CT_CARDIAC3: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -289,7 +289,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CHEST_CONTRAST_ENHANCED: + case Presets::CT_CHEST_CONTRAST_ENHANCED: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -322,7 +322,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CHEST_VESSELS: + case Presets::CT_CHEST_VESSELS: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -355,7 +355,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CORONARY_ARTERIES: + case Presets::CT_CORONARY_ARTERIES: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -390,7 +390,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CORONARY_ARTERIES_2: + case Presets::CT_CORONARY_ARTERIES_2: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -427,7 +427,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_CORONARY_ARTERIES_3: + case Presets::CT_CORONARY_ARTERIES_3: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -464,7 +464,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_VOLUME_BONE: + case Presets::CT_VOLUME_BONE: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -497,7 +497,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_FAT: + case Presets::CT_FAT: { // color ctf->AddRGBPoint(-1000, 0.3, 0.3, 1); @@ -536,7 +536,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_LIVER_VASCULATURE: + case Presets::CT_LIVER_VASCULATURE: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -573,7 +573,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_LUNG: + case Presets::CT_LUNG: { // color ctf->AddRGBPoint(-1000, 0.3, 0.3, 1); @@ -608,7 +608,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_MIP: + case Presets::CT_MIP: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -639,7 +639,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_MUSCLE: + case Presets::CT_MUSCLE: { // color ctf->AddRGBPoint(-3024, 0, 0, 0); @@ -672,7 +672,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_PULMONARY_ARTERIES: + case Presets::CT_PULMONARY_ARTERIES: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -709,7 +709,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_SOFT_TISSUE: + case Presets::CT_SOFT_TISSUE: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -742,7 +742,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_AIR: + case Presets::CT_AIR: { // color ctf->AddRGBPoint(-3024, 1, 1, 1); @@ -773,7 +773,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::CT_X_RAY: + case Presets::CT_X_RAY: { // color ctf->AddRGBPoint(-3024, 1, 1, 1); @@ -802,7 +802,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::MR_ANGIO: + case Presets::MR_ANGIO: { // color ctf->AddRGBPoint(-2048, 0, 0, 0); @@ -837,7 +837,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::MR_DEFAULT: + case Presets::MR_DEFAULT: { // color ctf->AddRGBPoint(0, 0, 0, 0); @@ -872,7 +872,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::MR_MIP: + case Presets::MR_MIP: { // color ctf->AddRGBPoint(0, 1, 1, 1); @@ -903,7 +903,7 @@ VolumeRenderMaterialPresets::getPreset(const int p) break; } - case VolumeRenderMaterialPresets::MR_T2_BRAIN: + case Presets::MR_T2_BRAIN: { // color ctf->AddRGBPoint(0, 0, 0, 0); @@ -941,9 +941,9 @@ VolumeRenderMaterialPresets::getPreset(const int p) } const char* -VolumeRenderMaterialPresets::getPresetName(int p) +VolumeRenderMaterialPresets::getPresetName(Presets p) { - if (p >= VolumeRenderMaterialPresets::NUM_PRESETS) + if (p >= Presets::NUM_PRESETS) { return ""; } @@ -975,6 +975,6 @@ VolumeRenderMaterialPresets::getPresetName(int p) "MR_MIP", "MR_T2_BRAIN", }; - return presets[p]; + return presets[static_cast<int>(p)]; } } diff --git a/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.h b/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.h index 6ad6c443d1d7fb487afb71d4e1191f8d3a43fc41..f5212f18f98c232a69a7c9bdc147e2000e3a27e5 100644 --- a/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.h +++ b/Source/RenderingVTK/imstkVolumeRenderMaterialPresets.h @@ -34,7 +34,7 @@ class VolumeRenderMaterial; class VolumeRenderMaterialPresets { public: - enum Presets + enum class Presets { CT_AAA = 0, CT_AAA2, @@ -68,9 +68,9 @@ public: /// /// \brief TODO /// - static std::shared_ptr<VolumeRenderMaterial> getPreset(int p = CT_BONES); + static std::shared_ptr<VolumeRenderMaterial> getPreset(Presets p = Presets::CT_BONES); // Convenience API to get preset names - static const char* getPresetName(int p); + static const char* getPresetName(Presets p); }; } diff --git a/Source/Scene/imstkCollisionInteraction.h b/Source/Scene/imstkCollisionInteraction.h index 50068b406e6fde1093437863a87b60a724cb63c1..4482bf40d8e7ce26a9bb38a8da88cf2164aca972 100644 --- a/Source/Scene/imstkCollisionInteraction.h +++ b/Source/Scene/imstkCollisionInteraction.h @@ -89,7 +89,6 @@ protected: /// void updateCHB(); -protected: std::shared_ptr<CollidingObject> m_objA = nullptr; std::shared_ptr<CollidingObject> m_objB = nullptr; diff --git a/Source/Scene/imstkPbdObjectCollision.h b/Source/Scene/imstkPbdObjectCollision.h index 6618d3e73a11892e46d0c02547a9f7a38f72421b..b7ea0d8c61a684d8a24cef750140e65944e731d1 100644 --- a/Source/Scene/imstkPbdObjectCollision.h +++ b/Source/Scene/imstkPbdObjectCollision.h @@ -43,17 +43,14 @@ public: std::string cdType = "MeshToMeshBruteForceCD"); virtual ~PbdObjectCollision() override = default; -public: virtual const std::string getTypeName() const override { return "PbdObjectCollision"; } -public: void setRestitution(const double restitution); const double getRestitution() const; void setFriction(const double friction); const double getFriction() const; -public: /// /// \brief Setup connectivity of task graph /// diff --git a/Source/Scene/imstkPbdObjectCutting.h b/Source/Scene/imstkPbdObjectCutting.h index a2c0cd205031e5974f652127d928dafabd8a5653..63fb8ceaebbb4bac639ec4e39427ae0da6f1d7e5 100644 --- a/Source/Scene/imstkPbdObjectCutting.h +++ b/Source/Scene/imstkPbdObjectCutting.h @@ -46,10 +46,8 @@ public: PbdObjectCutting(std::shared_ptr<PbdObject> pbdObj, std::shared_ptr<CollidingObject> cutObj); virtual ~PbdObjectCutting() override = default; -public: virtual const std::string getTypeName() const override { return "PbdObjectCutting"; } -public: /// /// \brief Applies the cut when called /// @@ -84,7 +82,6 @@ protected: std::shared_ptr<std::vector<size_t>> elementIndices, std::shared_ptr<VecDataArray<int, 3>> elements); -protected: std::shared_ptr<PbdObject> m_objA = nullptr; std::shared_ptr<CollidingObject> m_objB = nullptr; diff --git a/Source/Scene/imstkPbdObjectPicking.h b/Source/Scene/imstkPbdObjectPicking.h index 07ca649394339965a6884be4e6eda0aed7436f51..d8759038e055144bd7f01735fa48b515fb5f9ab7 100644 --- a/Source/Scene/imstkPbdObjectPicking.h +++ b/Source/Scene/imstkPbdObjectPicking.h @@ -41,10 +41,8 @@ public: PbdObjectPicking(std::shared_ptr<PbdObject> obj1, std::shared_ptr<CollidingObject> obj2, std::string cdType); virtual ~PbdObjectPicking() override = default; -public: virtual const std::string getTypeName() const override { return "PbdObjectPicking"; } -public: /// /// \brief Remove all picking nodes and constraints /// diff --git a/Source/Scene/imstkPbdRigidObjectCollision.h b/Source/Scene/imstkPbdRigidObjectCollision.h index 5cfa275a25f5def1f63273b9a749ab21993a2685..2f0142ea17fd86e240777f52c504e366fcad6fdc 100644 --- a/Source/Scene/imstkPbdRigidObjectCollision.h +++ b/Source/Scene/imstkPbdRigidObjectCollision.h @@ -45,17 +45,14 @@ public: virtual ~PbdRigidObjectCollision() override = default; -public: virtual const std::string getTypeName() const override { return "PbdRigidObjectCollision"; } -public: void setRestitution(const double restitution); const double getRestitution() const; void setFriction(const double friction); const double getFriction() const; -public: /// /// \brief Setup connectivity of task graph /// diff --git a/Source/Scene/imstkRigidObjectCollision.h b/Source/Scene/imstkRigidObjectCollision.h index 0185cb52ae3c6fca56efb9a2bf96753c44908963..8a2053543c8ecc54b749ec333c9d7312d54564cb 100644 --- a/Source/Scene/imstkRigidObjectCollision.h +++ b/Source/Scene/imstkRigidObjectCollision.h @@ -41,17 +41,14 @@ public: RigidObjectCollision(std::shared_ptr<RigidObject2> obj1, std::shared_ptr<CollidingObject> obj2, std::string cdType); virtual ~RigidObjectCollision() override = default; -public: virtual const std::string getTypeName() const override { return "RigidObjectCollision"; } -public: void setStiffness(double stiffness); const double getStiffness() const; void setFriction(double frictionalCoefficient); const double getFriction() const; -public: /// /// \brief Setup connectivity of task graph /// @@ -61,7 +58,6 @@ public: void measureDisplacementFromPrevious(); -public: std::shared_ptr<VecDataArray<double, 3>> m_prevVertices; protected: diff --git a/Source/Scene/imstkRigidObjectLevelSetCollision.h b/Source/Scene/imstkRigidObjectLevelSetCollision.h index eec514247bfc5ea11016fbe8418f29972c7d2cb7..2f13dd76a46a6d990f022c21c5f633c77b30fd33 100644 --- a/Source/Scene/imstkRigidObjectLevelSetCollision.h +++ b/Source/Scene/imstkRigidObjectLevelSetCollision.h @@ -41,10 +41,8 @@ public: RigidObjectLevelSetCollision(std::shared_ptr<RigidObject2> obj1, std::shared_ptr<LevelSetDeformableObject> obj2); virtual ~RigidObjectLevelSetCollision() override = default; -public: virtual const std::string getTypeName() const override { return "RigidObjectLevelSetCollision"; } -public: /// /// \brief Setup connectivity of task graph /// @@ -53,7 +51,6 @@ public: void copyVertsToPrevious(); void measureDisplacementFromPrevious(); -public: std::shared_ptr<VecDataArray<double, 3>> m_prevVertices; protected: diff --git a/Source/Scene/imstkScene.h b/Source/Scene/imstkScene.h index fe8b9620535f19e7cc528e3c82c4166ca9e34b8a..897ae0fe78a5d00182b869e0191550e9347f4d84 100644 --- a/Source/Scene/imstkScene.h +++ b/Source/Scene/imstkScene.h @@ -35,7 +35,7 @@ namespace imstk { class Camera; class CameraController; -class IBLProbe; +class IblProbe; class Light; class ObjectInteractionPair; class SceneObject; @@ -81,7 +81,6 @@ public: Scene(const std::string& name, std::shared_ptr<SceneConfig> config = std::make_shared<SceneConfig>()); virtual ~Scene() override = default; -public: // *INDENT-OFF* SIGNAL(Scene, configureTaskGraph); /// @@ -91,7 +90,6 @@ public: SIGNAL(Scene, modified); // *INDENT-ON* -public: /// /// \brief Initialize the scene /// @@ -201,12 +199,12 @@ public: /// /// \brief Set global IBL probe /// - void setGlobalIBLProbe(std::shared_ptr<IBLProbe> newIBLProbe) { m_globalIBLProbe = newIBLProbe; } + void setGlobalIBLProbe(std::shared_ptr<IblProbe> newIBLProbe) { m_globalIBLProbe = newIBLProbe; } /// /// \brief Return global IBL probe /// - std::shared_ptr<IBLProbe> getGlobalIBLProbe() { return m_globalIBLProbe; } + std::shared_ptr<IblProbe> getGlobalIBLProbe() { return m_globalIBLProbe; } /// /// \brief Get the name of the scene @@ -285,7 +283,7 @@ protected: std::string m_name; ///> Name of the scene std::unordered_set<std::shared_ptr<SceneObject>> m_sceneObjects; std::unordered_map<std::string, std::shared_ptr<Light>> m_lightsMap; - std::shared_ptr<IBLProbe> m_globalIBLProbe = nullptr; + std::shared_ptr<IblProbe> m_globalIBLProbe = nullptr; std::unordered_map<std::string, std::shared_ptr<Camera>> m_cameras; std::shared_ptr<Camera> m_activeCamera; diff --git a/Source/Scene/imstkSphObjectCollision.cpp b/Source/Scene/imstkSphObjectCollision.cpp index afb121a7a0a47b3e412b75a21fcc8b23b6dd7a60..05a8a17b050c5d4e684319344a3fb92943434df0 100644 --- a/Source/Scene/imstkSphObjectCollision.cpp +++ b/Source/Scene/imstkSphObjectCollision.cpp @@ -31,7 +31,7 @@ limitations under the License. namespace imstk { // Pbd Collision will be tested before any step of pbd, then resolved after the solve steps of the two objects -SphObjectCollision::SphObjectCollision(std::shared_ptr<SPHObject> obj1, std::shared_ptr<CollidingObject> obj2, +SphObjectCollision::SphObjectCollision(std::shared_ptr<SphObject> obj1, std::shared_ptr<CollidingObject> obj2, std::string cdType) : CollisionInteraction("SphObjectCollision_" + obj1->getName() + "_vs_" + obj2->getName(), obj1, obj2) { @@ -43,7 +43,7 @@ SphObjectCollision::SphObjectCollision(std::shared_ptr<SPHObject> obj1, std::sha setCollisionDetection(cd); // Setup the handler - std::shared_ptr<SPHCollisionHandling> ch = std::make_shared<SPHCollisionHandling>(); + std::shared_ptr<SphCollisionHandling> ch = std::make_shared<SphCollisionHandling>(); ch->setInputObjectA(obj1); ch->setInputCollisionData(cd->getCollisionData()); ch->setDetection(cd); @@ -62,7 +62,7 @@ SphObjectCollision::initGraphEdges(std::shared_ptr<TaskNode> source, std::shared { CollisionInteraction::initGraphEdges(source, sink); - auto sphObj1 = std::dynamic_pointer_cast<SPHObject>(m_objA); + auto sphObj1 = std::dynamic_pointer_cast<SphObject>(m_objA); // // ...SPH steps... diff --git a/Source/Scene/imstkSphObjectCollision.h b/Source/Scene/imstkSphObjectCollision.h index d0eeec57593ab612901773c13eaae1cfc205b15b..a7d635bd33abf07a3b24fd6c9fa5559e96e7d090 100644 --- a/Source/Scene/imstkSphObjectCollision.h +++ b/Source/Scene/imstkSphObjectCollision.h @@ -25,7 +25,7 @@ limitations under the License. namespace imstk { -class SPHObject; +class SphObject; /// /// \class SphObjectCollision @@ -36,14 +36,12 @@ class SPHObject; class SphObjectCollision : public CollisionInteraction { public: - SphObjectCollision(std::shared_ptr<SPHObject> obj1, std::shared_ptr<CollidingObject> obj2, + SphObjectCollision(std::shared_ptr<SphObject> obj1, std::shared_ptr<CollidingObject> obj2, std::string cdType = "ImplicitGeometryToPointSetCD"); virtual ~SphObjectCollision() override = default; -public: virtual const std::string getTypeName() const override { return "SphObjectCollision"; } -public: /// /// \brief Setup connectivity of task graph /// diff --git a/Source/SceneEntities/Camera/imstkCamera.h b/Source/SceneEntities/Camera/imstkCamera.h index 1105bae36964995ebe6e6cc167c0eb4f0817dc2e..b3eb69d2b7376125849a7166315568cc06088be9 100644 --- a/Source/SceneEntities/Camera/imstkCamera.h +++ b/Source/SceneEntities/Camera/imstkCamera.h @@ -82,7 +82,6 @@ public: /// friend class VTKRenderer; -public: /// /// \brief Get camera view matrix /// \returns Camera view matrix reference @@ -256,7 +255,6 @@ protected: double m_nearZ = 0.01; ///> near plane of the camera double m_farZ = 1000.0; ///> far plane of the camera -protected: // Lookat camera parameters Vec3d m_position = Vec3d(0.0, 0.0, 0.0); ///> camera position Vec3d m_focalPoint = -Vec3d::UnitZ(); ///> camera focal point diff --git a/Source/SceneEntities/Lights/imstkDirectionalLight.h b/Source/SceneEntities/Lights/imstkDirectionalLight.h index 387a1d607a5e1985326f02f49c0f68a6c5be5769..7d5af949f2bfb025f6d123061bb566dcc25e25a5 100644 --- a/Source/SceneEntities/Lights/imstkDirectionalLight.h +++ b/Source/SceneEntities/Lights/imstkDirectionalLight.h @@ -43,7 +43,6 @@ public: virtual ~DirectionalLight() override = default; -public: const std::string getTypeName() const override { return "DirectionalLight"; } /// diff --git a/Source/SceneEntities/Lights/imstkIBLProbe.cpp b/Source/SceneEntities/Lights/imstkIBLProbe.cpp index 9c8b5e1c67ed6602a3d373478a66608111211916..31a01c8d8003996f01aa3ee2f31cf8e1f4050d15 100644 --- a/Source/SceneEntities/Lights/imstkIBLProbe.cpp +++ b/Source/SceneEntities/Lights/imstkIBLProbe.cpp @@ -24,7 +24,7 @@ namespace imstk { -IBLProbe::IBLProbe(std::string irradianceCubemapPath, +IblProbe::IblProbe(std::string irradianceCubemapPath, std::string radianceCubemapPath, std::string brdfLUTPath) : m_irradianceCubemapPath(irradianceCubemapPath), m_radianceCubemapPath(radianceCubemapPath), @@ -38,19 +38,19 @@ IBLProbe::IBLProbe(std::string irradianceCubemapPath, } std::shared_ptr<Texture> -IBLProbe::getIrradianceCubemapTexture() +IblProbe::getIrradianceCubemapTexture() { return m_irradianceCubemapTexture; } std::shared_ptr<Texture> -IBLProbe::getRadianceCubemapTexture() +IblProbe::getRadianceCubemapTexture() { return m_radianceCubemapTexture; } std::shared_ptr<Texture> -IBLProbe::getBrdfLUTTexture() +IblProbe::getBrdfLUTTexture() { return m_brdfLUTTexture; } diff --git a/Source/SceneEntities/Lights/imstkIBLProbe.h b/Source/SceneEntities/Lights/imstkIBLProbe.h index e456b53c60233a0411c53d444143d49bb33f0e5f..5b07af130450696f8c99fa8477cae3a54d23cc5e 100644 --- a/Source/SceneEntities/Lights/imstkIBLProbe.h +++ b/Source/SceneEntities/Lights/imstkIBLProbe.h @@ -38,7 +38,7 @@ class Texture; /// lookup table (LUT) texture. The cubemaps should be preintegrated using /// split-sum approximation. /// -class IBLProbe +class IblProbe { public: /// @@ -48,7 +48,7 @@ public: /// \param radianceCubemapPath path to .dds radiance (specular) cubemap /// \param brdfLUTPath path to BRDF LUT (shouldn't be .dds) /// - IBLProbe(std::string irradianceCubemapPath, + IblProbe(std::string irradianceCubemapPath, std::string radianceCubemapPath, std::string brdfLUTPath); /// \brief TODO diff --git a/Source/SceneEntities/Lights/imstkLight.h b/Source/SceneEntities/Lights/imstkLight.h index f4b58668b50aa9eebdc3df86bc7f466065c8c6bf..b57d8b0d6fd546873371c4e8d66ee2f244f42980 100644 --- a/Source/SceneEntities/Lights/imstkLight.h +++ b/Source/SceneEntities/Lights/imstkLight.h @@ -42,7 +42,6 @@ protected: public: virtual ~Light() override = default; -public: /// /// \brief Set the light focal point /// diff --git a/Source/SceneEntities/Lights/imstkPointLight.h b/Source/SceneEntities/Lights/imstkPointLight.h index 5674e650c5a6609d4f364dae26dc79d49fef8f5b..b74135b31f965f5078fa62bddfca6d69149231cd 100644 --- a/Source/SceneEntities/Lights/imstkPointLight.h +++ b/Source/SceneEntities/Lights/imstkPointLight.h @@ -39,7 +39,6 @@ public: PointLight() = default; virtual ~PointLight() override = default; -public: const std::string getTypeName() const override { return "PointLight"; } const Vec3d getPosition() const { return m_position; } diff --git a/Source/SceneEntities/Lights/imstkSpotLight.h b/Source/SceneEntities/Lights/imstkSpotLight.h index 70039ddb622994c9957d4a0a06c2dfc416dd0719..2ac4743f5924d456ac3534b41be010b0fed01cf8 100644 --- a/Source/SceneEntities/Lights/imstkSpotLight.h +++ b/Source/SceneEntities/Lights/imstkSpotLight.h @@ -36,7 +36,6 @@ public: SpotLight() : m_spotAngle(10.0) { } virtual ~SpotLight() override = default; -public: const std::string getTypeName() const override { return "SpotLight"; } /// diff --git a/Source/SceneEntities/Objects/imstkAnimationObject.h b/Source/SceneEntities/Objects/imstkAnimationObject.h index 3c9cc47d6c035fc67402c68a3b8bd1ecde399774..100c673566537c0c1271bb6a03cb84d742094858 100644 --- a/Source/SceneEntities/Objects/imstkAnimationObject.h +++ b/Source/SceneEntities/Objects/imstkAnimationObject.h @@ -37,7 +37,6 @@ public: AnimationObject(const std::string& name) : SceneObject(name) { } virtual ~AnimationObject() override = default; -public: virtual const std::string getTypeName() const override { return "AnimationObject"; } /// diff --git a/Source/SceneEntities/Objects/imstkCollidingObject.h b/Source/SceneEntities/Objects/imstkCollidingObject.h index 84191d058a9088a9246f50d05e5b2d3900c40c79..54c1e7e13fbc20c5753e19d65eb0cd1e5fb9c78a 100644 --- a/Source/SceneEntities/Objects/imstkCollidingObject.h +++ b/Source/SceneEntities/Objects/imstkCollidingObject.h @@ -40,7 +40,6 @@ public: CollidingObject(const std::string& name) : SceneObject(name) { } virtual ~CollidingObject() override = default; -public: virtual const std::string getTypeName() const override { return "CollidingObject"; } /// diff --git a/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.h b/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.h index 4521efd440732d86081e1596b8f7da54913fd260..6a0e5340a600a4ef5ae426861152584a4e3c2824 100644 --- a/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.h +++ b/Source/SceneEntities/Objects/imstkCollisionDataDebugObject.h @@ -39,7 +39,6 @@ public: CollisionDataDebugObject() : DebugGeometryObject() { } virtual ~CollisionDataDebugObject() = default; -public: /// /// \brief Append visual representation to the debug meshes for the given contact and geometry /// diff --git a/Source/SceneEntities/Objects/imstkDebugGeometryObject.h b/Source/SceneEntities/Objects/imstkDebugGeometryObject.h index a51f8a95420e60971ae1eeeecaa1d80105a64375..cb25df58575501345475927b7580b52a49154f2c 100644 --- a/Source/SceneEntities/Objects/imstkDebugGeometryObject.h +++ b/Source/SceneEntities/Objects/imstkDebugGeometryObject.h @@ -46,7 +46,6 @@ public: DebugGeometryObject(); virtual ~DebugGeometryObject() = default; -public: /// /// \brief Adds a line to the debug lines with default color /// @@ -101,7 +100,6 @@ public: void clear(); /// Accessors -public: std::shared_ptr<RenderMaterial> getPointMaterial() const; std::shared_ptr<RenderMaterial> getLineMaterial() const; std::shared_ptr<RenderMaterial> getFaceMaterial() const; diff --git a/Source/SceneEntities/Objects/imstkDynamicObject.h b/Source/SceneEntities/Objects/imstkDynamicObject.h index d7730d7b1265a8c64c678c25c647e2f3ef6a6093..01a0e64a6c459d4aa075bf507583fd49a5afcd15 100644 --- a/Source/SceneEntities/Objects/imstkDynamicObject.h +++ b/Source/SceneEntities/Objects/imstkDynamicObject.h @@ -97,7 +97,6 @@ protected: /// virtual void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink) override; -protected: /// /// \brief Constructor /// diff --git a/Source/SceneEntities/Objects/imstkFeDeformableObject.cpp b/Source/SceneEntities/Objects/imstkFeDeformableObject.cpp index ef34448492e5faed86276541a79eda0b5728d071..54b02119b4182c5e8adfc9f1a03661767f4bbed3 100644 --- a/Source/SceneEntities/Objects/imstkFeDeformableObject.cpp +++ b/Source/SceneEntities/Objects/imstkFeDeformableObject.cpp @@ -28,7 +28,7 @@ namespace imstk bool FeDeformableObject::initialize() { - m_femModel = std::dynamic_pointer_cast<FEMDeformableBodyModel>(m_dynamicalModel); + m_femModel = std::dynamic_pointer_cast<FemDeformableBodyModel>(m_dynamicalModel); if (m_femModel == nullptr) { LOG(FATAL) << "Dynamics pointer cast failure in DeformableObject::initialize()"; @@ -41,10 +41,10 @@ FeDeformableObject::initialize() return true; } -std::shared_ptr<FEMDeformableBodyModel> +std::shared_ptr<FemDeformableBodyModel> FeDeformableObject::getFEMModel() { - m_femModel = std::dynamic_pointer_cast<FEMDeformableBodyModel>(m_dynamicalModel); + m_femModel = std::dynamic_pointer_cast<FemDeformableBodyModel>(m_dynamicalModel); return m_femModel; } } // imstk diff --git a/Source/SceneEntities/Objects/imstkFeDeformableObject.h b/Source/SceneEntities/Objects/imstkFeDeformableObject.h index 774364587ef468a53838eea83c3cf43b3a6416d3..d02575a9fdb2be345e0fe340de5c1e9da8ecaae5 100644 --- a/Source/SceneEntities/Objects/imstkFeDeformableObject.h +++ b/Source/SceneEntities/Objects/imstkFeDeformableObject.h @@ -26,7 +26,7 @@ namespace imstk { -class FEMDeformableBodyModel; +class FemDeformableBodyModel; /// /// \class FeDeformableObject @@ -39,7 +39,6 @@ public: FeDeformableObject(const std::string& name) : DynamicObject(name) { } virtual ~FeDeformableObject() override = default; -public: virtual const std::string getTypeName() const override { return "FeDeformableObject"; } /// @@ -47,9 +46,9 @@ public: /// bool initialize() override; - std::shared_ptr<FEMDeformableBodyModel> getFEMModel(); + std::shared_ptr<FemDeformableBodyModel> getFEMModel(); protected: - std::shared_ptr<FEMDeformableBodyModel> m_femModel = nullptr; + std::shared_ptr<FemDeformableBodyModel> m_femModel = nullptr; }; } // imstk diff --git a/Source/SceneEntities/Objects/imstkLevelSetDeformableObject.h b/Source/SceneEntities/Objects/imstkLevelSetDeformableObject.h index 2b3de0e2db41016fc0acc2280541f969976022b6..79fc23ce5bd0fc12ae543480b8964d4d975fc31c 100644 --- a/Source/SceneEntities/Objects/imstkLevelSetDeformableObject.h +++ b/Source/SceneEntities/Objects/imstkLevelSetDeformableObject.h @@ -39,7 +39,6 @@ public: LevelSetDeformableObject(const std::string& name) : DynamicObject(name) { } virtual ~LevelSetDeformableObject() override = default; -public: virtual const std::string getTypeName() const override { return "LevelSetDeformableObject"; } /// diff --git a/Source/SceneEntities/Objects/imstkPbdObject.h b/Source/SceneEntities/Objects/imstkPbdObject.h index ce682c388ae2c89e501c7d1f0ceb87b5319196b3..c9459342154a2ec4e015a40bd4e006d009bde9f5 100644 --- a/Source/SceneEntities/Objects/imstkPbdObject.h +++ b/Source/SceneEntities/Objects/imstkPbdObject.h @@ -39,7 +39,6 @@ public: PbdObject(const std::string& name) : DynamicObject(name) { } virtual ~PbdObject() override = default; -public: virtual const std::string getTypeName() const override { return "PbdObject"; } /// diff --git a/Source/SceneEntities/Objects/imstkRigidObject2.h b/Source/SceneEntities/Objects/imstkRigidObject2.h index 2dbc0928c12fa473b1dccc75f84e310effb5c67c..62744d54db63552084192d8a546df0555b991d56 100644 --- a/Source/SceneEntities/Objects/imstkRigidObject2.h +++ b/Source/SceneEntities/Objects/imstkRigidObject2.h @@ -42,7 +42,6 @@ public: virtual ~RigidObject2() = default; -public: virtual const std::string getTypeName() const override { return "RigidObject2"; } /// diff --git a/Source/SceneEntities/Objects/imstkSPHObject.cpp b/Source/SceneEntities/Objects/imstkSPHObject.cpp index a8771baad9fc1ddf7edf537e20ab592004c0965c..78f509bf0b478c9528dccf2735c85b15d51f6d3d 100644 --- a/Source/SceneEntities/Objects/imstkSPHObject.cpp +++ b/Source/SceneEntities/Objects/imstkSPHObject.cpp @@ -25,10 +25,10 @@ namespace imstk { bool -SPHObject::initialize() +SphObject::initialize() { - m_SPHModel = std::dynamic_pointer_cast<SPHModel>(m_dynamicalModel); - if (m_SPHModel == nullptr) + m_sphModel = std::dynamic_pointer_cast<SphModel>(m_dynamicalModel); + if (m_sphModel == nullptr) { LOG(FATAL) << "Dynamics pointer cast failure in SPHObject::initialize()"; return false; @@ -36,15 +36,15 @@ SPHObject::initialize() // why are we initializing twice? DynamicObject::initialize(); - m_SPHModel->initialize(); + m_sphModel->initialize(); return true; } -std::shared_ptr<SPHModel> -SPHObject::getSPHModel() +std::shared_ptr<SphModel> +SphObject::getSphModel() { - m_SPHModel = std::dynamic_pointer_cast<SPHModel>(m_dynamicalModel); - return m_SPHModel; + m_sphModel = std::dynamic_pointer_cast<SphModel>(m_dynamicalModel); + return m_sphModel; } } // end namespace imstk diff --git a/Source/SceneEntities/Objects/imstkSPHObject.h b/Source/SceneEntities/Objects/imstkSPHObject.h index 89882e32779f482d21dbb5744cc9288eee0ea38e..400a742550723518dae49ce08f10ddb3280f8107 100644 --- a/Source/SceneEntities/Objects/imstkSPHObject.h +++ b/Source/SceneEntities/Objects/imstkSPHObject.h @@ -25,7 +25,7 @@ namespace imstk { -class SPHModel; +class SphModel; /// /// \class SPHObject @@ -33,19 +33,18 @@ class SPHModel; /// \brief Base class for scene objects that move and/or deform under /// smooth particle hydrodynamics /// -class SPHObject : public DynamicObject +class SphObject : public DynamicObject { public: - SPHObject(const std::string& name) : DynamicObject(name) { } - virtual ~SPHObject() override = default; + SphObject(const std::string& name) : DynamicObject(name) { } + virtual ~SphObject() override = default; -public: virtual const std::string getTypeName() const override { return "SPHObject"; } /// /// \brief Get the model governing the SPH fluid dynamics of this object /// - std::shared_ptr<SPHModel> getSPHModel(); + std::shared_ptr<SphModel> getSphModel(); /// /// \brief Initialize the SPH scene object @@ -53,6 +52,6 @@ public: bool initialize() override; protected: - std::shared_ptr<SPHModel> m_SPHModel = nullptr; + std::shared_ptr<SphModel> m_sphModel = nullptr; }; } // end namespace imstk diff --git a/Source/SceneEntities/Objects/imstkSceneObject.h b/Source/SceneEntities/Objects/imstkSceneObject.h index 7ebdca31cdd9e6d6abcb57954d35407f1862a9bf..8eca62f7df0afd374d4ae8aee404d04537f820cd 100644 --- a/Source/SceneEntities/Objects/imstkSceneObject.h +++ b/Source/SceneEntities/Objects/imstkSceneObject.h @@ -46,12 +46,10 @@ public: SceneObject(const std::string& name); virtual ~SceneObject() override = default; -public: // *INDENT-OFF* SIGNAL(SceneObject, modified); // *INDENT-ON* -public: /// /// \brief Get the type of the object /// @@ -150,7 +148,6 @@ protected: /// virtual void initGraphEdges(std::shared_ptr<TaskNode> source, std::shared_ptr<TaskNode> sink); -protected: std::string m_name; ///> Custom name of the scene object std::vector<std::shared_ptr<VisualModel>> m_visualModels; ///> Visual objects for rendering std::shared_ptr<TaskGraph> m_taskGraph = nullptr; ///> Computational Graph diff --git a/Source/SceneEntities/Objects/imstkVisualModel.h b/Source/SceneEntities/Objects/imstkVisualModel.h index dae04b57ec868b09fe9d4bf0adb67b8824d22284..0ed9d210ce5f473eaa6504535fb041b3a828d00b 100644 --- a/Source/SceneEntities/Objects/imstkVisualModel.h +++ b/Source/SceneEntities/Objects/imstkVisualModel.h @@ -50,12 +50,10 @@ public: VisualModel(); virtual ~VisualModel() override = default; -public: // *INDENT-OFF* SIGNAL(VisualModel, modified); // *INDENT-ON* -public: /// /// \brief Get/set geometry /// diff --git a/Source/SceneEntities/imstkSceneEntity.h b/Source/SceneEntities/imstkSceneEntity.h index 8902437443d1f3f0a7427745c3117c78fe733520..a15a06988b01cb4c9d17b26a29ed6b46f6f1a253 100644 --- a/Source/SceneEntities/imstkSceneEntity.h +++ b/Source/SceneEntities/imstkSceneEntity.h @@ -38,7 +38,6 @@ class SceneEntity : public EventObject public: virtual ~SceneEntity() = default; -public: /// /// \brief Get ID (ALWAYS query the ID in your code, DO NOT hardcode it) /// \returns ID of entity diff --git a/Source/SimulationManager/imstkConsoleModule.h b/Source/SimulationManager/imstkConsoleModule.h index 97aa14bf257e7a75677d4aa26f13ac8f5cf85f55..29e86052295fb26d9b33c7ac903c8379d3a8e754 100644 --- a/Source/SimulationManager/imstkConsoleModule.h +++ b/Source/SimulationManager/imstkConsoleModule.h @@ -40,7 +40,6 @@ public: ConsoleModule(std::string name = "ConsoleModule"); ~ConsoleModule() override = default; -public: std::shared_ptr<KeyboardDeviceClient> getKeyboardDevice() const { return m_keyboardDeviceClient; } protected: @@ -51,7 +50,6 @@ protected: /// void updateModule() override; -protected: std::shared_ptr<KeyboardDeviceClient> m_keyboardDeviceClient; }; } \ No newline at end of file diff --git a/Source/SimulationManager/imstkKeyboardSceneControl.h b/Source/SimulationManager/imstkKeyboardSceneControl.h index 5de210d6224656cd4d9f365c453275b61afe3d21..7e3d90c20ee931a54ec35387514a5bfe35f90b1c 100644 --- a/Source/SimulationManager/imstkKeyboardSceneControl.h +++ b/Source/SimulationManager/imstkKeyboardSceneControl.h @@ -44,7 +44,6 @@ public: KeyboardSceneControl(std::shared_ptr<KeyboardDeviceClient> keyDevice); virtual ~KeyboardSceneControl() override = default; -public: /// /// \brief The driver is used to stop the simulation /// @@ -55,7 +54,6 @@ public: /// void setSceneManager(std::weak_ptr<SceneManager> sceneManager) { m_sceneManager = sceneManager; } -public: void printControls() override; void OnKeyPress(const char key) override; diff --git a/Source/SimulationManager/imstkMouseSceneControl.h b/Source/SimulationManager/imstkMouseSceneControl.h index 495f585efd8a2de9ee9590632c1fe17fc81120a9..96ff819d672e6f884e7d95bea33744b67097d538 100644 --- a/Source/SimulationManager/imstkMouseSceneControl.h +++ b/Source/SimulationManager/imstkMouseSceneControl.h @@ -46,12 +46,10 @@ public: Rotate }; -public: MouseSceneControl() = default; MouseSceneControl(std::shared_ptr<MouseDeviceClient> device); ~MouseSceneControl() override = default; -public: /// /// \brief Set the scroll controlled zoom speed /// @@ -83,7 +81,6 @@ public: /// bool getEnabled() const; -public: void printControls() override; /// diff --git a/Source/SimulationManager/imstkSceneManager.h b/Source/SimulationManager/imstkSceneManager.h index cd54c236b078d1ea7458c98cead2ec89add8f575..322ca13e220012c333b7a3273e0cbe82f7351d99 100644 --- a/Source/SimulationManager/imstkSceneManager.h +++ b/Source/SimulationManager/imstkSceneManager.h @@ -45,11 +45,9 @@ public: Debug }; -public: SceneManager(std::string name = "SceneManager"); virtual ~SceneManager() override = default; -public: /// /// \brief Get the scene that the scene manager is managing /// @@ -106,7 +104,6 @@ public: /// void removeScene(std::string name); -public: /// /// \brief Initialize the thread /// diff --git a/Source/SimulationManager/imstkSimulationManager.h b/Source/SimulationManager/imstkSimulationManager.h index c40ddb8212ad9dc2e5a2a677e6a1feb74974c01b..0f0d9ecfdd72642c620b8caf95ff223d4e77652d 100644 --- a/Source/SimulationManager/imstkSimulationManager.h +++ b/Source/SimulationManager/imstkSimulationManager.h @@ -52,12 +52,9 @@ public: STL }; -public: - SimulationManager() = default; virtual ~SimulationManager() override = default; -public: // *INDENT-OFF* /// /// \brief Called after initialization but before starting the loop @@ -70,7 +67,6 @@ public: SIGNAL(SimulationManager, ending); // *INDENT-ON* -public: void start() override; /// @@ -115,7 +111,6 @@ protected: void runModuleParallel(std::shared_ptr<Module> module); -protected: std::vector<std::shared_ptr<Viewer>> m_viewers; std::unordered_map<Module*, bool> m_running; diff --git a/Source/Solvers/imstkLinearSolver.h b/Source/Solvers/imstkLinearSolver.h index 1d55d8ed32f46b7cceeae9f3dfbbd84dee66ed88..e65b73bbabf2cc4684113ddf2bc52304fb10eca9 100644 --- a/Source/Solvers/imstkLinearSolver.h +++ b/Source/Solvers/imstkLinearSolver.h @@ -47,7 +47,6 @@ public: None }; -public: /// /// \brief Default constructor/destructor /// diff --git a/Source/Solvers/imstkNewtonSolver.h b/Source/Solvers/imstkNewtonSolver.h index dc5ef3d47cbb5f98c994fb87ee4fdbdd669ee412..82f00c85b2cb6120da6202fe76d66e2ddedbe127 100644 --- a/Source/Solvers/imstkNewtonSolver.h +++ b/Source/Solvers/imstkNewtonSolver.h @@ -39,7 +39,6 @@ class NewtonSolver : public NonLinearSolver<SystemMatrix> public: using LinearSolverType = LinearSolver<SystemMatrix>; -public: /// /// \brief Constructors\Destructors /// diff --git a/Source/Solvers/imstkNonLinearSolver.h b/Source/Solvers/imstkNonLinearSolver.h index 2fe134e3ce4696c0eb4f81aafe226b937d0946fc..2f088eb1cdaddc1ec5e10c9da644ae04c277f49b 100644 --- a/Source/Solvers/imstkNonLinearSolver.h +++ b/Source/Solvers/imstkNonLinearSolver.h @@ -41,7 +41,6 @@ public: using UpdateIterateType = std::function<void (const Vectord&, Vectord&)>; using FunctionType = NonLinearSystem<SparseMatrixd>::VectorFunctionType; -public: /// /// \brief Default Constructor/Destructor /// diff --git a/Source/Solvers/imstkNonLinearSystem.h b/Source/Solvers/imstkNonLinearSystem.h index 6ebadcdd8e380cf4f043deefaa124362f10721e8..024cf60d618652aabaac06c384e22dc1bfecf158 100644 --- a/Source/Solvers/imstkNonLinearSystem.h +++ b/Source/Solvers/imstkNonLinearSystem.h @@ -43,7 +43,6 @@ public: using UpdateFunctionType = std::function<void (const Vectord&, const bool)>; using UpdatePrevStateFunctionType = std::function<void ()>; -public: /// /// \brief default Constructor/Destructor /// @@ -133,7 +132,6 @@ public: return *m_DynamicLinearProjConstraints; }*/ -public: VectorFunctionType m_F; ///> Nonlinear function MatrixFunctionType m_dF; ///> Gradient of the Nonlinear function with respect to the unknown vector VectorMatrixFunctionType m_F_dF; diff --git a/Source/Solvers/imstkPbdSolver.h b/Source/Solvers/imstkPbdSolver.h index be49a5e39a882c28df5da33a019fb52e806b3caa..2cd9a08630f7e235db35ebf6aa99d6f85d5b0c5a 100644 --- a/Source/Solvers/imstkPbdSolver.h +++ b/Source/Solvers/imstkPbdSolver.h @@ -65,7 +65,6 @@ public: PbdSolver(); virtual ~PbdSolver() override = default; -public: /// /// \brief Set Iterations. The number of nonlinear iterations. /// @@ -130,7 +129,6 @@ public: PbdCollisionSolver(); virtual ~PbdCollisionSolver() override = default; -public: /// /// \brief Get CollisionIterations /// diff --git a/Source/ViewerCore/imstkViewer.h b/Source/ViewerCore/imstkViewer.h index d8985237fdb13f4a3248a9497ae92931fea9c085..423f7aabbcfc214e48df11a1afac098f4ba38f5d 100644 --- a/Source/ViewerCore/imstkViewer.h +++ b/Source/ViewerCore/imstkViewer.h @@ -155,7 +155,6 @@ public: protected: virtual void updateModule() override; -protected: std::vector<std::shared_ptr<DeviceControl>> m_controls; ///> Set of controls updated on the viewer thread std::unordered_map<std::shared_ptr<Scene>, std::shared_ptr<Renderer>> m_rendererMap; diff --git a/Source/ViewerVTK/imstkAbstractVTKViewer.h b/Source/ViewerVTK/imstkAbstractVTKViewer.h index 16c955c387950084990c3acf480452b7221f19fb..569e12578ef3de81e93632b06cd99938eec102ad 100644 --- a/Source/ViewerVTK/imstkAbstractVTKViewer.h +++ b/Source/ViewerVTK/imstkAbstractVTKViewer.h @@ -52,7 +52,6 @@ protected: public: virtual ~AbstractVTKViewer() override = default; -public: /// /// \brief Get the current renderer mode /// @@ -101,7 +100,6 @@ protected: void uninitModule() override; -protected: vtkSmartPointer<vtkRenderWindow> m_vtkRenderWindow; vtkSmartPointer<vtkInteractorStyle> m_vtkInteractorStyle; vtkSmartPointer<vtkCallbackCommand> exitCallback; diff --git a/Source/ViewerVTK/imstkVTKInteractorStyle.h b/Source/ViewerVTK/imstkVTKInteractorStyle.h index 294535532dce31939684ee5da10f2f97226d4106..8bb245891d984bb50e238f2f24eaa2bb612babdf 100644 --- a/Source/ViewerVTK/imstkVTKInteractorStyle.h +++ b/Source/ViewerVTK/imstkVTKInteractorStyle.h @@ -43,7 +43,6 @@ public: VTKInteractorStyle(); virtual ~VTKInteractorStyle() override; -public: /// /// \brief Slot for key pressed /// diff --git a/Source/ViewerVTK/imstkVTKInteractorStyleVR.h b/Source/ViewerVTK/imstkVTKInteractorStyleVR.h index 13137f338ea821ac7daa4e676a77ed2e21d17c50..9188b9b2948041c24d3fe8589a59689092a2517f 100644 --- a/Source/ViewerVTK/imstkVTKInteractorStyleVR.h +++ b/Source/ViewerVTK/imstkVTKInteractorStyleVR.h @@ -52,7 +52,6 @@ public: std::shared_ptr<imstk::OpenVRDeviceClient> getRightControllerDeviceClient() const { return m_rightControllerDeviceClient; } std::shared_ptr<imstk::OpenVRDeviceClient> getHmdDeviceClient() const { return m_hmdDeviceClient; } -public: vtkInteractorStyleVR(); protected: diff --git a/Source/ViewerVTK/imstkVTKOpenVRViewer.h b/Source/ViewerVTK/imstkVTKOpenVRViewer.h index 023ee9c8114660a71f82274e993bd0e71d55d612..247500f25a544893a2bad043ec506a610f203929 100644 --- a/Source/ViewerVTK/imstkVTKOpenVRViewer.h +++ b/Source/ViewerVTK/imstkVTKOpenVRViewer.h @@ -45,7 +45,6 @@ public: VTKOpenVRViewer(std::string name = "VTKOpenVRViewer"); ~VTKOpenVRViewer() override = default; -public: /// /// \brief Destructor /// @@ -81,7 +80,6 @@ protected: void updateModule() override; -protected: ///> The VR controllers are tied to the view std::list<std::shared_ptr<OpenVRDeviceClient>> m_vrDeviceClients; }; diff --git a/Source/ViewerVTK/imstkVTKTextStatusManager.h b/Source/ViewerVTK/imstkVTKTextStatusManager.h index bcc492e99db29683deb7c48a6bd14243f452823c..fe6099128e9c5c680eb6c7c67ca49768a009b716 100644 --- a/Source/ViewerVTK/imstkVTKTextStatusManager.h +++ b/Source/ViewerVTK/imstkVTKTextStatusManager.h @@ -66,11 +66,9 @@ public: LowerRight }; -public: explicit VTKTextStatusManager(); virtual ~VTKTextStatusManager(); -public: /// /// \brief Return the text actor at index i /// diff --git a/Source/ViewerVTK/imstkVTKViewer.h b/Source/ViewerVTK/imstkVTKViewer.h index 79c9407b6f61453022e7c0160ce6eb5577812851..0a9aa833094000a9770e3d18ab24129df6a8cd98 100644 --- a/Source/ViewerVTK/imstkVTKViewer.h +++ b/Source/ViewerVTK/imstkVTKViewer.h @@ -43,7 +43,6 @@ public: VTKViewer(std::string name = "VTKViewer"); ~VTKViewer() override = default; -public: /// /// \brief Set the rendering mode. In debug, debug actors will be shown. /// @@ -97,7 +96,6 @@ protected: void updateModule() override; -protected: std::chrono::high_resolution_clock::time_point m_pre; ///> time point pre-rendering std::chrono::high_resolution_clock::time_point m_post; ///> time point post-rendering std::chrono::high_resolution_clock::time_point m_lastFpsUpdate; ///> time point for last framerate display update