1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-17 20:53:02 +00:00

nicer model flag naming

This commit is contained in:
Zeno Rogue 2019-08-14 15:25:00 +02:00
parent 2693298825
commit 7f967ba30d
4 changed files with 11 additions and 7 deletions

View File

@ -595,20 +595,20 @@ const modelinfo mdinf[int(mdPolynomial)+1] = {
{"hemisphere", "sphere", "sphere", mf::conformal | mf::space}, {"hemisphere", "sphere", "sphere", mf::conformal | mf::space},
{X3("band equidistant"), mf::band | mf::equidistant | mf::euc_boring}, {X3("band equidistant"), mf::band | mf::equidistant | mf::euc_boring},
{X3("band equi-area"), mf::band | mf::equiarea | mf::euc_boring}, {X3("band equi-area"), mf::band | mf::equiarea | mf::euc_boring},
{X3("sinusoidal"), mf::quasiband | mf::equiarea | mf::euc_boring}, {X3("sinusoidal"), mf::pseudoband | mf::equiarea | mf::euc_boring},
{X3("two-point equidistant"), mf::equidistant | mf::euc_boring | mf::twopoint}, {X3("two-point equidistant"), mf::equidistant | mf::euc_boring | mf::twopoint},
{X3("fisheye"), 0}, {X3("fisheye"), 0},
{X3("Joukowsky transform"), mf::hyper_only | mf::conformal}, {X3("Joukowsky transform"), mf::hyper_only | mf::conformal},
{X3("Joukowsky+inversion"), mf::hyper_only | mf::conformal}, {X3("Joukowsky+inversion"), mf::hyper_only | mf::conformal},
{X3("rotated hyperboles"), mf::hyper_only}, {X3("rotated hyperboles"), mf::hyper_only},
{X3("spiral/ring"), mf::hyper_or_torus | mf::quasiband}, {X3("spiral/ring"), mf::hyper_or_torus | mf::uses_bandshift},
{X3("native perspective"), 0}, {X3("native perspective"), 0},
{X3("azimuthal equi-volume"), mf::azimuthal | mf::equivolume | mf::euc_boring}, {X3("azimuthal equi-volume"), mf::azimuthal | mf::equivolume | mf::euc_boring},
{X3("central inversion"), mf::azimuthal | mf::conformal}, {X3("central inversion"), mf::azimuthal | mf::conformal},
{X3("two-point azimuthal"), mf::euc_boring | mf::twopoint}, {X3("two-point azimuthal"), mf::euc_boring | mf::twopoint},
{X3("two-point hybrid"), mf::euc_boring | mf::twopoint}, {X3("two-point hybrid"), mf::euc_boring | mf::twopoint},
{X3("geodesic"), 0}, {X3("geodesic"), 0},
{X3("Mollweide"), mf::euc_boring | mf::quasiband | mf::equiarea }, {X3("Mollweide"), mf::euc_boring | mf::pseudoband | mf::equiarea },
{X3(""), 0}, {X3(""), 0},
{X3("polynomial"), mf::conformal} {X3("polynomial"), mf::conformal}
}; };

View File

@ -295,7 +295,7 @@ typedef unsigned long long flagtype;
namespace mf { namespace mf {
static const flagtype azimuthal = 1; static const flagtype azimuthal = 1;
static const flagtype band = 2 + 512; static const flagtype cylindrical = 2;
static const flagtype equiarea = 4; static const flagtype equiarea = 4;
static const flagtype equidistant = 8; static const flagtype equidistant = 8;
static const flagtype conformal = 16; static const flagtype conformal = 16;
@ -303,9 +303,13 @@ namespace mf {
static const flagtype space = 64; static const flagtype space = 64;
static const flagtype hyper_only = 128; static const flagtype hyper_only = 128;
static const flagtype hyper_or_torus = 256; static const flagtype hyper_or_torus = 256;
static const flagtype quasiband = 512; static const flagtype pseudocylindrical = 512; /* includes cylindrical */
static const flagtype equivolume = 1024; static const flagtype equivolume = 1024;
static const flagtype twopoint = 2048; static const flagtype twopoint = 2048;
static const flagtype uses_bandshift = 4096;
static const flagtype band = (cylindrical | pseudocylindrical | uses_bandshift);
static const flagtype pseudoband = (pseudocylindrical | uses_bandshift);
}; };
struct modelinfo { struct modelinfo {

View File

@ -1831,7 +1831,7 @@ EX void draw_boundary(int w) {
EX ld band_shift = 0; EX ld band_shift = 0;
EX void fix_the_band(transmatrix& T) { EX void fix_the_band(transmatrix& T) {
if(((mdinf[pmodel].flags & mf::quasiband) && T[DIM][DIM] > 1e6) || (sphere && pmodel == mdSpiral)) { if(((mdinf[pmodel].flags & mf::uses_bandshift) && T[DIM][DIM] > 1e6) || (sphere && pmodel == mdSpiral)) {
hyperpoint H = tC0(T); hyperpoint H = tC0(T);
find_zlev(H); find_zlev(H);
models::apply_orientation(H[0], H[1]); models::apply_orientation(H[0], H[1]);

View File

@ -108,7 +108,7 @@ EX namespace polygonal {
#if HDR #if HDR
inline bool mdAzimuthalEqui() { return among(pmodel, mdEquidistant, mdEquiarea, mdEquivolume); } inline bool mdAzimuthalEqui() { return among(pmodel, mdEquidistant, mdEquiarea, mdEquivolume); }
inline bool mdBandAny() { return among(pmodel, mdBand, mdBandEquidistant, mdBandEquiarea, mdSinusoidal, mdMollweide); } inline bool mdBandAny() { return mdinf[pmodel].flags & mf::pseudoband; }
#endif #endif
EX namespace models { EX namespace models {