summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-30 06:54:35 +0000
committerJohannes Hofmann <johannes.hofmann@gmx.de>2005-04-30 06:54:35 +0000
commit89f0409c69a69132ecc581451c9c0d750e0a4bc7 (patch)
treee280a2b2899310c06628550f133d2e9f6e709a6f
parentd1d892145b6aa9f44d09b25f8cdab825fea74dbb (diff)
cleanups
cleanups
-rw-r--r--src/GipfelWidget.cxx10
-rw-r--r--src/Panorama.cxx31
2 files changed, 11 insertions, 30 deletions
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 4bdc991..9883611 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: GipfelWidget.cxx,v 1.12 2005/04/30 07:58:19 hofmann Exp $"
+// "$Id: GipfelWidget.cxx,v 1.13 2005/04/30 08:54:35 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -106,11 +106,9 @@ GipfelWidget::draw() {
fl_color(FL_BLACK);
}
- fl_rectf(center_x + m->x + x() - 2,
- center_y + m->y + y() - 2,
- 4,
- 4);
- // fl_line(center_x + m->x + x(), 0 + y(), center_x + m->x + x(), h() + y());
+ fl_xyline(center_x + m->x + x() - 2, center_y + m->y + y(), center_x + m->x + x() + 2);
+ fl_yxline(center_x + m->x + x(), center_y + m->y + y() - 2, center_y + m->y + y() + 2);
+
fl_draw(m->name,
center_x + m->x + x(),
center_y + m->y + y());
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index 30f8a31..4756e57 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Panorama.cxx,v 1.13 2005/04/30 07:58:19 hofmann Exp $"
+// "$Id: Panorama.cxx,v 1.14 2005/04/30 08:54:35 hofmann Exp $"
//
// PSEditWidget routines.
//
@@ -41,7 +41,7 @@ Panorama::Panorama() {
a_center = 0.0;
a_nick = 0.0;
a_tilt = 0.0;
- scale = 20.0;
+ scale = 500.0;
}
Panorama::~Panorama() {
@@ -135,6 +135,8 @@ Panorama::set_mountain(Mountain *m, int x, int y) {
int
Panorama::comp_params() {
+ int i;
+
if (m1 == NULL || m2 == NULL) {
fprintf(stderr, "Position two mountains first.\n");
m1 = NULL;
@@ -153,13 +155,8 @@ Panorama::comp_params() {
scale = comp_scale(m1->alph, m2->alph, x1, x2);
fprintf(stderr, "center = %f, scale = %f, nick=%f\n", a_center /deg2rad, scale, a_nick/deg2rad);
a_nick = atan ((y1 + tan(m1->a_nick) * scale) / ( scale - y1 * tan(m1->a_nick)));
- // a_nick = comp_center_angle(m1->a_nick, m2->a_nick, -y1, -y2) - pi;
fprintf(stderr, "center = %f, scale = %f, nick=%f\n", a_center /deg2rad, scale, a_nick/deg2rad);
-#if 0
- m1 = NULL;
- m2 = NULL;
-#endif
tan_nick_view = tan(a_nick);
tan_dir_view = tan(a_center);
@@ -169,10 +166,9 @@ Panorama::comp_params() {
tan_dir_m2 = tan(m2->alph);
tan_nick_m2 = tan(m2->a_nick);
- newton();
- newton();
- newton();
- newton();
+ for (i=0; i<8; i++) {
+ newton();
+ }
a_nick = atan(tan_nick_view);
a_center = atan(tan_dir_view);
@@ -339,19 +335,6 @@ Panorama::alpha(double phi, double lam) {
return alph;
}
-#if 0
-double
-Panorama::center_angle(double alph_a, double alph_b, double d1, double d2) {
- double tan_a, tan_b;
-
- tan_a = tan(alph_a - alph_b);
- fprintf(stderr, "tan_a %f\n", tan_a);
- tan_b = (d2 - d1 + ((sqrt((d2*(d2 - (2.0*d1*(1.0 + (2.0 * tan_a * tan_a))))) + (d1*d1))))) / (2.0*d2*tan_a);
-
- fprintf(stderr, "tan_b=%f\n", tan_b);
- return alph_a + atan(tan_b);
-}
-#endif
double
Panorama::comp_center_angle(double a1, double a2, double d1, double d2) {