improved model naming a bit

This commit is contained in:
Zeno Rogue 2019-03-20 02:12:37 +01:00
parent 46ae64e945
commit 3f941cabb0
4 changed files with 22 additions and 14 deletions

View File

@ -1803,7 +1803,7 @@ vector<geometryinfo> ginf = {
#define X3(x) x, x, x
const modelinfo models[int(mdPolynomial)+1] = {
{X3("disk"), mf::azimuthal | mf::conformal},
{"disk/Gans", "general perspective", "general perspective", mf::azimuthal | mf::conformal},
{"half-plane", "inversion", "half-plane", mf::conformal},
{"band", "band", "Mercator", mf::band | mf::conformal},
{X3("polygonal"), mf::conformal},

View File

@ -595,18 +595,21 @@ namespace conformal {
}
bool model_has_transition() {
return among(pmodel, mdJoukowsky, mdJoukowskyInverted, mdBand);
return among(pmodel, mdJoukowsky, mdJoukowskyInverted, mdBand) && DIM == 2;
}
int editpos = 0;
string get_model_name(eModel m) {
if(m == mdDisk && DIM == 3 && hyperbolic) return XLAT("ball model/Gans");
if(m == mdDisk && DIM == 3) return XLAT("perspective in 4D");
if(m == mdHalfplane && DIM == 3 && hyperbolic) return XLAT("half-space");
if(sphere)
return models[m].name_spherical;
return XLAT(models[m].name_spherical);
if(euclid)
return models[m].name_euclidean;
return XLAT(models[m].name_euclidean);
if(hyperbolic)
return models[m].name_hyperbolic;
return XLAT(models[m].name_hyperbolic);
return "?";
}
@ -670,7 +673,7 @@ namespace conformal {
void model_menu() {
cmode = sm::SIDE | sm::MAYDARK | sm::CENTER;
gamescreen(0);
dialog::init(XLAT("models of hyperbolic geometry"));
dialog::init(XLAT("models and projections"));
for(int i=0; i<mdGUARD; i++) {
eModel m = eModel(i);
if(m == mdFormula && ISMOBILE) continue;
@ -709,7 +712,8 @@ namespace conformal {
}
if(among(pmodel, mdDisk, mdBall, mdHyperboloid, mdRotatedHyperboles)) {
dialog::addSelItem(XLAT("Projection at the ground level"), fts3(vid.alpha), 'p');
dialog::addSelItem(XLAT("projection distance"),
fts3(vid.alpha) + " (" + current_proj_name() + ")", 'p');
}
if(model_has_orientation()) {

View File

@ -448,17 +448,21 @@ string current_proj_name() {
if(pmodel != mdDisk)
return conformal::get_model_name(pmodel);
else if(hyperbolic && vid.alpha == 1)
return "Poincaré";
return XLAT("Poincaré");
else if(hyperbolic && vid.alpha == 0)
return "Klein";
return XLAT("Klein");
else if(hyperbolic && vid.alpha == -1)
return "inverted Poincaré";
return XLAT("inverted Poincaré");
else if(sphere && vid.alpha == 1)
return "stereographic";
return XLAT("stereographic");
else if(sphere && vid.alpha == 0)
return "gnomonic";
return XLAT("gnomonic");
else if(sphere && vid.alpha >= 999)
return XLAT("orthographic");
else if(hyperbolic && vid.alpha >= 999)
return XLAT("Gans");
else
return "generalized perspective";
return XLAT("general perspective");
}
void showEuclideanMenu() {

View File

@ -381,7 +381,7 @@ void showDisplayMode() {
#endif
if(DIM == 2)
dialog::addBoolItem(XLAT("models of hyperbolic geometry"), pmodel, 'a');
dialog::addBoolItem(XLAT("models and projections"), pmodel, 'a');
if(DIM == 2)
dialog::addBoolItem(XLAT("animations/history"), anims::any_on(), 'A');