From 5a73eccd4cd4a1978ef489c9a32007f5fcee45ae Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 27 Mar 2022 09:05:47 +0200 Subject: [PATCH] an option to add more projections via plugins --- hypgraph.cpp | 7 +++++++ models.cpp | 5 +++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/hypgraph.cpp b/hypgraph.cpp index ebbd365d..1768a73c 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -497,6 +497,8 @@ EX void threepoint_projection(const hyperpoint& H, hyperpoint& ret) { } #endif +EX vector> extra_projections; + EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) { hyperpoint H = H_orig.h; @@ -1345,6 +1347,11 @@ EX void apply_other_model(shiftpoint H_orig, hyperpoint& ret, eModel md) { } case mdGUARD: case mdManual: break; + + default: + if(md < isize(extra_projections) && extra_projections[md]) + extra_projections[md](H_orig, H, ret); + break; } ghcheck(ret,H_orig); diff --git a/models.cpp b/models.cpp index f63af00e..56d88b7d 100644 --- a/models.cpp +++ b/models.cpp @@ -186,6 +186,7 @@ EX namespace models { } EX bool model_available(eModel pm) { + if(mdinf[pm].flags & mf::technical) return false; if(prod) { if(pm == mdPerspective) return true; if(among(pm, mdBall, mdHemisphere)) return false; @@ -360,7 +361,7 @@ EX namespace models { USING_NATIVE_GEOMETRY_IN_RUG; #endif - for(int i=0; i