~ubuntu-branches/ubuntu/warty/xplanet/warty

« back to all changes in this revision

Viewing changes to src/Ring.h

  • Committer: Bazaar Package Importer
  • Author(s): LaMont Jones
  • Date: 2004-08-24 07:14:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040824071400-2dr4qnjbjmm8z3ia
Tags: 1.0.6-1ubuntu1
Build-depend: libtiff4-dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef RING_H
 
2
#define RING_H
 
3
 
 
4
class Planet;
 
5
 
 
6
class Ring
 
7
{
 
8
 public:
 
9
    Ring(const double inner_radius, const double outer_radius, 
 
10
         const double planet_radius, 
 
11
         const double *ring_brightness, const int num_bright,
 
12
         const double *ring_transparency, const int num_trans,
 
13
         const double sunlon, const double sunlat,
 
14
         const double shade, 
 
15
         Planet *p);
 
16
 
 
17
    ~Ring();
 
18
 
 
19
    // get the radius of the ring shadowing the specified location on
 
20
    // the planet
 
21
    double getShadowRadius(double lat, double lon);
 
22
 
 
23
    // get the brightness on the lit side
 
24
    double getBrightness(const double lon, const double r);
 
25
 
 
26
    // get the brightness on the dark side
 
27
    double getBrightness(const double lon, const double r, const double t);
 
28
 
 
29
    double getTransparency(const double r);
 
30
 
 
31
    // set the size of each pixel, used to window average the ring
 
32
    // brightness/transparency
 
33
    void setDistPerPixel(const double d);
 
34
 
 
35
    double getOuterRadius() const { return(r_out); };
 
36
 
 
37
 private:
 
38
    double r_out;  // outer ring radius, units of planetary radii
 
39
    double dr_b;   // resolution of brightness grid
 
40
    double dr_t;   // resolution of transparency grid
 
41
 
 
42
    int num_t;
 
43
    double *radius_t;
 
44
    double *transparency;
 
45
    int window_t;  // each pixel contains this many transparency points
 
46
 
 
47
    int num_b;
 
48
    double *radius_b;
 
49
    double *brightness;
 
50
    int window_b;  // each pixel contains this many brightness points
 
51
 
 
52
    Planet *planet_;
 
53
 
 
54
    double shade_;
 
55
    double sun_lat, sun_lon;
 
56
    double sunX_, sunY_, sunZ_;
 
57
 
 
58
    double ellipseCoeffC_; // constant in quadratic to solve for
 
59
                           // ellipsoid intersection
 
60
 
 
61
    // get a window average of array
 
62
    double getValue(const double *array, const int size, const int window,
 
63
                    const double dr, const double r);
 
64
 
 
65
    // get a window average of array, accounts for shadowing by the planet
 
66
    double getValue(const double *array, const int size, const int window,
 
67
                    const double dr, const double r, const double lon);
 
68
};
 
69
 
 
70
#endif