model listing

This commit is contained in:
Zeno Rogue 2018-11-09 14:13:01 +01:00
parent 7d6136375f
commit 41445f00ca
4 changed files with 81 additions and 27 deletions

View File

@ -1684,4 +1684,34 @@ geometryinfo ginf[gGUARD] = {
{"Archimedean", "A", 7, 3, 0, gcHyperbolic, 0, {{7, 5}}, eVariation::pure}
};
#define X3(x) x, x, x
const modelinfo models[int(mdPolynomial)+1] = {
{X3("disk"), mf::azimuthal | mf::conformal},
{"half-plane", "inversion", "half-plane", mf::conformal},
{"band", "band", "Mercator", mf::band | mf::conformal},
{X3("polygonal"), mf::conformal},
{X3("formula"), 0},
{X3("azimuthal equidistant"), mf::azimuthal | mf::equidistant | mf::euc_boring},
{X3("azimuthal equi-area"), mf::azimuthal | mf::equiarea | mf::euc_boring},
{X3("ball model"), mf::conformal | mf::azimuthal | mf::space},
{"Minkowski hyperboloid", "plane", "sphere", mf::conformal | mf::space | mf::euc_boring},
{"hemisphere", "sphere", "sphere", mf::conformal | mf::space},
{X3("band equidistant"), mf::band | mf::equidistant | mf::euc_boring},
{X3("band equi-area"), mf::band | mf::equiarea | mf::euc_boring},
{X3("sinusoidal"), mf::quasiband | mf::equiarea | mf::euc_boring},
{X3("two-point equidistant"), mf::equidistant | mf::euc_boring},
{X3("fisheye"), 0},
{X3("Joukowsky transform"), mf::hyper_only | mf::conformal},
{X3("Joukowsky+inversion"), mf::hyper_only | mf::conformal},
{X3("rotated hyperboles"), mf::hyper_only},
{X3("spiral"), mf::hyper_or_torus | mf::quasiband},
{X3(""), 0},
{X3(""), 0},
{X3(""), 0},
{X3("polynomial"), mf::conformal}
};
#undef X3
}

View File

@ -247,4 +247,45 @@ enum cpatterntype {
struct landtacinfo { eLand l; int tries, multiplier; };
enum eModel {
mdDisk, mdHalfplane, mdBand, mdPolygonal, mdFormula,
mdEquidistant, mdEquiarea, mdBall, mdHyperboloid,
mdHemisphere, mdBandEquidistant, mdBandEquiarea, mdSinusoidal, mdTwoPoint,
mdFisheye, mdJoukowsky, mdJoukowskyInverted,
mdRotatedHyperboles, mdSpiral,
mdGUARD, mdUnchanged, mdHyperboloidFlat, mdPolynomial
};
typedef unsigned long long flagtype;
namespace mf {
static const flagtype azimuthal = 1;
static const flagtype band = 2 + 512;
static const flagtype equiarea = 4;
static const flagtype equidistant = 8;
static const flagtype conformal = 16;
static const flagtype euc_boring = 32;
static const flagtype space = 64;
static const flagtype hyper_only = 128;
static const flagtype hyper_or_torus = 256;
static const flagtype quasiband = 512;
};
struct modelinfo {
const char *name_hyperbolic;
const char *name_euclidean;
const char *name_spherical;
flagtype flags;
int is_azimuthal;
int is_band;
int is_equiarea;
int is_equidistant;
int is_conformal;
const char* name;
};
extern const modelinfo models[int(mdPolynomial)+1];
}

View File

@ -556,24 +556,6 @@ namespace conformal {
}
#endif
const char *modelnames[MODELCOUNT] = {
"disk", "half-plane", "band", "polygonal", "formula",
"azimuthal equidistant", "azimuthal equi-area",
"ball model", "Minkowski hyperboloid", "hemisphere",
"band equidistant", "band equi-area", "sinusoidal", "two-point equidistant",
"fisheye", "Joukowsky transform", "Joukowsky+inversion", "rotated hyperboles"
};
string get_model_name(eModel pm) {
return XLAT(
pm == mdBand && sphere ? "Mercator" :
pm == mdHalfplane && euclid ? "inversion" :
pm == mdHemisphere && !hyperbolic ? "sphere" :
pm == mdHyperboloid && euclid ? "plane" :
pm == mdHyperboloid && sphere ? "sphere" :
modelnames[pm]);
}
bool model_available(eModel pm) {
if(sphere && (pm == mdHalfplane || pm == mdBall))
return false;
@ -590,6 +572,16 @@ namespace conformal {
}
int editpos = 0;
string get_model_name(eModel m) {
if(sphere)
return models[m].name_spherical;
if(euclid)
return models[m].name_euclidean;
if(hyperbolic)
return models[m].name_hyperbolic;
return "?";
}
void model_menu() {
cmode = sm::SIDE | sm::MAYDARK | sm::CENTER;

View File

@ -1270,15 +1270,6 @@ extern ld ruggo;
#define HASLINEVIEW
enum eModel {
mdDisk, mdHalfplane, mdBand, mdPolygonal, mdFormula,
mdEquidistant, mdEquiarea, mdBall, mdHyperboloid,
mdHemisphere, mdBandEquidistant, mdBandEquiarea, mdSinusoidal, mdTwoPoint,
mdFisheye, mdJoukowsky, mdJoukowskyInverted,
mdRotatedHyperboles,
mdGUARD, mdUnchanged, mdHyperboloidFlat, mdPolynomial
};
namespace conformal {
extern bool on;
extern vector<pair<cell*, eMonster> > killhistory;