diff --git a/CMake/SimMedTKMacros.cmake b/CMake/SimMedTKMacros.cmake index 31ae81ed81f832bd3224f734b08db533905dd874..7e8fca122f04798e1961ad72d433bffd6cca12f9 100644 --- a/CMake/SimMedTKMacros.cmake +++ b/CMake/SimMedTKMacros.cmake @@ -55,7 +55,7 @@ function(simmedtk_add_library target) if (target_PUBLIC_HEADERS) simmedtk_install_library(${target}) install(FILES ${target_PUBLIC_HEADERS} - DESTINATION include/simmedtk/${target} + DESTINATION include/v${SimMedTK_VERSION}/${target} COMPONENT Development ) endif() diff --git a/CMakeLists.txt b/CMakeLists.txt index 3f5645a5d7e6301926e3ee89498fc6a3ee642986..afecea73481712796ef95073abe918dff4779c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,7 @@ if(SimMedTK_SUPERBUILD) return() endif() -include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src") +include_directories("${CMAKE_CURRENT_SOURCE_DIR}") #----------------------------------------------------------------------------- # Find required packages @@ -240,9 +240,19 @@ if(SimMedTK_USE_OCULUS) list(APPEND SimMedTK_exports RenderingOculus) endif() -add_subdirectory(src) - -add_subdirectory(examples) +add_subdirectory(Core) +add_subdirectory(Collision) +add_subdirectory(ContactHandling) +add_subdirectory(External) +add_subdirectory(Devices) +add_subdirectory(Mesh) +add_subdirectory(Rendering) +add_subdirectory(RenderDelegates) +add_subdirectory(Simulators) +add_subdirectory(VirtualTools) +add_subdirectory(Event) +add_subdirectory(Geometry) +add_subdirectory(Examples) ################################################################################ # Build documentation @@ -252,7 +262,7 @@ add_subdirectory(examples) # if (SimMedTK_ENABLE_DOCUMENTATION) - add_subdirectory(documentation) + add_subdirectory(Documentation) endif() ################################################################################ diff --git a/src/Collision/CMakeLists.txt b/Collision/CMakeLists.txt similarity index 100% rename from src/Collision/CMakeLists.txt rename to Collision/CMakeLists.txt diff --git a/src/Collision/CollisionMoller.cpp b/Collision/CollisionMoller.cpp similarity index 100% rename from src/Collision/CollisionMoller.cpp rename to Collision/CollisionMoller.cpp diff --git a/src/Collision/CollisionMoller.h b/Collision/CollisionMoller.h similarity index 100% rename from src/Collision/CollisionMoller.h rename to Collision/CollisionMoller.h diff --git a/src/Collision/CollisionUtilities.cpp b/Collision/CollisionUtilities.cpp similarity index 98% rename from src/Collision/CollisionUtilities.cpp rename to Collision/CollisionUtilities.cpp index 051960723b90899f010eeb1ca9bea15b4ab5ae1c..1a72dbf429a2848f6a46717b97eacc2679f445cd 100644 --- a/src/Collision/CollisionUtilities.cpp +++ b/Collision/CollisionUtilities.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "CollisionUtilities.h" +#include "Collision/CollisionUtilities.h" int intersect3D_RayTriangleWithBarycentric( core::Vec3d P0, core::Vec3d P1, core::Vec3d V0, core::Vec3d V1, core::Vec3d V2, core::Vec3d *I, float &p_baryU, float &p_baryV, float &p_baryW, bool considerFrontFaceOnly ) { diff --git a/src/Collision/CollisionUtilities.h b/Collision/CollisionUtilities.h similarity index 100% rename from src/Collision/CollisionUtilities.h rename to Collision/CollisionUtilities.h diff --git a/src/Collision/MeshCollisionModel.cpp b/Collision/MeshCollisionModel.cpp similarity index 97% rename from src/Collision/MeshCollisionModel.cpp rename to Collision/MeshCollisionModel.cpp index 08692880bcb0484d6c40ff73e2b26b6ce3b22e9b..92c8442ef421e8d4663e2f2c6dd2540f31a56fe9 100644 --- a/src/Collision/MeshCollisionModel.cpp +++ b/Collision/MeshCollisionModel.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "MeshCollisionModel.h" +#include "Collision/MeshCollisionModel.h" MeshCollisionModel::MeshCollisionModel() { diff --git a/src/Collision/MeshCollisionModel.h b/Collision/MeshCollisionModel.h similarity index 100% rename from src/Collision/MeshCollisionModel.h rename to Collision/MeshCollisionModel.h diff --git a/src/Collision/MeshToMeshCollision.cpp b/Collision/MeshToMeshCollision.cpp similarity index 100% rename from src/Collision/MeshToMeshCollision.cpp rename to Collision/MeshToMeshCollision.cpp diff --git a/src/Collision/MeshToMeshCollision.h b/Collision/MeshToMeshCollision.h similarity index 100% rename from src/Collision/MeshToMeshCollision.h rename to Collision/MeshToMeshCollision.h diff --git a/src/Collision/OctreeCell.cpp b/Collision/OctreeCell.cpp similarity index 100% rename from src/Collision/OctreeCell.cpp rename to Collision/OctreeCell.cpp diff --git a/src/Collision/OctreeCell.h b/Collision/OctreeCell.h similarity index 100% rename from src/Collision/OctreeCell.h rename to Collision/OctreeCell.h index 7e22ec0c9eebc2133e997e18427d75c27dd31bac..57c8b4491bb414aa169299cf0e880e80ce0b54a6 100644 --- a/src/Collision/OctreeCell.h +++ b/Collision/OctreeCell.h @@ -24,14 +24,14 @@ #ifndef SM_OCTREECELL_H #define SM_OCTREECELL_H -// SimMedTK includes -#include "Collision/SurfaceTreeCell.h" -#include "Core/Geometry.h" - #include <Eigen/Geometry> #include <array> #include <memory> +// SimMedTK includes +#include "Collision/SurfaceTreeCell.h" +#include "Core/Geometry.h" + /// \brief cell of an octree class OctreeCell : public SurfaceTreeCell<OctreeCell> { diff --git a/src/Collision/PlaneCollisionModel.cpp b/Collision/PlaneCollisionModel.cpp similarity index 96% rename from src/Collision/PlaneCollisionModel.cpp rename to Collision/PlaneCollisionModel.cpp index 0b9a22e4058a292545b1e8b6c548801c87b40a66..fa51ee89508c46b14e565e250a3929ade3af4e09 100644 --- a/src/Collision/PlaneCollisionModel.cpp +++ b/Collision/PlaneCollisionModel.cpp @@ -22,7 +22,7 @@ //--------------------------------------------------------------------------- -#include "PlaneCollisionModel.h" +#include "Collision/PlaneCollisionModel.h" PlaneCollisionModel::PlaneCollisionModel(const core::Vec3d& p, const core::Vec3d& n) : PlaneModel(p, n) diff --git a/src/Collision/PlaneCollisionModel.h b/Collision/PlaneCollisionModel.h similarity index 100% rename from src/Collision/PlaneCollisionModel.h rename to Collision/PlaneCollisionModel.h diff --git a/src/Collision/PlaneToMeshCollision.cpp b/Collision/PlaneToMeshCollision.cpp similarity index 100% rename from src/Collision/PlaneToMeshCollision.cpp rename to Collision/PlaneToMeshCollision.cpp diff --git a/src/Collision/PlaneToMeshCollision.h b/Collision/PlaneToMeshCollision.h similarity index 100% rename from src/Collision/PlaneToMeshCollision.h rename to Collision/PlaneToMeshCollision.h diff --git a/src/Collision/SpatialHashCollision.cpp b/Collision/SpatialHashCollision.cpp similarity index 93% rename from src/Collision/SpatialHashCollision.cpp rename to Collision/SpatialHashCollision.cpp index 1507ec6ba3a6c18b54dfcce1144f7a2401102c44..71b0993cdde7c50f978b2d7a5c76db0a613251e8 100644 --- a/src/Collision/SpatialHashCollision.cpp +++ b/Collision/SpatialHashCollision.cpp @@ -161,8 +161,8 @@ bool SpatialHashCollision::findCandidateTrisLines(std::shared_ptr<Mesh> meshA, s void SpatialHashCollision::computeCollisionTri2Tri() { - smHashIterator<CellTriangle> iterator; - smHashIterator<CellTriangle> iterator1; + HashIterator<CellTriangle> iterator; + HashIterator<CellTriangle> iterator1; CellTriangle triA; CellTriangle triB; @@ -198,7 +198,7 @@ void SpatialHashCollision::computeCollisionTri2Tri() proj1, proj2)) { - auto collisionPair = std::make_shared<smCollidedTriangles>(); + auto collisionPair = std::make_shared<CollidedTriangles>(); collisionPair->tri1 = triA; collisionPair->tri2 = triB; collidedTriangles.push_back(collisionPair); @@ -211,9 +211,9 @@ void SpatialHashCollision::computeCollisionTri2Tri() ///line to triangle collision void SpatialHashCollision::computeCollisionLine2Tri() { - smHashIterator<smCellLine > iteratorLine; - smHashIterator<CellTriangle > iteratorTri; - smCellLine line; + HashIterator<CellLine > iteratorLine; + HashIterator<CellTriangle > iteratorTri; + CellLine line; CellTriangle tri; core::Vec3d intersection; @@ -239,7 +239,7 @@ void SpatialHashCollision::computeCollisionLine2Tri() tri.vert[2], intersection)) { - auto collisionPair = std::make_shared<smCollidedLineTris>(); + auto collisionPair = std::make_shared<CollidedLineTris>(); collisionPair->line = line; collisionPair->tri = tri; collisionPair->intersection = intersection; @@ -252,10 +252,10 @@ void SpatialHashCollision::computeCollisionLine2Tri() void SpatialHashCollision::computeCollisionModel2Points() { - smHashIterator<smCellModel > iteratorModel; - smHashIterator<smCellPoint > iteratorPoint; - smCellModel model; - smCellPoint point; + HashIterator<CellModel > iteratorModel; + HashIterator<CellPoint > iteratorPoint; + CellModel model; + CellPoint point; while (cellsForModel.next(iteratorModel) && cellsForModelPoints.next(iteratorPoint)) { @@ -271,7 +271,7 @@ void SpatialHashCollision::computeCollisionModel2Points() if (distanceFromCenter < model.radius) { - auto collisionPair = std::make_shared<smCollidedModelPoints>(); + auto collisionPair = std::make_shared<CollidedModelPoints>(); collisionPair->penetration = model.radius - distanceFromCenter; collisionPair->model = model; collisionPair->point = point; @@ -303,7 +303,7 @@ void SpatialHashCollision::computeHash(std::shared_ptr<Mesh> mesh, const std::ve } } -void SpatialHashCollision::addTriangle(std::shared_ptr<Mesh> mesh, int triangleId, smHash<CellTriangle> &cells) +void SpatialHashCollision::addTriangle(std::shared_ptr<Mesh> mesh, int triangleId, Hash<CellTriangle> &cells) { CellTriangle triangle; triangle.meshID = mesh->getUniqueId(); @@ -330,9 +330,9 @@ void SpatialHashCollision::addTriangle(std::shared_ptr<Mesh> mesh, int triangleI } void SpatialHashCollision::addLine(std::shared_ptr<LineMesh> mesh, - int edgeId, smHash<smCellLine> &cells) + int edgeId, Hash<CellLine> &cells) { - smCellLine line; + CellLine line; line.meshID = mesh->getUniqueId(); line.primID = edgeId; line.vert[0] = mesh->vertices[mesh->edges[edgeId].vert[0]]; @@ -354,9 +354,9 @@ void SpatialHashCollision::addLine(std::shared_ptr<LineMesh> mesh, } } -void SpatialHashCollision::addPoint(std::shared_ptr<Mesh> mesh, int vertId, smHash<smCellPoint> &cells) +void SpatialHashCollision::addPoint(std::shared_ptr<Mesh> mesh, int vertId, Hash<CellPoint> &cells) { - smCellPoint cellPoint; + CellPoint cellPoint; cellPoint.meshID = mesh->getUniqueId(); cellPoint.primID = vertId; cellPoint.vert = mesh->vertices[vertId]; @@ -368,9 +368,9 @@ void SpatialHashCollision::addPoint(std::shared_ptr<Mesh> mesh, int vertId, smHa cells.checkAndInsert(cellPoint, hasher->getKey(cells.tableSize, xStartIndex, yStartIndex, zStartIndex)); } -void SpatialHashCollision::addOctreeCell(std::shared_ptr<SpatialHashCollision::SurfaceTreeType> colModel, smHash<smCellModel> &cells) +void SpatialHashCollision::addOctreeCell(std::shared_ptr<SpatialHashCollision::SurfaceTreeType> colModel, Hash<CellModel> &cells) { - smCellModel cellModel; + CellModel cellModel; AABB temp; SurfaceTreeIterator<OctreeCell> iter = colModel->getLevelIterator(); @@ -466,11 +466,11 @@ void SpatialHashCollision::updateBVH() meshes[i]->upadateAABB(); } } -const std::vector< std::shared_ptr< smCollidedTriangles > >& SpatialHashCollision::getCollidedTriangles() const +const std::vector< std::shared_ptr< CollidedTriangles > >& SpatialHashCollision::getCollidedTriangles() const { return collidedTriangles; } -std::vector< std::shared_ptr< smCollidedTriangles > >& SpatialHashCollision::getCollidedTriangles() +std::vector< std::shared_ptr< CollidedTriangles > >& SpatialHashCollision::getCollidedTriangles() { return collidedTriangles; } diff --git a/src/Collision/SpatialHashCollision.h b/Collision/SpatialHashCollision.h similarity index 73% rename from src/Collision/SpatialHashCollision.h rename to Collision/SpatialHashCollision.h index 8ece0c5dd43699121a2847f3c85f78593a0f00a2..7e80067556935877fbb58fcebd4ff2142f0f3177 100644 --- a/src/Collision/SpatialHashCollision.h +++ b/Collision/SpatialHashCollision.h @@ -32,13 +32,13 @@ #include "Core/DataStructures.h" #include "Core/MakeUnique.h" -class smCellLine; -class smCellModel; -class smCellPoint; +class CellLine; +class CellModel; +class CellPoint; class CellTriangle; -class smCollidedLineTris; -class smCollidedModelPoints; -class smCollidedTriangles; +class CollidedLineTris; +class CollidedModelPoints; +class CollidedTriangles; class LineMesh; class Mesh; class OctreeCell; @@ -46,14 +46,6 @@ class OctreeCell; template<typename CellType> class SurfaceTree; -/// \brief -enum smCollisionSetting -{ - SIMMEDTK_COLISIONSETTING_MODEL2POINT, - SIMMEDTK_COLISIONSETTING_MODEL2TRIANGLE, - SIMMEDTK_COLISIONSETTING_MODEL2MODEL -}; - /// \brief spatial hash class SpatialHashCollision: public CollisionDetection { @@ -107,22 +99,22 @@ public: /// \brief !! compute the hash void computeHash(std::shared_ptr<Mesh> mesh, const std::vector<int> &tris); - const std::vector<std::shared_ptr<smCollidedTriangles>> &getCollidedTriangles() const; + const std::vector<std::shared_ptr<CollidedTriangles>> &getCollidedTriangles() const; - std::vector<std::shared_ptr<smCollidedTriangles>> &getCollidedTriangles(); + std::vector<std::shared_ptr<CollidedTriangles>> &getCollidedTriangles(); protected: /// \brief adds triangle to hash - void addTriangle(std::shared_ptr<Mesh> mesh, int triangleId, smHash<CellTriangle> &cells); + void addTriangle(std::shared_ptr<Mesh> mesh, int triangleId, Hash<CellTriangle> &cells); /// \brief adds line to hash - void addLine(std::shared_ptr<LineMesh> mesh, int edgeId, smHash<smCellLine> &cells); + void addLine(std::shared_ptr<LineMesh> mesh, int edgeId, Hash<CellLine> &cells); /// \brief adds point to hash - void addPoint(std::shared_ptr<Mesh> mesh, int vertId, smHash<smCellPoint> &cells); + void addPoint(std::shared_ptr<Mesh> mesh, int vertId, Hash<CellPoint> &cells); /// \brief adds octree cell to hash - void addOctreeCell(std::shared_ptr<SurfaceTreeType> colModel, smHash<smCellModel> &cells); + void addOctreeCell(std::shared_ptr<SurfaceTreeType> colModel, Hash<CellModel> &cells); /// \brief !! void reset(); @@ -145,16 +137,16 @@ private: float cellSizeY; ///< cell spacing in y-direction float cellSizeZ; ///< cell spacing in z-direction - smHash<CellTriangle> cells; // Candidate triangles - smHash<smCellLine> cellLines; // Lines that stored in the scene. - smHash<CellTriangle> cellsForTri2Line; // Candidate triangles in the scene. - smHash<smCellModel> cellsForModel; // Candidate cells for collision model - smHash<smCellPoint> cellsForModelPoints; // Candidate for Collision model to point + Hash<CellTriangle> cells; // Candidate triangles + Hash<CellLine> cellLines; // Lines that stored in the scene. + Hash<CellTriangle> cellsForTri2Line; // Candidate triangles in the scene. + Hash<CellModel> cellsForModel; // Candidate cells for collision model + Hash<CellPoint> cellsForModelPoints; // Candidate for Collision model to point std::vector<std::shared_ptr<Mesh>> meshes; // Mesh models std::vector<std::shared_ptr<LineMesh>> lineMeshes; // Line mehs models - std::vector<std::shared_ptr<smCollidedTriangles>> collidedTriangles; // List of collision pairs triangles - std::vector<std::shared_ptr<smCollidedLineTris>> collidedLineTris; // List of collision pairs triangles-lines - std::vector<std::shared_ptr<smCollidedModelPoints>> collidedModelPoints; // List of collision pairs models-points + std::vector<std::shared_ptr<CollidedTriangles>> collidedTriangles; // List of collision pairs triangles + std::vector<std::shared_ptr<CollidedLineTris>> collidedLineTris; // List of collision pairs triangles-lines + std::vector<std::shared_ptr<CollidedModelPoints>> collidedModelPoints; // List of collision pairs models-points std::vector<std::shared_ptr<SurfaceTreeType>> colModel; struct HashFunction; std::unique_ptr<HashFunction> hasher; diff --git a/src/Collision/SurfaceTree.h b/Collision/SurfaceTree.h similarity index 100% rename from src/Collision/SurfaceTree.h rename to Collision/SurfaceTree.h diff --git a/src/Collision/SurfaceTree.hpp b/Collision/SurfaceTree.hpp similarity index 100% rename from src/Collision/SurfaceTree.hpp rename to Collision/SurfaceTree.hpp diff --git a/src/Collision/SurfaceTreeCell.h b/Collision/SurfaceTreeCell.h similarity index 100% rename from src/Collision/SurfaceTreeCell.h rename to Collision/SurfaceTreeCell.h diff --git a/src/Collision/SurfaceTreeIterator.h b/Collision/SurfaceTreeIterator.h similarity index 100% rename from src/Collision/SurfaceTreeIterator.h rename to Collision/SurfaceTreeIterator.h diff --git a/src/Collision/UnitTests/CMakeLists.txt b/Collision/UnitTests/CMakeLists.txt similarity index 100% rename from src/Collision/UnitTests/CMakeLists.txt rename to Collision/UnitTests/CMakeLists.txt diff --git a/src/Collision/UnitTests/CollisionPairSpec.cpp b/Collision/UnitTests/CollisionPairSpec.cpp similarity index 100% rename from src/Collision/UnitTests/CollisionPairSpec.cpp rename to Collision/UnitTests/CollisionPairSpec.cpp diff --git a/src/Collision/UnitTests/MeshCollisionModelSpec.cpp b/Collision/UnitTests/MeshCollisionModelSpec.cpp similarity index 100% rename from src/Collision/UnitTests/MeshCollisionModelSpec.cpp rename to Collision/UnitTests/MeshCollisionModelSpec.cpp diff --git a/src/Collision/UnitTests/MeshToMeshCollisionSpec.cpp b/Collision/UnitTests/MeshToMeshCollisionSpec.cpp similarity index 100% rename from src/Collision/UnitTests/MeshToMeshCollisionSpec.cpp rename to Collision/UnitTests/MeshToMeshCollisionSpec.cpp diff --git a/src/Collision/UnitTests/OctreeCellSpec.cpp b/Collision/UnitTests/OctreeCellSpec.cpp similarity index 100% rename from src/Collision/UnitTests/OctreeCellSpec.cpp rename to Collision/UnitTests/OctreeCellSpec.cpp diff --git a/src/Collision/UnitTests/SpatialHashSpec.cpp b/Collision/UnitTests/SpatialHashSpec.cpp similarity index 100% rename from src/Collision/UnitTests/SpatialHashSpec.cpp rename to Collision/UnitTests/SpatialHashSpec.cpp diff --git a/src/ContactHandling/CMakeLists.txt b/ContactHandling/CMakeLists.txt similarity index 100% rename from src/ContactHandling/CMakeLists.txt rename to ContactHandling/CMakeLists.txt diff --git a/src/ContactHandling/PenaltyContactFemToStatic.cpp b/ContactHandling/PenaltyContactFemToStatic.cpp similarity index 93% rename from src/ContactHandling/PenaltyContactFemToStatic.cpp rename to ContactHandling/PenaltyContactFemToStatic.cpp index b7d1f1db66a6a665498782f4ec61ee41b9698cc1..a94a596851c522ac8a96e690bc1ecbfe95ec8c05 100644 --- a/src/ContactHandling/PenaltyContactFemToStatic.cpp +++ b/ContactHandling/PenaltyContactFemToStatic.cpp @@ -21,8 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "PenaltyContactFemToStatic.h" - +#include "ContactHandling/PenaltyContactFemToStatic.h" #include "Core/CollisionPair.h" PenaltyContactFemToStatic::PenaltyContactFemToStatic(bool typeBilateral) : PenaltyContactHandling(typeBilateral) @@ -54,7 +53,7 @@ void PenaltyContactFemToStatic::computeUnilateralContactForces() if (this->getSecondSceneObject()->getType() == core::ClassType::VegaFemSceneObject && this->getFirstSceneObject()->getType() == core::ClassType::StaticSceneObject) { - auto femSceneObject = std::static_pointer_cast<smVegaFemSceneObject>(this->getSecondSceneObject()); + auto femSceneObject = std::static_pointer_cast<VegaFemSceneObject>(this->getSecondSceneObject()); femSceneObject->setContactForcesToZero(); core::Vec3d force; @@ -72,7 +71,7 @@ void PenaltyContactFemToStatic::computeUnilateralContactForces() } else { - std::cout << "Error: Scene objects don't match the required types in 'smPenaltyContactFemToStatic' \n"; + std::cout << "Error: Scene objects don't match the required types in 'PenaltyContactFemToStatic' \n"; } } diff --git a/src/ContactHandling/PenaltyContactFemToStatic.h b/ContactHandling/PenaltyContactFemToStatic.h similarity index 99% rename from src/ContactHandling/PenaltyContactFemToStatic.h rename to ContactHandling/PenaltyContactFemToStatic.h index cdfa2a6dee1466bdac5ba8995156b1516e7686d7..55d55c101b80ea5b4e5814f6b6ba965ea86c245c 100644 --- a/src/ContactHandling/PenaltyContactFemToStatic.h +++ b/ContactHandling/PenaltyContactFemToStatic.h @@ -20,8 +20,6 @@ // // Contact: //--------------------------------------------------------------------------- - - #ifndef SMPENALTY_FEM_TO_STATIC_SCENE_OBJECT #define SMPENALTY_FEM_TO_STATIC_SCENE_OBJECT diff --git a/src/ContactHandling/PenaltyContactHandling.cpp b/ContactHandling/PenaltyContactHandling.cpp similarity index 97% rename from src/ContactHandling/PenaltyContactHandling.cpp rename to ContactHandling/PenaltyContactHandling.cpp index 07b2b22d14f7cbef011090929e981a253e3c4607..d6e0e291d3dd052a74f4e5c5066300f5e6e91714 100644 --- a/src/ContactHandling/PenaltyContactHandling.cpp +++ b/ContactHandling/PenaltyContactHandling.cpp @@ -21,8 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "PenaltyContactHandling.h" - +#include "ContactHandling/PenaltyContactHandling.h" #include "Simulators/VegaFemSceneObject.h" #include "Core/CollisionPair.h" diff --git a/src/ContactHandling/PenaltyContactHandling.h b/ContactHandling/PenaltyContactHandling.h similarity index 99% rename from src/ContactHandling/PenaltyContactHandling.h rename to ContactHandling/PenaltyContactHandling.h index 038ee0c682cbb9b7fc411e63cc1aef999e900fca..1ac597166d1dbb51a4a3c52288794525e5cb2407 100644 --- a/src/ContactHandling/PenaltyContactHandling.h +++ b/ContactHandling/PenaltyContactHandling.h @@ -20,8 +20,6 @@ // // Contact: //--------------------------------------------------------------------------- - - #ifndef SMPENALTY_CONTACTHANDLING_H #define SMPENALTY_CONTACTHANDLING_H diff --git a/src/ContactHandling/UnitTests/CMakeLists.txt b/ContactHandling/UnitTests/CMakeLists.txt similarity index 100% rename from src/ContactHandling/UnitTests/CMakeLists.txt rename to ContactHandling/UnitTests/CMakeLists.txt diff --git a/src/ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp b/ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp similarity index 96% rename from src/ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp rename to ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp index cd2a5aa892d002ccb30e0111f52fb03ab3ae1501..bbc73253799ac66a60346579e0db05601303bdf1 100644 --- a/src/ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp +++ b/ContactHandling/UnitTests/PenaltyContactHandlingSpec.cpp @@ -79,7 +79,7 @@ go_bandit([]() { it("attaches a scene object ", []() { auto handler = std::make_shared<PenaltyContactFemToStatic>(false); - auto fem = std::make_shared<smVegaFemSceneObject>(); + auto fem = std::make_shared<VegaFemSceneObject>(); auto plane = createStaticPlaneSceneObject(); handler->setSceneObjects(plane,fem); AssertThat(handler->getFirstSceneObject() == plane, IsTrue()); @@ -90,7 +90,7 @@ go_bandit([]() { it("computes contact force ", []() { auto handler = std::make_shared<PenaltyContactFemToStatic>(false); - auto fem = std::make_shared<smVegaFemSceneObject>(); + auto fem = std::make_shared<VegaFemSceneObject>(); auto collisionPair = createSampleCollisionPair(); auto plane = createStaticPlaneSceneObject(); diff --git a/src/Core/CMakeLists.txt b/Core/CMakeLists.txt similarity index 100% rename from src/Core/CMakeLists.txt rename to Core/CMakeLists.txt diff --git a/src/Core/CollisionConfig.cpp b/Core/CollisionConfig.cpp similarity index 74% rename from src/Core/CollisionConfig.cpp rename to Core/CollisionConfig.cpp index 3ea01b95c4d1729d09767f04acc0901e50806676..abcbdece78d58871d7fb712b1af2366738a0fe1f 100644 --- a/src/Core/CollisionConfig.cpp +++ b/Core/CollisionConfig.cpp @@ -39,66 +39,66 @@ std::ostream &operator<<( std::ostream &out, CellTriangle &tri ) return out; } -bool smCellLine::operator==( unsigned int p_ID ) +bool CellLine::operator==( unsigned int p_ID ) { return ( primID == p_ID ? true : false ); } -bool smCellLine::operator==( smCellLine &p_line ) +bool CellLine::operator==( CellLine &p_line ) { return ( p_line.primID == primID ? true : false ); } -std::ostream &operator<<( std::ostream &out, smCellLine &p ) +std::ostream &operator<<( std::ostream &out, CellLine &p ) { out << p.primID; return out; } -bool smCellModel::operator==( unsigned int p_ID ) +bool CellModel::operator==( unsigned int p_ID ) { return ( primID == p_ID ? true : false ); } -bool smCellModel::operator==( smCellModel &p_model ) +bool CellModel::operator==( CellModel &p_model ) { return ( p_model.primID == primID ? true : false ); } -std::ostream &operator<<( std::ostream &out, smCellModel &p ) +std::ostream &operator<<( std::ostream &out, CellModel &p ) { out << p.primID; return out; } -bool smCellPoint::operator==( unsigned int p_ID ) +bool CellPoint::operator==( unsigned int p_ID ) { return ( primID == p_ID ? true : false ); } -bool smCellPoint::operator==( smCellPoint &p_point ) +bool CellPoint::operator==( CellPoint &p_point ) { return ( p_point.primID == primID ? true : false ); } -std::ostream &operator<<( std::ostream &out, smCellPoint &p ) +std::ostream &operator<<( std::ostream &out, CellPoint &p ) { out << p.primID; return out; } -smCollisionGroup::smCollisionGroup() +CollisionGroup::CollisionGroup() { groupId = 1; groupMask = 1; } -void smCollisionGroup::setGroup( unsigned int p_groupId ) +void CollisionGroup::setGroup( unsigned int p_groupId ) { groupId = 1 << p_groupId; groupMask = groupId; } -void smCollisionGroup::permitCollision( smCollisionGroup &p_group ) +void CollisionGroup::permitCollision( CollisionGroup &p_group ) { groupMask = groupMask | ( p_group.groupId ); p_group.groupMask = p_group.groupMask | ( groupId ); @@ -106,13 +106,13 @@ void smCollisionGroup::permitCollision( smCollisionGroup &p_group ) std::cout << "GroupId:" << groupId << "\n"; } -void smCollisionGroup::forbidCollision( smCollisionGroup &p_group ) +void CollisionGroup::forbidCollision( CollisionGroup &p_group ) { groupMask = groupMask & ( ~p_group.groupId ); p_group.groupMask = p_group.groupMask & ( ~groupId ); } -bool smCollisionGroup::isCollisionPermitted( smCollisionGroup &p_group ) +bool CollisionGroup::isCollisionPermitted( CollisionGroup &p_group ) { return ( ( groupId & p_group.groupId ) == 0 ? ( ( groupId & p_group.groupMask ) == 0 ? false : true ) : true ); } diff --git a/src/Core/CollisionConfig.h b/Core/CollisionConfig.h similarity index 67% rename from src/Core/CollisionConfig.h rename to Core/CollisionConfig.h index d3e74bfc8b64e07216b8aca13f62fe838f242458..ef0af5f83538ffb02ff045bb4d13761ada4c5651 100644 --- a/src/Core/CollisionConfig.h +++ b/Core/CollisionConfig.h @@ -25,9 +25,9 @@ #define SMCOLLISIONCONFIG_H // SimMedTK includes -#include "Config.h" -#include "Vector.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/Vector.h" +#include "Core/CoreClass.h" struct GeometryRepresentation {}; @@ -50,58 +50,58 @@ struct CellTriangle : public GeometryRepresentation /// \brief Contains information related to the a line segments that are present in a cell /// at any given point -struct smCellLine : public GeometryRepresentation +struct CellLine : public GeometryRepresentation { - smCellLine() : primID(0) {} - smCellLine(const unsigned int &id) : primID(id) {} + CellLine() : primID(0) {} + CellLine(const unsigned int &id) : primID(id) {} unsigned int primID; ///< Edge id - std::shared_ptr<UnifiedId> meshID; ///< smMeshLine id + std::shared_ptr<UnifiedId> meshID; ///< MeshLine id core::Vec3d vert[2]; ///< Vertices bool operator ==(unsigned int p_ID); - bool operator ==(smCellLine &p_line); + bool operator ==(CellLine &p_line); - friend std::ostream &operator<<(std::ostream &out, smCellLine &p); + friend std::ostream &operator<<(std::ostream &out, CellLine &p); }; /// \brief !! -struct smCellModel : public GeometryRepresentation +struct CellModel : public GeometryRepresentation { - smCellModel() : primID(0) {} - smCellModel(const unsigned int &id) : primID(id) {} + CellModel() : primID(0) {} + CellModel(const unsigned int &id) : primID(id) {} unsigned int primID; ///< Model Prim id - std::shared_ptr<UnifiedId> meshID; ///< smMeshLine id + std::shared_ptr<UnifiedId> meshID; ///< MeshLine id core::Vec3d center; ///< Vertices double radius; bool operator ==(unsigned int p_ID); - bool operator ==(smCellModel &p_model); + bool operator ==(CellModel &p_model); - friend std::ostream &operator<<(std::ostream &out, smCellModel &p); + friend std::ostream &operator<<(std::ostream &out, CellModel &p); }; /// \brief Contains information related to the a verticess that are present in a cell /// at any given point -struct smCellPoint : public GeometryRepresentation +struct CellPoint : public GeometryRepresentation { - smCellPoint() : primID(0) {} - smCellPoint(const unsigned int &id) : primID(id) {} + CellPoint() : primID(0) {} + CellPoint(const unsigned int &id) : primID(id) {} unsigned int primID; ///< Model Prim id - std::shared_ptr<UnifiedId> meshID; ///< smMeshLine id + std::shared_ptr<UnifiedId> meshID; ///< MeshLine id core::Vec3d vert; ///< Vertices bool operator ==(unsigned int p_ID); - bool operator ==(smCellPoint &p_point); + bool operator ==(CellPoint &p_point); - friend std::ostream &operator<<(std::ostream &out, smCellPoint &p); + friend std::ostream &operator<<(std::ostream &out, CellPoint &p); }; /// \brief Contains triangle pair that have collided -struct smCollidedTriangles +struct CollidedTriangles { CellTriangle tri1; CellTriangle tri2; @@ -110,23 +110,23 @@ struct smCollidedTriangles }; /// \brief Contains line pair that have collided -struct smCollidedLineTris +struct CollidedLineTris { CellTriangle tri; - smCellLine line; + CellLine line; core::Vec3d intersection; }; /// \brief Contains model-point pair that have collided -struct smCollidedModelPoints +struct CollidedModelPoints { - smCellModel model; - smCellPoint point; + CellModel model; + CellPoint point; double penetration; }; /// \brief !! -class smCollisionGroup +class CollisionGroup { public: @@ -134,20 +134,20 @@ public: size_t groupMask; /// \brief !! - smCollisionGroup(); + CollisionGroup(); /// \brief !! void setGroup(unsigned int p_groupId); /// \brief !! - void permitCollision(smCollisionGroup &p_group); + void permitCollision(CollisionGroup &p_group); /// \brief !! - void forbidCollision(smCollisionGroup &p_group); + void forbidCollision(CollisionGroup &p_group); /// \brief if the group is different then the function checks the group mask.. // if they're in the same group collision enabled - bool isCollisionPermitted(smCollisionGroup& p_group); + bool isCollisionPermitted(CollisionGroup& p_group); }; diff --git a/src/Core/CollisionDetection.cpp b/Core/CollisionDetection.cpp similarity index 96% rename from src/Core/CollisionDetection.cpp rename to Core/CollisionDetection.cpp index cd55e24be8f1d92fe548f56fd4056d61feaf56bc..b9b81019eb202a2e0e413093c903998aabf620e6 100644 --- a/src/Core/CollisionDetection.cpp +++ b/Core/CollisionDetection.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "CollisionDetection.h" +#include "Core/CollisionDetection.h" void CollisionDetection::computeCollision(std::shared_ptr< CollisionPair > pairs) { diff --git a/src/Core/CollisionDetection.h b/Core/CollisionDetection.h similarity index 98% rename from src/Core/CollisionDetection.h rename to Core/CollisionDetection.h index ba3251a675362d9d7c789f27e7e8ddede5b2e69d..d8cf588c59d84bb7c5f491dfa33cac63dc0c00e3 100644 --- a/src/Core/CollisionDetection.h +++ b/Core/CollisionDetection.h @@ -28,7 +28,7 @@ #include <memory> // SimMedTK includes -#include "CoreClass.h" +#include "Core/CoreClass.h" class Mesh; class CollisionPair; diff --git a/src/Core/CollisionModelIterator.h b/Core/CollisionModelIterator.h similarity index 100% rename from src/Core/CollisionModelIterator.h rename to Core/CollisionModelIterator.h diff --git a/src/Core/CollisionPair.cpp b/Core/CollisionPair.cpp similarity index 95% rename from src/Core/CollisionPair.cpp rename to Core/CollisionPair.cpp index a03203368508fb3f13a1f3eaf17a394daf8fcea0..1d34b6644209cd5be56ccbb673bd5e1a9f29497d 100644 --- a/src/Core/CollisionPair.cpp +++ b/Core/CollisionPair.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "CollisionPair.h" +#include "Core/CollisionPair.h" CollisionPair::CollisionPair() {} CollisionPair::~CollisionPair() {} @@ -36,7 +36,7 @@ void CollisionPair::setModels(const std::shared_ptr< ModelRepresentation >& firs void CollisionPair::addContact(const double& penetrationDepth, const core::Vec3d& vert, const int index, const core::Vec3d& contactNornmal) { auto contact = std::make_shared<Contact>(penetrationDepth, vert, index, contactNornmal); - //std::shared_ptr<smContact> contact(new smContact(penetrationDepth, vert, index, contactNornmal)); + //std::shared_ptr<Contact> contact(new Contact(penetrationDepth, vert, index, contactNornmal)); this->contacts.emplace_back(contact); } diff --git a/src/Core/CollisionPair.h b/Core/CollisionPair.h similarity index 94% rename from src/Core/CollisionPair.h rename to Core/CollisionPair.h index 53921fa2979af8a66d298b4d800418224ec22878..b1d30c546020ac263fbab0dd9ba633f470a65022 100644 --- a/src/Core/CollisionPair.h +++ b/Core/CollisionPair.h @@ -26,7 +26,7 @@ #define SMCOLLISIONPAIR_H // SimMedTK includes -#include "Vector.h" +#include "Core/Vector.h" // STL includes #include <memory> @@ -41,11 +41,10 @@ class ModelRepresentation; class Contact { public: - Contact ( const double penetrationDepth, - const core::Vec3d& p, - const int ind, - const core::Vec3d& contactNornmal - ) : + Contact (const double penetrationDepth, + const core::Vec3d& p, + const int ind, + const core::Vec3d& contactNornmal) : depth(penetrationDepth), point(p), normal(contactNornmal), index(ind){} void printInfo() diff --git a/src/Core/Color.cpp b/Core/Color.cpp similarity index 99% rename from src/Core/Color.cpp rename to Core/Color.cpp index 442b60b43b3a0327cc8c3f0ed4215ee7b4ff07ed..20eb44fb1c8ddcc3ad9ab06b03af21fec9824177 100644 --- a/src/Core/Color.cpp +++ b/Core/Color.cpp @@ -14,7 +14,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "Color.h" +#include "Core/Color.h" Color Color::colorWhite(1.0, 1.0, 1.0, 1.0); Color Color::colorBlue(0.0, 0.0, 1.0, 1.0); diff --git a/src/Core/Color.h b/Core/Color.h similarity index 98% rename from src/Core/Color.h rename to Core/Color.h index dedb80ef29d4668af131b48b0990892a500ab2e2..4b30357920ce57f3c92bb29af78fd891d88a76e3 100644 --- a/src/Core/Color.h +++ b/Core/Color.h @@ -16,7 +16,7 @@ #ifndef SMCOLOR_H #define SMCOLOR_H -#include "Config.h" +#include "Core/Config.h" struct Color { diff --git a/src/Core/Config.h b/Core/Config.h similarity index 100% rename from src/Core/Config.h rename to Core/Config.h diff --git a/src/Core/ContactHandling.cpp b/Core/ContactHandling.cpp similarity index 98% rename from src/Core/ContactHandling.cpp rename to Core/ContactHandling.cpp index f34bd68f68b344e7a191143042a2d73a6923c984..83f259e13df58c5b0884ce5a605b7700cff41765 100644 --- a/src/Core/ContactHandling.cpp +++ b/Core/ContactHandling.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "ContactHandling.h" +#include "Core/ContactHandling.h" ContactHandling::ContactHandling(const bool typeBilateral) { diff --git a/src/Core/ContactHandling.h b/Core/ContactHandling.h similarity index 98% rename from src/Core/ContactHandling.h rename to Core/ContactHandling.h index 06fe333426f7fe9d09eca9be1bbd3e0b39ee6748..848f9cb4aa52770008f36e8c2d69712b4fd2247b 100644 --- a/src/Core/ContactHandling.h +++ b/Core/ContactHandling.h @@ -25,8 +25,8 @@ #define SMCONTACTHANDLING_H // SimMedTK includes -#include "CoreClass.h" -#include "SceneObject.h" +#include "Core/CoreClass.h" +#include "Core/SceneObject.h" // STL includes #include <memory> diff --git a/src/Core/CoreClass.cpp b/Core/CoreClass.cpp similarity index 93% rename from src/Core/CoreClass.cpp rename to Core/CoreClass.cpp index 76b2b09a431be3517269c041616c45b50b17beee..0bba46eb5a00894a38d5868fa6e73305bb58eccc 100644 --- a/src/Core/CoreClass.cpp +++ b/Core/CoreClass.cpp @@ -23,8 +23,8 @@ #include "CoreClass.h" -#include "EventHandler.h" -#include "RenderDelegate.h" +#include "Core/EventHandler.h" +#include "Core/RenderDelegate.h" std::shared_ptr<core::EventHandler> CoreClass::eventHandler = std::make_shared<core::EventHandler>(); @@ -55,12 +55,12 @@ void CoreClass::setType(const core::ClassType& newType) this->type = newType; } -void CoreClass::initSimulate( const smSimulationParam &/*p_params*/ ) +void CoreClass::initSimulate( const SimulationParam &/*p_params*/ ) { std::cout << "Default initSimulate" << std::endl; } -void CoreClass::simulate( const smSimulationParam &/*p_params*/ ) +void CoreClass::simulate( const SimulationParam &/*p_params*/ ) { std::cout << "Default simulate" << std::endl; } diff --git a/src/Core/CoreClass.h b/Core/CoreClass.h similarity index 96% rename from src/Core/CoreClass.h rename to Core/CoreClass.h index c5cf3365d6fe0af3ddae874fdd23231f9c65b5c5..52c0884bb5babf74b8e055bc5216fa090f8f84ab 100644 --- a/src/Core/CoreClass.h +++ b/Core/CoreClass.h @@ -31,9 +31,9 @@ #include <map> // SimMedTK includes -#include "Config.h" -#include "UnifiedId.h" -#include "EventHandler.h" +#include "Core/Config.h" +#include "Core/UnifiedId.h" +#include "Core/EventHandler.h" #include "Rendering/ConfigRendering.h" class SDK; @@ -43,7 +43,7 @@ class ObjectSimulator; class Viewer; /// \brief simulator calls object and sends this structure -struct smSimulationParam +struct SimulationParam { std::shared_ptr<ObjectSimulator> objectSimulator; void *caller; @@ -111,12 +111,12 @@ public: /// /// \brief initialization of simulation /// - virtual void initSimulate(const smSimulationParam &p_params); + virtual void initSimulate(const SimulationParam &p_params); /// /// \brief simulates the object /// - virtual void simulate(const smSimulationParam &p_params); + virtual void simulate(const SimulationParam &p_params); /// /// \brief print the object diff --git a/src/Core/DataStructures.h b/Core/DataStructures.h similarity index 83% rename from src/Core/DataStructures.h rename to Core/DataStructures.h index 198c88d17ff53153f657e6ee23c09ef173492ec6..fb3e2cac2ee709e097400b7148a94c427bb95cdd 100644 --- a/src/Core/DataStructures.h +++ b/Core/DataStructures.h @@ -25,7 +25,7 @@ #define SMDATASTRUTCTURES_H // SimMedTK includes -#include "Config.h" +#include "Core/Config.h" template<typename T> class IndiceArrayIter; @@ -105,36 +105,36 @@ public: #define SIMMEDTK_HASHBUCKET_SIZE 10 /// \brief a hash entry; bucket template <class T> -struct smEntryList +struct EntryList { public: - smEntryList(); + EntryList(); T ID[SIMMEDTK_HASHBUCKET_SIZE]; unsigned int totalEntries; - smEntryList* p_entry; + EntryList* p_entry; }; /// \brief hash iterator template <class T> -struct smHashIterator +struct HashIterator { /// \brief default initializaiton - smHashIterator(); + HashIterator(); /// \brief to clone the has iterator - inline void clone(smHashIterator<T> &p_iterator); + inline void clone(HashIterator<T> &p_iterator); template<typename K> - inline void clone(smHashIterator<K> &p_iterator); + inline void clone(HashIterator<K> &p_iterator); /// \brief reseting the index for bucket iteration inline void resetBucketIteration(); - smEntryList<T> *iterator; - smEntryList<T> *bucketStart; + EntryList<T> *iterator; + EntryList<T> *bucketStart; int tableIndex; int currentIndex; template <class K> - friend std::ostream &operator<<(std::ostream &out, smHashIterator<K> &p); + friend std::ostream &operator<<(std::ostream &out, HashIterator<K> &p); }; /// \brief hash return codes enum SIMMEDTK_HASHRETURN_CODES @@ -149,16 +149,16 @@ enum SIMMEDTK_HASHRETURN_CODES }; /// \brief hash implementation. Table-> template <class T> -class smHash +class Hash { /// \brief primitive ids that is stored with entry list - smEntryList<T> *primitiveIDs; + EntryList<T> *primitiveIDs; /// \brief current table index long int currentTableIndex; /// \brief current entry index in the bucket long int currentEntryIndex; /// \brief current bucket pointer - smEntryList<T> *currentIterationBucket; + EntryList<T> *currentIterationBucket; public: /// \brief number of pritimives long int num_prim; @@ -166,17 +166,17 @@ public: long int tableSize; private: /// \brief entries in the bucket - inline void moveEntriesInBucket(smEntryList<T> &p_Bucket, int p_entryIndex); + inline void moveEntriesInBucket(EntryList<T> &p_Bucket, int p_entryIndex); /// \brief check if the p_prim exists in the bucket - inline bool checkIdentical(smEntryList<T> &p_entry, T p_prim); + inline bool checkIdentical(EntryList<T> &p_entry, T p_prim); /// \brief find the bucket entry and update it - inline bool findandUpdateEntry(smEntryList<T> &p_startEntry, T &p_prim); + inline bool findandUpdateEntry(EntryList<T> &p_startEntry, T &p_prim); /// \brief clear buckets - inline void clearBuckets(smEntryList<T> &p_startEntry); + inline void clearBuckets(EntryList<T> &p_startEntry); public: /// \brief initializes the table; entry - smHash(int p_tableSize); + Hash(int p_tableSize); /// \brief insert the entry; indicate as p_triangle. It can be any type not only a triangle /// hashindex is the has number generated for the entry inline SIMMEDTK_HASHRETURN_CODES insert(T p_triangle, unsigned int hashIndex); @@ -185,9 +185,9 @@ public: /// \brief starts the iteration. reset the indices inline void startIteration(); /// \brief go to next table index - inline bool next(smHashIterator<T> &p_iterator); + inline bool next(HashIterator<T> &p_iterator); /// \brief iterate over the next bucket item - inline bool nextBucketItem(smHashIterator<T> &p_iterator, T &p_prim); + inline bool nextBucketItem(HashIterator<T> &p_iterator, T &p_prim); /// \brief proceed to next entry and return the element. it the bucket ends it will go to next table index inline bool next(T &p_prim); /// \brief next element by getting reference to it @@ -198,29 +198,29 @@ public: void clearAll(); }; /// \brief sliding storage type -enum smStorageSlideType +enum StorageSlideType { SIMMEDTK_STORAGESLIDING_FRONTFIRST, SIMMEDTK_STORAGESLIDING_LASTFIRST }; /// \brief sliding storage window template<typename T> -class smStorageSlidingWindow +class StorageSlidingWindow { private: /// \brief type - smStorageSlideType strorageType; + StorageSlideType strorageType; public: /// \brief data T *data; /// \brief window size unsigned int windowSize; /// \brief constructor - ~smStorageSlidingWindow(); + ~StorageSlidingWindow(); /// \brief siding window storage. constructor gets window size, type - smStorageSlidingWindow(int p_windowSize = 10, smStorageSlideType p_type = SIMMEDTK_STORAGESLIDING_LASTFIRST); + StorageSlidingWindow(int p_windowSize = 10, StorageSlideType p_type = SIMMEDTK_STORAGESLIDING_LASTFIRST); /// \brief storage type - inline smStorageSlideType getStorageType(); + inline StorageSlideType getStorageType(); /// \brief resize storage inline void resize(int p_newSize); /// \brief add value @@ -231,6 +231,6 @@ public: void print() const; }; -#include "DataStructures.hpp" +#include "Core/DataStructures.hpp" #endif diff --git a/src/Core/DataStructures.hpp b/Core/DataStructures.hpp similarity index 87% rename from src/Core/DataStructures.hpp rename to Core/DataStructures.hpp index 80c567fe41a4a671395d83c78869af392fbf2cb3..3bff1ac53ce8b248d2c5b5070a4b53df9e265710 100644 --- a/src/Core/DataStructures.hpp +++ b/Core/DataStructures.hpp @@ -242,20 +242,20 @@ IndiceArrayIter<T>::end() return arrayPtr->nbrElements; } template<typename T> -smEntryList<T>::smEntryList() +EntryList<T>::EntryList() { totalEntries = 0; p_entry = NULL; } template<typename T> -smHashIterator<T>::smHashIterator() +HashIterator<T>::HashIterator() { tableIndex = 0; currentIndex = 0; bucketStart = NULL; } template<typename T> void -smHashIterator<T>::clone( smHashIterator< T > &p_iterator ) +HashIterator<T>::clone( HashIterator< T > &p_iterator ) { tableIndex = p_iterator.tableIndex; currentIndex = p_iterator.currentIndex; @@ -263,19 +263,19 @@ smHashIterator<T>::clone( smHashIterator< T > &p_iterator ) } template<typename T> void -smHashIterator<T>::resetBucketIteration() +HashIterator<T>::resetBucketIteration() { currentIndex = 0; iterator = bucketStart; } template<typename T> -std::ostream &operator<<( std::ostream &out, smHashIterator< T > &p ) +std::ostream &operator<<( std::ostream &out, HashIterator< T > &p ) { out << "Table Index:" << p.tableIndex << " Current Bucket Index:" << p.currentIndex; return out; } template<typename T> -void smHash<T>::moveEntriesInBucket( smEntryList< T > &p_Bucket, int p_entryIndex ) +void Hash<T>::moveEntriesInBucket( EntryList< T > &p_Bucket, int p_entryIndex ) { for ( unsigned int i = p_entryIndex; i < p_Bucket.totalEntries - 1; i++ ) { @@ -285,7 +285,7 @@ void smHash<T>::moveEntriesInBucket( smEntryList< T > &p_Bucket, int p_entryInde p_Bucket.totalEntries--; } template<typename T> -bool smHash<T>::checkIdentical( smEntryList< T > &p_entry, T p_prim ) +bool Hash<T>::checkIdentical( EntryList< T > &p_entry, T p_prim ) { for ( unsigned int i = 0; i < p_entry.totalEntries; i++ ) { @@ -298,9 +298,9 @@ bool smHash<T>::checkIdentical( smEntryList< T > &p_entry, T p_prim ) return false; } template<typename T> -bool smHash<T>::findandUpdateEntry( smEntryList< T > &p_startEntry, T &p_prim ) +bool Hash<T>::findandUpdateEntry( EntryList< T > &p_startEntry, T &p_prim ) { - smEntryList<T> *currentBucket = &p_startEntry; + EntryList<T> *currentBucket = &p_startEntry; while ( true ) { @@ -322,9 +322,9 @@ bool smHash<T>::findandUpdateEntry( smEntryList< T > &p_startEntry, T &p_prim ) } } template<typename T> -void smHash<T>::clearBuckets( smEntryList< T > &p_startEntry ) +void Hash<T>::clearBuckets( EntryList< T > &p_startEntry ) { - smEntryList<T> *currentBucket = &p_startEntry; + EntryList<T> *currentBucket = &p_startEntry; while ( true ) { @@ -338,20 +338,20 @@ void smHash<T>::clearBuckets( smEntryList< T > &p_startEntry ) } } template<typename T> -smHash<T>::smHash( int p_tableSize ) +Hash<T>::Hash( int p_tableSize ) { tableSize = p_tableSize; - primitiveIDs = new smEntryList<T>[tableSize]; + primitiveIDs = new EntryList<T>[tableSize]; currentEntryIndex = 0; currentTableIndex = 0; num_prim = 0; } template<typename T> -SIMMEDTK_HASHRETURN_CODES smHash<T>::insert( T p_triangle, unsigned int hashIndex ) +SIMMEDTK_HASHRETURN_CODES Hash<T>::insert( T p_triangle, unsigned int hashIndex ) { - smEntryList<T> *currentBucket; - smEntryList<T> *prevBucket; - smEntryList<T> *emptySpace = NULL; + EntryList<T> *currentBucket; + EntryList<T> *prevBucket; + EntryList<T> *emptySpace = NULL; prevBucket = &primitiveIDs[hashIndex]; currentBucket = &primitiveIDs[hashIndex]; @@ -374,7 +374,7 @@ SIMMEDTK_HASHRETURN_CODES smHash<T>::insert( T p_triangle, unsigned int hashInde if ( currentBucket == NULL && emptySpace == NULL ) { - prevBucket->p_entry = new smEntryList<T>; + prevBucket->p_entry = new EntryList<T>; prevBucket->p_entry->ID[prevBucket->p_entry->totalEntries] = p_triangle; prevBucket->p_entry->totalEntries++; num_prim++; @@ -390,11 +390,11 @@ SIMMEDTK_HASHRETURN_CODES smHash<T>::insert( T p_triangle, unsigned int hashInde return SIMMEDTK_HASH_ENTRYINSERTED; } template<typename T> -SIMMEDTK_HASHRETURN_CODES smHash<T>::checkAndInsert( T p_triangle, unsigned int hashIndex ) +SIMMEDTK_HASHRETURN_CODES Hash<T>::checkAndInsert( T p_triangle, unsigned int hashIndex ) { - smEntryList<T> *currentBucket; - smEntryList<T> *prevBucket; - smEntryList<T> *emptySpace = NULL; + EntryList<T> *currentBucket; + EntryList<T> *prevBucket; + EntryList<T> *emptySpace = NULL; prevBucket = &primitiveIDs[hashIndex]; currentBucket = &primitiveIDs[hashIndex]; @@ -422,7 +422,7 @@ SIMMEDTK_HASHRETURN_CODES smHash<T>::checkAndInsert( T p_triangle, unsigned int if ( currentBucket == NULL && emptySpace == NULL ) { - prevBucket->p_entry = new smEntryList<T>; + prevBucket->p_entry = new EntryList<T>; prevBucket->p_entry->ID[prevBucket->p_entry->totalEntries] = p_triangle; prevBucket->p_entry->totalEntries++; num_prim++; @@ -438,14 +438,14 @@ SIMMEDTK_HASHRETURN_CODES smHash<T>::checkAndInsert( T p_triangle, unsigned int return SIMMEDTK_HASH_ENTRYINSERTED; } template<typename T> -void smHash<T>::startIteration() +void Hash<T>::startIteration() { currentTableIndex = 0; currentEntryIndex = 0; currentIterationBucket = &primitiveIDs[currentTableIndex]; } template<typename T> -bool smHash<T>::next( smHashIterator< T > &p_iterator ) +bool Hash<T>::next( HashIterator< T > &p_iterator ) { if ( p_iterator.tableIndex >= tableSize ) { @@ -459,7 +459,7 @@ bool smHash<T>::next( smHashIterator< T > &p_iterator ) return true; } template<typename T> -bool smHash<T>::nextBucketItem( smHashIterator< T > &p_iterator, T &p_prim ) +bool Hash<T>::nextBucketItem( HashIterator< T > &p_iterator, T &p_prim ) { while ( true ) { @@ -486,7 +486,7 @@ bool smHash<T>::nextBucketItem( smHashIterator< T > &p_iterator, T &p_prim ) } } template<typename T> -bool smHash<T>::next( T &p_prim ) +bool Hash<T>::next( T &p_prim ) { while ( true ) { @@ -521,7 +521,7 @@ bool smHash<T>::next( T &p_prim ) } } template<typename T> -bool smHash<T>::nextByRef( T **p_prim ) +bool Hash<T>::nextByRef( T **p_prim ) { while ( true ) { @@ -556,7 +556,7 @@ bool smHash<T>::nextByRef( T **p_prim ) } } template<typename T> -void smHash<T>::printContent() +void Hash<T>::printContent() { T prim; startIteration(); @@ -567,7 +567,7 @@ void smHash<T>::printContent() } } template<typename T> -void smHash<T>::clearAll() +void Hash<T>::clearAll() { for ( int i = 0; i < tableSize; i++ ) { @@ -577,12 +577,12 @@ void smHash<T>::clearAll() num_prim = 0; } template<typename T> -smStorageSlidingWindow<T>::~smStorageSlidingWindow() +StorageSlidingWindow<T>::~StorageSlidingWindow() { delete[] data; } template<typename T> -smStorageSlidingWindow<T>::smStorageSlidingWindow( int p_windowSize, smStorageSlideType p_type ) +StorageSlidingWindow<T>::StorageSlidingWindow( int p_windowSize, StorageSlideType p_type ) { data = new T[p_windowSize]; windowSize = p_windowSize; @@ -590,12 +590,12 @@ smStorageSlidingWindow<T>::smStorageSlidingWindow( int p_windowSize, smStorageSl strorageType = p_type; } template<typename T> -smStorageSlideType smStorageSlidingWindow<T>::getStorageType() +StorageSlideType StorageSlidingWindow<T>::getStorageType() { return strorageType; } template<typename T> -void smStorageSlidingWindow<T>::resize( int p_newSize ) +void StorageSlidingWindow<T>::resize( int p_newSize ) { T *tempData; int index; @@ -636,7 +636,7 @@ void smStorageSlidingWindow<T>::resize( int p_newSize ) windowSize = p_newSize; } template<typename T> -void smStorageSlidingWindow<T>::add( T p_value ) +void StorageSlidingWindow<T>::add( T p_value ) { if ( strorageType == SIMMEDTK_STORAGESLIDING_LASTFIRST ) { @@ -654,12 +654,12 @@ void smStorageSlidingWindow<T>::add( T p_value ) } } template<typename T> -void smStorageSlidingWindow<T>::zeroed() +void StorageSlidingWindow<T>::zeroed() { memset( data, 0, sizeof( T )*windowSize ); } template<typename T> -void smStorageSlidingWindow<T>::print() const +void StorageSlidingWindow<T>::print() const { for ( int i = 0; i < windowSize; i++ ) { diff --git a/src/Core/Dispatcher.cpp b/Core/Dispatcher.cpp similarity index 98% rename from src/Core/Dispatcher.cpp rename to Core/Dispatcher.cpp index 93db05bd455b494425304d11e6422662dedb96c6..6e62083e3cb1f00b0a1d19d38b23a2ebd0819d5d 100644 --- a/src/Core/Dispatcher.cpp +++ b/Core/Dispatcher.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Dispatcher.h" +#include "Core/Dispatcher.h" void Dispatcher::handleViewer(std::shared_ptr<CoreClass> /*p_caller*/, core::CallerState /*p_callerState*/) diff --git a/src/Core/Dispatcher.h b/Core/Dispatcher.h similarity index 95% rename from src/Core/Dispatcher.h rename to Core/Dispatcher.h index 840fb2c43807518c72ab87b7183c99d91a6d43e0..b39b945180f91de7e91d9280ba223c3bb56e400a 100644 --- a/src/Core/Dispatcher.h +++ b/Core/Dispatcher.h @@ -25,8 +25,8 @@ #define SMDISPATCHER_H // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" ///The dispacther class is responsible of taking care of the ///tasks that need to proppgated over the whole modules.For instance, adding a new @@ -37,7 +37,7 @@ class Dispatcher: public CoreClass private: ///handle viewer events /// \param p_caller this is the caller class - /// \param p_callerState it indicates the state of the called which is predefined at the smConfig.h + /// \param p_callerState it indicates the state of the called which is predefined at the Config.h void handleViewer(std::shared_ptr<CoreClass> p_caller, core::CallerState p_callerState); ///handle simulator events diff --git a/src/Core/DisplayText.cpp b/Core/DisplayText.cpp similarity index 97% rename from src/Core/DisplayText.cpp rename to Core/DisplayText.cpp index 9914be06da75aacd3e7646dcb764d0e6aa735f2d..0bcf35a542ddde7d02f70db5c7dac9ccae50166e 100644 --- a/src/Core/DisplayText.cpp +++ b/Core/DisplayText.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "DisplayText.h" +#include "Core/DisplayText.h" // STL includes #include <iostream> diff --git a/src/Core/DisplayText.h b/Core/DisplayText.h similarity index 96% rename from src/Core/DisplayText.h rename to Core/DisplayText.h index 4a99794c1455f80985e3bd178eb4b39dba456912..50e891fdef4b675550364ff0868d1d4e622197fa 100644 --- a/src/Core/DisplayText.h +++ b/Core/DisplayText.h @@ -24,8 +24,8 @@ #define SMDISPLAYTEXT_H // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" /// \brief display type enum SMDISPLAY_STREAM diff --git a/src/Core/ErrorLog.cpp b/Core/ErrorLog.cpp similarity index 98% rename from src/Core/ErrorLog.cpp rename to Core/ErrorLog.cpp index dfc1ede97d1fbcb62251c03d6176b6077c621c65..ca0ee5016ca2d35a541ba5c3161210a09f31308c 100644 --- a/src/Core/ErrorLog.cpp +++ b/Core/ErrorLog.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "ErrorLog.h" +#include "Core/ErrorLog.h" #include <cstring> #include <string> diff --git a/src/Core/ErrorLog.h b/Core/ErrorLog.h similarity index 97% rename from src/Core/ErrorLog.h rename to Core/ErrorLog.h index 96a1002c4a33686db2f364f6a4b1878dc62225a2..bb2e7ac6ba723dd7d807b61a1b82424887f441c5 100644 --- a/src/Core/ErrorLog.h +++ b/Core/ErrorLog.h @@ -32,9 +32,9 @@ #include <vector> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" -#include "Timer.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/Timer.h" #define PRINT_ERROR_LOCATION std::cout << "Error! In file: " << __FILE__ << "; at line: " << __LINE__ << std::endl; diff --git a/src/Core/Event.cpp b/Core/Event.cpp similarity index 98% rename from src/Core/Event.cpp rename to Core/Event.cpp index 465b4730a4800c9a2def402ec1e1612023cde8e6..c38af5b87e1390984f42d0f1a701189612056a0c 100644 --- a/src/Core/Event.cpp +++ b/Core/Event.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Event.h" +#include "Core/Event.h" namespace core { diff --git a/src/Core/Event.h b/Core/Event.h similarity index 100% rename from src/Core/Event.h rename to Core/Event.h diff --git a/src/Core/EventHandler.cpp b/Core/EventHandler.cpp similarity index 97% rename from src/Core/EventHandler.cpp rename to Core/EventHandler.cpp index 0775c3490b55e53e23a3f0bcc0ef5742cae533f0..a4a7e5c8ec9300c28743781578b6050e40583968 100644 --- a/src/Core/EventHandler.cpp +++ b/Core/EventHandler.cpp @@ -21,8 +21,8 @@ // Contact: //--------------------------------------------------------------------------- -#include "EventHandler.h" -#include "CoreClass.h" +#include "Core/EventHandler.h" +#include "Core/CoreClass.h" namespace core { diff --git a/src/Core/EventHandler.h b/Core/EventHandler.h similarity index 99% rename from src/Core/EventHandler.h rename to Core/EventHandler.h index df278eca0199c76471259e4c1dc27b9f026b1a00..7cefbab07751dbbe54c3d37651ed386167f98432 100644 --- a/src/Core/EventHandler.h +++ b/Core/EventHandler.h @@ -33,7 +33,7 @@ #include <algorithm> // SimMedTK includes -#include "Event.h" +#include "Core/Event.h" class CoreClass; diff --git a/src/Core/Factory.h b/Core/Factory.h similarity index 90% rename from src/Core/Factory.h rename to Core/Factory.h index 20774872c2e0a705bcae51bda74019a0674a90bb..ba072ca1e6cdf658d6e0674224a2106113c82be6 100644 --- a/src/Core/Factory.h +++ b/Core/Factory.h @@ -1,7 +1,7 @@ #ifndef SMFACTORY_H #define SMFACTORY_H -#include "CoreClass.h" +#include "Core/CoreClass.h" #include <map> #include <set> @@ -31,7 +31,7 @@ * inside Core, Factory::s_catalog might not be initialized * before the first registration call is made. * - * A more specific example is the way the smRendering library + * A more specific example is the way the Rendering library * registers the Viewer class as a concrete child of ViewerBase: * <pre> * SIMMEDTK_BEGIN_DYNAMIC_LOADER() @@ -41,8 +41,8 @@ * SIMMEDTK_FINISH_DYNAMIC_LOADER() * </pre> * When SimMedTK is built as dynamic libraries, this registration is - * automatic whenever linking to smRendering. Versions with a static - * smRendering library require you to call + * automatic whenever linking to Rendering. Versions with a static + * Rendering library require you to call * simmedtk_register_viewer_children_onload() * at startup. */ @@ -86,13 +86,13 @@ public: typedef std::function<std::shared_ptr<T>()> SharedPointerConstructor; /// An internal structure used by Factory to track subclasses of abstract classes. - struct smFactoryEntry + struct FactoryEntry { std::string subclassname; SharedPointerConstructor constructor; int group; - bool operator < (const smFactoryEntry& other) const + bool operator < (const FactoryEntry& other) const { return (this->group < other.group || @@ -102,7 +102,7 @@ public: }; /// A set of subclasses associated with one abstract base class. - typedef std::set<smFactoryEntry> smFactoryConfigurationOptions; + typedef std::set<FactoryEntry> FactoryConfigurationOptions; static void registerClassConfiguration( const std::string& classname, @@ -110,7 +110,7 @@ public: SharedPointerConstructor ctor, int group = 1000); - static const smFactoryConfigurationOptions& optionsForClass(const std::string& targetClassname); + static const FactoryConfigurationOptions& optionsForClass(const std::string& targetClassname); static std::shared_ptr<T> createDefault( const std::string& targetClassname); @@ -143,9 +143,9 @@ public: { return std::dynamic_pointer_cast<U>(createConcreteClass(targetClassname)); } protected: - static std::map<std::string, smFactoryConfigurationOptions>* s_catalog; + static std::map<std::string, FactoryConfigurationOptions>* s_catalog; }; -#include "Factory.hpp" +#include "Core/Factory.hpp" #endif // SMFACTORY_H diff --git a/src/Core/Factory.hpp b/Core/Factory.hpp similarity index 76% rename from src/Core/Factory.hpp rename to Core/Factory.hpp index e5c6ed3bccf5029634baa859cbdc830fab70918c..e615ef8f75745ac16c128521bfdb68d1d04ce4ee 100644 --- a/src/Core/Factory.hpp +++ b/Core/Factory.hpp @@ -16,11 +16,11 @@ void Factory<T>::registerClassConfiguration( if (!Factory::s_catalog) { Factory::s_catalog = - new std::map<std::string, typename Factory<T>::smFactoryConfigurationOptions>; + new std::map<std::string, typename Factory<T>::FactoryConfigurationOptions>; atexit( []() { delete Factory::s_catalog; } ); } - smFactoryEntry entry; + FactoryEntry entry; entry.subclassname = subclassname; entry.constructor = ctor; entry.group = group; @@ -28,13 +28,13 @@ void Factory<T>::registerClassConfiguration( } template<typename T> -const typename Factory<T>::smFactoryConfigurationOptions& Factory<T>::optionsForClass(const std::string& classname) +const typename Factory<T>::FactoryConfigurationOptions& Factory<T>::optionsForClass(const std::string& classname) { - static smFactoryConfigurationOptions emptyOptions; + static FactoryConfigurationOptions emptyOptions; if (!Factory::s_catalog) return emptyOptions; - typename std::map<std::string, smFactoryConfigurationOptions>::const_iterator it; + typename std::map<std::string, FactoryConfigurationOptions>::const_iterator it; if (classname.empty() || (it = Factory::s_catalog->find(classname)) == Factory::s_catalog->end()) return emptyOptions; return it->second; @@ -44,7 +44,7 @@ template<typename T> std::shared_ptr<T> Factory<T>::createDefault( const std::string& classname) { - const smFactoryConfigurationOptions& opts( + const FactoryConfigurationOptions& opts( Factory::optionsForClass(classname)); if (opts.empty()) return std::shared_ptr<T>(); @@ -57,10 +57,10 @@ std::shared_ptr<T> Factory<T>::createSubclass( const std::string& classname, const std::string& subclassname) { - const smFactoryConfigurationOptions& opts( + const FactoryConfigurationOptions& opts( Factory::optionsForClass(classname)); - typename smFactoryConfigurationOptions::const_iterator it; + typename FactoryConfigurationOptions::const_iterator it; for (it = opts.begin(); it != opts.end(); ++it) if (it->subclassname == subclassname) { @@ -84,8 +84,8 @@ std::shared_ptr<T> Factory<T>::createConcreteClass( if (classname.empty() || !Factory::s_catalog) return std::shared_ptr<T>(); - typename std::map<std::string, smFactoryConfigurationOptions>::const_iterator bit; - typename smFactoryConfigurationOptions::const_iterator cit; + typename std::map<std::string, FactoryConfigurationOptions>::const_iterator bit; + typename FactoryConfigurationOptions::const_iterator cit; for (bit = Factory::s_catalog->begin(); bit != Factory::s_catalog->end(); ++bit) for (cit = bit->second.begin(); cit != bit->second.end(); ++cit) if (cit->subclassname == classname) @@ -102,10 +102,10 @@ std::shared_ptr<T> Factory<T>::createSubclassForGroup( const std::string& classname, int group) { - const smFactoryConfigurationOptions& opts( + const FactoryConfigurationOptions& opts( Factory::optionsForClass(classname)); - typename smFactoryConfigurationOptions::const_iterator it; + typename FactoryConfigurationOptions::const_iterator it; for (it = opts.begin(); it != opts.end(); ++it) if (it->group == group) { @@ -118,6 +118,6 @@ std::shared_ptr<T> Factory<T>::createSubclassForGroup( /// Class-static map from abstract class names to registered concrete children. template<typename T> -std::map<std::string, typename Factory<T>::smFactoryConfigurationOptions>* Factory<T>::s_catalog = NULL; +std::map<std::string, typename Factory<T>::FactoryConfigurationOptions>* Factory<T>::s_catalog = NULL; #endif // SMFACTORY_HPP diff --git a/src/Core/Geometry.cpp b/Core/Geometry.cpp similarity index 99% rename from src/Core/Geometry.cpp rename to Core/Geometry.cpp index 3d1e38429777007b1d754d260147b09c575fd456..2d0f9dd204e895d5fd95b5f61f0a0429df1d5b17 100644 --- a/src/Core/Geometry.cpp +++ b/Core/Geometry.cpp @@ -24,8 +24,8 @@ // STL includes #include <limits> -#include "Geometry.h" -#include "RenderDelegate.h" +#include "Core/Geometry.h" +#include "Core/RenderDelegate.h" AABB::AABB() { diff --git a/src/Core/Geometry.h b/Core/Geometry.h similarity index 98% rename from src/Core/Geometry.h rename to Core/Geometry.h index b4dc99d7d0cb613d606986b47bef3782fb32fcf6..5db7788ba31ac72a74c7bcd9a830421cd66a78f1 100644 --- a/src/Core/Geometry.h +++ b/Core/Geometry.h @@ -25,11 +25,11 @@ #define SMGEOMETRY_H // SimMedTK includes -#include "Config.h" -#include "Vector.h" -#include "Matrix.h" +#include "Core/Config.h" +#include "Core/Vector.h" +#include "Core/Matrix.h" -#include "Factory.h" +#include "Core/Factory.h" #include "Rendering/GLRenderer.h" #include "RenderDelegate.h" diff --git a/src/Core/IOStream.cpp b/Core/IOStream.cpp similarity index 75% rename from src/Core/IOStream.cpp rename to Core/IOStream.cpp index 03f10a12919408640c421d77a44d66490867dc85..bfc693f950e51282e17325d2e6af9318aff8a29e 100644 --- a/src/Core/IOStream.cpp +++ b/Core/IOStream.cpp @@ -22,64 +22,64 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "IOStream.h" +#include "Core/IOStream.h" -smConsoleStream::smConsoleStream() +ConsoleStream::ConsoleStream() { } -IOStream& smConsoleStream::operator<<(std::string p_string) +IOStream& ConsoleStream::operator<<(std::string p_string) { std::cout << p_string; return *this; } -IOStream& smConsoleStream::operator>>(std::string &p_string) +IOStream& ConsoleStream::operator>>(std::string &p_string) { std::getline(std::cin, inputBuffer); p_string = inputBuffer; return *this; } -smWindowString::smWindowString() +WindowString::WindowString() { x = 0; y = 0; string = ""; string.reserve(SM_WINDOW_MAXSTRINGSIZE); } -smWindowString::smWindowString(std::string p_string) +WindowString::WindowString(std::string p_string) { string = p_string; } -smWindowString::smWindowString(std::string p_string, float p_x, float p_y) +WindowString::WindowString(std::string p_string, float p_x, float p_y) { string = p_string; x = p_x; y = p_y; } -smWindowString& smWindowString::operator<<(std::string p_string) +WindowString& WindowString::operator<<(std::string p_string) { string = p_string; return *this; } -void smWindowString::operator=(smWindowString& p_windowString) +void WindowString::operator=(WindowString& p_windowString) { string.clear(); string = p_windowString.string; x = p_windowString.x; y = p_windowString.y; } -IOStream& smWindowStream::operator<<(std::string /*p_string*/) +IOStream& WindowStream::operator<<(std::string /*p_string*/) { return *this; } -IOStream& smWindowStream::operator>>(std::string& /*p_string*/) +IOStream& WindowStream::operator>>(std::string& /*p_string*/) { return *this; } -void smOpenGLWindowStream::init(int p_totalTexts) +void OpenGLWindowStream::init(int p_totalTexts) { textColor.setValue(1.0, 1.0, 1.0, 1.0); totalTexts = p_totalTexts; - windowTexts = new smWindowData[totalTexts]; + windowTexts = new WindowData[totalTexts]; this->setDrawOrder(core::ClassDrawOrder::AfterObjects); for (int i = 0; i < totalTexts; i++) @@ -94,14 +94,14 @@ void smOpenGLWindowStream::init(int p_totalTexts) initialTextPositionY = 0.0; lastTextPosition = 0; } -smOpenGLWindowStream::smOpenGLWindowStream(int p_totalTexts) +OpenGLWindowStream::OpenGLWindowStream(int p_totalTexts) { //font.setPointSize(10.0); init(p_totalTexts); } -int smOpenGLWindowStream::addText(const std::string& p_tag, const std::string& p_string) +int OpenGLWindowStream::addText(const std::string& p_tag, const std::string& p_string) { - smWindowString string; + WindowString string; string.string = p_string; string.x = 0; string.y = lastTextPosition; @@ -112,7 +112,7 @@ int smOpenGLWindowStream::addText(const std::string& p_tag, const std::string& p currentIndex = (currentIndex + 1) % totalTexts; return currentIndex; } -bool smOpenGLWindowStream::addText(std::string p_tag, smWindowString& p_string) +bool OpenGLWindowStream::addText(std::string p_tag, WindowString& p_string) { if (p_string.string.size() > SM_WINDOW_MAXSTRINGSIZE) { @@ -125,7 +125,7 @@ bool smOpenGLWindowStream::addText(std::string p_tag, smWindowString& p_string) windowTexts[currentIndex].enabled = true; return true; } -bool smOpenGLWindowStream::updateText(std::string p_tag, std::string p_string) +bool OpenGLWindowStream::updateText(std::string p_tag, std::string p_string) { int index = -1; @@ -145,7 +145,7 @@ bool smOpenGLWindowStream::updateText(std::string p_tag, std::string p_string) return true; } -bool smOpenGLWindowStream::updateText(int p_textHandle, std::string p_string) +bool OpenGLWindowStream::updateText(int p_textHandle, std::string p_string) { int index = p_textHandle; @@ -163,14 +163,14 @@ bool smOpenGLWindowStream::updateText(int p_textHandle, std::string p_string) return true; } -bool smOpenGLWindowStream::removeText(std::string p_tag) +bool OpenGLWindowStream::removeText(std::string p_tag) { int index = tagMap[p_tag]; windowTexts[index].enabled = false; return true; } -smWindowConsole::smWindowConsole(int p_totalTexts) +WindowConsole::WindowConsole(int p_totalTexts) { init(p_totalTexts); backGroundColor.setValue(1.0, 1.0, 1.0, 0.15); @@ -180,14 +180,14 @@ smWindowConsole::smWindowConsole(int p_totalTexts) right = 1.0; top = 0.15; } -std::string smWindowConsole::getLastEntry() +std::string WindowConsole::getLastEntry() { return windowTexts[currentIndex].windowString.string; } -int smWindowConsole::addText(const std::string &p_tag, const std::string& p_string) +int WindowConsole::addText(const std::string &p_tag, const std::string& p_string) { int traverseIndex; - smWindowString string; + WindowString string; string.string = p_string; windowTexts[currentIndex].enabled = true; windowTexts[currentIndex].windowString = string; diff --git a/src/Core/IOStream.h b/Core/IOStream.h similarity index 83% rename from src/Core/IOStream.h rename to Core/IOStream.h index 45d4eb5e2f035a416db35f22bd9e4a0df8860105..2b2c7cc2a864a2032f360b2db34739eb06cba688 100644 --- a/src/Core/IOStream.h +++ b/Core/IOStream.h @@ -24,9 +24,9 @@ #ifndef SMIOSTREAM_H #define SMIOSTREAM_H -#include "Config.h" -#include "CoreClass.h" -#include "SDK.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/SDK.h" #include <iostream> #include <string> @@ -54,11 +54,11 @@ protected: }; /// \brief console stream; for printing text on the console -class smConsoleStream: public IOStream +class ConsoleStream: public IOStream { std::string inputBuffer; public: - smConsoleStream(); + ConsoleStream(); /// \brief operator to print text virtual IOStream& operator <<(std::string p_string); @@ -67,19 +67,19 @@ public: }; /// \brief window string -struct smWindowString +struct WindowString { public: /// \brief constructors - smWindowString(); + WindowString(); - smWindowString(std::string p_string); + WindowString(std::string p_string); - smWindowString(std::string p_string, float p_x, float p_y); + WindowString(std::string p_string, float p_x, float p_y); /// \brief operators for string - smWindowString &operator<<(std::string p_string); + WindowString &operator<<(std::string p_string); - void operator =(smWindowString &p_windowString); + void operator =(WindowString &p_windowString); public: /// \brief string @@ -88,13 +88,13 @@ public: float x, y; }; -struct smWindowData +struct WindowData { bool enabled; - smWindowString windowString; + WindowString windowString; }; /// \brief window stream for putting window string on text -class smWindowStream: public IOStream +class WindowStream: public IOStream { public: virtual IOStream& operator <<(std::string p_string); @@ -102,7 +102,7 @@ public: }; /// \brief opengl window stream for putting text on the screen -class smOpenGLWindowStream: public smWindowStream +class OpenGLWindowStream: public WindowStream { public: void init(int p_totalTexts); @@ -114,13 +114,13 @@ public: Color textColor; /// \brief constructors - smOpenGLWindowStream(int p_totalTexts = SM_WINDOW_TOTALSTRINGS_ONWINDOW); + OpenGLWindowStream(int p_totalTexts = SM_WINDOW_TOTALSTRINGS_ONWINDOW); /// \brief add text on window virtual int addText(const std::string &p_tag, const std::string &p_string); /// \brief add text on window - bool addText(std::string p_tag, smWindowString &p_string); + bool addText(std::string p_tag, WindowString &p_string); /// \brief update the text with specificed tag(p_tag) bool updateText(std::string p_tag, std::string p_string); @@ -140,7 +140,7 @@ protected: /// \brief #of the total texts int totalTexts; /// \brief window texts - smWindowData *windowTexts; + WindowData *windowTexts; std::unordered_map<std::string, int> tagMap; int currentIndex; /// \brief initial text position on window @@ -150,11 +150,11 @@ protected: /// \brief initialization routines }; /// \brief window console -class smWindowConsole: public smOpenGLWindowStream +class WindowConsole: public OpenGLWindowStream { public: /// \brief window console constructor - smWindowConsole(int p_totalTexts = 5); + WindowConsole(int p_totalTexts = 5); /// \brief return last entered entry std::string getLastEntry(); diff --git a/src/Core/Light.cpp b/Core/Light.cpp similarity index 95% rename from src/Core/Light.cpp rename to Core/Light.cpp index 845b1c946c44f379707e9ad84799ffa68e722f06..69862d9f3aa0f0c15736a9f20c6458d08024b77b 100644 --- a/src/Core/Light.cpp +++ b/Core/Light.cpp @@ -22,8 +22,8 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "Light.h" -#include "Quaternion.h" +#include "Core/Light.h" +#include "Core/Quaternion.h" core::Vec3d Light::defaultDir(0, 0, -1.0); core::Vec3d Light::defaultUpDir(0, 1, 0.0); @@ -43,7 +43,7 @@ void Light::updateDirection() transverseDir = rot*defaultTransDir; } -smLightPos::smLightPos( float p_x, float p_y, float p_z, float /*p_w*/ ) +LightPos::LightPos( float p_x, float p_y, float p_z, float /*p_w*/ ) { position << p_x, p_y, p_z; } diff --git a/src/Core/Light.h b/Core/Light.h similarity index 95% rename from src/Core/Light.h rename to Core/Light.h index 07d8d9e66daf99ecaf5604f000d08157e9c7d12a..7401c41505fe1d8bec1187562463ecdf61517828 100644 --- a/src/Core/Light.h +++ b/Core/Light.h @@ -28,20 +28,20 @@ #include <string> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/Vector.h" #include "Rendering/ConfigRendering.h" -#include "Vector.h" #define SMLIGHT_SPOTMAX 128 class Light; /// \brief light position. light at inifinite position can be defined with w -struct smLightPos +struct LightPos { public: - smLightPos(float p_x = 0.0, float p_y = 0.0, float p_z = 0.0, float p_w = 1.0); + LightPos(float p_x = 0.0, float p_y = 0.0, float p_z = 0.0, float p_w = 1.0); void setPosition(const core::Vec3d &p) { position = p; @@ -110,7 +110,7 @@ public: Color lightColorAmbient; Color lightColorSpecular; - smLightPos lightPos; + LightPos lightPos; //Vec3d direction; //between 0-1.0 /// \brief higher spot exponents result in a more focused light source, diff --git a/src/Core/MakeUnique.h b/Core/MakeUnique.h similarity index 100% rename from src/Core/MakeUnique.h rename to Core/MakeUnique.h diff --git a/src/Core/Matrix.h b/Core/Matrix.h similarity index 96% rename from src/Core/Matrix.h rename to Core/Matrix.h index ee3e491fda07bc1623c5b51ec4bb3d8a1f12a8f2..c8d547234aa8a7c4455d3dd661272c347c86bcda 100644 --- a/src/Core/Matrix.h +++ b/Core/Matrix.h @@ -54,7 +54,7 @@ using Matrix66 = Eigen::Matrix<T, 6, 6>; /// A dynamic size diagonal matrix template<typename T> -using smDiagonalMatrix = Eigen::DiagonalMatrix<T, Eigen::Dynamic>; +using DiagonalMatrix = Eigen::DiagonalMatrix<T, Eigen::Dynamic>; /// A dynamic size dense matrix template<typename T> @@ -86,10 +86,10 @@ using Matrix44d = Matrix44<double>; using Matrix66d = Matrix66<double>; /// A dynamic size diagonal matrix of floats -using smDiagonalMatrixf = smDiagonalMatrix<float>; +using DiagonalMatrixf = DiagonalMatrix<float>; /// A dynamic size diagonal matrix of doubles -using smDiagonalMatrixd = smDiagonalMatrix<double>; +using DiagonalMatrixd = DiagonalMatrix<double>; /// A dynamic size matrix of floats using Matrixf = Matrix<float>; diff --git a/src/Core/ModelRepresentation.cpp b/Core/ModelRepresentation.cpp similarity index 96% rename from src/Core/ModelRepresentation.cpp rename to Core/ModelRepresentation.cpp index 1f38fd75edeb79848cb7047f5bcff99f974c8d58..7014168166da9ce8c353ed07577ab925a4d008a7 100644 --- a/src/Core/ModelRepresentation.cpp +++ b/Core/ModelRepresentation.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "ModelRepresentation.h" +#include "Core/ModelRepresentation.h" ModelRepresentation::ModelRepresentation() { diff --git a/src/Core/ModelRepresentation.h b/Core/ModelRepresentation.h similarity index 98% rename from src/Core/ModelRepresentation.h rename to Core/ModelRepresentation.h index f5a370ec66b69a8df69b5bfc675df4fb7e3748e5..ca3e2bc5ab3f62c69806b82e519e18dbfedff894 100644 --- a/src/Core/ModelRepresentation.h +++ b/Core/ModelRepresentation.h @@ -28,7 +28,7 @@ #include <memory> // SimMedTK includes -#include "CoreClass.h" +#include "Core/CoreClass.h" #include "Mesh/Mesh.h" class Mesh; diff --git a/src/Core/Module.cpp b/Core/Module.cpp similarity index 98% rename from src/Core/Module.cpp rename to Core/Module.cpp index 1433d3ee005ca3174ec3b79e2471058802169bd9..f6ac73e6376f66cfdf2c83db20d3a1d3b050f38b 100644 --- a/src/Core/Module.cpp +++ b/Core/Module.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Module.h" +#include "Core/Module.h" /// \brief Begin frame will be called before the cycle void Module::beginModule() diff --git a/src/Core/Module.h b/Core/Module.h similarity index 94% rename from src/Core/Module.h rename to Core/Module.h index e1c155da4f6a99b15d52b39ab097941ddd522b44..e594cd1c2c14548db2be2f071bcbdd07c115d738 100644 --- a/src/Core/Module.h +++ b/Core/Module.h @@ -28,11 +28,11 @@ #include <memory> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" -#include "Dispatcher.h" -#include "Scene.h" -#include "SceneObject.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/Dispatcher.h" +#include "Core/Scene.h" +#include "Core/SceneObject.h" ///this class is module major. Every other thread should derive this class class Module: public CoreClass diff --git a/src/Core/ObjectSimulator.cpp b/Core/ObjectSimulator.cpp similarity index 87% rename from src/Core/ObjectSimulator.cpp rename to Core/ObjectSimulator.cpp index 9e9f9ca9df03e9a63ee816a28d3d013ee148f1cd..546ddbbf63007fc11ef1a76a514170a6670e977b 100644 --- a/src/Core/ObjectSimulator.cpp +++ b/Core/ObjectSimulator.cpp @@ -21,9 +21,9 @@ // Contact: //--------------------------------------------------------------------------- -#include "ObjectSimulator.h" +#include "Core/ObjectSimulator.h" +#include "Core/SDK.h" #include "Rendering/Viewer.h" -#include "SDK.h" ObjectSimulator::ObjectSimulator(std::shared_ptr<ErrorLog> p_log) { @@ -55,12 +55,12 @@ void ObjectSimulator::removeObject(std::shared_ptr<SceneObject> /*p_object*/ ) { } -void ObjectSimulator::setPriority( smThreadPriority p_priority ) +void ObjectSimulator::setPriority( ThreadPriority p_priority ) { threadPriority = p_priority; } -void ObjectSimulator::setExecutionType( smSimulatorExecutionType p_type ) +void ObjectSimulator::setExecutionType( SimulatorExecutionType p_type ) { if ( execType != p_type ) { @@ -70,7 +70,7 @@ void ObjectSimulator::setExecutionType( smSimulatorExecutionType p_type ) execType = p_type; } -smThreadPriority ObjectSimulator::getPriority() +ThreadPriority ObjectSimulator::getPriority() { return threadPriority; } @@ -107,7 +107,7 @@ void ObjectSimulator::updateSceneList() { } -ObjectSimulator::smObjectSimulatorObjectIter::smObjectSimulatorObjectIter( ScheduleGroup &p_group, +ObjectSimulator::ObjectSimulatorObjectIter::ObjectSimulatorObjectIter( ScheduleGroup &p_group, std::vector<std::shared_ptr<SceneObject>> &p_objectsSimulated, int p_threadIndex ) { @@ -146,17 +146,17 @@ ObjectSimulator::smObjectSimulatorObjectIter::smObjectSimulatorObjectIter( Sched } } } -void ObjectSimulator::smObjectSimulatorObjectIter::setThreadIndex( short int p_threadIndex ) +void ObjectSimulator::ObjectSimulatorObjectIter::setThreadIndex( short int p_threadIndex ) { threadIndex = p_threadIndex; } -int ObjectSimulator::smObjectSimulatorObjectIter::begin() +int ObjectSimulator::ObjectSimulatorObjectIter::begin() { return beginIndex; } -int ObjectSimulator::smObjectSimulatorObjectIter::end() +int ObjectSimulator::ObjectSimulatorObjectIter::end() { return endIndex; } diff --git a/src/Core/ObjectSimulator.h b/Core/ObjectSimulator.h similarity index 88% rename from src/Core/ObjectSimulator.h rename to Core/ObjectSimulator.h index f5693dbbc17398a32ae84bd46d6717ca476791b8..8ceba50ba89af704d48f8ee90ff48e54eefc8bf6 100644 --- a/src/Core/ObjectSimulator.h +++ b/Core/ObjectSimulator.h @@ -24,19 +24,16 @@ #ifndef SMOBJECTSIMULATOR_H #define SMOBJECTSIMULATOR_H -// STL includes -#include <memory> - // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" -#include "SceneObject.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/SceneObject.h" #include "Scheduler.h" -#include "ErrorLog.h" -#include "Timer.h" +#include "Core/ErrorLog.h" +#include "Core/Timer.h" /// \brief thread priority definitions -enum smThreadPriority +enum ThreadPriority { SIMMEDTK_THREAD_IDLE, SIMMEDTK_THREAD_LOWPRIORITY, @@ -45,7 +42,7 @@ enum smThreadPriority SIMMEDTK_THREAD_TIMECRITICAL, }; -enum smSimulatorExecutionType +enum SimulatorExecutionType { SIMMEDTK_SIMEXECUTION_SYNCMODE, SIMMEDTK_SIMEXECUTION_ASYNCMODE @@ -66,13 +63,13 @@ protected: ///log of the object std::shared_ptr<ErrorLog> log; bool isObjectSimInitialized; - smThreadPriority threadPriority; + ThreadPriority threadPriority; Timer timer; long double timerPerFrame; long double FPS; unsigned int frameCounter; long double totalTime; - smSimulatorExecutionType execType; + SimulatorExecutionType execType; bool executionTypeStatusChanged; public: @@ -91,12 +88,12 @@ public: ObjectSimulator(std::shared_ptr<ErrorLog> p_log); /// \brief set thread priority - void setPriority(smThreadPriority p_priority); + void setPriority(ThreadPriority p_priority); /// \brief set execution type - void setExecutionType(smSimulatorExecutionType p_type); + void setExecutionType(SimulatorExecutionType p_type); /// \brief get thread priority - smThreadPriority getPriority(); + ThreadPriority getPriority(); protected: ///objects that are simulated by this will be added to the list @@ -124,7 +121,7 @@ protected: /// \brief object simulator iterator. The default iteration is sequantial in the order of the insertion. /// custom iteration requires extension of this class. - struct smObjectSimulatorObjectIter + struct ObjectSimulatorObjectIter { private: @@ -134,7 +131,7 @@ protected: short threadIndex; public: - smObjectSimulatorObjectIter(ScheduleGroup &p_group, + ObjectSimulatorObjectIter(ScheduleGroup &p_group, std::vector<std::shared_ptr<SceneObject>> &p_objectsSimulated, int p_threadIndex); diff --git a/src/Core/Quaternion.h b/Core/Quaternion.h similarity index 97% rename from src/Core/Quaternion.h rename to Core/Quaternion.h index 2312be1e2621582c51d411bc599e970dac613a8d..2c81c473c893288288e380badf2c247d6633b0b6 100644 --- a/src/Core/Quaternion.h +++ b/Core/Quaternion.h @@ -28,8 +28,8 @@ #include "Eigen/Geometry" // SimMedTK includes -#include "Matrix.h" -#include "Vector.h" +#include "Core/Matrix.h" +#include "Core/Vector.h" /// A quaternion. template<typename T> diff --git a/src/Core/RenderDelegate.h b/Core/RenderDelegate.h similarity index 92% rename from src/Core/RenderDelegate.h rename to Core/RenderDelegate.h index a5d8d2b77473fb1b957fdaa7dda2fa7cc23d029b..ac9b72cc65d81f8cc99dc9cac1dd01dab6f3e755 100644 --- a/src/Core/RenderDelegate.h +++ b/Core/RenderDelegate.h @@ -1,7 +1,7 @@ #ifndef SMRENDERABLE_H #define SMRENDERABLE_H -#include "RenderDetail.h" // for GeometrySource +#include "Core/RenderDetail.h" // for GeometrySource #include <memory> // for shared_ptr diff --git a/src/Core/RenderDetail.cpp b/Core/RenderDetail.cpp similarity index 98% rename from src/Core/RenderDetail.cpp rename to Core/RenderDetail.cpp index 791a87103402462a88976993591d82c70b6859c9..541ea4790f4a6907fb9c11614b6676501a54c44f 100644 --- a/src/Core/RenderDetail.cpp +++ b/Core/RenderDetail.cpp @@ -13,8 +13,8 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -#include "RenderDetail.h" -//#include "Shader/Shader.h" + +#include "Core/RenderDetail.h" void RenderDetail::addShader(std::shared_ptr<UnifiedId> p_shaderID) { diff --git a/src/Core/RenderDetail.h b/Core/RenderDetail.h similarity index 98% rename from src/Core/RenderDetail.h rename to Core/RenderDetail.h index 29b3f31bc6255530446560baa0f6ff83c03d3c55..b3ea8e1fab11398031b202a613f66ca309fb5c2b 100644 --- a/src/Core/RenderDetail.h +++ b/Core/RenderDetail.h @@ -17,8 +17,8 @@ #ifndef SMRENDERDETAIL_H #define SMRENDERDETAIL_H -#include "Config.h" -#include "Color.h" +#include "Core/Config.h" +#include "Core/Color.h" #include <memory> #include <vector> diff --git a/src/Core/SDK.cpp b/Core/SDK.cpp similarity index 99% rename from src/Core/SDK.cpp rename to Core/SDK.cpp index 8f58005ce179b184f5eb9e5dbc3a14d68c9334ad..e45ce672d0e6a400ec1cd00c5fc6273a964a3fe5 100644 --- a/src/Core/SDK.cpp +++ b/Core/SDK.cpp @@ -21,8 +21,8 @@ // Contact: //--------------------------------------------------------------------------- -#include "SDK.h" -#include "Factory.h" +#include "Core/SDK.h" +#include "Core/Factory.h" #include <chrono> #include <thread> diff --git a/src/Core/SDK.h b/Core/SDK.h similarity index 94% rename from src/Core/SDK.h rename to Core/SDK.h index 403b922da47fda0c7eb806dba408c9ea122ec0c4..ec00bd1aee8d5f17ff5f0aadff64df19292f3cea 100644 --- a/src/Core/SDK.h +++ b/Core/SDK.h @@ -25,14 +25,14 @@ #define SMSDK_H // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" -#include "Scene.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/Scene.h" +#include "Core/Simulator.h" +#include "Core/Module.h" +#include "Core/DataStructures.h" +#include "Core/MakeUnique.h" #include "Rendering/Viewer.h" -#include "Simulator.h" -#include "Module.h" -#include "DataStructures.h" -#include "MakeUnique.h" /// \brief maximum entities in the framework #define SIMMEDTK_SDK_MAXMESHES 100 @@ -41,17 +41,9 @@ #define SIMMEDTK_SDK_MAXSCENES 100 #define SIMMEDTK_SDK_MAXSCENEOBJTECTS 100 -class smMotionTransformer; template<typename T> class IndiceArray; class Scene; -/// \brief module registration -enum smSDKReturnType -{ - SIMMEDTK_SDK_MODULEREGISTERED, - SIMMEDTK_SDK_MODULEREGISTEREDALREADY -}; - /// \brief mesh holder struct MeshHolder @@ -216,7 +208,7 @@ public: ///SDK returns logger for the system std::shared_ptr<ErrorLog> getErrorLog(); - ///terminates every module. Do it later on with smMessager + ///terminates every module. Do it later on with Messager void terminateAll(); ///release the scene from the SDK..not implemented yet diff --git a/src/Core/Scene.cpp b/Core/Scene.cpp similarity index 97% rename from src/Core/Scene.cpp rename to Core/Scene.cpp index 544a2f0cd924a7ab6c8ba7b6aab1aadbf3871bef..a2b3f5a159eec49cc0b2e3cb3125106310153c17 100644 --- a/src/Core/Scene.cpp +++ b/Core/Scene.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Scene.h" +#include "Core/Scene.h" Scene::Scene(std::shared_ptr<ErrorLog> p_log) : @@ -159,14 +159,14 @@ void Scene::refreshLights() } } -void Scene::setLightPos(int p_lightId, smLightPos p_pos) +void Scene::setLightPos(int p_lightId, LightPos p_pos) { std::shared_ptr<Light> temp = lights.at(p_lightId); temp->lightPos = p_pos; temp->updateDirection(); } -void Scene::setLightPos(int p_lightId, smLightPos p_pos, core::Vec3d p_direction) +void Scene::setLightPos(int p_lightId, LightPos p_pos, core::Vec3d p_direction) { std::shared_ptr<Light> temp = lights.at(p_lightId); temp->lightPos = p_pos; diff --git a/src/Core/Scene.h b/Core/Scene.h similarity index 93% rename from src/Core/Scene.h rename to Core/Scene.h index 545418f2c79b83ba9c51efac3e48426e1b0f09c2..8828ade30f9f9b0616aa0da563e8362274ff1fcd 100644 --- a/src/Core/Scene.h +++ b/Core/Scene.h @@ -30,12 +30,12 @@ #include <unordered_map> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" -#include "ErrorLog.h" -#include "Light.h" -#include "SceneObject.h" -#include "DataStructures.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" +#include "Core/ErrorLog.h" +#include "Core/Light.h" +#include "Core/SceneObject.h" +#include "Core/DataStructures.h" #include "Event/KeyboardEvent.h" #include "Event/MouseButtonEvent.h" #include "Event/MouseMoveEvent.h" @@ -77,7 +77,7 @@ public: ///remove the phyics in the scene. ///The removal of the phsyics in the scene needs some sync all over the modules - ///so not implemented yet. Be aware that when you remove the phyics do no free the smPhysics class + ///so not implemented yet. Be aware that when you remove the phyics do no free the Physics class void removeSceneObject(std::shared_ptr<SceneObject> p_sceneObject); ///the same as @@ -126,9 +126,9 @@ public: /// \brief refresh lights. updates light position based on the gl matrix void refreshLights(); - void setLightPos(int p_lightId, smLightPos p_pos); + void setLightPos(int p_lightId, LightPos p_pos); - void setLightPos(int p_lightId, smLightPos p_pos, core::Vec3d p_direction); + void setLightPos(int p_lightId, LightPos p_pos, core::Vec3d p_direction); std::shared_ptr<Camera> getCamera() { diff --git a/src/Core/SceneObject.cpp b/Core/SceneObject.cpp similarity index 90% rename from src/Core/SceneObject.cpp rename to Core/SceneObject.cpp index f3538f55ce8d7818173f1592f33746a29be46a26..319187bb9431104044c71fbfaee0d37382aa4697 100644 --- a/src/Core/SceneObject.cpp +++ b/Core/SceneObject.cpp @@ -21,9 +21,9 @@ // Contact: //--------------------------------------------------------------------------- -#include "SceneObject.h" -#include "ObjectSimulator.h" -#include "SDK.h" +#include "Core/SceneObject.h" +#include "Core/ObjectSimulator.h" +#include "Core/SDK.h" SceneObject::SceneObject() { @@ -57,7 +57,7 @@ std::shared_ptr<ObjectSimulator> SceneObject::getObjectSimulator() return objectSim; } -void SceneObject::attachCustomRenderer(std::shared_ptr<smCustomRenderer> p_customeRenderer) +void SceneObject::attachCustomRenderer(std::shared_ptr<CustomRenderer> p_customeRenderer) { customRender = p_customeRenderer; } @@ -87,7 +87,7 @@ ObjectInitFlags & SceneObject::getFlags() return flags; } -std::shared_ptr<smCustomRenderer> SceneObject::getRenderer() +std::shared_ptr<CustomRenderer> SceneObject::getRenderer() { return customRender; } diff --git a/src/Core/SceneObject.h b/Core/SceneObject.h similarity index 93% rename from src/Core/SceneObject.h rename to Core/SceneObject.h index f252a0897719ec33c68bb217a756bda9ece7b635..6714da957dac59a66f9263b6fff273e88df48fa9 100644 --- a/src/Core/SceneObject.h +++ b/Core/SceneObject.h @@ -29,15 +29,15 @@ #include <memory> // SimMedTK includes -#include "Vector.h" -#include "Config.h" -#include "CoreClass.h" +#include "Core/Vector.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" #include "Rendering/ConfigRendering.h" #include "Rendering/CustomRenderer.h" //forward class declaration class ObjectSimulator; -class smCustomRenderer; +class CustomRenderer; ///booleans for objects indicate whether they're initialized or not. struct ObjectInitFlags @@ -90,7 +90,7 @@ public: /// \brief attach custome renderer for the object. /// If the default rendering is not helpful - void attachCustomRenderer(std::shared_ptr<smCustomRenderer> p_customeRenderer); + void attachCustomRenderer(std::shared_ptr<CustomRenderer> p_customeRenderer); /// \brief release the renderer void releaseCustomeRenderer(); @@ -105,7 +105,7 @@ public: ObjectInitFlags &getFlags(); - std::shared_ptr<smCustomRenderer> getRenderer(); + std::shared_ptr<CustomRenderer> getRenderer(); ///serialize function explicity writes the object to the memory block ///each scene object should know how to write itself to a memory block @@ -127,7 +127,7 @@ protected: private: std::shared_ptr<ObjectSimulator> objectSim; // object simulator that will simulate the object - std::shared_ptr<smCustomRenderer> customRender; + std::shared_ptr<CustomRenderer> customRender; core::StdVector3d localVertices; // local copy of vertices ObjectInitFlags flags; }; diff --git a/src/Core/Scheduler.h b/Core/Scheduler.h similarity index 91% rename from src/Core/Scheduler.h rename to Core/Scheduler.h index fadc659518ac51813156cd475620a23041696b65..7e7feeff4054f32c21364176bef7924aecc4a4e4 100644 --- a/src/Core/Scheduler.h +++ b/Core/Scheduler.h @@ -26,13 +26,6 @@ class Simulator; -enum smSchedulingPriority -{ - SIMMEDTK_SCHEDULING_HIGHRATE, - SIMMEDTK_SCHEDULING_AUTOSCHEDULE, - SIMMEDTK_SCHEDULING_BACKGROUND -}; - struct ScheduleGroup { diff --git a/src/Core/Simulator.cpp b/Core/Simulator.cpp similarity index 99% rename from src/Core/Simulator.cpp rename to Core/Simulator.cpp index 04a3aa0fbdfe1fe5372d2d0032f73f2e384c9671..8e82556511d767ca8853b972c02bf0128d05bed9 100644 --- a/src/Core/Simulator.cpp +++ b/Core/Simulator.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Simulator.h" +#include "Core/Simulator.h" /// \brief starts the tasks with the threads from thread pool void Simulator::beginFrame() diff --git a/src/Core/Simulator.h b/Core/Simulator.h similarity index 95% rename from src/Core/Simulator.h rename to Core/Simulator.h index 04c53f0c89bc325e1cac0a56294b453cddacf18d..f5a3a32294fe84e749d4002264c972aac3f68ecd 100644 --- a/src/Core/Simulator.h +++ b/Core/Simulator.h @@ -31,11 +31,11 @@ #include <ThreadPool.h> // SimMedTK includes -#include "Module.h" -#include "ObjectSimulator.h" -#include "MakeUnique.h" -#include "CollisionDetection.h" -#include "ContactHandling.h" +#include "Core/Module.h" +#include "Core/ObjectSimulator.h" +#include "Core/MakeUnique.h" +#include "Core/CollisionDetection.h" +#include "Core/ContactHandling.h" struct SimulationMainParam { diff --git a/src/Core/StaticSceneObject.cpp b/Core/StaticSceneObject.cpp similarity index 97% rename from src/Core/StaticSceneObject.cpp rename to Core/StaticSceneObject.cpp index 2cb9eadab2517c447cbf6e7de1d51cf9bc7c90b3..ada986e6023dfa19b3b45b9dd81ed86a68e8cccf 100644 --- a/src/Core/StaticSceneObject.cpp +++ b/Core/StaticSceneObject.cpp @@ -21,8 +21,8 @@ // Contact: //--------------------------------------------------------------------------- -#include "StaticSceneObject.h" -#include "Factory.h" +#include "Core/StaticSceneObject.h" +#include "Core/Factory.h" StaticSceneObject::StaticSceneObject(std::shared_ptr<ErrorLog> /*p_log*/) : SceneObject() { diff --git a/src/Core/StaticSceneObject.h b/Core/StaticSceneObject.h similarity index 94% rename from src/Core/StaticSceneObject.h rename to Core/StaticSceneObject.h index 037e321ab6087aa51b477265bfaafb51baaf2d4e..285d8f6029964cad1f4cfd51d2f515d7ca53e2a5 100644 --- a/src/Core/StaticSceneObject.h +++ b/Core/StaticSceneObject.h @@ -25,12 +25,12 @@ #define SMSTATICSCENEOBJECT_H // SimMedTK includes -#include "Config.h" -#include "ModelRepresentation.h" -#include "SceneObject.h" -#include "Mesh/SurfaceMesh.h" +#include "Core/Config.h" +#include "Core/ModelRepresentation.h" +#include "Core/SceneObject.h" #include "CoreClass.h" -#include "ModelRepresentation.h" +#include "Core/ModelRepresentation.h" +#include "Mesh/SurfaceMesh.h" namespace core { class Event; diff --git a/src/Core/Synchronization.h b/Core/Synchronization.h similarity index 98% rename from src/Core/Synchronization.h rename to Core/Synchronization.h index 0f029c6e0fccbc476027dd1bc56432ca3914d6dd..9f8061e8585a4c92114eb352d6d144ee9d40c654 100644 --- a/src/Core/Synchronization.h +++ b/Core/Synchronization.h @@ -31,8 +31,8 @@ #include <thread> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" /// \brief Synchronization class for sync the start/end of multiple threads ///simply set number of worker threads in the constructor diff --git a/src/Core/Texture.h b/Core/Texture.h similarity index 90% rename from src/Core/Texture.h rename to Core/Texture.h index c751a22483a6c5499b1c4b6410ecec14e2317761..cbc3b711c253571f238a147ad6bde0dc8dee98cb 100644 --- a/src/Core/Texture.h +++ b/Core/Texture.h @@ -22,10 +22,10 @@ #include <cstring> // SimMedTK includes -#include "Config.h" -#include "ErrorLog.h" +#include "Core/Config.h" +#include "Core/ErrorLog.h" -enum smTextureReturnType +enum TextureReturnType { SIMMEDTK_TEXTURE_NOTFOUND, SIMMEDTK_TEXTURE_IMAGELOADINGERROR, @@ -75,15 +75,4 @@ struct Texture } }; -/// \brief image data -struct smImageData -{ - void *data; - int width; - int height; - int bytePerPixel; - ImageColorType imageColorType; - std::string fileName; -}; - #endif // SMTEXTURE_H diff --git a/src/Core/Timer.cpp b/Core/Timer.cpp similarity index 98% rename from src/Core/Timer.cpp rename to Core/Timer.cpp index 5322b7e0a71fafac9d8603724aad5270945cc2f4..e5f82921137f2de116580bc5322514d3afff110a 100644 --- a/src/Core/Timer.cpp +++ b/Core/Timer.cpp @@ -22,7 +22,7 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "Timer.h" +#include "Core/Timer.h" Timer::Timer() { diff --git a/src/Core/Timer.h b/Core/Timer.h similarity index 96% rename from src/Core/Timer.h rename to Core/Timer.h index f4bfd385e37ac8abb4ca15a64ab8d62406940635..b2caf4f5344a427876915adc8ed3f62c3f197dc8 100644 --- a/src/Core/Timer.h +++ b/Core/Timer.h @@ -28,8 +28,8 @@ #include <chrono> // SimMedTK includes -#include "Config.h" -#include "CoreClass.h" +#include "Core/Config.h" +#include "Core/CoreClass.h" /// \brief timer class class Timer: public CoreClass diff --git a/src/Core/UnifiedId.cpp b/Core/UnifiedId.cpp similarity index 97% rename from src/Core/UnifiedId.cpp rename to Core/UnifiedId.cpp index 6f4ef01a7a111e35b85fd63ba4fa54f3478e69b3..03dd2d21e2896c0eafcb109221b79763e12c9c88 100644 --- a/src/Core/UnifiedId.cpp +++ b/Core/UnifiedId.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "UnifiedId.h" +#include "Core/UnifiedId.h" std::atomic_int UnifiedId::IDcounter; UnifiedId::UnifiedId() diff --git a/src/Core/UnifiedId.h b/Core/UnifiedId.h similarity index 100% rename from src/Core/UnifiedId.h rename to Core/UnifiedId.h diff --git a/src/Core/UnitTests/CMakeLists.txt b/Core/UnitTests/CMakeLists.txt similarity index 100% rename from src/Core/UnitTests/CMakeLists.txt rename to Core/UnitTests/CMakeLists.txt diff --git a/src/Core/UnitTests/Factory.cpp b/Core/UnitTests/Factory.cpp similarity index 100% rename from src/Core/UnitTests/Factory.cpp rename to Core/UnitTests/Factory.cpp diff --git a/src/Core/Utils.h b/Core/Utils.h similarity index 100% rename from src/Core/Utils.h rename to Core/Utils.h diff --git a/src/Core/Vector.h b/Core/Vector.h similarity index 100% rename from src/Core/Vector.h rename to Core/Vector.h diff --git a/src/Core/ViewerBase.cpp b/Core/ViewerBase.cpp similarity index 96% rename from src/Core/ViewerBase.cpp rename to Core/ViewerBase.cpp index 9b8b0c5d596909d00881a8a335e9187a30534ab5..a1d892723070feb8076254f12900757e005a086e 100644 --- a/src/Core/ViewerBase.cpp +++ b/Core/ViewerBase.cpp @@ -21,12 +21,11 @@ // Contact: //--------------------------------------------------------------------------- -#include "Config.h" -#include "SDK.h" -#include "IOStream.h" -#include "ViewerBase.h" -#include "DataStructures.h" -#include "External/tree.hh" +#include "Core/Config.h" +#include "Core/SDK.h" +#include "Core/IOStream.h" +#include "Core/ViewerBase.h" +#include "Core/DataStructures.h" RenderOperation::RenderOperation() { @@ -159,7 +158,7 @@ void ViewerBase::processRenderOperation(const RenderOperation &p_rop) } void ViewerBase::registerScene(std::shared_ptr<Scene> p_scene, - smRenderTargetType p_target, + RenderTargetType p_target, const std::string &p_fboName) { RenderOperation rop; diff --git a/src/Core/ViewerBase.h b/Core/ViewerBase.h similarity index 92% rename from src/Core/ViewerBase.h rename to Core/ViewerBase.h index af94e408c27fe084adb2a4dcc4647bcb4444b7a8..98f0dc60cc19d9b19a94b342ef569432478c066d 100644 --- a/src/Core/ViewerBase.h +++ b/Core/ViewerBase.h @@ -25,22 +25,22 @@ #define SMVIEWERBASE_H // SimMedTK includes -#include "Config.h" -#include "Scene.h" -#include "Dispatcher.h" -#include "Module.h" -#include "StaticSceneObject.h" -#include "DataStructures.h" +#include "Core/Config.h" +#include "Core/Scene.h" +#include "Core/Dispatcher.h" +#include "Core/Module.h" +#include "Core/StaticSceneObject.h" +#include "Core/DataStructures.h" // Forward declaration class SDK; -class smOpenGLWindowStream; +class OpenGLWindowStream; class MetalShader; class SceneTextureShader; class FrameBuffer; class Texture; -enum smRenderingStageType +enum RenderingStageType { SMRENDERSTAGE_SHADOWPASS, SMRENDERSTAGE_DPMAPPASS, @@ -48,7 +48,7 @@ enum smRenderingStageType SMRENDERSTAGE_FINALPASS }; -enum smRenderTargetType +enum RenderTargetType { SMRENDERTARGET_SCREEN, SMRENDERTARGET_FBO @@ -61,7 +61,7 @@ struct RenderOperation std::shared_ptr<Scene> scene; ///< The scene full of objects to render FrameBuffer *fbo; ///< Only required if rendering to FBO, specifies the FBO to render to std::string fboName; ///< Only required if rendering to FBO, named reference to look up the FBO pointer - smRenderTargetType target; ///< Specifies where the rendered result should be placed see smRenderTargetType + RenderTargetType target; ///< Specifies where the rendered result should be placed see RenderTargetType }; struct FboListItem @@ -90,7 +90,7 @@ protected: public: - smRenderingStageType renderStage; + RenderingStageType renderStage; ///if the camera motion is enabled from other external devices bool enableCameraMotion; @@ -125,7 +125,7 @@ public: /// \brief enable/disable VSync virtual void setVSync(bool sync) = 0; /// \brief Registers a scene for rendering with the viewer - virtual void registerScene(std::shared_ptr<Scene> p_scene, smRenderTargetType p_target, const std::string &p_fboName); + virtual void registerScene(std::shared_ptr<Scene> p_scene, RenderTargetType p_target, const std::string &p_fboName); /// \brief Adds an FBO to the viewer to allow rendering to it. /// /// \detail The FBO will be created an initialized in the viewer. diff --git a/src/Core/WorkerThread.h b/Core/WorkerThread.h similarity index 98% rename from src/Core/WorkerThread.h rename to Core/WorkerThread.h index 63b2b7cac89bf161606e934cb24959702180392c..91c7c6837ca82e19f6e13225509e2bb27ad57395 100644 --- a/src/Core/WorkerThread.h +++ b/Core/WorkerThread.h @@ -25,8 +25,8 @@ #define SMWORKERTHREAD_H // SimMedTK includes -#include "CoreClass.h" -#include "Synchronization.h" +#include "Core/CoreClass.h" +#include "Core/Synchronization.h" /// \brief process id struct ProcessID diff --git a/src/Devices/ADUInterface.cpp b/Devices/ADUInterface.cpp similarity index 77% rename from src/Devices/ADUInterface.cpp rename to Devices/ADUInterface.cpp index 772010ce77648e7f1f882608ce39f1734daf66d3..7dc0e18e9a33a33f39ef265818ca8d87ef3ff6cd 100644 --- a/src/Devices/ADUInterface.cpp +++ b/Devices/ADUInterface.cpp @@ -26,11 +26,11 @@ #define __CPLUSPLUS -#include "smExternalDevices/smADUInterface.h" +#include "Devices/ADUInterface.h" #include <iostream> #include <fstream> #include <string> -#include "smExternalDevices/AduHid.h" +#include "Devices/AduHid.h" /// \brief default constructor void smADUInterface::init() @@ -57,7 +57,7 @@ smADUInterface::smADUInterface() calibrationData->minValue2 = 0; calibrationData->maxValue2 = 1; - if (openDevice(serialNumber) == Message::Success) + if (openDevice(serialNumber) == SIMMEDTK_MSG_SUCCESS) { std::cout << "ADU USB Device Opened Successfully" << "\n"; } @@ -66,14 +66,14 @@ smADUInterface::smADUInterface() std::cout << "Check the USB connection of the ADU device or the serial number: Couldn't initialize the device" << "\n"; } -// ADUpipe = new smPipe("ADU_Data", sizeof(ADUDeviceData), 10); + ADUpipe = new smPipe("ADU_Data", sizeof(ADUDeviceData), 10); } /// \brief -smADUInterface::smADUInterface(const std::string& calibrationFile) +smADUInterface::smADUInterface(const smString& calibrationFile) { -// Read device serial number and calibration values + // Read device serial number and calibration values isOpened = false; calibrationData = new ADUDeviceCalibrationData(); deviceData = new ADUDeviceData(); @@ -86,10 +86,10 @@ smADUInterface::smADUInterface(const std::string& calibrationFile) std::cout << " Check the location for file : " << deviceData << "\n"; } - std::string buffer; - int i; - std::string t; - std::string s; + smString buffer; + smInt i; + smString t; + smString s; while (!reader.eof()) { @@ -156,10 +156,10 @@ smADUInterface::smADUInterface(const std::string& calibrationFile) reader.close(); std::cout << "Calibration values are : " << calibrationData->minValue1 << " " - << calibrationData->maxValue1 << " " << calibrationData->minValue2 - << " " << calibrationData->maxValue2 << "\n"; + << calibrationData->maxValue1 << " " << calibrationData->minValue2 + << " " << calibrationData->maxValue2 << "\n"; - if (openDevice(serialNumber) == Message::Success) + if (openDevice(serialNumber) == SIMMEDTK_MSG_SUCCESS) { std::cout << "ADU USB Device Opened Successfully" << "\n"; } @@ -168,7 +168,7 @@ smADUInterface::smADUInterface(const std::string& calibrationFile) std::cout << "Check the USB connection of the ADU device or the serial number: Couldn't initialize the device" << "\n"; } -// ADUpipe = new smPipe("ADU_Data", sizeof(ADUDeviceData), 10); + ADUpipe = new smPipe("ADU_Data", sizeof(ADUDeviceData), 10); sw = 0; updateFlag = 0; } @@ -181,7 +181,7 @@ smADUInterface::~smADUInterface() } /// \brief -int smADUInterface::openDevice(const std::string& serialNumber) +smInt smADUInterface::openDevice(const smString& serialNumber) { deviceHandle = OpenAduDeviceBySerialNumber(serialNumber.c_str(), 0); @@ -189,17 +189,17 @@ int smADUInterface::openDevice(const std::string& serialNumber) if ((*((int *)&deviceHandle)) > 0) { isOpened = true; - return Message::Success; + return SIMMEDTK_MSG_SUCCESS; } else { isOpened = false; - return Message::Failure; + return SIMMEDTK_MSG_FAILURE; } } /// \brief -int smADUInterface::closeDevice() +smInt smADUInterface::closeDevice() { CloseAduDevice(deviceHandle); @@ -207,17 +207,17 @@ int smADUInterface::closeDevice() } /// \brief -int* smADUInterface::readAnalogInputs() +smInt* smADUInterface::readAnalogInputs() { return 0; } /// \brief Support for two inputs -int smADUInterface::readAnalogInput(int channel) +smInt smADUInterface::readAnalogInput(int channel) { - std::string command; + smString command; smChar data[8]; if (channel == 0) @@ -242,7 +242,7 @@ void smADUInterface::runDevice() if (isOpened) { - for (int i = 0; i < 2; i++) + for (smInt i = 0; i < 2; i++) { deviceData->anValue[i] = readAnalogInput(i); } @@ -255,17 +255,17 @@ void smADUInterface::runDevice() void smADUInterface::sendDataToPipe() { -// ADUDeviceData *pipeData; -// pipeData = (ADUDeviceData*)ADUpipe->beginWrite(); -// pipeData->calibration[0] = calibrationData->minValue1; -// pipeData->calibration[1] = calibrationData->maxValue1; -// pipeData->calibration[2] = calibrationData->minValue2; -// pipeData->calibration[3] = calibrationData->maxValue2; -// pipeData->anValue[0] = deviceData->anValue[0]; -// pipeData->anValue[1] = deviceData->anValue[1]; -// pipeData->deviceOpen = isOpened; -// ADUpipe->endWrite(1); -// ADUpipe->acknowledgeValueListeners(); + ADUDeviceData *pipeData; + pipeData = (ADUDeviceData*)ADUpipe->beginWrite(); + pipeData->calibration[0] = calibrationData->minValue1; + pipeData->calibration[1] = calibrationData->maxValue1; + pipeData->calibration[2] = calibrationData->minValue2; + pipeData->calibration[3] = calibrationData->maxValue2; + pipeData->anValue[0] = deviceData->anValue[0]; + pipeData->anValue[1] = deviceData->anValue[1]; + pipeData->deviceOpen = isOpened; + ADUpipe->endWrite(1); + ADUpipe->acknowledgeValueListeners(); } /// \brief diff --git a/src/Devices/ADUInterface.h b/Devices/ADUInterface.h similarity index 94% rename from src/Devices/ADUInterface.h rename to Devices/ADUInterface.h index cd753779ec6c1755e6096c38a102126c5cdb76a8..f5c789b55cd350b55043199761bf75162c3ff787 100644 --- a/src/Devices/ADUInterface.h +++ b/Devices/ADUInterface.h @@ -29,7 +29,6 @@ #include "Devices/DeviceInterface.h" #include "Core/Event.h" -#include "Core/smEventData.h" /// \brief holds data for calibration of ADU device struct ADUDeviceCalibrationData @@ -49,18 +48,18 @@ struct ADUDeviceData }; /// \device Interface class for the ADU device -class smADUInterface: public DeviceInterface +class ADUInterface: public DeviceInterface { public: /// \brief constructor - smADUInterface(); + ADUInterface(); /// \brief constructor Open the ADU device with all necessary data recorded in a file - smADUInterface(const std::string& calibrationFile); + ADUInterface(const std::string& calibrationFile); /// \brief destructor - ~smADUInterface(); + ~ADUInterface(); /// \brief Open the ADU device specified by the serial number int openDevice(const std::string& serialNumber); diff --git a/src/Devices/AduHid.h b/Devices/AduHid.h similarity index 100% rename from src/Devices/AduHid.h rename to Devices/AduHid.h diff --git a/src/Devices/Audio.h b/Devices/Audio.h similarity index 100% rename from src/Devices/Audio.h rename to Devices/Audio.h diff --git a/src/Devices/CMakeLists.txt b/Devices/CMakeLists.txt similarity index 100% rename from src/Devices/CMakeLists.txt rename to Devices/CMakeLists.txt diff --git a/src/Devices/DeviceInterface.cpp b/Devices/DeviceInterface.cpp similarity index 100% rename from src/Devices/DeviceInterface.cpp rename to Devices/DeviceInterface.cpp diff --git a/src/Devices/DeviceInterface.h b/Devices/DeviceInterface.h similarity index 100% rename from src/Devices/DeviceInterface.h rename to Devices/DeviceInterface.h diff --git a/src/Devices/HapticInterface.cpp b/Devices/HapticInterface.cpp similarity index 95% rename from src/Devices/HapticInterface.cpp rename to Devices/HapticInterface.cpp index 928d54c34a40ed968b1f017936b0d827186de06a..f290353ef5d88ab6e01207e72d9ebbe1163a4cbb 100644 --- a/src/Devices/HapticInterface.cpp +++ b/Devices/HapticInterface.cpp @@ -22,7 +22,7 @@ //--------------------------------------------------------------------------- -#include "smExternalDevices/HapticInterface.h" +#include "Devices/HapticInterface.h" HapticInterface::HapticInterface() { diff --git a/src/Devices/HapticInterface.h b/Devices/HapticInterface.h similarity index 85% rename from src/Devices/HapticInterface.h rename to Devices/HapticInterface.h index e49d59f8e71143e995072569d89ddd71e4af205a..239a27326402ac720922ced3a079f58cd5e566e3 100644 --- a/src/Devices/HapticInterface.h +++ b/Devices/HapticInterface.h @@ -24,7 +24,7 @@ #ifndef SM_HAPTIC_INTERFACE_H #define SM_HAPTIC_INTERFACE_H -#include "DeviceInterface.h" +#include "External/DeviceInterface.h" #define SM_MAX_BUTTONS 4 @@ -33,10 +33,10 @@ struct hapticDeviceData_t { int deviceID; std::string deviceName; - core::Vec3 <smDouble> position; - core::Vec3 <smDouble> velocity; - core::Vec3 <smDouble> angles; - Matrix44 <smDouble> transform; + core::Vec3d position; + core::Vec3d velocity; + core::Vec3d angles; + Matrix44 transform; bool buttonState[SM_MAX_BUTTONS]; }; @@ -77,13 +77,13 @@ public: } /// \brief get the orientation of the end effector the haptic device - virtual int getOreintation(Matrix33 <smDouble> *d_rot) + virtual int getOreintation(Matrix33 *d_rot) { return Message::Unknown; } /// \brief get the transform (position + orientation) of the end effector the haptic device - virtual int getDeviceTransform(Matrix44 <smDouble> *d_transform) + virtual int getDeviceTransform(Matrix44 *d_transform) { return Message::Unknown; } @@ -95,7 +95,7 @@ public: } /// \brief set torque to the haptic device - virtual int setForceandTorque(core::Vec3 <smDouble>& force, core::Vec3 <smDouble> & torque) + virtual int setForceandTorque(core::Vec3 & force, core::Vec3 & torque) { return Message::Unknown; } diff --git a/src/Devices/NIDAQmx.h b/Devices/NIDAQmx.h similarity index 100% rename from src/Devices/NIDAQmx.h rename to Devices/NIDAQmx.h diff --git a/src/Devices/NIUSB6008Interface.cpp b/Devices/NIUSB6008Interface.cpp similarity index 99% rename from src/Devices/NIUSB6008Interface.cpp rename to Devices/NIUSB6008Interface.cpp index 741ce61fdb806a6982dfdf0e5bd916f19df7028d..61ca8af713b761e4139fe60e030e854e9c7b4c69 100644 --- a/src/Devices/NIUSB6008Interface.cpp +++ b/Devices/NIUSB6008Interface.cpp @@ -21,13 +21,13 @@ // Contact: //--------------------------------------------------------------------------- -#include "Core/smConfig.h" +#include "Core/Config.h" #ifndef __linux__ #include <iostream> #include <fstream> #include <cassert> -#include "smExternalDevices/NIUSB6008Interface.h" +#include "Devices/NIUSB6008Interface.h" #define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else diff --git a/src/Devices/NIUSB6008Interface.h b/Devices/NIUSB6008Interface.h similarity index 96% rename from src/Devices/NIUSB6008Interface.h rename to Devices/NIUSB6008Interface.h index 1fe9162b6fea39fd0060bdb337f3096a91e1673f..b422ccfab8a4467dce7d51d08b220fc0aa4ed904 100644 --- a/src/Devices/NIUSB6008Interface.h +++ b/Devices/NIUSB6008Interface.h @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Core/smConfig.h" +#include "Core/Config.h" #ifndef __linux__ @@ -29,10 +29,8 @@ #define SM_NIUSB6008_INTERFACE_H -#include "smExternalDevices/DeviceInterface.h" +#include "Devices/DeviceInterface.h" #include "Core/Event.h" -#include "Core/smEventData.h" -#include "Core/smPipe.h" #include <NIDAQmx.h> diff --git a/src/Devices/PhantomInterface.cpp b/Devices/PhantomInterface.cpp similarity index 96% rename from src/Devices/PhantomInterface.cpp rename to Devices/PhantomInterface.cpp index 0cabf9ff33f017307f29bb25c8afd28feb0d4c26..ab2e2a199718b3bc466ea5eb9d3014d3ab6c036d 100644 --- a/src/Devices/PhantomInterface.cpp +++ b/Devices/PhantomInterface.cpp @@ -134,21 +134,21 @@ int PhantomInterface::openDevice(int phantomNumber) } /// \brief -int PhantomInterface::getPosition(core::Vec3 <smDouble> &d_pos) +int PhantomInterface::getPosition(core::Vec3d &d_pos) { return Message::Unknown; } /// \brief -int PhantomInterface::getOreintation(Matrix33 <smDouble> *d_rot) +int PhantomInterface::getOreintation(Matrix33d *d_rot) { return Message::Unknown; } /// \brief -int PhantomInterface::getDeviceTransform(Matrix44 <smDouble> *d_transform) +int PhantomInterface::getDeviceTransform(Matrix44d *d_transform) { return Message::Unknown; @@ -158,7 +158,7 @@ int PhantomInterface::getDeviceTransform(Matrix44 <smDouble> *d_transform) int frameCounter = 0; double totalTime = 0.0; int FPS; -smLongDouble timerPerFrame; +long double timerPerFrame; /// \brief HDCallbackCode HDCALLBACK hapticCallback(void *pData) @@ -285,14 +285,11 @@ HDCallbackCode HDCALLBACK hapticCallback(void *pData) void PhantomInterface::handleEvent(std::shared_ptr<core::Event> event) { - smHapticInEventData *hapticEventData; - switch (p_event->eventType.eventTypeCode) { case SIMMEDTK_EVENTTYPE_HAPTICIN: if (forceEnabled) { - hapticEventData = (smHapticInEventData *)p_event->data; force[hapticEventData->deviceId][0] = hapticEventData->force.x; force[hapticEventData->deviceId][1] = hapticEventData->force.y; force[hapticEventData->deviceId][2] = hapticEventData->force.z; diff --git a/src/Devices/PhantomInterface.h b/Devices/PhantomInterface.h similarity index 92% rename from src/Devices/PhantomInterface.h rename to Devices/PhantomInterface.h index 470835aefe3a2239769bcdadcfe1eb1ba416d26a..745de2cb1294005c66bc3978437c9b025f7cdcb4 100644 --- a/src/Devices/PhantomInterface.h +++ b/Devices/PhantomInterface.h @@ -24,10 +24,10 @@ #ifndef SMPHANTOMINTERFACE_H #define SMPHANTOMINTERFACE_H -#include "HapticInterface.h" #include <HD/hd.h> #include <HDU/hduVector.h> #include <HDU/hduError.h> +#include "Devices/HapticInterface.h" #include "Core/EventHandler.h" const int SM_MAX_PHANTOM_DEVICES = 4; @@ -65,13 +65,13 @@ public: int startDevice(); /// \brief get phantom position - int getPosition(core::Vec3 <smDouble>& d_pos); + int getPosition(core::Vec3d& d_pos); /// \brief get phantom orientation - int getOreintation(Matrix33 <smDouble> *d_rot); + int getOreintation(Matrix33d *d_rot); /// \brief get phantom transformation - int getDeviceTransform(Matrix44 <smDouble> *d_transform); + int getDeviceTransform(Matrix44d *d_transform); HHD dHandle[SM_MAX_PHANTOM_DEVICES]; ///< handles for devices available int numPhantomDevices; ///< number of phantom devices @@ -80,7 +80,7 @@ public: hduVector3Dd angles[SM_MAX_PHANTOM_DEVICES]; ///< !! angles of arms hduVector3Dd force[SM_MAX_PHANTOM_DEVICES]; ///< force hduVector3Dd torque[SM_MAX_PHANTOM_DEVICES]; ///< torque (if any) - smDouble transform[SM_MAX_PHANTOM_DEVICES][16]; ///< transforms + Double transform[SM_MAX_PHANTOM_DEVICES][16]; ///< transforms hapticDeviceData_t hapticDeviceData[SM_MAX_PHANTOM_DEVICES]; ///< haptic device data HDSchedulerHandle hapticCallbackHandle; ///< !! diff --git a/documentation/CMakeLists.txt b/Documentation/CMakeLists.txt similarity index 100% rename from documentation/CMakeLists.txt rename to Documentation/CMakeLists.txt diff --git a/documentation/SimMedTK.doxyfile.in b/Documentation/SimMedTK.doxyfile.in similarity index 100% rename from documentation/SimMedTK.doxyfile.in rename to Documentation/SimMedTK.doxyfile.in diff --git a/documentation/Temporary_logo.png b/Documentation/Temporary_logo.png similarity index 100% rename from documentation/Temporary_logo.png rename to Documentation/Temporary_logo.png diff --git a/documentation/conf.py b/Documentation/conf.py similarity index 100% rename from documentation/conf.py rename to Documentation/conf.py diff --git a/documentation/findfigure.py b/Documentation/findfigure.py similarity index 100% rename from documentation/findfigure.py rename to Documentation/findfigure.py diff --git a/documentation/index.rst b/Documentation/index.rst similarity index 100% rename from documentation/index.rst rename to Documentation/index.rst diff --git a/documentation/numfig.py b/Documentation/numfig.py similarity index 100% rename from documentation/numfig.py rename to Documentation/numfig.py diff --git a/documentation/requirements/dev.txt b/Documentation/requirements/dev.txt similarity index 100% rename from documentation/requirements/dev.txt rename to Documentation/requirements/dev.txt diff --git a/documentation/userguide/administration.rst b/Documentation/userguide/administration.rst similarity index 100% rename from documentation/userguide/administration.rst rename to Documentation/userguide/administration.rst diff --git a/documentation/userguide/contributing.rst b/Documentation/userguide/contributing.rst similarity index 100% rename from documentation/userguide/contributing.rst rename to Documentation/userguide/contributing.rst diff --git a/documentation/userguide/figures/SimMedTK-logo.svg b/Documentation/userguide/figures/SimMedTK-logo.svg similarity index 100% rename from documentation/userguide/figures/SimMedTK-logo.svg rename to Documentation/userguide/figures/SimMedTK-logo.svg diff --git a/documentation/userguide/figures/simmedtk-dataflow.svg b/Documentation/userguide/figures/simmedtk-dataflow.svg similarity index 100% rename from documentation/userguide/figures/simmedtk-dataflow.svg rename to Documentation/userguide/figures/simmedtk-dataflow.svg diff --git a/documentation/userguide/figures/simmedtk-interaction-types.svg b/Documentation/userguide/figures/simmedtk-interaction-types.svg similarity index 100% rename from documentation/userguide/figures/simmedtk-interaction-types.svg rename to Documentation/userguide/figures/simmedtk-interaction-types.svg diff --git a/documentation/userguide/figures/simmedtk-mesh-interactions.svg b/Documentation/userguide/figures/simmedtk-mesh-interactions.svg similarity index 100% rename from documentation/userguide/figures/simmedtk-mesh-interactions.svg rename to Documentation/userguide/figures/simmedtk-mesh-interactions.svg diff --git a/documentation/userguide/index.rst b/Documentation/userguide/index.rst similarity index 100% rename from documentation/userguide/index.rst rename to Documentation/userguide/index.rst diff --git a/documentation/userguide/introduction.rst b/Documentation/userguide/introduction.rst similarity index 100% rename from documentation/userguide/introduction.rst rename to Documentation/userguide/introduction.rst diff --git a/src/Event/AudioEvent.cpp b/Event/AudioEvent.cpp similarity index 98% rename from src/Event/AudioEvent.cpp rename to Event/AudioEvent.cpp index 3adccd52d318add6c2c4d52d3a980085cb2557bd..b8825df40371c3b731dd6c303e0462bbea4930fe 100644 --- a/src/Event/AudioEvent.cpp +++ b/Event/AudioEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "AudioEvent.h" +#include "Event/AudioEvent.h" namespace event diff --git a/src/Event/AudioEvent.h b/Event/AudioEvent.h similarity index 100% rename from src/Event/AudioEvent.h rename to Event/AudioEvent.h diff --git a/src/Event/CMakeLists.txt b/Event/CMakeLists.txt similarity index 100% rename from src/Event/CMakeLists.txt rename to Event/CMakeLists.txt diff --git a/src/Event/CameraEvent.cpp b/Event/CameraEvent.cpp similarity index 98% rename from src/Event/CameraEvent.cpp rename to Event/CameraEvent.cpp index 513179936821da6a0bb0fb2dc02a802bca4859a4..c2fe7cb157e9679afe2a96d8f62fb6a902efe7ca 100644 --- a/src/Event/CameraEvent.cpp +++ b/Event/CameraEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "CameraEvent.h" +#include "Event/CameraEvent.h" namespace event { diff --git a/src/Event/CameraEvent.h b/Event/CameraEvent.h similarity index 100% rename from src/Event/CameraEvent.h rename to Event/CameraEvent.h diff --git a/src/Event/HapticEvent.cpp b/Event/HapticEvent.cpp similarity index 98% rename from src/Event/HapticEvent.cpp rename to Event/HapticEvent.cpp index daa897935f8507ecbb7901a46a5b025ae739af17..f2deb43e69eaa657b0486acee993f328a7e19a6c 100644 --- a/src/Event/HapticEvent.cpp +++ b/Event/HapticEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "HapticEvent.h" +#include "Event/HapticEvent.h" namespace event { diff --git a/src/Event/HapticEvent.h b/Event/HapticEvent.h similarity index 100% rename from src/Event/HapticEvent.h rename to Event/HapticEvent.h diff --git a/src/Event/Key.h b/Event/Key.h similarity index 100% rename from src/Event/Key.h rename to Event/Key.h diff --git a/src/Event/KeySFMLInterface.h b/Event/KeySFMLInterface.h similarity index 99% rename from src/Event/KeySFMLInterface.h rename to Event/KeySFMLInterface.h index f9df7b0b4028d26c0673cb8a56265029fc631972..0502756f8029540a74f421fbcf22d67384b27a2f 100644 --- a/src/Event/KeySFMLInterface.h +++ b/Event/KeySFMLInterface.h @@ -24,7 +24,7 @@ #ifndef SMKEYSFMLINTERFACE_H #define SMKEYSFMLINTERFACE_H -#include "Key.h" +#include "Event/Key.h" #include <SFML/Window/Keyboard.hpp> #include <map> diff --git a/src/Event/KeyboardEvent.cpp b/Event/KeyboardEvent.cpp similarity index 97% rename from src/Event/KeyboardEvent.cpp rename to Event/KeyboardEvent.cpp index 74b24b7edc14ac5315dc040d0f5eaddf6c59013c..b22212c2fefeef230aa2d1c060372ab858bc63e2 100644 --- a/src/Event/KeyboardEvent.cpp +++ b/Event/KeyboardEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "KeyboardEvent.h" +#include "Event/KeyboardEvent.h" namespace event { diff --git a/src/Event/KeyboardEvent.h b/Event/KeyboardEvent.h similarity index 98% rename from src/Event/KeyboardEvent.h rename to Event/KeyboardEvent.h index 4abc3bc8f7a3f398dc6be9bb240a8d80c3ab3d08..1cedb37a37f409a4db329dab5c4bdcf17844f063 100644 --- a/src/Event/KeyboardEvent.h +++ b/Event/KeyboardEvent.h @@ -26,7 +26,7 @@ // SimMedTK includes #include "Core/Event.h" -#include "Key.h" +#include "Event/Key.h" namespace event { diff --git a/src/Event/LightMotionEvent.cpp b/Event/LightMotionEvent.cpp similarity index 97% rename from src/Event/LightMotionEvent.cpp rename to Event/LightMotionEvent.cpp index 9d5f58c5f2b5fcf56be27381c97cc8ff420fdca6..51e8a66de33b6728034da4951e2f61ae8cbe613d 100644 --- a/src/Event/LightMotionEvent.cpp +++ b/Event/LightMotionEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "LightMotionEvent.h" +#include "Event/LightMotionEvent.h" namespace event { diff --git a/src/Event/LightMotionEvent.h b/Event/LightMotionEvent.h similarity index 98% rename from src/Event/LightMotionEvent.h rename to Event/LightMotionEvent.h index e2fae4ff91fabadd4fd76847570788969ca53f9a..d32dac72a6c6b373aec6ad99060309f11073435e 100644 --- a/src/Event/LightMotionEvent.h +++ b/Event/LightMotionEvent.h @@ -26,7 +26,7 @@ // SimMedTK includes #include "Core/Event.h" -#include <Core/Vector.h> +#include "Core/Vector.h" namespace event { diff --git a/src/Event/MouseButtonEvent.cpp b/Event/MouseButtonEvent.cpp similarity index 97% rename from src/Event/MouseButtonEvent.cpp rename to Event/MouseButtonEvent.cpp index ca5f9d477319b2456aa51180c953da325d8e0522..dcb6c44536b5733f7eae4ea42e3f7bd449702d26 100644 --- a/src/Event/MouseButtonEvent.cpp +++ b/Event/MouseButtonEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "MouseButtonEvent.h" +#include "Event/MouseButtonEvent.h" namespace event { diff --git a/src/Event/MouseButtonEvent.h b/Event/MouseButtonEvent.h similarity index 100% rename from src/Event/MouseButtonEvent.h rename to Event/MouseButtonEvent.h diff --git a/src/Event/MouseMoveEvent.cpp b/Event/MouseMoveEvent.cpp similarity index 97% rename from src/Event/MouseMoveEvent.cpp rename to Event/MouseMoveEvent.cpp index 5b040eb01940406dab7ec2f24adfd44ac44e587a..4eec3ec5c39e8bf246dd1a288aad9e55ba1a8b68 100644 --- a/src/Event/MouseMoveEvent.cpp +++ b/Event/MouseMoveEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "MouseMoveEvent.h" +#include "Event/MouseMoveEvent.h" namespace event { diff --git a/src/Event/MouseMoveEvent.h b/Event/MouseMoveEvent.h similarity index 100% rename from src/Event/MouseMoveEvent.h rename to Event/MouseMoveEvent.h diff --git a/src/Event/ObjectClickedEvent.cpp b/Event/ObjectClickedEvent.cpp similarity index 97% rename from src/Event/ObjectClickedEvent.cpp rename to Event/ObjectClickedEvent.cpp index 2a296fc3c76f18b712151d5814d6592c50d3499f..0deb4d8ea5d7eb7f7b091d403117d4f83b75a9ff 100644 --- a/src/Event/ObjectClickedEvent.cpp +++ b/Event/ObjectClickedEvent.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "ObjectClickedEvent.h" +#include "Event/ObjectClickedEvent.h" namespace event { diff --git a/src/Event/ObjectClickedEvent.h b/Event/ObjectClickedEvent.h similarity index 98% rename from src/Event/ObjectClickedEvent.h rename to Event/ObjectClickedEvent.h index de978a77b14a484dc9286ff8fce772b8f78015e0..5f296199ee8bd69ab735858e9873a657b0ba1a78 100644 --- a/src/Event/ObjectClickedEvent.h +++ b/Event/ObjectClickedEvent.h @@ -27,7 +27,7 @@ // SimMedTK includes #include "Core/Event.h" -#include <Core/Vector.h> +#include "Core/Vector.h" namespace event { diff --git a/src/Event/UnitTests/CMakeLists.txt b/Event/UnitTests/CMakeLists.txt similarity index 100% rename from src/Event/UnitTests/CMakeLists.txt rename to Event/UnitTests/CMakeLists.txt diff --git a/src/Event/UnitTests/EventHandlerSpec.cpp b/Event/UnitTests/EventHandlerSpec.cpp similarity index 100% rename from src/Event/UnitTests/EventHandlerSpec.cpp rename to Event/UnitTests/EventHandlerSpec.cpp diff --git a/examples/AlphaMap/AlphaMappingExample.cpp b/Examples/AlphaMap/AlphaMappingExample.cpp similarity index 100% rename from examples/AlphaMap/AlphaMappingExample.cpp rename to Examples/AlphaMap/AlphaMappingExample.cpp diff --git a/examples/AlphaMap/AlphaMappingExample.h b/Examples/AlphaMap/AlphaMappingExample.h similarity index 100% rename from examples/AlphaMap/AlphaMappingExample.h rename to Examples/AlphaMap/AlphaMappingExample.h diff --git a/examples/AlphaMap/CMakeLists.txt b/Examples/AlphaMap/CMakeLists.txt similarity index 100% rename from examples/AlphaMap/CMakeLists.txt rename to Examples/AlphaMap/CMakeLists.txt diff --git a/examples/AudioExample/AudioExample.cpp b/Examples/AudioExample/AudioExample.cpp similarity index 100% rename from examples/AudioExample/AudioExample.cpp rename to Examples/AudioExample/AudioExample.cpp diff --git a/examples/AudioExample/AudioExample.h b/Examples/AudioExample/AudioExample.h similarity index 100% rename from examples/AudioExample/AudioExample.h rename to Examples/AudioExample/AudioExample.h diff --git a/examples/AudioExample/CMakeLists.txt b/Examples/AudioExample/CMakeLists.txt similarity index 100% rename from examples/AudioExample/CMakeLists.txt rename to Examples/AudioExample/CMakeLists.txt diff --git a/examples/AudioExample/main.cpp b/Examples/AudioExample/main.cpp similarity index 100% rename from examples/AudioExample/main.cpp rename to Examples/AudioExample/main.cpp diff --git a/examples/CMakeLists.txt b/Examples/CMakeLists.txt similarity index 100% rename from examples/CMakeLists.txt rename to Examples/CMakeLists.txt diff --git a/examples/CollisionDetectionBVH/CMakeLists.txt b/Examples/CollisionDetectionBVH/CMakeLists.txt similarity index 100% rename from examples/CollisionDetectionBVH/CMakeLists.txt rename to Examples/CollisionDetectionBVH/CMakeLists.txt diff --git a/examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp b/Examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp similarity index 98% rename from examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp rename to Examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp index 9110ef45cd8803581e808fc97b2659fddfbcec71..4a843793724195ce1548132057e4c03ac64503ba 100644 --- a/examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp +++ b/Examples/CollisionDetectionBVH/CollisionDetectionBVH.cpp @@ -53,7 +53,7 @@ CollisionDetectionBVH::CollisionDetectionBVH() std::shared_ptr<mstk::Examples::Common::KeyPressSDKShutdown> keyShutdown = std::make_shared<mstk::Examples::Common::KeyPressSDKShutdown>(); // Create dummy simulator - defaultSimulator = std::make_shared<smDummySimulator>(sdk->getErrorLog()); + defaultSimulator = std::make_shared<DummySimulator>(sdk->getErrorLog()); sdk->registerObjectSim(defaultSimulator); // Init texture manager and specify the textures needed for the current application diff --git a/examples/CollisionDetectionBVH/CollisionDetectionBVH.h b/Examples/CollisionDetectionBVH/CollisionDetectionBVH.h similarity index 97% rename from examples/CollisionDetectionBVH/CollisionDetectionBVH.h rename to Examples/CollisionDetectionBVH/CollisionDetectionBVH.h index ff1993ca9c9e10cde6e867c639d8320830cd1c99..64acfbfd785b7c30c9d162eed371b436fcbbfe53 100644 --- a/examples/CollisionDetectionBVH/CollisionDetectionBVH.h +++ b/Examples/CollisionDetectionBVH/CollisionDetectionBVH.h @@ -57,7 +57,7 @@ public: std::shared_ptr<StaticSceneObject> modelB; std::shared_ptr<Scene> scene; std::shared_ptr<Viewer> viewer; - std::shared_ptr<smDummySimulator> defaultSimulator; + std::shared_ptr<DummySimulator> defaultSimulator; std::shared_ptr<Simulator> simulator; std::shared_ptr<MeshToMeshCollision> collisionDetection; int moveObj; diff --git a/examples/CollisionDetectionBVH/main.cpp b/Examples/CollisionDetectionBVH/main.cpp similarity index 100% rename from examples/CollisionDetectionBVH/main.cpp rename to Examples/CollisionDetectionBVH/main.cpp diff --git a/examples/CollisionDetectionSpatialHashing/CMakeLists.txt b/Examples/CollisionDetectionSpatialHashing/CMakeLists.txt similarity index 100% rename from examples/CollisionDetectionSpatialHashing/CMakeLists.txt rename to Examples/CollisionDetectionSpatialHashing/CMakeLists.txt diff --git a/examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp b/Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp similarity index 98% rename from examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp rename to Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp index de10a8d7806261e395e2893fd180232e9f992e74..9a6e60e8eeec6fc8db30b6d6715f22ef755e3991 100644 --- a/examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp +++ b/Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.cpp @@ -55,7 +55,7 @@ CollisionDetectionSpatialHashing::CollisionDetectionSpatialHashing() std::shared_ptr<mstk::Examples::Common::KeyPressSDKShutdown> keyShutdown = std::make_shared<mstk::Examples::Common::KeyPressSDKShutdown>(); // Create dummy simulator - defaultSimulator = std::make_shared<smDummySimulator>(sdk->getErrorLog()); + defaultSimulator = std::make_shared<DummySimulator>(sdk->getErrorLog()); sdk->registerObjectSim(defaultSimulator); // Init texture manager and specify the textures needed for the current application diff --git a/examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h b/Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h similarity index 97% rename from examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h rename to Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h index 23e7f24d5b746697c3790617e75d9f259d091847..377cf405b6ea0b50a885f687b0b243ae78339d69 100644 --- a/examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h +++ b/Examples/CollisionDetectionSpatialHashing/CollisionDetectionSpatialHashing.h @@ -57,7 +57,7 @@ public: std::shared_ptr<StaticSceneObject> modelB; std::shared_ptr<Scene> scene; std::shared_ptr<Viewer> viewer; - std::shared_ptr<smDummySimulator> defaultSimulator; + std::shared_ptr<DummySimulator> defaultSimulator; std::shared_ptr<Simulator> simulator; std::shared_ptr<SpatialHashCollision> spatialHashing; int moveObj; diff --git a/examples/CollisionDetectionSpatialHashing/main.cpp b/Examples/CollisionDetectionSpatialHashing/main.cpp similarity index 100% rename from examples/CollisionDetectionSpatialHashing/main.cpp rename to Examples/CollisionDetectionSpatialHashing/main.cpp diff --git a/examples/ExampleTool/exampleTool.cpp b/Examples/ExampleTool/exampleTool.cpp similarity index 98% rename from examples/ExampleTool/exampleTool.cpp rename to Examples/ExampleTool/exampleTool.cpp index fb96e953addce770af5db802ab530f990f20e5e5..9e63b68696dc02e4c5a001c0b0aae52df099edbb 100644 --- a/examples/ExampleTool/exampleTool.cpp +++ b/Examples/ExampleTool/exampleTool.cpp @@ -86,7 +86,7 @@ void main() Scene *scene1; Viewer *viewer; Simulator *simulator; - smToolSimulator *toolSim; + ToolSimulator *toolSim; ///Initializes the lights Light light("light0", InfiniteLight, Eye); @@ -152,7 +152,7 @@ void main() hapticStylus1getRenderDetail()->renderType = (SIMMEDTK_RENDER_FACES | SIMMEDTK_RENDER_TEXTURE | SIMMEDTK_RENDER_MATERIALCOLOR); ///creates tool simulator - toolSim = new smToolSimulator(SDK::getErrorLog()); + toolSim = new ToolSimulator(SDK::getErrorLog()); ///define the execution of the simulator. toolSim->setExecutionType(SIMMEDTK_SIMEXECUTION_ASYNCMODE); diff --git a/examples/ExampleTool2/exampleTool2.cpp b/Examples/ExampleTool2/exampleTool2.cpp similarity index 96% rename from examples/ExampleTool2/exampleTool2.cpp rename to Examples/ExampleTool2/exampleTool2.cpp index 25b010fd6cc7a96b1248cf8c76e25dede4cf7f87..8bfe444891d8dbf4bc09dab7b7080ca7e4b4e3a6 100644 --- a/examples/ExampleTool2/exampleTool2.cpp +++ b/Examples/ExampleTool2/exampleTool2.cpp @@ -36,7 +36,7 @@ #include "Rendering/metalShader.h" #include "Simulators/ToolSimulator.h" #include "Simulators/ToolSimulator.h" -#include "Tools/curvedGrasper.h" +#include "Tools/CurvedGrasper.h" #include "Rendering/metalShader.h" #include <iostream> @@ -97,12 +97,12 @@ void main() ///register the shader. Otherwise it won't initialize metalShader->registerShader(); - ///tools are maniuplated with smToolSimulator - smToolSimulator *toolSim = new smToolSimulator(SDK::getErrorLog()); + ///tools are maniuplated with ToolSimulator + ToolSimulator *toolSim = new ToolSimulator(SDK::getErrorLog()); ///curved grasper requires device ID and models for pivot, upper and lower mesh - curvedGrasper *curvedTool; - curvedTool = new curvedGrasper(0, "../../resources/models/curved_pivot.3DS", + CurvedGrasper *curvedTool; + curvedTool = new CurvedGrasper(0, "../../resources/models/curved_pivot.3DS", "../../resources/models/curved_upper.3DS", "../../resources/models/curved_lower.3DS"); diff --git a/examples/MultipleObjects/MultipleObjects.cpp b/Examples/MultipleObjects/MultipleObjects.cpp similarity index 95% rename from examples/MultipleObjects/MultipleObjects.cpp rename to Examples/MultipleObjects/MultipleObjects.cpp index cbcee07a1e2716d9c7b7874d02daeb629a09f956..f73df03539066ffa47ac4023da0cbfc74c3c62e9 100644 --- a/examples/MultipleObjects/MultipleObjects.cpp +++ b/Examples/MultipleObjects/MultipleObjects.cpp @@ -32,10 +32,10 @@ void createPBDandFEM() { SDK *simmedtkSDK; - smFemSceneObject *femobj; + FemSceneObject *femobj; smFemSimulator *femSim; - smPBDSurfaceSceneObject *pbdObject; - smPBDObjectSimulator * pbd; + PBDSurfaceSceneObject *pbdObject; + PBDObjectSimulator * pbd; Matrix33d mat; Simulator *simulator; Viewer *viewer; @@ -65,10 +65,10 @@ void createPBDandFEM() simmedtkSDK->getEventDispatcher()->registerEventHandler(femSim, SIMMEDTK_EVENTTYPE_HAPTICOUT); ///create a position dynamics object - pbd = new smPBDObjectSimulator(simmedtkSDK->getErrorLog()); + pbd = new PBDObjectSimulator(simmedtkSDK->getErrorLog()); ///create a FEM object - femobj = new smFemSceneObject(); + femobj = new FemSceneObject(); femobj->v_mesh->LoadTetra("../../resources/models/cylinder_Mesh.txt"); femobj->v_mesh->getSurface("../../resources/models/cylinder_smesh.txt"); femobj->v_mesh->readBC("../../resources/models/cylinder_BC.txt"); @@ -87,7 +87,7 @@ void createPBDandFEM() femobj->attachObjectSimulator(femSim); ///create a position based dynamics(PBD) surface object - pbdObject = new smPBDSurfaceSceneObject(); + pbdObject = new PBDSurfaceSceneObject(); pbdObjectgetRenderDetail()->colorDiffuse = Color::colorWhite; pbdObjectgetRenderDetail()->colorAmbient = Color::colorWhite; pbdObject->mesh->loadMeshLegacy("../../resources/models/clothtextured.3ds", BaseMesh::MeshFileType::ThreeDS); diff --git a/examples/MultipleObjects/MultipleObjects.h b/Examples/MultipleObjects/MultipleObjects.h similarity index 100% rename from examples/MultipleObjects/MultipleObjects.h rename to Examples/MultipleObjects/MultipleObjects.h diff --git a/examples/common/CMakeLists.txt b/Examples/common/CMakeLists.txt similarity index 100% rename from examples/common/CMakeLists.txt rename to Examples/common/CMakeLists.txt diff --git a/examples/common/KeyPressSDKShutdown.cpp b/Examples/common/KeyPressSDKShutdown.cpp similarity index 100% rename from examples/common/KeyPressSDKShutdown.cpp rename to Examples/common/KeyPressSDKShutdown.cpp diff --git a/examples/common/KeyPressSDKShutdown.h b/Examples/common/KeyPressSDKShutdown.h similarity index 100% rename from examples/common/KeyPressSDKShutdown.h rename to Examples/common/KeyPressSDKShutdown.h diff --git a/examples/common/hapticController.cpp b/Examples/common/hapticController.cpp similarity index 97% rename from examples/common/hapticController.cpp rename to Examples/common/hapticController.cpp index b774692fa3e85670898028226d0eb7cfadb95f38..2a71b50378f89e1d0b9dc9f71c0431cc3bf401b3 100644 --- a/examples/common/hapticController.cpp +++ b/Examples/common/hapticController.cpp @@ -37,7 +37,7 @@ void hapticController::handleEvent(std::shared_ptr<core::Event> event) } } -void hapticController::setVegaFemSceneObject(const std::shared_ptr<smVegaFemSceneObject> &femSO) +void hapticController::setVegaFemSceneObject(const std::shared_ptr<VegaFemSceneObject> &femSO) { this->femSceneObject = femSO; } diff --git a/examples/common/hapticController.h b/Examples/common/hapticController.h similarity index 87% rename from examples/common/hapticController.h rename to Examples/common/hapticController.h index bce1e613801d7f9d65e9b390b29fcd7caba55d6e..7b4c640e485ecd06f6be1c77fa578651c2824166 100644 --- a/examples/common/hapticController.h +++ b/Examples/common/hapticController.h @@ -48,11 +48,11 @@ public: /// \brief Set the scene objects which gets affected by this haptic event /// - /// \param scene object of type smVegaFemSceneObject - void setVegaFemSceneObject(const std::shared_ptr<smVegaFemSceneObject> &femSO); + /// \param scene object of type VegaFemSceneObject + void setVegaFemSceneObject(const std::shared_ptr<VegaFemSceneObject> &femSO); private: - std::shared_ptr<smVegaFemSceneObject> femSceneObject; ///< Pointer to the vegafemscene object + std::shared_ptr<VegaFemSceneObject> femSceneObject; ///< Pointer to the vegafemscene object }; }//Common diff --git a/examples/common/pzrMouseCameraController.cpp b/Examples/common/pzrMouseCameraController.cpp similarity index 100% rename from examples/common/pzrMouseCameraController.cpp rename to Examples/common/pzrMouseCameraController.cpp diff --git a/examples/common/pzrMouseCameraController.h b/Examples/common/pzrMouseCameraController.h similarity index 100% rename from examples/common/pzrMouseCameraController.h rename to Examples/common/pzrMouseCameraController.h diff --git a/examples/common/wasdCameraController.cpp b/Examples/common/wasdCameraController.cpp similarity index 100% rename from examples/common/wasdCameraController.cpp rename to Examples/common/wasdCameraController.cpp diff --git a/examples/common/wasdCameraController.h b/Examples/common/wasdCameraController.h similarity index 100% rename from examples/common/wasdCameraController.h rename to Examples/common/wasdCameraController.h diff --git a/examples/renderCube/CMakeLists.txt b/Examples/renderCube/CMakeLists.txt similarity index 100% rename from examples/renderCube/CMakeLists.txt rename to Examples/renderCube/CMakeLists.txt diff --git a/examples/renderCube/main.cpp b/Examples/renderCube/main.cpp similarity index 100% rename from examples/renderCube/main.cpp rename to Examples/renderCube/main.cpp diff --git a/examples/renderCubeOculus/CMakeLists.txt b/Examples/renderCubeOculus/CMakeLists.txt similarity index 100% rename from examples/renderCubeOculus/CMakeLists.txt rename to Examples/renderCubeOculus/CMakeLists.txt diff --git a/examples/renderCubeOculus/main.cpp b/Examples/renderCubeOculus/main.cpp similarity index 100% rename from examples/renderCubeOculus/main.cpp rename to Examples/renderCubeOculus/main.cpp diff --git a/examples/renderCubeToTexture/CMakeLists.txt b/Examples/renderCubeToTexture/CMakeLists.txt similarity index 100% rename from examples/renderCubeToTexture/CMakeLists.txt rename to Examples/renderCubeToTexture/CMakeLists.txt diff --git a/examples/renderCubeToTexture/main.cpp b/Examples/renderCubeToTexture/main.cpp similarity index 100% rename from examples/renderCubeToTexture/main.cpp rename to Examples/renderCubeToTexture/main.cpp diff --git a/examples/renderCubeToTextureOculus/CMakeLists.txt b/Examples/renderCubeToTextureOculus/CMakeLists.txt similarity index 100% rename from examples/renderCubeToTextureOculus/CMakeLists.txt rename to Examples/renderCubeToTextureOculus/CMakeLists.txt diff --git a/examples/renderCubeToTextureOculus/main.cpp b/Examples/renderCubeToTextureOculus/main.cpp similarity index 100% rename from examples/renderCubeToTextureOculus/main.cpp rename to Examples/renderCubeToTextureOculus/main.cpp diff --git a/examples/vegaFem/CMakeLists.txt b/Examples/vegaFem/CMakeLists.txt similarity index 100% rename from examples/vegaFem/CMakeLists.txt rename to Examples/vegaFem/CMakeLists.txt diff --git a/examples/vegaFem/main.cpp b/Examples/vegaFem/main.cpp similarity index 95% rename from examples/vegaFem/main.cpp rename to Examples/vegaFem/main.cpp index 2bbfccf46b41c576f93c58857b52f83303ad3bbd..f97380e10ab8acd0c3b952c18b0ce5f7103227dc 100644 --- a/examples/vegaFem/main.cpp +++ b/Examples/vegaFem/main.cpp @@ -55,10 +55,10 @@ int main() { SIMMEDTK_REGISTER_RENDER_DELEGATES(); std::shared_ptr<SDK> sdk; - std::shared_ptr<smVegaFemSceneObject> femObject; + std::shared_ptr<VegaFemSceneObject> femObject; std::shared_ptr<StaticSceneObject> staticObject; - std::shared_ptr<smVegaFemSimulator> femSimulator; - std::shared_ptr<smDummySimulator> staticSimulator; + std::shared_ptr<VegaFemSimulator> femSimulator; + std::shared_ptr<DummySimulator> staticSimulator; std::shared_ptr<PlaneCollisionModel> plane; std::shared_ptr<Viewer> viewer; std::shared_ptr<Scene> scene; @@ -82,10 +82,10 @@ int main() //------------------------------------------------------- // create a FEM simulator - femSimulator = std::make_shared<smVegaFemSimulator>(sdk->getErrorLog()); + femSimulator = std::make_shared<VegaFemSimulator>(sdk->getErrorLog()); // create a Vega based FEM object and attach it to the fem simulator - femObject = std::make_shared<smVegaFemSceneObject>( + femObject = std::make_shared<VegaFemSceneObject>( sdk->getErrorLog(), "asianDragon/asianDragon.config"); @@ -111,7 +111,7 @@ int main() // Create scene actor 2: plane + dummy simulator //------------------------------------------------------- // Create dummy simulator - staticSimulator = std::make_shared<smDummySimulator>(sdk->getErrorLog()); + staticSimulator = std::make_shared<DummySimulator>(sdk->getErrorLog()); // create a static plane scene object of given normal and position staticObject = std::make_shared<StaticSceneObject>(); diff --git a/src/External/CMakeLists.txt b/External/CMakeLists.txt similarity index 100% rename from src/External/CMakeLists.txt rename to External/CMakeLists.txt diff --git a/src/External/FrameBufferObject.cpp b/External/FrameBufferObject.cpp similarity index 100% rename from src/External/FrameBufferObject.cpp rename to External/FrameBufferObject.cpp diff --git a/src/External/FrameBufferObject.h b/External/FrameBufferObject.h similarity index 100% rename from src/External/FrameBufferObject.h rename to External/FrameBufferObject.h diff --git a/src/External/RenderBuffer.cpp b/External/RenderBuffer.cpp similarity index 100% rename from src/External/RenderBuffer.cpp rename to External/RenderBuffer.cpp diff --git a/src/External/RenderBuffer.h b/External/RenderBuffer.h similarity index 100% rename from src/External/RenderBuffer.h rename to External/RenderBuffer.h diff --git a/src/External/moller.h b/External/moller.h similarity index 100% rename from src/External/moller.h rename to External/moller.h diff --git a/src/External/moller2.h b/External/moller2.h similarity index 100% rename from src/External/moller2.h rename to External/moller2.h diff --git a/src/External/tree.hh b/External/tree.hh similarity index 99% rename from src/External/tree.hh rename to External/tree.hh index 6258f0d485338271ceefe7413f58605ca2df455e..2283297569fb09d69dd19362d8213ba8e4770b92 100644 --- a/src/External/tree.hh +++ b/External/tree.hh @@ -1,5 +1,5 @@ /// WARNING: This file is distributed under the GPL -/// TODO: Removed from the source tree. +/// TODO: Remove from the source tree. // STL-like templated tree class. // diff --git a/src/Geometry/CMakeLists.txt b/Geometry/CMakeLists.txt similarity index 100% rename from src/Geometry/CMakeLists.txt rename to Geometry/CMakeLists.txt diff --git a/src/Geometry/MeshModel.cpp b/Geometry/MeshModel.cpp similarity index 99% rename from src/Geometry/MeshModel.cpp rename to Geometry/MeshModel.cpp index fc17147eac5e9b2f607e352cd4474743148406fa..62006068023b7607682fe916be1d932b87d90e73 100644 --- a/src/Geometry/MeshModel.cpp +++ b/Geometry/MeshModel.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "MeshModel.h" +#include "Geometry/MeshModel.h" #include "Rendering/TextureManager.h" MeshModel::MeshModel() {} diff --git a/src/Geometry/MeshModel.h b/Geometry/MeshModel.h similarity index 98% rename from src/Geometry/MeshModel.h rename to Geometry/MeshModel.h index a3f6e80899bf0b560c46067718a8275c1c525177..256e73599f576af5d7d75f388401522348abd4fc 100644 --- a/src/Geometry/MeshModel.h +++ b/Geometry/MeshModel.h @@ -37,7 +37,7 @@ /// @brief Mesh representation of a model. /// Base class used by all models that can be represented by a mesh /// -/// @see smMeshCollisionModel +/// @see MeshCollisionModel /// class MeshModel : public ModelRepresentation { diff --git a/src/Geometry/PlaneModel.cpp b/Geometry/PlaneModel.cpp similarity index 98% rename from src/Geometry/PlaneModel.cpp rename to Geometry/PlaneModel.cpp index 3c3630c3ce022b1a22ebf734659099e6f1d67ae2..6ce8cf71b720dc895deab93d73a1103bd4ca6e66 100644 --- a/src/Geometry/PlaneModel.cpp +++ b/Geometry/PlaneModel.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "PlaneModel.h" +#include "Geometry/PlaneModel.h" PlaneModel::PlaneModel(const core::Vec3d& p, const core::Vec3d& n) { diff --git a/src/Geometry/PlaneModel.h b/Geometry/PlaneModel.h similarity index 98% rename from src/Geometry/PlaneModel.h rename to Geometry/PlaneModel.h index d8af9a27c9e987af895f1f87eb39098673135148..d3dc4811614d75ff030bfd8a3282167296842e79 100644 --- a/src/Geometry/PlaneModel.h +++ b/Geometry/PlaneModel.h @@ -39,7 +39,7 @@ /// @brief Plane representation of a model. /// Base class used by all models that can be represented by a plane /// -/// @see smPlaneCollisionModel +/// @see PlaneCollisionModel /// class PlaneModel : public ModelRepresentation { diff --git a/src/Geometry/UnitTests/CMakeLists.txt b/Geometry/UnitTests/CMakeLists.txt similarity index 100% rename from src/Geometry/UnitTests/CMakeLists.txt rename to Geometry/UnitTests/CMakeLists.txt diff --git a/src/Geometry/UnitTests/MeshModelSpec.cpp b/Geometry/UnitTests/MeshModelSpec.cpp similarity index 100% rename from src/Geometry/UnitTests/MeshModelSpec.cpp rename to Geometry/UnitTests/MeshModelSpec.cpp diff --git a/src/Mesh/CMakeLists.txt b/Mesh/CMakeLists.txt similarity index 100% rename from src/Mesh/CMakeLists.txt rename to Mesh/CMakeLists.txt diff --git a/src/Mesh/Mesh.cpp b/Mesh/Mesh.cpp similarity index 99% rename from src/Mesh/Mesh.cpp rename to Mesh/Mesh.cpp index 1520ac63e6d4d39c56a089ee43b5f24b11a8be75..628b95c06f8524ea07305e1bb5046d12a85e49f4 100644 --- a/src/Mesh/Mesh.cpp +++ b/Mesh/Mesh.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "Mesh.h" +#include "Mesh/Mesh.h" #include <limits> diff --git a/src/Mesh/Mesh.h b/Mesh/Mesh.h similarity index 99% rename from src/Mesh/Mesh.h rename to Mesh/Mesh.h index 1a1e9c8e5c658964396af2dcb144a293318615ae..58ca6cc9ebbd173eb6a7be1bcf43a4dd46c1f8d3 100644 --- a/src/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -106,7 +106,7 @@ public: } public: - smCollisionGroup collisionGroup; ///< !! + CollisionGroup collisionGroup; ///< !! GLint renderingID; ///< !! std::shared_ptr<ErrorLog> log; ///< record the log core::StdVector3d vertices; ///< vertices co-ordinate data at time t diff --git a/src/Mesh/SurfaceMesh.cpp b/Mesh/SurfaceMesh.cpp similarity index 99% rename from src/Mesh/SurfaceMesh.cpp rename to Mesh/SurfaceMesh.cpp index e7c1dc247c7fca2eeccda05b45ea7f93f7db573e..20c59747370a0e42627aa2edb59d901c5719ef7c 100644 --- a/src/Mesh/SurfaceMesh.cpp +++ b/Mesh/SurfaceMesh.cpp @@ -21,13 +21,14 @@ // Contact: //--------------------------------------------------------------------------- +#include "Mesh/SurfaceMesh.h" + #include <assert.h> //assimp includes #include <assimp/Importer.hpp> #include <assimp/scene.h> #include <assimp/postprocess.h> -#include "SurfaceMesh.h" #ifdef _WIN32 #define fileno _fileno diff --git a/src/Mesh/SurfaceMesh.h b/Mesh/SurfaceMesh.h similarity index 98% rename from src/Mesh/SurfaceMesh.h rename to Mesh/SurfaceMesh.h index 8d86b3435f3b2ab0059331eae6b706e5510905d9..f2a7a48700c6e8d5ab5ca36894875ce2a7b18f59 100644 --- a/src/Mesh/SurfaceMesh.h +++ b/Mesh/SurfaceMesh.h @@ -25,7 +25,7 @@ #define SMSURFACEMESH_H // SimMedTK includes -#include "Mesh.h" +#include "Mesh/Mesh.h" /// \brief this is the Surface Mesh class derived from generic Mesh class. class SurfaceMesh: public Mesh diff --git a/src/Mesh/UnitTests/CMakeLists.txt b/Mesh/UnitTests/CMakeLists.txt similarity index 100% rename from src/Mesh/UnitTests/CMakeLists.txt rename to Mesh/UnitTests/CMakeLists.txt diff --git a/src/Mesh/UnitTests/VegaVolumetricMeshSpec.cpp.in b/Mesh/UnitTests/VegaVolumetricMeshSpec.cpp.in similarity index 100% rename from src/Mesh/UnitTests/VegaVolumetricMeshSpec.cpp.in rename to Mesh/UnitTests/VegaVolumetricMeshSpec.cpp.in diff --git a/src/Mesh/VegaSceneObject.cpp b/Mesh/VegaSceneObject.cpp similarity index 98% rename from src/Mesh/VegaSceneObject.cpp rename to Mesh/VegaSceneObject.cpp index b14778aec149024cb70dba085ad7b69fdaa26cc9..716cd5f8cb9b09c602c55200273a19cc9e7bf3ae 100644 --- a/src/Mesh/VegaSceneObject.cpp +++ b/Mesh/VegaSceneObject.cpp @@ -1,10 +1,11 @@ +#include "Mesh/VegaSceneObject.h" +#include "objMeshEncode.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> #include <float.h> -#include "VegaSceneObject.h" -#include "objMeshEncode.h" VegaSceneObject::VegaSceneObject(char * filename): mesh(NULL) diff --git a/src/Mesh/VegaSceneObject.h b/Mesh/VegaSceneObject.h similarity index 100% rename from src/Mesh/VegaSceneObject.h rename to Mesh/VegaSceneObject.h diff --git a/src/Mesh/VegaSceneObjectDeformable.cpp b/Mesh/VegaSceneObjectDeformable.cpp similarity index 96% rename from src/Mesh/VegaSceneObjectDeformable.cpp rename to Mesh/VegaSceneObjectDeformable.cpp index de71abc5a2c5564663107d14fb460ad20a6c2be7..e068af2c4166b4c7a82c228eff46d07ee142ee68 100644 --- a/src/Mesh/VegaSceneObjectDeformable.cpp +++ b/Mesh/VegaSceneObjectDeformable.cpp @@ -1,8 +1,9 @@ +#include "Mesh/VegaSceneObjectDeformable.h" + #include <stdio.h> #include <stdlib.h> #include <string.h> -#include "VegaSceneObjectDeformable.h" VegaSceneObjectDeformable::VegaSceneObjectDeformable(char * filenameOBJ): VegaSceneObjectWithRestPosition(filenameOBJ) diff --git a/src/Mesh/VegaSceneObjectDeformable.h b/Mesh/VegaSceneObjectDeformable.h similarity index 97% rename from src/Mesh/VegaSceneObjectDeformable.h rename to Mesh/VegaSceneObjectDeformable.h index 43c1e887ea078571e922b75044955fd6d724e600..5ab20bb1e80c17bba1a559e9826427e3dd1e88c4 100644 --- a/src/Mesh/VegaSceneObjectDeformable.h +++ b/Mesh/VegaSceneObjectDeformable.h @@ -6,7 +6,7 @@ #ifndef _SIMMEDTK_VEGASCENEOBJECTDEFORMABLE_H_ #define _SIMMEDTK_VEGASCENEOBJECTDEFORMABLE_H_ -#include "VegaSceneObjectWithRestPosition.h" +#include "Mesh/VegaSceneObjectWithRestPosition.h" class VegaSceneObjectDeformable : public virtual VegaSceneObjectWithRestPosition { diff --git a/src/Mesh/VegaSceneObjectWithRestPosition.cpp b/Mesh/VegaSceneObjectWithRestPosition.cpp similarity index 95% rename from src/Mesh/VegaSceneObjectWithRestPosition.cpp rename to Mesh/VegaSceneObjectWithRestPosition.cpp index 820e3d7d01eca1252f1d74e2d3ddae15be6104a8..f803581ca9c718e52fe3a5c427aba4965f9370ea 100644 --- a/src/Mesh/VegaSceneObjectWithRestPosition.cpp +++ b/Mesh/VegaSceneObjectWithRestPosition.cpp @@ -1,6 +1,8 @@ + +#include "Mesh/VegaSceneObjectWithRestPosition.h" + #include <string.h> #include <stdlib.h> -#include "VegaSceneObjectWithRestPosition.h" VegaSceneObjectWithRestPosition::VegaSceneObjectWithRestPosition(char * filename): VegaSceneObject(filename) { diff --git a/src/Mesh/VegaSceneObjectWithRestPosition.h b/Mesh/VegaSceneObjectWithRestPosition.h similarity index 92% rename from src/Mesh/VegaSceneObjectWithRestPosition.h rename to Mesh/VegaSceneObjectWithRestPosition.h index 3d8c142d02aadcacc4a93e51698a7d4be766424d..029f5db4cfb64b52c1d1bf8ca5ad85fa53b23699 100644 --- a/src/Mesh/VegaSceneObjectWithRestPosition.h +++ b/Mesh/VegaSceneObjectWithRestPosition.h @@ -1,7 +1,7 @@ #ifndef _SIMMEDTK_VEGASCENEOBJECTWITHRESTPOSITION_H_ #define _SIMMEDTK_VEGASCENEOBJECTWITHRESTPOSITION_H_ -#include "VegaSceneObject.h" +#include "Mesh/VegaSceneObject.h" class VegaSceneObjectWithRestPosition: public VegaSceneObject { diff --git a/src/Mesh/VegaVolumetricMesh.cpp b/Mesh/VegaVolumetricMesh.cpp similarity index 99% rename from src/Mesh/VegaVolumetricMesh.cpp rename to Mesh/VegaVolumetricMesh.cpp index 4c9299ad136c69bb2a16d5f4debe505569237e0e..eddd762ee245ca9b13979ff11547495a264e8189 100644 --- a/src/Mesh/VegaVolumetricMesh.cpp +++ b/Mesh/VegaVolumetricMesh.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "VegaVolumetricMesh.h" +#include "Mesh/VegaVolumetricMesh.h" VegaVolumetricMesh::VegaVolumetricMesh(bool generateMeshGraph) : generateGraph(generateMeshGraph) {} VegaVolumetricMesh::~VegaVolumetricMesh() {} diff --git a/src/Mesh/VegaVolumetricMesh.h b/Mesh/VegaVolumetricMesh.h similarity index 99% rename from src/Mesh/VegaVolumetricMesh.h rename to Mesh/VegaVolumetricMesh.h index 14caaf317c1306b0e6c4998a54d49cea46d8a793..89bd8c1cb9350b002366fbb3ebb0f11d3eb87091 100644 --- a/src/Mesh/VegaVolumetricMesh.h +++ b/Mesh/VegaVolumetricMesh.h @@ -30,7 +30,7 @@ #include <map> // SimMedTK includes -#include "SurfaceMesh.h" +#include "Mesh/SurfaceMesh.h" // VEGA includes #include "volumetricMesh.h" diff --git a/src/Mesh/VolumeMesh.cpp b/Mesh/VolumeMesh.cpp similarity index 99% rename from src/Mesh/VolumeMesh.cpp rename to Mesh/VolumeMesh.cpp index 113894f08409b3e5c4256384b6ca47612d6fe82e..4116a43a4182f97f59f2024c9000d5cbe74d1f3e 100644 --- a/src/Mesh/VolumeMesh.cpp +++ b/Mesh/VolumeMesh.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "VolumeMesh.h" +#include "Mesh/VolumeMesh.h" /// \brief constructor diff --git a/src/Mesh/VolumeMesh.h b/Mesh/VolumeMesh.h similarity index 100% rename from src/Mesh/VolumeMesh.h rename to Mesh/VolumeMesh.h diff --git a/src/RenderDelegates/AABBRenderDelegate.cpp b/RenderDelegates/AABBRenderDelegate.cpp similarity index 100% rename from src/RenderDelegates/AABBRenderDelegate.cpp rename to RenderDelegates/AABBRenderDelegate.cpp diff --git a/src/RenderDelegates/CMakeLists.txt b/RenderDelegates/CMakeLists.txt similarity index 100% rename from src/RenderDelegates/CMakeLists.txt rename to RenderDelegates/CMakeLists.txt diff --git a/src/RenderDelegates/Config.h b/RenderDelegates/Config.h similarity index 100% rename from src/RenderDelegates/Config.h rename to RenderDelegates/Config.h diff --git a/src/RenderDelegates/FemSceneRenderDelegate.cpp b/RenderDelegates/FemSceneRenderDelegate.cpp similarity index 88% rename from src/RenderDelegates/FemSceneRenderDelegate.cpp rename to RenderDelegates/FemSceneRenderDelegate.cpp index a14edd66e7e1ad527fb5df5d9a1081ebb9e11db2..fb87c6cb0e2f3ae6a54bc4c7cd10987ead7abac3 100644 --- a/src/RenderDelegates/FemSceneRenderDelegate.cpp +++ b/RenderDelegates/FemSceneRenderDelegate.cpp @@ -11,7 +11,7 @@ public: void FemSceneRenderDelegate::draw() const { - VolumeMesh* v_mesh = this->getSourceGeometryAs<smFemSceneObject>()->v_mesh; + VolumeMesh* v_mesh = this->getSourceGeometryAs<FemSceneObject>()->v_mesh; RenderDelegate::Ptr delegate = v_mesh->getRenderDelegate(); if (delegate) delegate->draw(); diff --git a/src/RenderDelegates/MeshRenderDelegate.cpp b/RenderDelegates/MeshRenderDelegate.cpp similarity index 100% rename from src/RenderDelegates/MeshRenderDelegate.cpp rename to RenderDelegates/MeshRenderDelegate.cpp diff --git a/src/RenderDelegates/PBDSurfaceRenderDelegate.cpp b/RenderDelegates/PBDSurfaceRenderDelegate.cpp similarity index 86% rename from src/RenderDelegates/PBDSurfaceRenderDelegate.cpp rename to RenderDelegates/PBDSurfaceRenderDelegate.cpp index b12756031202abac5b8f37228c8b997f4957d702..1229571d7369ca8b43f150c5c29cb74cecca5252 100644 --- a/src/RenderDelegates/PBDSurfaceRenderDelegate.cpp +++ b/RenderDelegates/PBDSurfaceRenderDelegate.cpp @@ -10,7 +10,7 @@ public: void PBDSurfaceRenderDelegate::draw() const { - SurfaceMesh* mesh = this->getSourceGeometryAs<smPBDSurfaceSceneObject>()->mesh; + SurfaceMesh* mesh = this->getSourceGeometryAs<PBDSurfaceSceneObject>()->mesh; mesh->draw(); } diff --git a/src/RenderDelegates/PlaneRenderDelegate.cpp b/RenderDelegates/PlaneRenderDelegate.cpp similarity index 100% rename from src/RenderDelegates/PlaneRenderDelegate.cpp rename to RenderDelegates/PlaneRenderDelegate.cpp diff --git a/src/RenderDelegates/SceneObjectDeformableRenderDelegate.cpp b/RenderDelegates/SceneObjectDeformableRenderDelegate.cpp similarity index 92% rename from src/RenderDelegates/SceneObjectDeformableRenderDelegate.cpp rename to RenderDelegates/SceneObjectDeformableRenderDelegate.cpp index 2b15503414a8628031a3c650371cbed0638de9dc..edabab9547af11d43c47769524cac558ee17f4eb 100644 --- a/src/RenderDelegates/SceneObjectDeformableRenderDelegate.cpp +++ b/RenderDelegates/SceneObjectDeformableRenderDelegate.cpp @@ -12,7 +12,7 @@ public: void SceneObjectDeformableRenderDelegate::draw() const { - auto geom = this->getSourceGeometryAs<smSceneObjectDeformable>(); + auto geom = this->getSourceGeometryAs<SceneObjectDeformable>(); if (!geom) return; diff --git a/src/RenderDelegates/StaticSceneObjectRenderDelegate.cpp b/RenderDelegates/StaticSceneObjectRenderDelegate.cpp similarity index 100% rename from src/RenderDelegates/StaticSceneObjectRenderDelegate.cpp rename to RenderDelegates/StaticSceneObjectRenderDelegate.cpp diff --git a/src/RenderDelegates/StylusRenderDelegate.cpp b/RenderDelegates/StylusRenderDelegate.cpp similarity index 85% rename from src/RenderDelegates/StylusRenderDelegate.cpp rename to RenderDelegates/StylusRenderDelegate.cpp index 4912be21b3eba18a13520587cb3f83ff8f68ffcf..7d343e166aab1ba24e43f48d0278e3a342aada35 100644 --- a/src/RenderDelegates/StylusRenderDelegate.cpp +++ b/RenderDelegates/StylusRenderDelegate.cpp @@ -1,4 +1,3 @@ - #include "Core/Geometry.h" #include "Core/RenderDelegate.h" #include "Core/Factory.h" @@ -14,9 +13,9 @@ public: void StylusRenderDelegate::initDraw() const { - smStylusRigidSceneObject* geom = this->getSourceGeometryAs<smStylusRigidSceneObject>(); + StylusRigidSceneObject* geom = this->getSourceGeometryAs<StylusRigidSceneObject>(); std::string errorText; - tree<smMeshContainer*>::pre_order_iterator iter = geom->meshes.begin(); + tree<MeshContainer*>::pre_order_iterator iter = geom->meshes.begin(); GLint newList = glGenLists(geom->meshes.size()); GLUtils::queryGLError(errorText); @@ -35,14 +34,14 @@ void StylusRenderDelegate::initDraw() const void StylusRenderDelegate::draw() const { - smStylusRigidSceneObject* geom = this->getSourceGeometryAs<smStylusRigidSceneObject>(); + StylusRigidSceneObject* geom = this->getSourceGeometryAs<StylusRigidSceneObject>(); Matrix44d viewMatrix; for (int i = 0; i < 2; i++) { glMatrixMode(GL_MODELVIEW); glPushMatrix(); - tree<smMeshContainer*>::pre_order_iterator iter = geom->meshes.begin(); + tree<MeshContainer*>::pre_order_iterator iter = geom->meshes.begin(); glPushMatrix(); if (i == 2 && geom->enableDeviceManipulatedTool) diff --git a/src/RenderDelegates/SurfaceTreeRenderDelegate.cpp b/RenderDelegates/SurfaceTreeRenderDelegate.cpp similarity index 100% rename from src/RenderDelegates/SurfaceTreeRenderDelegate.cpp rename to RenderDelegates/SurfaceTreeRenderDelegate.cpp diff --git a/src/Rendering/CMakeLists.txt b/Rendering/CMakeLists.txt similarity index 100% rename from src/Rendering/CMakeLists.txt rename to Rendering/CMakeLists.txt diff --git a/src/Rendering/Camera.cpp b/Rendering/Camera.cpp similarity index 99% rename from src/Rendering/Camera.cpp rename to Rendering/Camera.cpp index 39672b1f9f9a1d32d6e1a4aafcc31714fde20b47..4af479fe34c54ab2ade0956e1ab3c48f1d54e13e 100644 --- a/src/Rendering/Camera.cpp +++ b/Rendering/Camera.cpp @@ -23,7 +23,7 @@ #include "Core/Quaternion.h" #include "Core/Vector.h" -#include "Camera.h" +#include "Rendering/Camera.h" Camera::Camera() : pos(0, 0, 0), diff --git a/src/Rendering/Camera.h b/Rendering/Camera.h similarity index 100% rename from src/Rendering/Camera.h rename to Rendering/Camera.h diff --git a/src/Rendering/ConfigRendering.cpp b/Rendering/ConfigRendering.cpp similarity index 95% rename from src/Rendering/ConfigRendering.cpp rename to Rendering/ConfigRendering.cpp index 3c8fc3319070f8fdb405b5753bec763bdc1ecb2a..e53175a181def251d4c3bbde96e0b201a5d2ff91 100644 --- a/src/Rendering/ConfigRendering.cpp +++ b/Rendering/ConfigRendering.cpp @@ -21,5 +21,5 @@ // Contact: //--------------------------------------------------------------------------- -#include "ConfigRendering.h" +#include "Rendering/ConfigRendering.h" diff --git a/src/Rendering/ConfigRendering.h b/Rendering/ConfigRendering.h similarity index 100% rename from src/Rendering/ConfigRendering.h rename to Rendering/ConfigRendering.h diff --git a/src/Rendering/CustomRenderer.h b/Rendering/CustomRenderer.h similarity index 94% rename from src/Rendering/CustomRenderer.h rename to Rendering/CustomRenderer.h index 5d736100c2eaf50ce2ec0c623c584f6558b4a0a7..6a63cb07054e6409897c6deb9831ab89163e941a 100644 --- a/src/Rendering/CustomRenderer.h +++ b/Rendering/CustomRenderer.h @@ -24,9 +24,10 @@ #ifndef SMCUSTOMRENDERER_H #define SMCUSTOMRENDERER_H + // SimMedTK includes +#include "Rendering/ConfigRendering.h" #include "Core/Config.h" -#include "ConfigRendering.h" #include "Core/CoreClass.h" #include "Core/SceneObject.h" @@ -36,7 +37,7 @@ class SceneObject; /// \brief custom renderer for the object. ///you could draw with one custom renderer with multiple objects. ///This is the reason why the functions are taken objects. -class smCustomRenderer: public CoreClass +class CustomRenderer: public CoreClass { public: @@ -50,7 +51,7 @@ public: }; /// \briefderive this class if you want to render a class in the viewer. -class smCustomRenderInterface +class CustomRenderInterface { virtual void draw(); }; diff --git a/src/Rendering/FrameBuffer.cpp b/Rendering/FrameBuffer.cpp similarity index 98% rename from src/Rendering/FrameBuffer.cpp rename to Rendering/FrameBuffer.cpp index 975674f252fa3fa9e1878d29fea508307f17f691..4fc13ab31f68e3a1b9e2dbb9996031746d9fe115 100644 --- a/src/Rendering/FrameBuffer.cpp +++ b/Rendering/FrameBuffer.cpp @@ -21,11 +21,12 @@ // Contact: //--------------------------------------------------------------------------- +#include "Rendering/FrameBuffer.h" + #include <string.h> -#include "FrameBuffer.h" #include "Core/Config.h" -#include "TextureManager.h" -#include "GLRenderer.h" +#include "Rendering/TextureManager.h" +#include "Rendering/GLRenderer.h" bool FrameBuffer::checkStatus() { diff --git a/src/Rendering/FrameBuffer.h b/Rendering/FrameBuffer.h similarity index 99% rename from src/Rendering/FrameBuffer.h rename to Rendering/FrameBuffer.h index e1c723a45fec4cba0888a29327ed0bac7d8475e1..06b12bfc6406ce61d442280cdc77693194cc1bf9 100644 --- a/src/Rendering/FrameBuffer.h +++ b/Rendering/FrameBuffer.h @@ -33,7 +33,7 @@ #include "Core/ErrorLog.h" #include "External/FrameBufferObject.h" #include "External/RenderBuffer.h" -#include "TextureManager.h" +#include "Rendering/TextureManager.h" /// \brief render buffer type used for frame buffer attachment class RenderBuffer: public CoreClass diff --git a/src/Rendering/GLRenderer.cpp b/Rendering/GLRenderer.cpp similarity index 99% rename from src/Rendering/GLRenderer.cpp rename to Rendering/GLRenderer.cpp index ed5e65f991ec7fdf0466a0f60e89381bb1f73b29..63d842a4256cbb6266032290851ef88cab9e760f 100644 --- a/src/Rendering/GLRenderer.cpp +++ b/Rendering/GLRenderer.cpp @@ -21,12 +21,12 @@ // Contact: //--------------------------------------------------------------------------- -#include "GLRenderer.h" +#include "Rendering/GLRenderer.h" #include "Mesh/Mesh.h" #include "Core/DataStructures.h" -#include "Viewer.h" +#include "Rendering/Viewer.h" #include "Core/Quaternion.h" -#include "VAO.h" +#include "Rendering/VAO.h" #ifndef _MSC_VER # pragma GCC diagnostic ignored "-Wdeprecated-declarations" @@ -605,7 +605,7 @@ void GLRenderer::renderSceneObject(std::shared_ptr<SceneObject> p_sceneObject) //if the custom rendering enable only render this RenderDelegate::Ptr delegate = p_sceneObject->getRenderDelegate(); - std::shared_ptr<smCustomRenderer> renderer = p_sceneObject->getRenderer(); + std::shared_ptr<CustomRenderer> renderer = p_sceneObject->getRenderer(); if (detail->getRenderType() & SIMMEDTK_RENDER_CUSTOMRENDERONLY) { if (renderer != nullptr) diff --git a/src/Rendering/GLRenderer.h b/Rendering/GLRenderer.h similarity index 100% rename from src/Rendering/GLRenderer.h rename to Rendering/GLRenderer.h diff --git a/src/Rendering/GLUtils.cpp b/Rendering/GLUtils.cpp similarity index 98% rename from src/Rendering/GLUtils.cpp rename to Rendering/GLUtils.cpp index 219c13167fba1c5d4cd68f1b8b66ec5464d9b380..39be9c80c8add4ede18f8a19164e0bd7303db61a 100644 --- a/src/Rendering/GLUtils.cpp +++ b/Rendering/GLUtils.cpp @@ -21,8 +21,8 @@ // Contact: //--------------------------------------------------------------------------- -#include "GLUtils.h" -#include "TextureManager.h" +#include "Rendering/GLUtils.h" +#include "Rendering/TextureManager.h" #ifndef _MSC_VER # pragma GCC diagnostic ignored "-Wdeprecated-declarations" diff --git a/src/Rendering/GLUtils.h b/Rendering/GLUtils.h similarity index 99% rename from src/Rendering/GLUtils.h rename to Rendering/GLUtils.h index 0e7bd1708220cfa8562b86e66b58eef7e01e79f8..2030614a537a7e14f4549bcc93708c727fd82e8a 100644 --- a/src/Rendering/GLUtils.h +++ b/Rendering/GLUtils.h @@ -31,7 +31,7 @@ #include "Core/Matrix.h" /// \brief stores the information about the ground -struct smGroundRenderInfo; +struct GroundRenderInfo; /// \brief opengl rendering utilities are here. class GLUtils : public CoreClass diff --git a/src/Rendering/MetalShader.cpp b/Rendering/MetalShader.cpp similarity index 99% rename from src/Rendering/MetalShader.cpp rename to Rendering/MetalShader.cpp index f90ca0c34033bf005128d809ea49d7e381dc2496..fe86265c4cf21721dbc1f5fc1b4562b9af48bd9b 100644 --- a/src/Rendering/MetalShader.cpp +++ b/Rendering/MetalShader.cpp @@ -22,10 +22,10 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "MetalShader.h" +#include "Rendering/MetalShader.h" #include "Core/Event.h" -#include "Event/KeyboardEvent.h" #include "Core/SDK.h" +#include "Event/KeyboardEvent.h" MetalShader::MetalShader( const std::string &p_verteShaderFileName, const std::string &p_fragmentFileName ) : diff --git a/src/Rendering/MetalShader.h b/Rendering/MetalShader.h similarity index 99% rename from src/Rendering/MetalShader.h rename to Rendering/MetalShader.h index 2e158fed9c406e2c36f22bfda09213203e9b4f17..97437aab8c2cb79db471ef83de2ce38193cbd0be 100644 --- a/src/Rendering/MetalShader.h +++ b/Rendering/MetalShader.h @@ -25,7 +25,7 @@ #define METALSHADER_H // SimMedTK includes -#include "Shader.h" +#include "Rendering/Shader.h" namespace mstk{ namespace Event{ diff --git a/src/Rendering/OculusViewer.cpp b/Rendering/OculusViewer.cpp similarity index 99% rename from src/Rendering/OculusViewer.cpp rename to Rendering/OculusViewer.cpp index 23c3afe4e8a9e57411c27320a482df58fed47147..4b856ae18b3b92c3079c4a5fbf52d8a50c7300dd 100644 --- a/src/Rendering/OculusViewer.cpp +++ b/Rendering/OculusViewer.cpp @@ -23,8 +23,8 @@ #include <iostream> -#include "OculusViewer.h" -#include "GLRenderer.h" +#include "Rendering/OculusViewer.h" +#include "Rendering/GLRenderer.h" #include "Core/Quaternion.h" #ifdef _WIN32 || WIN32 diff --git a/src/Rendering/OculusViewer.h b/Rendering/OculusViewer.h similarity index 98% rename from src/Rendering/OculusViewer.h rename to Rendering/OculusViewer.h index 2c808a108420a434f07b4be4cf2830a3b0be89fc..c9a3900b22789c7cfe7e16997985dd2649681a3f 100644 --- a/src/Rendering/OculusViewer.h +++ b/Rendering/OculusViewer.h @@ -25,7 +25,7 @@ #define SMOCULUSVIEWER_H // SimMedTK includes -#include "Viewer.h" +#include "Rendering/Viewer.h" // OculusSDK includes #include <OVR_CAPI_GL.h> diff --git a/src/Rendering/SceneTextureShader.cpp b/Rendering/SceneTextureShader.cpp similarity index 98% rename from src/Rendering/SceneTextureShader.cpp rename to Rendering/SceneTextureShader.cpp index 80e1ddd03b11624be63cd52093240511398530bf..67171266b059c3ecb1d6fae1449b5bc58e445433 100644 --- a/src/Rendering/SceneTextureShader.cpp +++ b/Rendering/SceneTextureShader.cpp @@ -22,7 +22,7 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "SceneTextureShader.h" +#include "Rendering/SceneTextureShader.h" #include "Core/SDK.h" SceneTextureShader::SceneTextureShader(const std::string &p_verteShaderFileName, const std::string &p_fragmentFileName) diff --git a/src/Rendering/SceneTextureShader.h b/Rendering/SceneTextureShader.h similarity index 98% rename from src/Rendering/SceneTextureShader.h rename to Rendering/SceneTextureShader.h index d71ef3ed9ccd573f50295a1929b091c0a74edb45..bd077c0bab45cddc07fd1040c35ee21ca9a233ee 100644 --- a/src/Rendering/SceneTextureShader.h +++ b/Rendering/SceneTextureShader.h @@ -25,7 +25,7 @@ #define SCENETEXTURESHADER_H // SimMedTK includes -#include "Shader.h" +#include "Rendering/Shader.h" namespace core { class Event; diff --git a/src/Rendering/Shader.cpp b/Rendering/Shader.cpp similarity index 99% rename from src/Rendering/Shader.cpp rename to Rendering/Shader.cpp index 76fd361c9ef35500d664ddde0234710a779a3cc1..83b08aa392ce6f5d56e6551b526af87886aff302 100644 --- a/src/Rendering/Shader.cpp +++ b/Rendering/Shader.cpp @@ -21,13 +21,14 @@ // Contact: //--------------------------------------------------------------------------- +#include "Rendering/Shader.h" + // STL includes #include <fstream> #include <iostream> #include <chrono> // SimMedTK includes -#include "Shader.h" #include "TextureManager.h" std::unordered_map<int, std::shared_ptr<Shader>> Shader::shaders; diff --git a/src/Rendering/Shader.h b/Rendering/Shader.h similarity index 99% rename from src/Rendering/Shader.h rename to Rendering/Shader.h index fc4107ea04e95edc5c3b300eb06df33c114007e5..d8e5012b07cdcc0167802b494881dc32eee4934f 100644 --- a/src/Rendering/Shader.h +++ b/Rendering/Shader.h @@ -35,7 +35,7 @@ #include "Core/Config.h" #include "Core/CoreClass.h" #include "Core/ErrorLog.h" -#include "GLUtils.h" +#include "Rendering/GLUtils.h" #include "Core/Timer.h" class Mesh; diff --git a/src/Rendering/TextureManager.cpp b/Rendering/TextureManager.cpp similarity index 96% rename from src/Rendering/TextureManager.cpp rename to Rendering/TextureManager.cpp index 74db3da1c03eb73dc0526ee58c8fb8d1a4aab59e..d19ffee20729000d009911988402e4fc9b7c663e 100644 --- a/src/Rendering/TextureManager.cpp +++ b/Rendering/TextureManager.cpp @@ -21,8 +21,8 @@ // Contact: //--------------------------------------------------------------------------- -#include "TextureManager.h" -#include "GLUtils.h" +#include "Rendering/TextureManager.h" +#include "Rendering/GLUtils.h" #include <cassert> @@ -35,7 +35,7 @@ bool TextureManager::isInitializedGL = false; bool TextureManager::isDeleteImagesEnabled = false; /// \brief -smTextureReturnType TextureManager::initGLTextures() +TextureReturnType TextureManager::initGLTextures() { std::string texManagerError; Texture *texture; @@ -94,10 +94,10 @@ smTextureReturnType TextureManager::initGLTextures() /// \brief load the texture and associated it with reference name. /// Also you could use texture Id for activation of the texture -smTextureReturnType TextureManager::loadTexture(const std::string& p_fileName, +TextureReturnType TextureManager::loadTexture(const std::string& p_fileName, const std::string& p_textureReferenceName, int &p_textureId) { - smTextureReturnType ret = loadTexture(p_fileName, p_textureReferenceName, true); + TextureReturnType ret = loadTexture(p_fileName, p_textureReferenceName, true); if (ret == SIMMEDTK_TEXTURE_OK) { p_textureId = textureIndexId[p_textureReferenceName]; @@ -106,7 +106,7 @@ smTextureReturnType TextureManager::loadTexture(const std::string& p_fileName, } /// \brief -smTextureReturnType TextureManager::loadTexture(const std::string& p_fileName, const std::string& p_textureReferenceName, bool p_flipImage) +TextureReturnType TextureManager::loadTexture(const std::string& p_fileName, const std::string& p_textureReferenceName, bool p_flipImage) { Texture *texture = nullptr; sf::Vector2u imageSize; @@ -145,7 +145,7 @@ smTextureReturnType TextureManager::loadTexture(const std::string& p_fileName, c /// \brief if the texture is not loaded previously, create and the texture return the id -smTextureReturnType TextureManager::findTextureId(const std::string& p_textureReferenceName, +TextureReturnType TextureManager::findTextureId(const std::string& p_textureReferenceName, int &p_textureId) { if (textureIndexId.count(p_textureReferenceName) > 0) diff --git a/src/Rendering/TextureManager.h b/Rendering/TextureManager.h similarity index 94% rename from src/Rendering/TextureManager.h rename to Rendering/TextureManager.h index d70db331069041b0f69fa6d2dcaee24ab97c6176..0178724f17c3a180a5897acb2f06b62df84dde3d 100644 --- a/src/Rendering/TextureManager.h +++ b/Rendering/TextureManager.h @@ -51,7 +51,7 @@ class TextureManager: public CoreClass public: /// \brief init function called by the renderer thread - static smTextureReturnType initGLTextures(); + static TextureReturnType initGLTextures(); /// \brief initialization function static void init(std::shared_ptr<ErrorLog> p_errorLog = nullptr) { @@ -66,15 +66,15 @@ public: } } /// \brief load textures with file name, reference that that is assigned to it, and returned texture id - static smTextureReturnType loadTexture(const std::string& p_fileName, + static TextureReturnType loadTexture(const std::string& p_fileName, const std::string& p_textureReferenceName, int &p_textureId); - static smTextureReturnType loadTexture(const std::string& p_fileName, + static TextureReturnType loadTexture(const std::string& p_fileName, const std::string& p_textureReferenceName, bool p_flipImage = false); - static smTextureReturnType findTextureId(const std::string& p_textureReferenceName, + static TextureReturnType findTextureId(const std::string& p_textureReferenceName, int &p_textureId); /// \brief activate textures based on texture reference name, texture reference, texture id and GL order static GLuint activateTexture(Texture *p_texture); diff --git a/src/Rendering/VAO.cpp b/Rendering/VAO.cpp similarity index 99% rename from src/Rendering/VAO.cpp rename to Rendering/VAO.cpp index 8b68554e64f8efdaaf22fba5ff7d449e8ba66679..0e14c8fa84b525e96259be0264636b075c99e7e8 100644 --- a/src/Rendering/VAO.cpp +++ b/Rendering/VAO.cpp @@ -21,9 +21,9 @@ // Contact: //--------------------------------------------------------------------------- -#include "VAO.h" -#include "Shader.h" -#include "Viewer.h" +#include "Rendering/VAO.h" +#include "Rendering/Shader.h" +#include "Rendering/Viewer.h" std::unordered_map<int, std::shared_ptr<VAO>> VAO::VAOs; diff --git a/src/Rendering/VAO.h b/Rendering/VAO.h similarity index 97% rename from src/Rendering/VAO.h rename to Rendering/VAO.h index 6bfdee268631f9b74bd746d530dabf7a94bddc2e..65c0da5e4845f3673299f34ec581274009c2a548 100644 --- a/src/Rendering/VAO.h +++ b/Rendering/VAO.h @@ -33,11 +33,10 @@ #include "Core/CoreClass.h" #include "ConfigRendering.h" #include "Mesh/Mesh.h" -#include "GLUtils.h" +#include "Rendering/GLUtils.h" #include "Core/Utils.h" -#include "VBO.h" -#include "VAO.h" -#include "Shader.h" +#include "Rendering/VBO.h" +#include "Rendering/Shader.h" enum VBOBufferType { diff --git a/src/Rendering/VBO.cpp b/Rendering/VBO.cpp similarity index 99% rename from src/Rendering/VBO.cpp rename to Rendering/VBO.cpp index 2345e546f9e51afaab1ce17d81a07b4d7289df49..ab6e895e9dea8abe4f822d299291b75c3c5083da 100644 --- a/src/Rendering/VBO.cpp +++ b/Rendering/VBO.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "VBO.h" +#include "Rendering/VBO.h" VBO::VBO( ErrorLog *p_log ) { diff --git a/src/Rendering/VBO.h b/Rendering/VBO.h similarity index 98% rename from src/Rendering/VBO.h rename to Rendering/VBO.h index bfe8cb94679bbeb78504e211a5382a7d3feced20..1c650b09c0c0a495d3a0771a345a43d633090a5d 100644 --- a/src/Rendering/VBO.h +++ b/Rendering/VBO.h @@ -32,8 +32,8 @@ #include "Core/Config.h" #include "Core/CoreClass.h" #include "Mesh/Mesh.h" -#include "ConfigRendering.h" -#include "GLUtils.h" +#include "Rendering/ConfigRendering.h" +#include "Rendering/GLUtils.h" #include "Core/Utils.h" #include "Core/Vector.h" diff --git a/src/Rendering/Viewer.cpp b/Rendering/Viewer.cpp similarity index 98% rename from src/Rendering/Viewer.cpp rename to Rendering/Viewer.cpp index bf4255f289996917c55297639a560009555ef9be..6d2c2705b74e27d835a8633c7b05a1d1ed097d90 100644 --- a/src/Rendering/Viewer.cpp +++ b/Rendering/Viewer.cpp @@ -21,13 +21,13 @@ // Contact: //--------------------------------------------------------------------------- +#include "Rendering/Viewer.h" #include "Core/IOStream.h" -#include "GLRenderer.h" -#include "Viewer.h" -#include "Shader.h" +#include "Rendering/GLRenderer.h" +#include "Rendering/Shader.h" #include "Core/DataStructures.h" -#include "VBO.h" -#include "VAO.h" +#include "Rendering/VBO.h" +#include "Rendering/VAO.h" #include "External/tree.hh" #include "Core/EventHandler.h" @@ -56,7 +56,7 @@ void Viewer::setVSync(bool sync) Viewer::Viewer() { - this->windowOutput = std::make_shared<smOpenGLWindowStream>(); + this->windowOutput = std::make_shared<OpenGLWindowStream>(); } void Viewer::exitViewer() @@ -323,7 +323,7 @@ void Viewer::renderToScreen(const RenderOperation &p_rop) /// \brief Registers a scene for rendering with the viewer void Viewer::registerScene(std::shared_ptr<Scene> p_scene, - smRenderTargetType p_target, + RenderTargetType p_target, const std::string &p_fboName) { RenderOperation rop; diff --git a/src/Rendering/Viewer.h b/Rendering/Viewer.h similarity index 90% rename from src/Rendering/Viewer.h rename to Rendering/Viewer.h index f14f7ea70f0effed941bd1e1690e780f4b8f6071..f9e878638fb638067be83e836908598e037602f0 100644 --- a/src/Rendering/Viewer.h +++ b/Rendering/Viewer.h @@ -29,17 +29,17 @@ // SimMedTK includes #include "Core/ViewerBase.h" -#include "Shader.h" -#include "GLUtils.h" -#include "VBO.h" +#include "Rendering/Shader.h" +#include "Rendering/GLUtils.h" +#include "Rendering/VBO.h" #include "Simulators/PBDSceneObject.h" #include "Core/DataStructures.h" #include "Simulators/StylusObject.h" -#include "FrameBuffer.h" -#include "Camera.h" +#include "Rendering/FrameBuffer.h" +#include "Rendering/Camera.h" //forward declaration -class smOpenGLWindowStream; +class OpenGLWindowStream; /// \brief Handles all rendering routines. class Viewer : public ViewerBase @@ -48,7 +48,7 @@ public: std::unique_ptr<sf::Context> sfmlContext; std::unique_ptr<sf::Window> sfmlWindow; - std::shared_ptr<smOpenGLWindowStream> windowOutput; + std::shared_ptr<OpenGLWindowStream> windowOutput; /// \brief default constructor Viewer(); @@ -67,7 +67,7 @@ public: void setWindowTitle(const std::string &str); /// \brief enable/disable VSync virtual void setVSync(bool sync) override; - virtual void registerScene(std::shared_ptr<Scene> p_scene, smRenderTargetType p_target, const std::string &p_fboName); + virtual void registerScene(std::shared_ptr<Scene> p_scene, RenderTargetType p_target, const std::string &p_fboName); virtual void addFBO(const std::string &p_fboName, Texture *p_colorTex, Texture *p_depthTex, unsigned int p_width, unsigned int p_height); diff --git a/src/Simulators/CMakeLists.txt b/Simulators/CMakeLists.txt similarity index 100% rename from src/Simulators/CMakeLists.txt rename to Simulators/CMakeLists.txt diff --git a/src/Simulators/DummySimulator.cpp b/Simulators/DummySimulator.cpp similarity index 91% rename from src/Simulators/DummySimulator.cpp rename to Simulators/DummySimulator.cpp index 2de4cefee16a5f47c78c0dc65078a1de84eaba0c..297ef3e8309e089580122da5acb9880db0fbd1c3 100644 --- a/src/Simulators/DummySimulator.cpp +++ b/Simulators/DummySimulator.cpp @@ -22,20 +22,20 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "DummySimulator.h" +#include "Simulators/DummySimulator.h" #include "Core/StaticSceneObject.h" #include "Core/Event.h" #include "Event/KeyboardEvent.h" #include "Collision/MeshCollisionModel.h" -smDummySimulator::smDummySimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) +DummySimulator::DummySimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) { } -void smDummySimulator::beginSim() +void DummySimulator::beginSim() { //start the job } -void smDummySimulator::initCustom() +void DummySimulator::initCustom() { //do nothing for now for ( size_t i = 0; i < objectsSimulated.size(); i++ ) @@ -66,7 +66,7 @@ void smDummySimulator::initCustom() } } } -void smDummySimulator::run() +void DummySimulator::run() { beginSim(); @@ -94,11 +94,11 @@ void smDummySimulator::run() endSim(); } -void smDummySimulator::endSim() +void DummySimulator::endSim() { //end the job } -void smDummySimulator::syncBuffers() +void DummySimulator::syncBuffers() { for ( size_t i = 0; i < this->objectsSimulated.size(); i++ ) { @@ -119,7 +119,7 @@ void smDummySimulator::syncBuffers() } } } -void smDummySimulator::handleEvent(std::shared_ptr<core::Event> p_event ) +void DummySimulator::handleEvent(std::shared_ptr<core::Event> p_event ) { if(!this->isListening()) { diff --git a/src/Simulators/DummySimulator.h b/Simulators/DummySimulator.h similarity index 92% rename from src/Simulators/DummySimulator.h rename to Simulators/DummySimulator.h index 0b9364bc579fc67602a34d08c3aaf0441b10750e..54508894847715eb3e782e9a3d3dacbe5f8bd096 100644 --- a/src/Simulators/DummySimulator.h +++ b/Simulators/DummySimulator.h @@ -30,13 +30,13 @@ #include "Core/ErrorLog.h" /// \brief Example simulator. This dummy simulator works on static scene objects for now. -class smDummySimulator: public ObjectSimulator +class DummySimulator: public ObjectSimulator { public: /// \brief constructor - smDummySimulator(std::shared_ptr<ErrorLog> p_errorLog); - virtual ~smDummySimulator(){} + DummySimulator(std::shared_ptr<ErrorLog> p_errorLog); + virtual ~DummySimulator(){} protected: virtual void beginSim() override; diff --git a/src/Simulators/MyStylus.cpp b/Simulators/MyStylus.cpp similarity index 97% rename from src/Simulators/MyStylus.cpp rename to Simulators/MyStylus.cpp index 119439f78040549209517018afd658323a0a407a..c424dfe42dccc8dbab9768a903552344461752d3 100644 --- a/src/Simulators/MyStylus.cpp +++ b/Simulators/MyStylus.cpp @@ -21,11 +21,12 @@ // Contact: //--------------------------------------------------------------------------- +#include "Simulators/MyStylus.h" + // Eigen includes #include "Eigen/Geometry" // SimMedTK includes -#include "MyStylus.h" #include "Mesh/SurfaceMesh.h" #include "Core/SDK.h" #include "Core/Matrix.h" @@ -115,8 +116,8 @@ void MyStylus::handleEvent (std::shared_ptr<core::Event> p_event) auto hapticEvent = std::static_pointer_cast<event::HapticEvent>(p_event); if(hapticEvent != nullptr && hapticEvent->getDeviceId() == this->phantomID) { - smMeshContainer *containerLower = this->getMeshContainer ( "HookCauteryLower" ); - smMeshContainer *containerUpper = this->getMeshContainer ( "HookCauteryUpper" ); + MeshContainer *containerLower = this->getMeshContainer ( "HookCauteryLower" ); + MeshContainer *containerUpper = this->getMeshContainer ( "HookCauteryUpper" ); transRot = hapticEvent->getTransform(); pos = hapticEvent->getPosition(); diff --git a/src/Simulators/MyStylus.h b/Simulators/MyStylus.h similarity index 89% rename from src/Simulators/MyStylus.h rename to Simulators/MyStylus.h index 8483f04cd4e2f2b8ccb5d890bc277c3440586cf1..7c14d385624ed553c62270a7b21679cf8a02c837 100644 --- a/src/Simulators/MyStylus.h +++ b/Simulators/MyStylus.h @@ -28,12 +28,12 @@ #include <memory> // SimMedTK includes -#include "StylusObject.h" +#include "Simulators/StylusObject.h" -class smMeshContainer; +class MeshContainer; /// \brief class for avatar controlled by phantom omni in virtual space -class MyStylus: public smStylusRigidSceneObject +class MyStylus: public StylusRigidSceneObject { public: @@ -41,7 +41,7 @@ public: bool buttonState[4]; ///< state of the buttons float angle; ///< angle of the jaw (if applicable) float maxangle; ///< maximum angle of the jaw (if applicable) - smMeshContainer meshContainer, meshContainerLower, meshContainerUpper; ///< !! + MeshContainer meshContainer, meshContainerLower, meshContainerUpper; ///< !! /// \brief handle keyboard and omni button presses void handleEvent(std::shared_ptr<core::Event> p_event) override; @@ -56,13 +56,13 @@ public: }; /// \brief class for cauter tool avatar in virtual space -class HookCautery: public smStylusRigidSceneObject +class HookCautery: public StylusRigidSceneObject { public: size_t phantomID; ///< ID of the phantom omni bool buttonState[4]; ///< state of the buttons - smMeshContainer meshContainer; ///< !! + MeshContainer meshContainer; ///< !! /// \brief handle keyboard and omni button presses void handleEvent(std::shared_ptr<core::Event> p_event) override; diff --git a/src/Simulators/PBDObjectSimulator.cpp b/Simulators/PBDObjectSimulator.cpp similarity index 86% rename from src/Simulators/PBDObjectSimulator.cpp rename to Simulators/PBDObjectSimulator.cpp index 339b0502507c636caa4a5eba56014233dd409845..4ed303677769bb330d48f488911fb1ed62a73f5f 100644 --- a/src/Simulators/PBDObjectSimulator.cpp +++ b/Simulators/PBDObjectSimulator.cpp @@ -21,27 +21,27 @@ // Contact: //--------------------------------------------------------------------------- -#include "PBDSceneObject.h" -#include "PBDObjectSimulator.h" +#include "Simulators/PBDSceneObject.h" +#include "Simulators/PBDObjectSimulator.h" #include "Rendering/GLRenderer.h" -void smPBDObjectSimulator::draw() +void PBDObjectSimulator::draw() { ObjectSimulator::draw(); - std::shared_ptr<smPBDSurfaceSceneObject> sceneObject; + std::shared_ptr<PBDSurfaceSceneObject> sceneObject; for (size_t i = 0; i < objectsSimulated.size(); i++) { - sceneObject = std::static_pointer_cast<smPBDSurfaceSceneObject>(objectsSimulated[i]); + sceneObject = std::static_pointer_cast<PBDSurfaceSceneObject>(objectsSimulated[i]); GLRenderer::draw(sceneObject->mesh->aabb); } } -smPBDObjectSimulator::smPBDObjectSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) +PBDObjectSimulator::PBDObjectSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) { this->scheduleGroup.maxTargetFPS = 100; this->scheduleGroup.minTargetFPS = 30; } -void smPBDObjectSimulator::initObject( std::shared_ptr<smPBDSurfaceSceneObject> p_object ) +void PBDObjectSimulator::initObject( std::shared_ptr<PBDSurfaceSceneObject> p_object ) { if ( p_object->getFlags().isSimulatorInit ) { @@ -54,11 +54,11 @@ void smPBDObjectSimulator::initObject( std::shared_ptr<smPBDSurfaceSceneObject> p_object->getLocalVertices() = p_object->mesh->vertices; p_object->getFlags().isSimulatorInit = true; } -void smPBDObjectSimulator::initCustom() +void PBDObjectSimulator::initCustom() { core::ClassType type; std::shared_ptr<SceneObject> object; - std::shared_ptr<smPBDSurfaceSceneObject> pbdSurfaceSceneObject; + std::shared_ptr<PBDSurfaceSceneObject> pbdSurfaceSceneObject; //do nothing for now for ( size_t i = 0; i < objectsSimulated.size(); i++ ) @@ -70,7 +70,7 @@ void smPBDObjectSimulator::initCustom() { case core::ClassType::PbdSurfaceSceneObject: { - pbdSurfaceSceneObject = std::static_pointer_cast<smPBDSurfaceSceneObject>(object); + pbdSurfaceSceneObject = std::static_pointer_cast<PBDSurfaceSceneObject>(object); initObject ( pbdSurfaceSceneObject ); break; } @@ -80,10 +80,10 @@ void smPBDObjectSimulator::initCustom() } } } -void smPBDObjectSimulator::run() +void PBDObjectSimulator::run() { std::shared_ptr<SceneObject> sceneObj; - std::shared_ptr<smPBDSurfaceSceneObject> pbdSurfaceSceneObject; + std::shared_ptr<PBDSurfaceSceneObject> pbdSurfaceSceneObject; float dist, lamda; core::Vec3d dirVec, dP; int count = 0; @@ -98,7 +98,7 @@ void smPBDObjectSimulator::run() //ensure that dummy simulator will work on static scene objects only. if ( sceneObj->getType() == core::ClassType::PbdSurfaceSceneObject ) { - pbdSurfaceSceneObject = std::static_pointer_cast<smPBDSurfaceSceneObject>(sceneObj); + pbdSurfaceSceneObject = std::static_pointer_cast<PBDSurfaceSceneObject>(sceneObj); core::StdVector3d &vertices = pbdSurfaceSceneObject->getLocalVertices(); if ( !pbdSurfaceSceneObject->getFlags().isSimulatorInit ) @@ -182,10 +182,10 @@ void smPBDObjectSimulator::run() endSim(); } -void smPBDObjectSimulator::syncBuffers() +void PBDObjectSimulator::syncBuffers() { std::shared_ptr<SceneObject> sceneObj; - std::shared_ptr<smPBDSurfaceSceneObject> pbdSurfaceSceneObject; + std::shared_ptr<PBDSurfaceSceneObject> pbdSurfaceSceneObject; for ( size_t i = 0; i < this->objectsSimulated.size(); i++ ) { @@ -202,7 +202,7 @@ void smPBDObjectSimulator::syncBuffers() } } } -void smPBDObjectSimulator::handleEvent(std::shared_ptr<core::Event> p_event ) +void PBDObjectSimulator::handleEvent(std::shared_ptr<core::Event> p_event ) { ; @@ -211,7 +211,7 @@ void smPBDObjectSimulator::handleEvent(std::shared_ptr<core::Event> p_event ) case SIMMEDTK_EVENTTYPE_KEYBOARD: { auto keyBoardData = - std::static_pointer_cast<smKeyboardEventData>(p_event->getEventData()); + std::static_pointer_cast<KeyboardEventData>(p_event->getEventData()); if ( keyBoardData->keyBoardKey == Key::F1 ) { diff --git a/src/Simulators/PBDObjectSimulator.h b/Simulators/PBDObjectSimulator.h similarity index 88% rename from src/Simulators/PBDObjectSimulator.h rename to Simulators/PBDObjectSimulator.h index 5704076585343d8413a03cb72efbe9fb73cb94ea..9c882658fc65f4622c5530e6534e23c8b2b4bfd3 100644 --- a/src/Simulators/PBDObjectSimulator.h +++ b/Simulators/PBDObjectSimulator.h @@ -29,20 +29,20 @@ #include "Core/EventHandler.h" class ErrorLog; -class smPBDSurfaceSceneObject; +class PBDSurfaceSceneObject; class Event; /// \brief Example Position based dynamics (PBD) simulator -class smPBDObjectSimulator: public ObjectSimulator +class PBDObjectSimulator: public ObjectSimulator { public: /// \brief constructor - smPBDObjectSimulator(std::shared_ptr<ErrorLog> p_errorLog); + PBDObjectSimulator(std::shared_ptr<ErrorLog> p_errorLog); protected: /// \brief initialize the PBD object - void initObject(std::shared_ptr<smPBDSurfaceSceneObject> p_object); + void initObject(std::shared_ptr<PBDSurfaceSceneObject> p_object); /// \brief !! virtual void initCustom(); diff --git a/src/Simulators/PBDSceneObject.cpp b/Simulators/PBDSceneObject.cpp similarity index 79% rename from src/Simulators/PBDSceneObject.cpp rename to Simulators/PBDSceneObject.cpp index 53111713843db66136154f0d2ad31b96bd48d2ee..283acfbe7db9e637777db4479f554631dd841a5d 100644 --- a/src/Simulators/PBDSceneObject.cpp +++ b/Simulators/PBDSceneObject.cpp @@ -21,9 +21,9 @@ // Contact: //--------------------------------------------------------------------------- -#include "PBDSceneObject.h" +#include "Simulators/PBDSceneObject.h" -void smPBDSurfaceSceneObject::findFixedMassWrtSphere(core::Vec3d p_center, float p_radius) +void PBDSurfaceSceneObject::findFixedMassWrtSphere(core::Vec3d p_center, float p_radius) { float dist = 0; @@ -38,43 +38,43 @@ void smPBDSurfaceSceneObject::findFixedMassWrtSphere(core::Vec3d p_center, float } } } -smPBDSceneObject::smPBDSceneObject( std::shared_ptr<ErrorLog>/*p_log*/ ) +PBDSceneObject::PBDSceneObject( std::shared_ptr<ErrorLog>/*p_log*/ ) { type = core::ClassType::PbdSceneObject; } -std::shared_ptr<SceneObject> smPBDSceneObject::clone() +std::shared_ptr<SceneObject> PBDSceneObject::clone() { return safeDownCast<SceneObject>(); } -void smPBDSceneObject::serialize( void */*p_memoryBlock*/ ) +void PBDSceneObject::serialize( void */*p_memoryBlock*/ ) { } -void smPBDSceneObject::unSerialize( void */*p_memoryBlock*/ ) +void PBDSceneObject::unSerialize( void */*p_memoryBlock*/ ) { } -smPBDSurfaceSceneObject::smPBDSurfaceSceneObject( std::shared_ptr<ErrorLog> p_log ) +PBDSurfaceSceneObject::PBDSurfaceSceneObject( std::shared_ptr<ErrorLog> p_log ) { type = core::ClassType::PbdSurfaceSceneObject; mesh = new SurfaceMesh( BaseMesh::MeshType::Deformable, p_log ); } -std::shared_ptr<SceneObject> smPBDSurfaceSceneObject::clone() +std::shared_ptr<SceneObject> PBDSurfaceSceneObject::clone() { return safeDownCast<SceneObject>(); } -void smPBDSurfaceSceneObject::serialize( void */*p_memoryBlock*/ ) +void PBDSurfaceSceneObject::serialize( void */*p_memoryBlock*/ ) { } -void smPBDSurfaceSceneObject::unSerialize( void */*p_memoryBlock*/ ) +void PBDSurfaceSceneObject::unSerialize( void */*p_memoryBlock*/ ) { } -void smPBDSurfaceSceneObject::initMeshStructure() +void PBDSurfaceSceneObject::initMeshStructure() { P = 0; V = 0; @@ -86,7 +86,7 @@ void smPBDSurfaceSceneObject::initMeshStructure() dT = 0.1; Damp = 0.0; } -void smPBDSurfaceSceneObject::InitSurfaceObject() +void PBDSurfaceSceneObject::InitSurfaceObject() { //surface mesh nbrMass = mesh->nbrVertices; @@ -116,7 +116,7 @@ void smPBDSurfaceSceneObject::InitSurfaceObject() mesh->allocateAABBTris(); } -smPBDSurfaceSceneObject::~smPBDSurfaceSceneObject() +PBDSurfaceSceneObject::~PBDSurfaceSceneObject() { if ( P != 0 ) { @@ -143,7 +143,7 @@ smPBDSurfaceSceneObject::~smPBDSurfaceSceneObject() delete [] fixedMass; } } -void smPBDSurfaceSceneObject::findFixedCorners() +void PBDSurfaceSceneObject::findFixedCorners() { nbrFixedMass = 2; diff --git a/src/Simulators/PBDSceneObject.h b/Simulators/PBDSceneObject.h similarity index 91% rename from src/Simulators/PBDSceneObject.h rename to Simulators/PBDSceneObject.h index c992ab225d6c085cfa43c55179f2adf4c73ec193..f0736300b0cdef30abef1eedcd4307cf2f19649b 100644 --- a/src/Simulators/PBDSceneObject.h +++ b/Simulators/PBDSceneObject.h @@ -31,11 +31,11 @@ #include "Mesh/Mesh.h" /// \brief Position based dynamics (PBD) object -class smPBDSceneObject: public SceneObject +class PBDSceneObject: public SceneObject { public: /// \brief constructor - smPBDSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); + PBDSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); /// \brief !! virtual std::shared_ptr<SceneObject> clone(); @@ -73,12 +73,12 @@ public: }; /// \brief Position based dynamics (PBD) object for surface mesh (eg. cloth) -class smPBDSurfaceSceneObject: public smPBDSceneObject +class PBDSurfaceSceneObject: public PBDSceneObject { public: /// \brief constructor - smPBDSurfaceSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); + PBDSurfaceSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); /// \brief !! virtual std::shared_ptr<SceneObject> clone() override; @@ -96,7 +96,7 @@ public: void InitSurfaceObject(); /// \brief destructor - ~smPBDSurfaceSceneObject(); + ~PBDSurfaceSceneObject(); /// \brief find the masses that will be fixed based on the spheres void findFixedMassWrtSphere(core::Vec3d p_center, float pos); @@ -105,7 +105,7 @@ public: void findFixedCorners(); public: - friend class smPBDSurfaceRenderDetail; + friend class PBDSurfaceRenderDetail; SurfaceMesh *mesh; ///< surface mesh int nbrTri; ///< number of surface triangles diff --git a/src/Simulators/SceneObjectDeformable.cpp b/Simulators/SceneObjectDeformable.cpp similarity index 68% rename from src/Simulators/SceneObjectDeformable.cpp rename to Simulators/SceneObjectDeformable.cpp index 370b933223df259dacad5dad06dbfe96ced121f0..434b661fdc3859feaa0413dfbaf0cd991e4563e7 100644 --- a/src/Simulators/SceneObjectDeformable.cpp +++ b/Simulators/SceneObjectDeformable.cpp @@ -22,10 +22,10 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "SceneObjectDeformable.h" +#include "Simulators/SceneObjectDeformable.h" #include "Core/Factory.h" -smSceneObjectDeformable::smSceneObjectDeformable() : +SceneObjectDeformable::SceneObjectDeformable() : renderSecondaryMesh(false), topologyAltered(false), pulledVertex(-1), @@ -37,11 +37,11 @@ smSceneObjectDeformable::smSceneObjectDeformable() : "RenderDelegate", "SceneObjectDeformableRenderDelegate")); } -smSceneObjectDeformable::~smSceneObjectDeformable() +SceneObjectDeformable::~SceneObjectDeformable() { } -void smSceneObjectDeformable::applyContactForces() +void SceneObjectDeformable::applyContactForces() { if (f_contact.size() != 0) { @@ -52,12 +52,12 @@ void smSceneObjectDeformable::applyContactForces() } } -void smSceneObjectDeformable::setContactForcesToZero() +void SceneObjectDeformable::setContactForcesToZero() { f_contact.assign(f_contact.size(), 0.0); } -void smSceneObjectDeformable::setContactForceOfNodeWithDofID(const int dofID, +void SceneObjectDeformable::setContactForceOfNodeWithDofID(const int dofID, const core::Vec3d force) { f_contact[dofID] = force(0); @@ -65,53 +65,53 @@ void smSceneObjectDeformable::setContactForceOfNodeWithDofID(const int dofID, f_contact[dofID + 2] = force(2); } -core::Vec3d smSceneObjectDeformable::getVelocityOfNodeWithDofID(const int dofID) const +core::Vec3d SceneObjectDeformable::getVelocityOfNodeWithDofID(const int dofID) const { core::Vec3d vel(uvel[dofID], uvel[dofID + 1], uvel[dofID + 2]); return vel; } -core::Vec3d smSceneObjectDeformable::getDisplacementOfNodeWithDofID(const int dofID) const +core::Vec3d SceneObjectDeformable::getDisplacementOfNodeWithDofID(const int dofID) const { core::Vec3d disp(u[dofID], u[dofID + 1], u[dofID + 2]); return disp; } -core::Vec3d smSceneObjectDeformable::getAccelerationOfNodeWithDofID(const int dofID) const +core::Vec3d SceneObjectDeformable::getAccelerationOfNodeWithDofID(const int dofID) const { core::Vec3d accn(uaccel[dofID], uaccel[dofID + 1], uaccel[dofID + 2]); return accn; } -int smSceneObjectDeformable::getNumNodes() const +int SceneObjectDeformable::getNumNodes() const { return numNodes; } -int smSceneObjectDeformable::getNumTotalDof() const +int SceneObjectDeformable::getNumTotalDof() const { return numTotalDOF; } -int smSceneObjectDeformable::getNumDof() const +int SceneObjectDeformable::getNumDof() const { return numDOF; } -int smSceneObjectDeformable::getNumFixedNodes() const +int SceneObjectDeformable::getNumFixedNodes() const { return numFixedNodes; } -int smSceneObjectDeformable::getNumFixedDof() const +int SceneObjectDeformable::getNumFixedDof() const { return numFixedDof; } -void smSceneObjectDeformable::setRenderDetail(const std::shared_ptr<RenderDetail> &r) +void SceneObjectDeformable::setRenderDetail(const std::shared_ptr<RenderDetail> &r) { primarySurfaceMesh->setRenderDetail(r); @@ -121,7 +121,7 @@ void smSceneObjectDeformable::setRenderDetail(const std::shared_ptr<RenderDetail } } -void smSceneObjectDeformable::setRenderSecondaryMesh() +void SceneObjectDeformable::setRenderSecondaryMesh() { if (secondarySurfaceMesh != nullptr) { @@ -133,17 +133,17 @@ void smSceneObjectDeformable::setRenderSecondaryMesh() } } -void smSceneObjectDeformable::setRenderPrimaryMesh() +void SceneObjectDeformable::setRenderPrimaryMesh() { renderSecondaryMesh = false; } -std::shared_ptr<SurfaceMesh> smSceneObjectDeformable::getPrimarySurfaceMesh() const +std::shared_ptr<SurfaceMesh> SceneObjectDeformable::getPrimarySurfaceMesh() const { return primarySurfaceMesh; } -std::shared_ptr<SurfaceMesh> smSceneObjectDeformable::getSecondarySurfaceMesh() const +std::shared_ptr<SurfaceMesh> SceneObjectDeformable::getSecondarySurfaceMesh() const { return secondarySurfaceMesh; } diff --git a/src/Simulators/SceneObjectDeformable.h b/Simulators/SceneObjectDeformable.h similarity index 98% rename from src/Simulators/SceneObjectDeformable.h rename to Simulators/SceneObjectDeformable.h index 25436a0dc09d3c53c47204482ab7c36b60df46e7..4bc133211b70350b149b9c66dc69ac51868c4414 100644 --- a/src/Simulators/SceneObjectDeformable.h +++ b/Simulators/SceneObjectDeformable.h @@ -33,15 +33,15 @@ #include "Mesh/VegaSceneObjectDeformable.h" /// \brief Base class for any scene object that is defmormable -class smSceneObjectDeformable : public SceneObject +class SceneObjectDeformable : public SceneObject { public: /// \brief Constructor - smSceneObjectDeformable(); + SceneObjectDeformable(); /// \brief Destructor - ~smSceneObjectDeformable(); + ~SceneObjectDeformable(); /// \brief rest the object to inital configuration /// and reset initial states diff --git a/src/Simulators/StylusObject.cpp b/Simulators/StylusObject.cpp similarity index 67% rename from src/Simulators/StylusObject.cpp rename to Simulators/StylusObject.cpp index c667b4761d288e308900a0dac8440090b8fb6578..d1a18fe8b2291db28495ad4ae2c6ecc91b82a108 100644 --- a/src/Simulators/StylusObject.cpp +++ b/Simulators/StylusObject.cpp @@ -21,13 +21,13 @@ // Contact: //--------------------------------------------------------------------------- -#include "StylusObject.h" +#include "Simulators/StylusObject.h" #include "Collision/SurfaceTree.h" #include "Collision/OctreeCell.h" #include "Mesh/Mesh.h" #include "Rendering/GLUtils.h" -smStylusSceneObject::smStylusSceneObject(std::shared_ptr<ErrorLog>/*p_log*/) : SceneObject() +StylusSceneObject::StylusSceneObject(std::shared_ptr<ErrorLog>/*p_log*/) : SceneObject() { type = core::ClassType::StylusSceneObject; toolEnabled = true; @@ -36,7 +36,7 @@ smStylusSceneObject::smStylusSceneObject(std::shared_ptr<ErrorLog>/*p_log*/) : S "StylusRenderDelegate")); } -smStylusRigidSceneObject::smStylusRigidSceneObject(std::shared_ptr<ErrorLog>/*p_log*/) +StylusRigidSceneObject::StylusRigidSceneObject(std::shared_ptr<ErrorLog>/*p_log*/) { type = core::ClassType::StylusRigidSceneObject; updateViewerMatrixEnabled = true; @@ -45,16 +45,16 @@ smStylusRigidSceneObject::smStylusRigidSceneObject(std::shared_ptr<ErrorLog>/*p_ enableDeviceManipulatedTool = false; } -smStylusDeformableSceneObject::smStylusDeformableSceneObject( +StylusDeformableSceneObject::StylusDeformableSceneObject( std::shared_ptr<ErrorLog>/*p_log*/) - : smStylusSceneObject() + : StylusSceneObject() { type = core::ClassType::StylusSeformableSceneObject; } -smMeshContainer *smStylusRigidSceneObject::getMeshContainer(std::string p_string) const +MeshContainer *StylusRigidSceneObject::getMeshContainer(std::string p_string) const { - tree<smMeshContainer*>::iterator iter = meshes.begin_leaf(); + tree<MeshContainer*>::iterator iter = meshes.begin_leaf(); while (iter != meshes.end_leaf()) { @@ -68,7 +68,7 @@ smMeshContainer *smStylusRigidSceneObject::getMeshContainer(std::string p_string return nullptr; } -void smStylusRigidSceneObject::posTraverseCallBack(smMeshContainer &p_container) +void StylusRigidSceneObject::posTraverseCallBack(MeshContainer &p_container) { if (p_container.colModel != NULL) { @@ -77,7 +77,7 @@ void smStylusRigidSceneObject::posTraverseCallBack(smMeshContainer &p_container) } } -smMeshContainer::smMeshContainer( std::string p_name ) +MeshContainer::MeshContainer( std::string p_name ) { name = p_name; offsetRotX = 0.0; @@ -89,7 +89,7 @@ smMeshContainer::smMeshContainer( std::string p_name ) colModel = NULL; } -smMeshContainer::smMeshContainer( std::string p_name, Mesh */*p_mesh*/, core::Vec3d p_prePos, core::Vec3d p_posPos, float p_offsetRotX, float p_offsetRotY, float p_offsetRotZ ) +MeshContainer::MeshContainer( std::string p_name, Mesh */*p_mesh*/, core::Vec3d p_prePos, core::Vec3d p_posPos, float p_offsetRotX, float p_offsetRotY, float p_offsetRotZ ) { offsetRotX = p_offsetRotX; offsetRotY = p_offsetRotY; @@ -100,7 +100,7 @@ smMeshContainer::smMeshContainer( std::string p_name, Mesh */*p_mesh*/, core::Ve colModel = NULL; } -void smMeshContainer::computeCurrentMatrix() +void MeshContainer::computeCurrentMatrix() { double pipi = 6.28318530717959; Eigen::Affine3d preTranslate( Eigen::Translation3d( preOffsetPos[0], preOffsetPos[1], preOffsetPos[2] ) ); @@ -114,28 +114,28 @@ void smMeshContainer::computeCurrentMatrix() tempCurrentDeviceMatrix *= transform; } -smStylusPoints::smStylusPoints() +StylusPoints::StylusPoints() { point = core::Vec3d::Zero(); container = NULL; } -void smStylusSceneObject::serialize( void */*p_memoryBlock*/ ) +void StylusSceneObject::serialize( void */*p_memoryBlock*/ ) { } -void smStylusSceneObject::unSerialize( void */*p_memoryBlock*/ ) +void StylusSceneObject::unSerialize( void */*p_memoryBlock*/ ) { } -void smStylusSceneObject::handleEvent(std::shared_ptr<core::Event>/*p_event*/ ) {} -void smStylusRigidSceneObject::posTraverseCallBack() +void StylusSceneObject::handleEvent(std::shared_ptr<core::Event>/*p_event*/ ) {} +void StylusRigidSceneObject::posTraverseCallBack() { } -tree< smMeshContainer * >::iterator smStylusRigidSceneObject::addMeshContainer( smMeshContainer *p_meshContainer ) +tree< MeshContainer * >::iterator StylusRigidSceneObject::addMeshContainer( MeshContainer *p_meshContainer ) { - tree<smMeshContainer *>::iterator iter; + tree<MeshContainer *>::iterator iter; if ( meshes.size() > 1 ) { @@ -151,9 +151,9 @@ tree< smMeshContainer * >::iterator smStylusRigidSceneObject::addMeshContainer( return iter; } -bool smStylusRigidSceneObject::addMeshContainer( std::string p_ParentName, smMeshContainer *p_meshContainer ) +bool StylusRigidSceneObject::addMeshContainer( std::string p_ParentName, MeshContainer *p_meshContainer ) { - tree<smMeshContainer *>::iterator iter; + tree<MeshContainer *>::iterator iter; if ( p_ParentName.size() > 0 ) { @@ -174,18 +174,18 @@ bool smStylusRigidSceneObject::addMeshContainer( std::string p_ParentName, smMes } } -tree< smMeshContainer * >::iterator smStylusRigidSceneObject::addMeshContainer( tree< smMeshContainer * >::iterator p_iterator, smMeshContainer *p_meshContainer ) +tree< MeshContainer * >::iterator StylusRigidSceneObject::addMeshContainer( tree< MeshContainer * >::iterator p_iterator, MeshContainer *p_meshContainer ) { return meshes.insert( p_iterator, p_meshContainer ); } -void smStylusRigidSceneObject::handleEvent(std::shared_ptr<core::Event>/*p_event*/ ) {} +void StylusRigidSceneObject::handleEvent(std::shared_ptr<core::Event>/*p_event*/ ) {} -std::shared_ptr<SceneObject> smStylusRigidSceneObject::clone() +std::shared_ptr<SceneObject> StylusRigidSceneObject::clone() { // WARNING: What is the purpose of this function - std::shared_ptr<smStylusRigidSceneObject> ret = std::make_shared<smStylusRigidSceneObject>(); + std::shared_ptr<StylusRigidSceneObject> ret = std::make_shared<StylusRigidSceneObject>(); return ret; } -//void smStylusSceneObject::init() {} +//void StylusSceneObject::init() {} diff --git a/src/Simulators/StylusObject.h b/Simulators/StylusObject.h similarity index 74% rename from src/Simulators/StylusObject.h rename to Simulators/StylusObject.h index 12ddfd1a4f812242205da9e8ae391ac2a6bc5d93..63b8297e81ee9ca86ff6bfc11028aadbdb97bae8 100644 --- a/src/Simulators/StylusObject.h +++ b/Simulators/StylusObject.h @@ -45,17 +45,17 @@ template<typename SurfaceTreeCell> class SurfaceTree; class OctreeCell; /// \brief !! -class smMeshContainer +class MeshContainer { public: using SurfaceTreeType = SurfaceTree<OctreeCell>; public: /// \brief constructor - smMeshContainer(std::string p_name = ""); + MeshContainer(std::string p_name = ""); /// \brief constructor - smMeshContainer(std::string p_name, Mesh *p_mesh, core::Vec3d p_prePos, core::Vec3d p_posPos, float p_offsetRotX, float p_offsetRotY, float p_offsetRotZ); + MeshContainer(std::string p_name, Mesh *p_mesh, core::Vec3d p_prePos, core::Vec3d p_posPos, float p_offsetRotX, float p_offsetRotY, float p_offsetRotZ); void computeCurrentMatrix(); @@ -79,21 +79,21 @@ public: }; /// \brief points on the stylus -struct smStylusPoints +struct StylusPoints { /// \brief constructor - smStylusPoints(); + StylusPoints(); core::Vec3d point; // co-ordinates of points on stylus - smMeshContainer *container; // !! + MeshContainer *container; // !! }; /// \brief stylus object of the scene (typically used for laparascopic VR simulations) -class smStylusSceneObject: public SceneObject +class StylusSceneObject: public SceneObject { public: /// \brief constructor - smStylusSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); + StylusSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); /// \brief !! virtual void serialize(void *p_memoryBlock) override; @@ -117,11 +117,11 @@ protected: }; /// \brief !! -class smStylusRigidSceneObject: public smStylusSceneObject +class StylusRigidSceneObject: public StylusSceneObject { public: - tree<smMeshContainer*> meshes; // meshes representing the stylus - tree<smMeshContainer*>::iterator rootIterator; // !! + tree<MeshContainer*> meshes; // meshes representing the stylus + tree<MeshContainer*>::iterator rootIterator; // !! volatile bool updateViewerMatrixEnabled; // !! /// \brief to show the device tool..It is for debugging god object @@ -131,7 +131,7 @@ public: bool posTraverseCallbackEnabled; /// \brief post traverse callback for each node - virtual void posTraverseCallBack(smMeshContainer &p_container); + virtual void posTraverseCallBack(MeshContainer &p_container); /// \brief Post Traverse callback for the entire object. virtual void posTraverseCallBack(); @@ -139,19 +139,19 @@ public: bool posCallBackEnabledForEntireObject; // !! /// \brief !! - smStylusRigidSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); + StylusRigidSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); /// \brief !! - tree<smMeshContainer*>::iterator addMeshContainer(smMeshContainer *p_meshContainer); + tree<MeshContainer*>::iterator addMeshContainer(MeshContainer *p_meshContainer); /// \brief !! - bool addMeshContainer(std::string p_ParentName, smMeshContainer *p_meshContainer); + bool addMeshContainer(std::string p_ParentName, MeshContainer *p_meshContainer); /// \brief !! - tree<smMeshContainer*>::iterator addMeshContainer(tree<smMeshContainer*>::iterator p_iterator, smMeshContainer *p_meshContainer); + tree<MeshContainer*>::iterator addMeshContainer(tree<MeshContainer*>::iterator p_iterator, MeshContainer *p_meshContainer); /// \brief !! - smMeshContainer *getMeshContainer(std::string p_string) const; + MeshContainer *getMeshContainer(std::string p_string) const; virtual void handleEvent(std::shared_ptr<core::Event> p_event) override; @@ -176,20 +176,20 @@ public: } private: - std::unordered_map<std::string, tree<smMeshContainer*>::iterator> indexIterators; + std::unordered_map<std::string, tree<MeshContainer*>::iterator> indexIterators; }; /// \brief !! -class smStylusDeformableSceneObject: public smStylusSceneObject +class StylusDeformableSceneObject: public StylusSceneObject { public: - smStylusDeformableSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); + StylusDeformableSceneObject(std::shared_ptr<ErrorLog> p_log = nullptr); - ~smStylusDeformableSceneObject(){}; + ~StylusDeformableSceneObject(){}; virtual void initialize() override {}; @@ -202,22 +202,22 @@ public: std::shared_ptr<void> duplicateAtRuntime() { - std::shared_ptr<smStylusDeformableSceneObject> newSO = - std::make_shared<smStylusDeformableSceneObject>(); + std::shared_ptr<StylusDeformableSceneObject> newSO = + std::make_shared<StylusDeformableSceneObject>(); return std::static_pointer_cast<void>(newSO); } std::shared_ptr<void> duplicateAtInitialization() { - std::shared_ptr<smStylusDeformableSceneObject> newSO = - std::make_shared<smStylusDeformableSceneObject>(); + std::shared_ptr<StylusDeformableSceneObject> newSO = + std::make_shared<StylusDeformableSceneObject>(); return std::static_pointer_cast<void>(newSO); } std::shared_ptr<SceneObject> clone() override { // WARNING: What is the purpose of this function - std::shared_ptr<smStylusDeformableSceneObject> ret = std::make_shared<smStylusDeformableSceneObject>(); + std::shared_ptr<StylusDeformableSceneObject> ret = std::make_shared<StylusDeformableSceneObject>(); return ret; } diff --git a/src/Simulators/ToolSimulator.cpp b/Simulators/ToolSimulator.cpp similarity index 86% rename from src/Simulators/ToolSimulator.cpp rename to Simulators/ToolSimulator.cpp index 9ecf83050b07f06414f95690c6b0b32259969c83..51ea6dd73d1b4a77338784f8f1f8a011112c7705 100644 --- a/src/Simulators/ToolSimulator.cpp +++ b/Simulators/ToolSimulator.cpp @@ -21,15 +21,15 @@ // Contact: //--------------------------------------------------------------------------- -#include "ToolSimulator.h" +#include "Simulators/ToolSimulator.h" #include "Core/Event.h" #include "Event/KeyboardEvent.h" -void smToolSimulator::updateTool(std::shared_ptr<smStylusRigidSceneObject> p_tool) +void ToolSimulator::updateTool(std::shared_ptr<StylusRigidSceneObject> p_tool) { Matrix44d tempMat, tempMatDevice; Matrix44d mat; - tree<smMeshContainer*>::pre_order_iterator iter = p_tool->meshes.begin(); + tree<MeshContainer*>::pre_order_iterator iter = p_tool->meshes.begin(); //update the Root node first iter.node->data->computeCurrentMatrix(); tempMat = p_tool->transRot * iter.node->data->tempCurrentMatrix; @@ -79,15 +79,15 @@ void smToolSimulator::updateTool(std::shared_ptr<smStylusRigidSceneObject> p_too } } -smToolSimulator::smToolSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) +ToolSimulator::ToolSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) { } -void smToolSimulator::initCustom() +void ToolSimulator::initCustom() { } -void smToolSimulator::run() +void ToolSimulator::run() { while ( true && this->enabled ) @@ -101,7 +101,7 @@ void smToolSimulator::run() //ensure that dummy simulator will work on static scene objects only. if ( sceneObj->getType() == core::ClassType::StylusRigidSceneObject ) { - auto tool = std::static_pointer_cast<smStylusRigidSceneObject>(sceneObj); + auto tool = std::static_pointer_cast<StylusRigidSceneObject>(sceneObj); if ( tool->toolEnabled ) { @@ -114,11 +114,11 @@ void smToolSimulator::run() } } -void smToolSimulator::syncBuffers() +void ToolSimulator::syncBuffers() { } -void smToolSimulator::handleEvent(std::shared_ptr<core::Event> p_event ) +void ToolSimulator::handleEvent(std::shared_ptr<core::Event> p_event ) { if(!this->isListening()) { diff --git a/src/Simulators/ToolSimulator.h b/Simulators/ToolSimulator.h similarity index 88% rename from src/Simulators/ToolSimulator.h rename to Simulators/ToolSimulator.h index b91ae4bd0b8a6ef6e242210432c1b3c31ab1f1da..d41e8fe4342ed4befcc2de170f6510a7f568c600 100644 --- a/src/Simulators/ToolSimulator.h +++ b/Simulators/ToolSimulator.h @@ -27,20 +27,20 @@ // SimMedTK includes #include "Core/Config.h" #include "Core/ObjectSimulator.h" -#include "StylusObject.h" +#include "Simulators/StylusObject.h" #include "Core/ErrorLog.h" /// \brief Example tool simulator -class smToolSimulator: public ObjectSimulator +class ToolSimulator: public ObjectSimulator { public: /// \brief constructor - smToolSimulator(std::shared_ptr<ErrorLog> p_errorLog); + ToolSimulator(std::shared_ptr<ErrorLog> p_errorLog); /// \brief update everything related to tool - void updateTool(std::shared_ptr<smStylusRigidSceneObject> p_tool); + void updateTool(std::shared_ptr<StylusRigidSceneObject> p_tool); /// \brief !! virtual void initCustom() override; diff --git a/src/Simulators/VegaFemSceneObject.cpp b/Simulators/VegaFemSceneObject.cpp similarity index 91% rename from src/Simulators/VegaFemSceneObject.cpp rename to Simulators/VegaFemSceneObject.cpp index 8a9ac6fc6d60c1d85638e7b561ff25f6f418d185..a3fe9c0cb57e5f481f3919ed4c6b46f7fe0aedfe 100644 --- a/src/Simulators/VegaFemSceneObject.cpp +++ b/Simulators/VegaFemSceneObject.cpp @@ -22,13 +22,13 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "VegaFemSceneObject.h" +#include "Simulators/VegaFemSceneObject.h" #include "Core/Factory.h" #include "Core/RenderDelegate.h" #include <exception> -smVegaFemSceneObject::smVegaFemSceneObject() : +VegaFemSceneObject::VegaFemSceneObject() : staticSolver(0), graphicFrame(0), explosionFlag(0), @@ -46,7 +46,7 @@ smVegaFemSceneObject::smVegaFemSceneObject() : "SceneObjectDeformableRenderDelegate")); } -smVegaFemSceneObject::smVegaFemSceneObject(const std::shared_ptr<ErrorLog> /*p_log*/, +VegaFemSceneObject::VegaFemSceneObject(const std::shared_ptr<ErrorLog> /*p_log*/, const std::string ConfigFile): staticSolver(0), graphicFrame(0), @@ -73,18 +73,18 @@ smVegaFemSceneObject::smVegaFemSceneObject(const std::shared_ptr<ErrorLog> /*p_l initialize(); } -smVegaFemSceneObject::~smVegaFemSceneObject() +VegaFemSceneObject::~VegaFemSceneObject() { } -std::shared_ptr<SceneObject> smVegaFemSceneObject::clone() +std::shared_ptr<SceneObject> VegaFemSceneObject::clone() { return safeDownCast<SceneObject>(); } -bool smVegaFemSceneObject::configure(const std::string ConfigFile) +bool VegaFemSceneObject::configure(const std::string ConfigFile) { - femConfig = std::make_shared<smVegaObjectConfig>(); + femConfig = std::make_shared<VegaObjectConfig>(); if (ConfigFile.compare("__none") != 0) { @@ -104,7 +104,7 @@ bool smVegaFemSceneObject::configure(const std::string ConfigFile) } } -void smVegaFemSceneObject::resetToInitialState() +void VegaFemSceneObject::resetToInitialState() { if (!topologyAltered) { @@ -129,7 +129,7 @@ void smVegaFemSceneObject::resetToInitialState() } } -void smVegaFemSceneObject::initialize() +void VegaFemSceneObject::initialize() { setDeformableModelType(); loadVolumeMesh(); @@ -194,7 +194,7 @@ void smVegaFemSceneObject::initialize() } } -void smVegaFemSceneObject::setDeformableModelType() +void VegaFemSceneObject::setDeformableModelType() { // set deformable material type @@ -202,40 +202,40 @@ void smVegaFemSceneObject::setDeformableModelType() { if (strcmp(femConfig->deformableObjectMethod, "StVK") == 0) { - femConfig->deformableObject = smVegaObjectConfig::STVK; + femConfig->deformableObject = VegaObjectConfig::STVK; } if (strcmp(femConfig->deformableObjectMethod, "CLFEM") == 0) { - femConfig->deformableObject = smVegaObjectConfig::COROTLINFEM; + femConfig->deformableObject = VegaObjectConfig::COROTLINFEM; } if (strcmp(femConfig->deformableObjectMethod, "LinearFEM") == 0) { - femConfig->deformableObject = smVegaObjectConfig::LINFEM; + femConfig->deformableObject = VegaObjectConfig::LINFEM; } if (strcmp(femConfig->deformableObjectMethod, "InvertibleFEM") == 0) { - femConfig->deformableObject = smVegaObjectConfig::INVERTIBLEFEM; + femConfig->deformableObject = VegaObjectConfig::INVERTIBLEFEM; } } - if (femConfig->deformableObject == smVegaObjectConfig::UNSPECIFIED) + if (femConfig->deformableObject == VegaObjectConfig::UNSPECIFIED) { PRINT_ERROR_LOCATION std::cout << "VEGA: error! no deformable model specified." << std::endl; } } -void smVegaFemSceneObject::loadVolumeMesh() +void VegaFemSceneObject::loadVolumeMesh() { // load mesh - if ((femConfig->deformableObject == smVegaObjectConfig::STVK) || - (femConfig->deformableObject == smVegaObjectConfig::COROTLINFEM) || - (femConfig->deformableObject == smVegaObjectConfig::LINFEM) || - (femConfig->deformableObject == smVegaObjectConfig::INVERTIBLEFEM)) + if ((femConfig->deformableObject == VegaObjectConfig::STVK) || + (femConfig->deformableObject == VegaObjectConfig::COROTLINFEM) || + (femConfig->deformableObject == VegaObjectConfig::LINFEM) || + (femConfig->deformableObject == VegaObjectConfig::INVERTIBLEFEM)) { std::cout << "VEGA: Loading volumetric mesh from file " @@ -303,8 +303,8 @@ void smVegaFemSceneObject::loadVolumeMesh() massMatrix = std::make_shared<SparseMatrix>(massMatrixOutline.get()); - if (femConfig->deformableObject == smVegaObjectConfig::STVK || - femConfig->deformableObject == smVegaObjectConfig::LINFEM) + if (femConfig->deformableObject == VegaObjectConfig::STVK || + femConfig->deformableObject == VegaObjectConfig::LINFEM) { unsigned int loadingFlag = 0; // 0 = use low-memory version, 1 = use high-memory version @@ -350,7 +350,7 @@ void smVegaFemSceneObject::loadVolumeMesh() } } -void smVegaFemSceneObject::loadSurfaceMesh() +void VegaFemSceneObject::loadSurfaceMesh() { // initialize the rendering mesh for the volumetric mesh if (strcmp(femConfig->renderingMeshFilename, "__none") == 0) @@ -444,7 +444,7 @@ void smVegaFemSceneObject::loadSurfaceMesh() } } -int smVegaFemSceneObject::readBcFromFile(const char* filename, const int offset) +int VegaFemSceneObject::readBcFromFile(const char* filename, const int offset) { // comma-separated text file of fixed vertices FILE * fin; @@ -496,7 +496,7 @@ int smVegaFemSceneObject::readBcFromFile(const char* filename, const int offset) return 0; } -void smVegaFemSceneObject::loadFixedBC() +void VegaFemSceneObject::loadFixedBC() { // read the fixed vertices // 1-indexed notation @@ -526,7 +526,7 @@ void smVegaFemSceneObject::loadFixedBC() std::cout << "VEGA: Fixed boundary vertices loaded.\n"; } -void smVegaFemSceneObject::loadInitialStates() +void VegaFemSceneObject::loadInitialStates() { // load initial condition if (strcmp(femConfig->initialPositionFilename, "__none") != 0) @@ -562,7 +562,7 @@ void smVegaFemSceneObject::loadInitialStates() } } -void smVegaFemSceneObject::loadScriptedExternalForces() +void VegaFemSceneObject::loadScriptedExternalForces() { // load force loads int numForceLoads = forceLoads.size(); @@ -580,7 +580,7 @@ void smVegaFemSceneObject::loadScriptedExternalForces() } } -void smVegaFemSceneObject::initializeTimeIntegrator() +void VegaFemSceneObject::initializeTimeIntegrator() { int numFixedDOFs = 3 * numFixedNodes; @@ -592,7 +592,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() integratorBaseSparse = nullptr; - if (femConfig->solver == smVegaObjectConfig::IMPLICITNEWMARK) + if (femConfig->solver == VegaObjectConfig::IMPLICITNEWMARK) { implicitNewmarkSparse = std::make_shared<ImplicitNewmarkSparse>( 3 * numNodes, @@ -613,7 +613,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() integratorBaseSparse = implicitNewmarkSparse; } - else if (femConfig->solver == smVegaObjectConfig::IMPLICITBACKWARDEULER) + else if (femConfig->solver == VegaObjectConfig::IMPLICITBACKWARDEULER) { implicitNewmarkSparse = std::make_shared<ImplicitBackwardEulerSparse>( 3 * numNodes, @@ -631,7 +631,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() integratorBaseSparse = implicitNewmarkSparse; } - else if (femConfig->solver == smVegaObjectConfig::EULER) + else if (femConfig->solver == VegaObjectConfig::EULER) { int symplectic = 0; integratorBaseSparse = std::make_shared<EulerSparse>( @@ -645,7 +645,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() femConfig->dampingMassCoef ); } - else if (femConfig->solver == smVegaObjectConfig::SYMPLECTICEULER) + else if (femConfig->solver == VegaObjectConfig::SYMPLECTICEULER) { int symplectic = 1; integratorBaseSparse = std::make_shared<EulerSparse>( @@ -659,7 +659,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() femConfig->dampingMassCoef ); } - else if (femConfig->solver == smVegaObjectConfig::CENTRALDIFFERENCES) + else if (femConfig->solver == VegaObjectConfig::CENTRALDIFFERENCES) { integratorBaseSparse = std::make_shared<CentralDifferencesSparse>( 3 * numNodes, @@ -704,7 +704,7 @@ void smVegaFemSceneObject::initializeTimeIntegrator() } } -void smVegaFemSceneObject::createForceModel() +void VegaFemSceneObject::createForceModel() { // create force models, to be used by the integrator @@ -712,7 +712,7 @@ void smVegaFemSceneObject::createForceModel() switch (femConfig->deformableObject) { - case smVegaObjectConfig::STVK: + case VegaObjectConfig::STVK: { stVKForceModel = std::make_shared<StVKForceModel>(stVKInternalForces.get(), @@ -722,7 +722,7 @@ void smVegaFemSceneObject::createForceModel() break; } - case smVegaObjectConfig::COROTLINFEM: + case VegaObjectConfig::COROTLINFEM: { TetMesh * tetMesh = dynamic_cast<TetMesh*>(volumetricMesh.get()); @@ -749,7 +749,7 @@ void smVegaFemSceneObject::createForceModel() break; } - case smVegaObjectConfig::LINFEM: + case VegaObjectConfig::LINFEM: { auto linearFEMForceModel = std::make_shared<LinearFEMForceModel>(stVKInternalForces.get()); @@ -757,7 +757,7 @@ void smVegaFemSceneObject::createForceModel() break; } - case smVegaObjectConfig::INVERTIBLEFEM: + case VegaObjectConfig::INVERTIBLEFEM: { TetMesh * tetMesh = dynamic_cast<TetMesh*>(volumetricMesh.get()); @@ -787,7 +787,7 @@ void smVegaFemSceneObject::createForceModel() switch (femConfig->invertibleMaterial) { - case smVegaObjectConfig::INV_STVK: + case VegaObjectConfig::INV_STVK: { isotropicMaterial = new StVKIsotropicMaterial( @@ -798,7 +798,7 @@ void smVegaFemSceneObject::createForceModel() break; } - case smVegaObjectConfig::INV_NEOHOOKEAN: + case VegaObjectConfig::INV_NEOHOOKEAN: isotropicMaterial = new NeoHookeanIsotropicMaterial( tetMesh, femConfig->enableCompressionResistance, @@ -806,7 +806,7 @@ void smVegaFemSceneObject::createForceModel() std::cout << "VEGA: Invertible material: neo-Hookean.\n"; break; - case smVegaObjectConfig::INV_MOONEYRIVLIN: + case VegaObjectConfig::INV_MOONEYRIVLIN: isotropicMaterial = new MooneyRivlinIsotropicMaterial( tetMesh, femConfig->enableCompressionResistance, @@ -859,7 +859,7 @@ void smVegaFemSceneObject::createForceModel() } -void smVegaFemSceneObject::advanceDynamics() +void VegaFemSceneObject::advanceDynamics() { int i; @@ -955,9 +955,9 @@ void smVegaFemSceneObject::advanceDynamics() updatePerformanceMetrics(); } -inline void smVegaFemSceneObject::advanceOneTimeStep() +inline void VegaFemSceneObject::advanceOneTimeStep() { - smVegaPerformanceCounter *pt = &performaceTracker; + VegaPerformanceCounter *pt = &performaceTracker; for (int i = 0; i < femConfig->substepsPerTimeStep; i++) { int code = integratorBase->DoTimestep(); @@ -1011,12 +1011,12 @@ inline void smVegaFemSceneObject::advanceOneTimeStep() } } -void smVegaFemSceneObject::setPulledVertex(const core::Vec3d &userPos) +void VegaFemSceneObject::setPulledVertex(const core::Vec3d &userPos) { pulledVertex = this->volumetricMesh->getClosestVertex(Vec3d(userPos(0), userPos(1), userPos(2))); } -inline void smVegaFemSceneObject::applyUserInteractionForces() +inline void VegaFemSceneObject::applyUserInteractionForces() { // determine force in case user is pulling on a vertex @@ -1088,7 +1088,7 @@ inline void smVegaFemSceneObject::applyUserInteractionForces() } } -inline void smVegaFemSceneObject::applyScriptedExternalForces() +inline void VegaFemSceneObject::applyScriptedExternalForces() { // apply any scripted force loads if (timestepCounter < this->forceLoads.size()) @@ -1103,7 +1103,7 @@ inline void smVegaFemSceneObject::applyScriptedExternalForces() } } -inline void smVegaFemSceneObject::updateSecondaryRenderingMesh() +inline void VegaFemSceneObject::updateSecondaryRenderingMesh() { // interpolate deformations from volumetric mesh to rendering triangle mesh if (vegaSecondarySurfaceMesh != nullptr) @@ -1139,9 +1139,9 @@ inline void smVegaFemSceneObject::updateSecondaryRenderingMesh() } } -inline void smVegaFemSceneObject::updatePerformanceMetrics() +inline void VegaFemSceneObject::updatePerformanceMetrics() { - smVegaPerformanceCounter *pt = &performaceTracker; + VegaPerformanceCounter *pt = &performaceTracker; //update window title at 5 Hz pt->objectPerformanceCounter.StopCounter(); double elapsedTime = pt->objectPerformanceCounter.GetElapsedTime(); @@ -1167,7 +1167,7 @@ inline void smVegaFemSceneObject::updatePerformanceMetrics() //std::cout << "FPS: " << pt->fps << std::endl; } -void smVegaFemSceneObject::printInfo() const +void VegaFemSceneObject::printInfo() const { std::cout << "\t-------------------------------------\n"; std::cout << "\t Name : " << this->getName() << std::endl; @@ -1177,48 +1177,48 @@ void smVegaFemSceneObject::printInfo() const std::cout << "\t-------------------------------------\n"; } -core::Vec3d smVegaFemSceneObject::getVelocityOfNodeWithDofID(const int dofID) const +core::Vec3d VegaFemSceneObject::getVelocityOfNodeWithDofID(const int dofID) const { core::Vec3d vel(uvel[dofID], uvel[dofID + 1], uvel[dofID + 2]); return vel; } -core::Vec3d smVegaFemSceneObject::getDisplacementOfNodeWithDofID(const int dofID) const +core::Vec3d VegaFemSceneObject::getDisplacementOfNodeWithDofID(const int dofID) const { core::Vec3d disp(u[dofID], u[dofID + 1], u[dofID + 2]); return disp; } -core::Vec3d smVegaFemSceneObject::getAccelerationOfNodeWithDofID(const int dofID) const +core::Vec3d VegaFemSceneObject::getAccelerationOfNodeWithDofID(const int dofID) const { core::Vec3d accn(uaccel[dofID], uaccel[dofID + 1], uaccel[dofID + 2]); return accn; } -int smVegaFemSceneObject::getNumNodes() const +int VegaFemSceneObject::getNumNodes() const { return numNodes; } -int smVegaFemSceneObject::getNumTotalDof() const +int VegaFemSceneObject::getNumTotalDof() const { return numTotalDOF; } -int smVegaFemSceneObject::getNumDof() const +int VegaFemSceneObject::getNumDof() const { return numDOF; } -int smVegaFemSceneObject::getNumFixedNodes() const +int VegaFemSceneObject::getNumFixedNodes() const { return numFixedNodes; } -int smVegaFemSceneObject::getNumFixedDof() const +int VegaFemSceneObject::getNumFixedDof() const { return numFixedDof; } diff --git a/src/Simulators/VegaFemSceneObject.h b/Simulators/VegaFemSceneObject.h similarity index 96% rename from src/Simulators/VegaFemSceneObject.h rename to Simulators/VegaFemSceneObject.h index b6959c0468d3552b0a7da6f46ef40252a0cca94f..c114244b0ba10993a9c4b092d6c7997d03d3e964 100644 --- a/src/Simulators/VegaFemSceneObject.h +++ b/Simulators/VegaFemSceneObject.h @@ -25,7 +25,7 @@ #define SMVEGAFEMSCENEOBJECT_H // SimMedTK includes -#include "SceneObjectDeformable.h" +#include "Simulators/SceneObjectDeformable.h" // VEGA includes #include "centralDifferencesSparse.h" @@ -68,18 +68,18 @@ /// \brief Base class for any scene object that is defmormable /// and uses FE formulation to compute the evolution of configuration /// in time. -class smVegaFemSceneObject: public smSceneObjectDeformable +class VegaFemSceneObject: public SceneObjectDeformable { public: /// \brief Constructor - smVegaFemSceneObject(); + VegaFemSceneObject(); /// \brief Constructor - smVegaFemSceneObject(const std::shared_ptr<ErrorLog> p_log, const std::string ConfigFile); + VegaFemSceneObject(const std::shared_ptr<ErrorLog> p_log, const std::string ConfigFile); /// \brief Destructor - ~smVegaFemSceneObject(); + ~VegaFemSceneObject(); /// \brief Initialize the parameters and properties of the simulation object void initialize() override; @@ -200,9 +200,9 @@ private: bool importAndUpdateVolumeMeshToSmtk; - smVegaPerformanceCounter performaceTracker; + VegaPerformanceCounter performaceTracker; - std::shared_ptr<smVegaObjectConfig> femConfig; + std::shared_ptr<VegaObjectConfig> femConfig; // Time integrators std::shared_ptr<IntegratorBase> integratorBase; ///< integrator diff --git a/src/Simulators/VegaFemSimulator.cpp b/Simulators/VegaFemSimulator.cpp similarity index 81% rename from src/Simulators/VegaFemSimulator.cpp rename to Simulators/VegaFemSimulator.cpp index bca354a2774b6b961edc9af7a9fca1c5355ebb83..93f2c481eee2790adf31aedd528fded427feeb24 100644 --- a/src/Simulators/VegaFemSimulator.cpp +++ b/Simulators/VegaFemSimulator.cpp @@ -22,18 +22,18 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "VegaFemSimulator.h" +#include "Simulators/VegaFemSimulator.h" -smVegaFemSimulator::smVegaFemSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) +VegaFemSimulator::VegaFemSimulator( std::shared_ptr<ErrorLog> p_errorLog ) : ObjectSimulator( p_errorLog ) { hapticButtonPressed = false; } -void smVegaFemSimulator::beginSim() +void VegaFemSimulator::beginSim() { } -void smVegaFemSimulator::initCustom() +void VegaFemSimulator::initCustom() {//do nothing for now for ( size_t i = 0; i < objectsSimulated.size(); i++ ) { @@ -52,7 +52,7 @@ void smVegaFemSimulator::initCustom() } } -void smVegaFemSimulator::run() +void VegaFemSimulator::run() { beginSim(); @@ -63,7 +63,7 @@ void smVegaFemSimulator::run() //ensure that dummy simulator will work on static scene objects only. if ( sceneObj->getType() == core::ClassType::VegaFemSceneObject ) { - auto femSceneObject = std::static_pointer_cast<smVegaFemSceneObject>(sceneObj); + auto femSceneObject = std::static_pointer_cast<VegaFemSceneObject>(sceneObj); //std::cout << "."; std::cout.flush(); femSceneObject->advanceDynamics(); } @@ -72,15 +72,15 @@ void smVegaFemSimulator::run() endSim(); } -void smVegaFemSimulator::endSim() +void VegaFemSimulator::endSim() { } -void smVegaFemSimulator::syncBuffers() +void VegaFemSimulator::syncBuffers() { } -void smVegaFemSimulator::handleEvent(std::shared_ptr<core::Event> /*p_event*/ ) +void VegaFemSimulator::handleEvent(std::shared_ptr<core::Event> /*p_event*/ ) { if (!this->isListening()) { diff --git a/src/Simulators/VegaFemSimulator.h b/Simulators/VegaFemSimulator.h similarity index 92% rename from src/Simulators/VegaFemSimulator.h rename to Simulators/VegaFemSimulator.h index bd4c7863d3241eca8746b8a682c2aec547b9ae4e..4f18528bccc127cf509ea9a2e04279f3a4b1e18e 100644 --- a/src/Simulators/VegaFemSimulator.h +++ b/Simulators/VegaFemSimulator.h @@ -28,15 +28,15 @@ #include "Core/Config.h" #include "Core/ObjectSimulator.h" #include "Core/ErrorLog.h" -#include "VegaFemSceneObject.h" +#include "Simulators/VegaFemSceneObject.h" /// \brief Interface class between Vega and SimMedTK core -class smVegaFemSimulator: public ObjectSimulator +class VegaFemSimulator: public ObjectSimulator { public: /// \brief constructor - smVegaFemSimulator(std::shared_ptr<ErrorLog> p_errorLog); + VegaFemSimulator(std::shared_ptr<ErrorLog> p_errorLog); /// \brief start the job virtual void beginSim() override; diff --git a/src/Simulators/VegaObjectConfig.cpp b/Simulators/VegaObjectConfig.cpp similarity index 94% rename from src/Simulators/VegaObjectConfig.cpp rename to Simulators/VegaObjectConfig.cpp index 5567bdf13ca65b6ef372b013652fa6c2db6337eb..49d4c2ed1082453941c53178b7b309da7ae7722a 100644 --- a/src/Simulators/VegaObjectConfig.cpp +++ b/Simulators/VegaObjectConfig.cpp @@ -22,11 +22,11 @@ //--------------------------------------------------------------------------- // SimMedTK includes -#include "VegaObjectConfig.h" +#include "Simulators/VegaObjectConfig.h" #include <cstring> -smVegaObjectConfig::smVegaObjectConfig() +VegaObjectConfig::VegaObjectConfig() { syncTimestepWithGraphics = 0; timeStep = 1.0 / 30; @@ -53,16 +53,16 @@ smVegaObjectConfig::smVegaObjectConfig() solver = timeIntegrationType::UNKNOWN; } -void smVegaObjectConfig::setSyncTimeStepWithGraphics(const bool syncOrNot) +void VegaObjectConfig::setSyncTimeStepWithGraphics(const bool syncOrNot) { syncTimestepWithGraphics = syncOrNot; } -smVegaObjectConfig::~smVegaObjectConfig() +VegaObjectConfig::~VegaObjectConfig() { } -void smVegaObjectConfig::setFemObjConfuguration(const std::string ConfigFilename, const bool printVerbose) +void VegaObjectConfig::setFemObjConfuguration(const std::string ConfigFilename, const bool printVerbose) { std::cout << "VEGA: Parsing configuration file" << ConfigFilename.c_str() << "...\n"; @@ -214,15 +214,15 @@ void smVegaObjectConfig::setFemObjConfuguration(const std::string ConfigFilename } } -smVegaPerformanceCounter::smVegaPerformanceCounter() +VegaPerformanceCounter::VegaPerformanceCounter() { } -smVegaPerformanceCounter::~smVegaPerformanceCounter() +VegaPerformanceCounter::~VegaPerformanceCounter() { } -void smVegaPerformanceCounter::initialize() +void VegaPerformanceCounter::initialize() { fps = 0.0; fpsHead = 0; @@ -238,7 +238,7 @@ void smVegaPerformanceCounter::initialize() systemSolveBufferSize = 50; } -void smVegaPerformanceCounter::clearFpsBuffer() +void VegaPerformanceCounter::clearFpsBuffer() { // clear fps buffer int i; diff --git a/src/Simulators/VegaObjectConfig.h b/Simulators/VegaObjectConfig.h similarity index 94% rename from src/Simulators/VegaObjectConfig.h rename to Simulators/VegaObjectConfig.h index d47ea6098a1a113870eb3b7cd3eff7a16872a6e4..e7876f438a8708889c116c7ad47a1a6cc1f786d0 100644 --- a/src/Simulators/VegaObjectConfig.h +++ b/Simulators/VegaObjectConfig.h @@ -33,9 +33,9 @@ #include "performanceCounter.h" /// \brief This class parses and holds the information related to various input files -/// It is separated from the smVegaFemSceneObject class in order to reduce the +/// It is separated from the VegaFemSceneObject class in order to reduce the /// amount of information stored while creating the fem model. -class smVegaObjectConfig +class VegaObjectConfig { public: @@ -133,12 +133,12 @@ public: timeIntegrationType solver; /// \brief Constructor - smVegaObjectConfig(); + VegaObjectConfig(); /// \brief Destructor - ~smVegaObjectConfig(); + ~VegaObjectConfig(); - /// \brief Read the confiuration file to + /// \brief Read the confiuration file to /// parse all the specifications of the FEM scene /// such as type of material type, input mesh and rendering files, /// boundary conditions etc. @@ -148,7 +148,7 @@ public: void setSyncTimeStepWithGraphics(const bool syncOrNot); }; -class smVegaPerformanceCounter +class VegaPerformanceCounter { public: double fps; ///< fps of the simulation @@ -162,22 +162,22 @@ public: int forceAssemblyBufferSize; int forceAssemblyHead; double forceAssemblyBuffer[50]; - + // solver metrics recording double systemSolveTime; double systemSolveLocalTime; int systemSolveBufferSize; int systemSolveHead; double systemSolveBuffer[50]; - + PerformanceCounter objectPerformanceCounter;///< keeps track of overall performance PerformanceCounter explosionCounter;///< keeps track of instability /// \brief constructor - smVegaPerformanceCounter(); + VegaPerformanceCounter(); /// \brief destructor - ~smVegaPerformanceCounter(); + ~VegaPerformanceCounter(); /// \brief Initialization void initialize(); @@ -186,4 +186,4 @@ public: void clearFpsBuffer(); }; -#endif \ No newline at end of file +#endif diff --git a/src/VirtualTools/CMakeLists.txt b/VirtualTools/CMakeLists.txt similarity index 78% rename from src/VirtualTools/CMakeLists.txt rename to VirtualTools/CMakeLists.txt index 12f58b29cd165a1412c46bcf4ee88034a706bfca..5f626032181ddcd19c859ef9aebe372fb6b7d37b 100644 --- a/src/VirtualTools/CMakeLists.txt +++ b/VirtualTools/CMakeLists.txt @@ -1,9 +1,9 @@ simmedtk_add_library(VirtualTools SOURCES - curvedGrasper.cpp + CurvedGrasper.cpp PUBLIC_HEADERS - curvedGrasper.h + CurvedGrasper.h ) target_link_libraries(VirtualTools diff --git a/src/VirtualTools/curvedGrasper.cpp b/VirtualTools/CurvedGrasper.cpp similarity index 91% rename from src/VirtualTools/curvedGrasper.cpp rename to VirtualTools/CurvedGrasper.cpp index 1466164592578b0561b10d02997ddf060cb90492..905ba896347fa0294a872ed3f6e71ec38cc3ea50 100644 --- a/src/VirtualTools/curvedGrasper.cpp +++ b/VirtualTools/CurvedGrasper.cpp @@ -21,7 +21,7 @@ // Contact: //--------------------------------------------------------------------------- -#include "curvedGrasper.h" +#include "VirtualTools/CurvedGrasper.h" // Eigen includes #include "Eigen/Geometry" @@ -31,7 +31,7 @@ #include "Event/HapticEvent.h" #include "Event/KeyboardEvent.h" -curvedGrasper::curvedGrasper(size_t p_PhantomID, +CurvedGrasper::CurvedGrasper(size_t p_PhantomID, const std::string& p_pivotModelFileName, const std::string& p_lowerModelFileName, const std::string& p_upperModelFileName) @@ -66,13 +66,13 @@ curvedGrasper::curvedGrasper(size_t p_PhantomID, rot = Eigen::AngleAxisd(-M_PI_2, core::Vec3d::UnitZ()).matrix(); mesh_lowerJaw->rotate(rot); - meshContainer_pivot.name = "curvedGrasperPivot"; + meshContainer_pivot.name = "CurvedGrasperPivot"; meshContainer_pivot.mesh = mesh_pivot; - meshContainer_upperJaw.name = "curvedGrasperUpper"; + meshContainer_upperJaw.name = "CurvedGrasperUpper"; meshContainer_upperJaw.mesh = mesh_upperJaw; - meshContainer_lowerJaw.name = "curvedGrasperLower"; + meshContainer_lowerJaw.name = "CurvedGrasperLower"; meshContainer_lowerJaw.mesh = mesh_lowerJaw; //for interface @@ -84,7 +84,7 @@ curvedGrasper::curvedGrasper(size_t p_PhantomID, DAQdataID = 0; } -void curvedGrasper::handleEvent(std::shared_ptr<core::Event> p_event) +void CurvedGrasper::handleEvent(std::shared_ptr<core::Event> p_event) { if(!this->isListening()) { @@ -94,8 +94,8 @@ void curvedGrasper::handleEvent(std::shared_ptr<core::Event> p_event) auto hapticEvent = std::static_pointer_cast<event::HapticEvent>(p_event); if(hapticEvent != nullptr && hapticEvent->getDeviceId() == this->phantomID) { - smMeshContainer *containerLower = this->getMeshContainer("curvedGrasperLower"); - smMeshContainer *containerUpper = this->getMeshContainer("curvedGrasperUpper"); + MeshContainer *containerLower = this->getMeshContainer("CurvedGrasperLower"); + MeshContainer *containerUpper = this->getMeshContainer("CurvedGrasperUpper"); Matrix44d godPosMat = hapticEvent->getTransform(); transRot = godPosMat; pos = hapticEvent->getPosition(); @@ -154,7 +154,7 @@ void curvedGrasper::handleEvent(std::shared_ptr<core::Event> p_event) } } -void curvedGrasper::updateOpenClose() +void CurvedGrasper::updateOpenClose() { if (buttonState[0]) diff --git a/src/VirtualTools/curvedGrasper.h b/VirtualTools/CurvedGrasper.h similarity index 89% rename from src/VirtualTools/curvedGrasper.h rename to VirtualTools/CurvedGrasper.h index 5672eacee3d7971d200100be55600ffb5ae5b21a..f94f82e05507c337eb25bfde84e4b16eede066ef 100644 --- a/src/VirtualTools/curvedGrasper.h +++ b/VirtualTools/CurvedGrasper.h @@ -33,11 +33,11 @@ namespace core { } /// \brief Cruver Grasper tool -class curvedGrasper: public smStylusRigidSceneObject +class CurvedGrasper: public StylusRigidSceneObject { public: /// \brief constrcutor that gest hatpic device ID (e.g. 0 or 1), pivot, lower and upper mesh file names - curvedGrasper(size_t ID, + CurvedGrasper(size_t ID, const std::string& p_pivotModelFileName = "../../resources/models/curved_pivot.3DS", const std::string& p_lowerModelFileName = "../../resources/models/curved_upper.3DS", const std::string& p_upperModelFileName = "../../resources/models/curved_lower.3DS"); @@ -53,9 +53,9 @@ public: bool buttonState[2]; // buttons states of haptic device double angle; // angle of the jaws double maxangle; // maximum angle that jaws can open - smMeshContainer meshContainer_pivot; // the pivto mesh container - smMeshContainer meshContainer_lowerJaw; // lower jaw container - smMeshContainer meshContainer_upperJaw; // upper jaw container + MeshContainer meshContainer_pivot; // the pivto mesh container + MeshContainer meshContainer_lowerJaw; // lower jaw container + MeshContainer meshContainer_upperJaw; // upper jaw container SurfaceMesh *mesh_pivot; // stores the pivot mesh SurfaceMesh *mesh_lowerJaw; // stores lower jaw mesh SurfaceMesh *mesh_upperJaw; // stores upper mesh jaw diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt deleted file mode 100644 index 7020e00427e95f062e7dfc4bb2758a2aa41803e1..0000000000000000000000000000000000000000 --- a/src/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ - -add_subdirectory(Core) -add_subdirectory(Collision) -add_subdirectory(ContactHandling) -add_subdirectory(External) -add_subdirectory(Devices) -add_subdirectory(Mesh) -add_subdirectory(Rendering) -add_subdirectory(RenderDelegates) -add_subdirectory(Simulators) -add_subdirectory(VirtualTools) -add_subdirectory(Event) -add_subdirectory(Geometry)