summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohannes Hofmann <Johannes.Hofmann@gmx.de>2005-09-04 12:09:18 +0200
committerJohannes Hofmann <Johannes.Hofmann@gmx.de>2005-09-04 12:09:18 +0200
commit700f8cb97bc9a033b82252e0120e41962135fb06 (patch)
treeb50f01b9d28774565dcbdcf6311745f5233a4230 /src
parent00122d6ce67e9500775d2ba6d80233b1300964b6 (diff)
make Projection_t part of Projection class
Diffstat (limited to 'src')
-rw-r--r--src/GipfelWidget.H4
-rw-r--r--src/GipfelWidget.cxx6
-rw-r--r--src/Panorama.H12
-rw-r--r--src/Panorama.cxx10
-rw-r--r--src/Projection.H5
-rw-r--r--src/gipfel.cxx4
6 files changed, 21 insertions, 20 deletions
diff --git a/src/GipfelWidget.H b/src/GipfelWidget.H
index 085908c..202ecc0 100644
--- a/src/GipfelWidget.H
+++ b/src/GipfelWidget.H
@@ -97,9 +97,9 @@ class GipfelWidget : public Fl_Widget {
double get_view_height();
- Projection_t get_projection();
+ Projection::Projection_t get_projection();
- void set_projection(Projection_t p);
+ void set_projection(Projection::Projection_t p);
Hills *get_mountains();
diff --git a/src/GipfelWidget.cxx b/src/GipfelWidget.cxx
index 95f8cde..6969744 100644
--- a/src/GipfelWidget.cxx
+++ b/src/GipfelWidget.cxx
@@ -79,7 +79,7 @@ GipfelWidget::load_image(char *file) {
char buf[1024];
double lo, la, he, dir, ni, ti, sc;
int status;
- Projection_t pt = PROJECTION_TANGENTIAL;
+ Projection::Projection_t pt = Projection::TANGENTIAL;
Fl_Image *new_img;
new_img = new Fl_JPEG_Image(file);
@@ -499,13 +499,13 @@ GipfelWidget::set_scale(double s) {
}
void
-GipfelWidget::set_projection(Projection_t p) {
+GipfelWidget::set_projection(Projection::Projection_t p) {
pan->set_projection(p);
set_labels(pan->get_visible_mountains());
redraw();
}
-Projection_t
+Projection::Projection_t
GipfelWidget::get_projection() {
return pan->get_projection();
}
diff --git a/src/Panorama.H b/src/Panorama.H
index fe5b989..0333338 100644
--- a/src/Panorama.H
+++ b/src/Panorama.H
@@ -27,10 +27,6 @@
#include "ViewParams.H"
-typedef enum {
- PROJECTION_TANGENTIAL = 0,
- PROJECTION_SPHAERIC = 1
-} Projection_t;
class Panorama {
private:
@@ -42,8 +38,8 @@ class Panorama {
Hills *close_mountains;
Hills *visible_mountains;
ViewParams parms;
- Projection *proj;
- Projection_t projection_type;
+ Projection::Projection *proj;
+ Projection::Projection_t projection_type;
Hill * get_pos(const char *name);
@@ -136,8 +132,8 @@ class Panorama {
int guess(Hills *p1, Hill *m1);
- Projection_t get_projection();
+ Projection::Projection_t get_projection();
- void set_projection(Projection_t p);
+ void set_projection(Projection::Projection_t p);
};
#endif
diff --git a/src/Panorama.cxx b/src/Panorama.cxx
index dea97e9..b72e37b 100644
--- a/src/Panorama.cxx
+++ b/src/Panorama.cxx
@@ -44,7 +44,7 @@ Panorama::Panorama() {
parms.a_tilt = 0.0;
parms.scale = 3500.0;
view_name = NULL;
- set_projection(PROJECTION_TANGENTIAL);
+ set_projection(Projection::TANGENTIAL);
}
Panorama::~Panorama() {
@@ -287,7 +287,7 @@ Panorama::set_view_height(double v) {
}
void
-Panorama::set_projection(Projection_t p) {
+Panorama::set_projection(Projection::Projection_t p) {
projection_type = p;
if (proj) {
@@ -295,11 +295,11 @@ Panorama::set_projection(Projection_t p) {
}
switch(projection_type) {
- case PROJECTION_TANGENTIAL:
+ case Projection::TANGENTIAL:
proj = new ProjectionTangential();
view_angle = pi_d / 3.0;
break;
- case PROJECTION_SPHAERIC:
+ case Projection::SPHAERIC:
proj = new ProjectionSphaeric();
view_angle = pi_d / 2.0;
break;
@@ -351,7 +351,7 @@ Panorama::get_view_height() {
return view_height;
}
-Projection_t
+Projection::Projection_t
Panorama::get_projection() {
return projection_type;
}
diff --git a/src/Projection.H b/src/Projection.H
index 92a37c8..a003f3d 100644
--- a/src/Projection.H
+++ b/src/Projection.H
@@ -30,6 +30,11 @@ class Projection {
double pi_d;
public:
+ typedef enum {
+ TANGENTIAL = 0,
+ SPHAERIC = 1
+ } Projection_t;
+
Projection();
virtual void set_coordinates(Hill *m, const ViewParams *parms);
diff --git a/src/gipfel.cxx b/src/gipfel.cxx
index 37eaaf4..e63fd86 100644
--- a/src/gipfel.cxx
+++ b/src/gipfel.cxx
@@ -142,9 +142,9 @@ void viewpoint_cb(Fl_Value_Input* o, void*) {
void proj_cb(Fl_Value_Input* o, void*d) {
if(d == NULL) {
- gipf->set_projection(PROJECTION_TANGENTIAL);
+ gipf->set_projection(Projection::TANGENTIAL);
} else {
- gipf->set_projection(PROJECTION_SPHAERIC);
+ gipf->set_projection(Projection::SPHAERIC);
}
}