Skip to content

Commit 73badf7

Browse files
committed
Remove ellipse domain option from VoronoiVisual, removing the arma requirement
1 parent c073d6a commit 73badf7

3 files changed

Lines changed: 41 additions & 40 deletions

File tree

examples/CMakeLists.txt

Lines changed: 33 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,33 @@ target_link_libraries(draw_triangles_intersections OpenGL::GL glfw Freetype::Fre
408408
add_executable(triangle_intersect triangle_intersect.cpp)
409409
target_link_libraries(triangle_intersect OpenGL::GL glfw Freetype::Freetype)
410410

411+
add_executable(voronoi_random voronoi_random.cpp)
412+
target_link_libraries(voronoi_random OpenGL::GL glfw Freetype::Freetype)
413+
414+
add_executable(voronoi_boundary voronoi_boundary.cpp)
415+
target_link_libraries(voronoi_boundary OpenGL::GL glfw Freetype::Freetype)
416+
417+
add_executable(voronoi_rectangular voronoi_rectangular.cpp)
418+
target_link_libraries(voronoi_rectangular OpenGL::GL glfw Freetype::Freetype)
419+
420+
add_executable(voronoi_vectordata voronoi_vectordata.cpp)
421+
target_link_libraries(voronoi_vectordata OpenGL::GL glfw Freetype::Freetype)
422+
423+
add_executable(voronoi_function voronoi_function.cpp)
424+
target_link_libraries(voronoi_function OpenGL::GL glfw Freetype::Freetype)
425+
426+
add_executable(voronoi_function_flat voronoi_function_flat.cpp)
427+
target_link_libraries(voronoi_function_flat OpenGL::GL glfw Freetype::Freetype)
428+
429+
add_executable(voronoi_fixed voronoi_fixed.cpp)
430+
target_link_libraries(voronoi_fixed OpenGL::GL glfw Freetype::Freetype)
431+
432+
add_executable(voronoi_fixed_xz voronoi_fixed_xz.cpp)
433+
target_link_libraries(voronoi_fixed_xz OpenGL::GL glfw Freetype::Freetype)
434+
435+
add_executable(voronoi_fixed_nearlyz voronoi_fixed_nearlyz.cpp)
436+
target_link_libraries(voronoi_fixed_nearlyz OpenGL::GL glfw Freetype::Freetype)
437+
411438
add_executable(rectangle rectangle.cpp)
412439
target_link_libraries(rectangle OpenGL::GL glfw Freetype::Freetype)
413440

@@ -531,44 +558,15 @@ endif()
531558
add_executable(show_boundingboxes show_boundingboxes.cpp)
532559
target_link_libraries(show_boundingboxes OpenGL::GL glfw Freetype::Freetype)
533560

534-
if(ARMADILLO_FOUND)
535-
# if have compound-ray header
536-
add_executable(cray_eye cray_eye.cpp)
537-
target_link_libraries(cray_eye OpenGL::GL glfw Freetype::Freetype)
561+
# if have compound-ray header
562+
add_executable(cray_eye cray_eye.cpp)
563+
target_link_libraries(cray_eye OpenGL::GL glfw Freetype::Freetype)
538564

539-
# use of principle component analysis from arma in this example
565+
if(ARMADILLO_FOUND)
566+
# Make use of principle component analysis from arma in this example
540567
add_executable(ellipse_pca ellipse_pca.cpp)
541568
target_link_libraries(ellipse_pca ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
542-
543-
# Voronoi code now also uses arma
544-
add_executable(voronoi_random voronoi_random.cpp)
545-
target_link_libraries(voronoi_random ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
546-
547-
add_executable(voronoi_boundary voronoi_boundary.cpp)
548-
target_link_libraries(voronoi_boundary ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
549-
550-
add_executable(voronoi_rectangular voronoi_rectangular.cpp)
551-
target_link_libraries(voronoi_rectangular ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
552-
553-
add_executable(voronoi_vectordata voronoi_vectordata.cpp)
554-
target_link_libraries(voronoi_vectordata ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
555-
556-
add_executable(voronoi_function voronoi_function.cpp)
557-
target_link_libraries(voronoi_function ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
558-
559-
add_executable(voronoi_function_flat voronoi_function_flat.cpp)
560-
target_link_libraries(voronoi_function_flat ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
561-
562-
add_executable(voronoi_fixed voronoi_fixed.cpp)
563-
target_link_libraries(voronoi_fixed ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
564-
565-
add_executable(voronoi_fixed_xz voronoi_fixed_xz.cpp)
566-
target_link_libraries(voronoi_fixed_xz ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
567-
568-
add_executable(voronoi_fixed_nearlyz voronoi_fixed_nearlyz.cpp)
569-
target_link_libraries(voronoi_fixed_nearlyz ${ARMADILLO_LIBRARY} ${ARMADILLO_LIBRARIES} OpenGL::GL glfw Freetype::Freetype)
570-
571-
endif(ARMADILLO_FOUND)
569+
endif()
572570

573571
add_executable(trace_boundary trace_boundary.cpp)
574572
target_link_libraries(trace_boundary OpenGL::GL glfw Freetype::Freetype)

mplot/VoronoiVisual.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
#include <map>
1919
#include <set>
2020

21-
#include <armadillo>
22-
2321
#include <sm/vec>
2422
#include <sm/range>
2523
#include <sm/quaternion>
@@ -126,6 +124,13 @@ namespace mplot
126124
this->boundary.resize (this->num_boundary_points, cent2.plus_one_dim());
127125

128126
if (this->dom_shape == domain_shape::ellipsoid) {
127+
throw std::runtime_error ("Elliptic domain shapes not supported");
128+
/*
129+
* Here is an approach using arma::princomp, but I don't want the arma
130+
* dependency, as elliptic boundaries are not as useful to me as traced
131+
* boundaries. This code awaits sm::pca::compute().
132+
*/
133+
#if 0
129134
// Find ellipse parameters for the data. First place data in an arma::mat, offsetting by the centroid
130135
arma::Mat<float> x (dcoords_ptr->size(), 2);
131136
for (unsigned int i = 0; i < dcoords_ptr->size(); ++i) {
@@ -149,7 +154,7 @@ namespace mplot
149154
sm::vec<float, 2> bp = el_rotn * sm::vec<float, 2>{ a * std::cos (phi), b * std::sin (phi) } + cent2;
150155
this->boundary[i] = bp.plus_one_dim();
151156
}
152-
157+
#endif
153158
} else { // circular boundary
154159
float l = max_len + this->border_width;
155160
for (unsigned int i = 0; i < this->num_boundary_points; ++i) {

mplot/compoundray/EyeVisual.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#include <array>
88
#include <vector>
99

10-
#include <armadillo>
11-
1210
#include <sm/mathconst>
1311
#include <sm/vec>
1412
#include <sm/range>

0 commit comments

Comments
 (0)