Commit d8d9bc01 authored by Aaron Bray's avatar Aaron Bray
Browse files

Sync Removal of Cylical Dependencies

parents a87ea030 f60fc673
......@@ -329,21 +329,20 @@ endif()
# Add Source code subdirectories
#--------------------------------------------------------------------------
add_subdirectory(Source/Core)
add_subdirectory(Source/Rendering/Materials)
add_subdirectory(Source/Geometry)#Circular Dependency
add_subdirectory(Source/DataStructures)#Circular Dependency
add_subdirectory(Source/Geometry)
add_subdirectory(Source/DataStructures)
add_subdirectory(Source/Devices)
add_subdirectory(Source/Constraint)
add_subdirectory(Source/Rendering/Materials)
add_subdirectory(Source/Rendering/GUIOverlay)
add_subdirectory(Source/Scene/SceneElements)
add_subdirectory(Source/Solvers)#Circular Dependency
add_subdirectory(Source/TimeIntegrators)#Circular Dependency
add_subdirectory(Source/DynamicalModels)#Circular Dependency
add_subdirectory(Source/Rendering)
add_subdirectory(Source/Solvers)
add_subdirectory(Source/DynamicalModels)
add_subdirectory(Source/Collision)
add_subdirectory(Source/Animation)
add_subdirectory(Source/Scene/SceneElements)
add_subdirectory(Source/Scene)
add_subdirectory(Source/Rendering)
add_subdirectory(Source/SimulationManager)
add_subdirectory(Source/Constraint)
add_subdirectory(Source/Animation)
add_subdirectory(Source/apiUtilities)
#--------------------------------------------------------------------------
......
......@@ -22,6 +22,7 @@
#include "imstkGraph.h"
#include "imstkTetrahedralMesh.h"
#include "imstkMeshIO.h"
#include "imstkAPIUtilities.h"
#include <iostream>
......@@ -90,11 +91,11 @@ main(int argc, char** argv)
else
{
auto volMesh = std::dynamic_pointer_cast<TetrahedralMesh>(tetMesh);
auto colorsGVMesh = volMesh->getMeshGraph()->doColoring(method, true);
auto colorsGVMesh = apiutils::getMeshGraph(volMesh)->doColoring(method, true);
auto surfMesh = std::make_shared<SurfaceMesh>();
volMesh->extractSurfaceMesh(surfMesh, true);
auto colorsGSMesh = surfMesh->getMeshGraph()->doColoring(method, true);
auto colorsGSMesh = apiutils::getMeshGraph(surfMesh)->doColoring(method, true);
}
std::cout << "Press any key to exit!" << std::endl;
......
......@@ -4,15 +4,16 @@
include(imstkAddLibrary)
imstk_add_library( DynamicalModels
SUBDIR_LIST
ObjectStates
TimeIntegrators
ObjectModels
ObjectModels/PbdConstraints
ObjectStates
InternalForceModel
DEPENDS
Core
DataStructures
Constraints
Geometry
TimeIntegrators
Solvers
VegaFEM::massSpringSystem
VegaFEM::corotationalLinearFEM
......
......@@ -5,10 +5,9 @@ include(imstkAddLibrary)
imstk_add_library( Geometry
DEPENDS
Core
Materials
DataStructures
glm
Assimp
Materials
VegaFEM::volumetricMesh
${VTK_LIBRARIES}
)
......
......@@ -20,7 +20,7 @@
=========================================================================*/
#include "imstkPointSet.h"
#include "imstkGraph.h"
//#include "imstkGraph.h"
#include "imstkParallelUtils.h"
namespace imstk
......@@ -317,12 +317,4 @@ PointSet::getMaxNumVertices()
{
return m_maxNumVertices;
}
std::shared_ptr<Graph>
PointSet::getMeshGraph()
{
LOG(WARNING) << "The graph of a point set has no edges";
return std::make_shared<Graph>(this->getNumVertices());
}
} // imstk
......@@ -166,11 +166,6 @@ public:
///
size_t getMaxNumVertices();
///
/// \brief Returns the mesh graph
///
virtual std::shared_ptr<Graph> getMeshGraph();
protected:
friend class VTKPointSetRenderDelegate;
......
......@@ -20,7 +20,7 @@
=========================================================================*/
#include "imstkSurfaceMesh.h"
#include "imstkGraph.h"
//#include "imstkGraph.h"
namespace imstk
{
......@@ -613,18 +613,4 @@ SurfaceMesh::getMaxNumTriangles()
{
return m_maxNumTriangles;
}
std::shared_ptr<Graph>
SurfaceMesh::getMeshGraph()
{
auto gMesh = std::make_shared<Graph>(this->getNumVertices());
for (auto tri : this->getTrianglesVertices())
{
gMesh->addEdge(tri[0], tri[1]);
gMesh->addEdge(tri[0], tri[2]);
gMesh->addEdge(tri[1], tri[2]);
}
return gMesh;
}
} // imstk
......@@ -212,11 +212,6 @@ public:
///
size_t getMaxNumTriangles();
///
/// \brief Returns the mesh graph
///
std::shared_ptr<Graph> getMeshGraph() override;
protected:
friend class VTKSurfaceMeshRenderDelegate;
......
......@@ -20,7 +20,7 @@
=========================================================================*/
#include "imstkTetrahedralMesh.h"
#include "imstkGraph.h"
//#include "imstkGraph.h"
namespace imstk
{
......@@ -303,20 +303,4 @@ TetrahedralMesh::getNumTetrahedra() const
{
return m_tetrahedraVertices.size();
}
std::shared_ptr<Graph>
TetrahedralMesh::getMeshGraph()
{
auto gMesh = std::make_shared<Graph>(this->getNumVertices());
for (auto tet : this->getTetrahedraVertices())
{
gMesh->addEdge(tet[0], tet[1]);
gMesh->addEdge(tet[0], tet[2]);
gMesh->addEdge(tet[0], tet[3]);
gMesh->addEdge(tet[1], tet[2]);
gMesh->addEdge(tet[1], tet[3]);
gMesh->addEdge(tet[2], tet[3]);
}
return gMesh;
}
} // imstk
......@@ -121,11 +121,6 @@ public:
void setTetrahedraAsRemoved(const unsigned int tetId) { m_removedMeshElems[tetId] = true; }
const std::vector<bool>& getRemovedTetrahedra() const { return m_removedMeshElems; }
///
/// \brief Returns the mesh graph
///
std::shared_ptr<Graph> getMeshGraph() override;
protected:
friend class VTKTetrahedralMeshRenderDelegate;
......
......@@ -13,11 +13,10 @@ imstk_add_library( SceneElements
DEPENDS
Core
Geometry
DataStructures
Constraints
Devices
TimeIntegrators
DynamicalModels
Materials
${iMSTK_ODE_DEPENDS}
)
......
......@@ -5,9 +5,8 @@ include(imstkAddLibrary)
imstk_add_library( Solvers
DEPENDS
Core
Constraints
DataStructures
DynamicalModels
Constraints
SceneElements
)
......
#-----------------------------------------------------------------------------
# Create target
#-----------------------------------------------------------------------------
include(imstkAddLibrary)
imstk_add_library( TimeIntegrators
DEPENDS
Core
DynamicalModels
)
#-----------------------------------------------------------------------------
# Testing
#-----------------------------------------------------------------------------
#if( ${PROJECT_NAME}_BUILD_TESTING )
# add_subdirectory( Testing )
#endif()
......@@ -34,9 +34,13 @@
#include "imstkSphere.h"
#include "imstkCapsule.h"
#include "imstkCube.h"
#include "imstkPointSet.h"
#include "imstkSurfaceMesh.h"
#include "imstkTetrahedralMesh.h"
#include "imstkMeshIO.h"
#include "imstkGraph.h"
// logger
#include "g3log/g3log.hpp"
#include "imstkTimer.h"
......@@ -242,5 +246,43 @@ printUPS(std::shared_ptr<SceneManager> sceneManager, std::shared_ptr<UPSCounter>
LOG(INFO) << "\nPost cleanup of " << module->getName() << " module";
});
}
std::shared_ptr<Graph>
getMeshGraph(std::shared_ptr<PointSet> m)
{
LOG(WARNING) << "The graph of a point set has no edges";
return std::make_shared<Graph>(m->getNumVertices());
}
std::shared_ptr<Graph>
getMeshGraph(std::shared_ptr<SurfaceMesh> m)
{
auto gMesh = std::make_shared<Graph>(m->getNumVertices());
for (auto tri : m->getTrianglesVertices())
{
gMesh->addEdge(tri[0], tri[1]);
gMesh->addEdge(tri[0], tri[2]);
gMesh->addEdge(tri[1], tri[2]);
}
return gMesh;
}
std::shared_ptr<Graph>
getMeshGraph(std::shared_ptr<TetrahedralMesh> m)
{
auto gMesh = std::make_shared<Graph>(m->getNumVertices());
for (auto tet : m->getTetrahedraVertices())
{
gMesh->addEdge(tet[0], tet[1]);
gMesh->addEdge(tet[0], tet[2]);
gMesh->addEdge(tet[0], tet[3]);
gMesh->addEdge(tet[1], tet[2]);
gMesh->addEdge(tet[1], tet[3]);
gMesh->addEdge(tet[2], tet[3]);
}
return gMesh;
}
} //apiutils
} // imstk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment