Skip to content

Commit 91f442e

Browse files
authored
Make most dependencies private; document dependencies with graphviz (#183)
- Added a figure to the documentation for default dependencies of the ipc::toolkit library. - Updated GraphViz configuration to include transparent backgrounds and Menlo font. - Refactored BVH class to use unique_ptr to hide SimpleBVH - Updated Sweep and Prune and Sweep and Tiniest Queue classes to use a Pimpl pattern for encapsulation. - Change potential.tpp to potential.cpp file to hide implementation details.
1 parent dbb1ab4 commit 91f442e

23 files changed

+540
-111
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,3 +670,4 @@ python/update_bindings.py
670670

671671
# External test data
672672
tests/data
673+
CMakeGraphVizOptions.cmake

CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -154,30 +154,30 @@ target_link_libraries(ipc_toolkit PUBLIC Eigen3::Eigen)
154154

155155
# libigl
156156
include(libigl)
157-
target_link_libraries(ipc_toolkit PUBLIC igl::core igl::predicates)
157+
target_link_libraries(ipc_toolkit PRIVATE igl::core igl::predicates)
158158

159159
# TBB
160160
include(onetbb)
161-
target_link_libraries(ipc_toolkit PUBLIC TBB::tbb)
161+
target_link_libraries(ipc_toolkit PRIVATE TBB::tbb)
162162

163163
# Provably conservative CCD of [Wang and Ferguson et al. 2021]
164164
include(tight_inclusion)
165-
target_link_libraries(ipc_toolkit PUBLIC tight_inclusion::tight_inclusion)
165+
target_link_libraries(ipc_toolkit PRIVATE tight_inclusion::tight_inclusion)
166166

167167
# Scalable CCD (STQ broad phase and GPU Tight Inclusion)
168168
include(scalable_ccd)
169-
target_link_libraries(ipc_toolkit PUBLIC scalable_ccd::scalable_ccd)
169+
target_link_libraries(ipc_toolkit PRIVATE scalable_ccd::scalable_ccd)
170170

171171
# CCD
172172
if(IPC_TOOLKIT_WITH_INEXACT_CCD)
173173
# Etienne Vouga's CTCD Library for the floating point root finding algorithm
174174
include(evouga_ccd)
175-
target_link_libraries(ipc_toolkit PUBLIC evouga::ccd)
175+
target_link_libraries(ipc_toolkit PRIVATE evouga::ccd)
176176
endif()
177177

178178
# SimpleBVH
179179
include(simple_bvh)
180-
target_link_libraries(ipc_toolkit PUBLIC simple_bvh::simple_bvh)
180+
target_link_libraries(ipc_toolkit PRIVATE simple_bvh::simple_bvh)
181181

182182
# Logger
183183
include(spdlog)
@@ -186,7 +186,7 @@ target_link_libraries(ipc_toolkit PUBLIC spdlog::spdlog)
186186
# rational-cpp (requires GMP)
187187
if(IPC_TOOLKIT_WITH_RATIONAL_INTERSECTION)
188188
include(rational_cpp)
189-
target_link_libraries(ipc_toolkit PUBLIC rational::rational)
189+
target_link_libraries(ipc_toolkit PRIVATE rational::rational)
190190
endif()
191191

192192
# Faster unordered map

cmake/recipes/abseil.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ endif()
66

77
message(STATUS "Third-party: creating target 'absl::flat_hash_map'")
88

9-
option(ABSL_PROPAGATE_CXX_STD "Use CMake C++ standard meta features (e.g. cxx_std_11) that propagate to targets that link to Abseil" ON)
9+
option(ABSL_PROPAGATE_CXX_STD "Use CMake C++ standard meta features (e.g. cxx_std_17) that propagate to targets that link to Abseil" ON)
1010
option(ABSL_USE_SYSTEM_INCLUDES "Silence warnings in Abseil headers by marking them as SYSTEM includes" ON)
1111
option(ABSL_BUILD_TESTING "If ON, Abseil will build all of Abseil's own tests." OFF)
1212
set(ABSL_IDE_FOLDER "ThirdParty/Abseil")
1313

1414
include(CPM)
15-
CPMAddPackage("gh:abseil/abseil-cpp#20230125.3")
15+
CPMAddPackage("gh:abseil/abseil-cpp#20250512.1")
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
digraph "IPC Toolkit Dependencies" {
2+
bgcolor = "transparent";
3+
splines = ortho;
4+
layout = dot;
5+
// nodesep = 0.1;
6+
ranksep = 0.5;
7+
node [fontname = "Menlo"; style = filled; penwidth = 2;];
8+
edge [penwidth = 2; fontname = "Menlo";];
9+
subgraph clusterLegend {
10+
label = "Legend";
11+
color = "grey";
12+
fontcolor = "grey";
13+
fontname = "Avenir Medium";
14+
penwidth = 2;
15+
node [fontname = "Avenir Light";];
16+
edge [fontname = "Avenir Light";];
17+
legendNode0 [label = "Static Library";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
18+
legendNode1 [label = "Shared Library";shape = box;style = "rounded,filled";fillcolor = "#CCE7F8";color = "#6596B2";];
19+
legendNode2 [label = "Interface Library";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
20+
legendNode0 -> legendNode1 [label = "Public"; color = "#8FB976"; fontcolor = "#8FB976";];
21+
legendNode2 -> legendNode0 [label = "Interface"; color = "#DAA52D"; fontcolor = "#DAA52D";];
22+
legendNode1 -> legendNode2 [label = "Private"; color = "#BE6562"; fontcolor = "#BE6562";];
23+
}
24+
// Force ipc_toolkit to top
25+
subgraph {
26+
rank = "source";
27+
"node5";
28+
}
29+
"node0" [label = "Eigen3_Eigen\n(Eigen3::Eigen)";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
30+
"node1" [label = "filib\n(filib::filib)";shape = box;style = "rounded,filled";fillcolor = "#CCE7F8";color = "#6596B2";];
31+
"node2" [label = "igl_core\n(igl::core)";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
32+
"node2" -> "node0" [color = "#DAA52D";];
33+
// igl_core -> Eigen3_Eigen
34+
"node3" [label = "igl_predicates\n(igl::predicates)";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
35+
"node3" -> "node2" [color = "#DAA52D";];
36+
// igl_predicates -> igl_core
37+
"node4" [label = "predicates\n(predicates::predicates)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
38+
"node3" -> "node4" [color = "#DAA52D";];
39+
// igl_predicates -> predicates
40+
"node5" [label = "ipc_toolkit\n(ipc::toolkit)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
41+
"node5" -> "node0" [color = "#8FB976";];
42+
// ipc_toolkit -> Eigen3_Eigen
43+
"node5" -> "node1" [color = "#8FB976";];
44+
// ipc_toolkit -> filib
45+
"node5" -> "node2" [color = "#BE6562";];
46+
// ipc_toolkit -> igl_core
47+
"node5" -> "node3" [color = "#BE6562";];
48+
// ipc_toolkit -> igl_predicates
49+
"node6" [label = "robin_map\n(tsl::robin_map)";shape = box;style = "rounded,filled";fillcolor = "#FFE6CC";color = "#DAA52D";];
50+
"node5" -> "node6" [color = "#8FB976";];
51+
// ipc_toolkit -> robin_map
52+
"node7" [label = "scalable_ccd\n(scalable_ccd::scalable_ccd)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
53+
"node7" -> "node0" [color = "#8FB976";];
54+
// scalable_ccd -> Eigen3_Eigen
55+
"node8" [label = "spdlog\n(spdlog::spdlog)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
56+
"node7" -> "node8" [color = "#8FB976";];
57+
// scalable_ccd -> spdlog
58+
"node9" [label = "tbb\n(TBB::tbb)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
59+
"node7" -> "node9" [color = "#BE6562";];
60+
// scalable_ccd -> tbb
61+
"node5" -> "node7" [color = "#BE6562";];
62+
// ipc_toolkit -> scalable_ccd
63+
"node10" [label = "simple_bvh\n(simple_bvh::simple_bvh)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
64+
"node10" -> "node0" [color = "#8FB976";];
65+
// simple_bvh -> Eigen3_Eigen
66+
"node5" -> "node10" [color = "#BE6562";];
67+
// ipc_toolkit -> simple_bvh
68+
"node5" -> "node8" [color = "#8FB976";];
69+
// ipc_toolkit -> spdlog
70+
"node5" -> "node9" [color = "#BE6562";];
71+
// ipc_toolkit -> tbb
72+
"node11" [label = "tight_inclusion\n(tight_inclusion::tight_inclusion)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
73+
"node11" -> "node0" [color = "#8FB976";];
74+
// tight_inclusion -> Eigen3_Eigen
75+
"node11" -> "node8" [color = "#8FB976";];
76+
// tight_inclusion -> spdlog
77+
"node5" -> "node11" [color = "#BE6562";];
78+
// ipc_toolkit -> tight_inclusion
79+
"node12" [label = "absl_hash\n(absl::hash)";shape = box;style = "rounded,filled";fillcolor = "#D5E8D4";color = "#8FB976";];
80+
"node5" -> "node12" [color = "#8FB976";];
81+
}

0 commit comments

Comments
 (0)