~ubuntu-branches/ubuntu/trusty/xplanet/trusty

« back to all changes in this revision

Viewing changes to src/drawMultipleBodies.cpp

  • Committer: Package Import Robot
  • Author(s): Steve McIntyre
  • Date: 2014-01-30 18:54:10 UTC
  • mfrom: (4.1.8 sid)
  • Revision ID: package-import@ubuntu.com-20140130185410-o2u51emh707gbevv
Tags: 1.3.0-1
* New maintainer
* Move to new upstream version 1.3.0. (Closes: #678464)
  + Upstream highlights:
    - add "outlined" keyword to marker files
    - update JPL ephemeris code for 64 bit machines
    - add bump_shade config file parameter
    - add opacity keyword for markers
    - implement Rayleigh scattering
  + Remove old Debian patches now obsoleted:
    - possible-buffer-overflow (included upstream)
    - orbit-step-bug (included upstream)
    - gcc44-includes (included upstream)
    - hyphen-used-as-minus-sign (included upstream)
    - tsc-aspect-ratio (included upstream)
  + Update (and include!) FreeMonoBold
* Update libtiff build-deps (Closes: #736052)
* Update libpng build-deps (Closes: #662568)
* Update Standards-Version to 3.9.5
* Update to debhelper 9 to enable hardening build.

Show diffs side-by-side

added added

removed removed

Lines of Context:
103
103
 
104
104
    // Find the pixel radius and angle subtended by the target.
105
105
    // This is used to get degrees per pixel.
106
 
    double pixels_per_radian;
 
106
    double pixels_per_radian = -1;
107
107
    switch (options->FOVMode())
108
108
    {
109
109
    case RADIUS:
152
152
        double sec;
153
153
        fromJulian(options->JulianDay(), year, month, day, hour, min, sec);
154
154
 
155
 
        snprintf(buffer, 128, "Julian Date = %14.6f (%04d%02d%02d.%02d%02d%02d)\n",
 
155
        snprintf(buffer, 128, "Julian Date    = %14.6f (%04d%02d%02d.%02d%02d%02d)\n",
156
156
                 options->JulianDay(), year, month, day, hour, min, (int) (sec+0.5));
157
157
        msg << buffer;
158
158
 
159
 
        snprintf(buffer, 128, "origin XYZ  = %14.8f %14.8f %14.8f\n",
 
159
        snprintf(buffer, 128, "origin XYZ     = %14.8f %14.8f %14.8f\n",
160
160
                 oX, oY, oZ);
161
161
        msg << buffer;
162
162
 
163
 
        snprintf(buffer, 128, "target XYZ  = %14.8f %14.8f %14.8f\n",
 
163
        snprintf(buffer, 128, "target XYZ     = %14.8f %14.8f %14.8f\n",
164
164
                 tX, tY, tZ);
165
165
        msg << buffer;
166
166
 
167
 
        snprintf(buffer, 128, "up XYZ      = %14.8f %14.8f %14.8f\n",
 
167
        snprintf(buffer, 128, "up XYZ         = %14.8f %14.8f %14.8f\n",
168
168
                 upX, upY, upZ);
169
169
        msg << buffer;
170
170
 
171
 
        snprintf(buffer, 128, "fov         = %14.8f degrees\n", 
 
171
        snprintf(buffer, 128, "fov            = %14.8f degrees\n", 
172
172
                 options->FieldOfView()/deg_to_rad);
173
173
        msg << buffer;
174
 
        snprintf(buffer, 128, "dist_per_pixel = %14.8f\n", dist_per_pixel);
 
174
        snprintf(buffer, 128, "dist_per_pixel = %14.8e AU (%14.8e km)\n", 
 
175
                 dist_per_pixel, dist_per_pixel*AU_to_km);
175
176
        msg << buffer;
176
177
        xpMsg(msg.str(), __FILE__, __LINE__);
177
178
    }
178
179
 
179
180
    // Put the primary in the center of the field of view when looking
180
181
    // from above or below
181
 
    if (options->OriginMode() == ABOVE
182
 
        || options->OriginMode() == BELOW)
 
182
    if (options->OriginMode() == ABOVE || options->OriginMode() == BELOW)
183
183
    {
184
184
        findBodyXYZ(options->JulianDay(), options->Primary(), -1, tX, tY, tZ);
185
185
    }
414
414
        m = createMap(sLat, sLon, oLat, oLon, width, height, pR,
415
415
                      current_planet, ring, planetsFromSunMap,
416
416
                      currentProperties);
 
417
 
 
418
        if (!options->OutputMapRect().empty())
 
419
        {
 
420
            if (current_planet->Index() == options->Target())
 
421
            {
 
422
                
 
423
                if (!m->Write(options->OutputMapRect().c_str()))
 
424
                {
 
425
                    ostringstream errStr;
 
426
                    errStr << "Can't create " << options->OutputMapRect() 
 
427
                           << "\n";
 
428
                    xpWarn(errStr.str(), __FILE__, __LINE__);
 
429
                }
 
430
            }
 
431
        }
 
432
        
417
433
        if (current_planet->Index() == JUPITER
418
434
            || current_planet->Index() == SATURN)
419
435
        {
420
436
            drawEllipsoid(pX, pY, pR, oX, oY, oZ, 
421
437
                          X, Y, Z, display, view, m,
422
 
                          current_planet, 
423
 
                          currentProperties->Magnify());
 
438
                          current_planet, currentProperties);
424
439
        }
425
440
        else
426
441
        {
427
442
            drawSphere(pX, pY, pR, oX, oY, oZ, 
428
443
                       X, Y, Z, display, view, m,
429
 
                       current_planet, 
430
 
                       current_planet->Radius() 
431
 
                       * currentProperties->Magnify());
 
444
                       current_planet, currentProperties);
432
445
        }
433
446
        delete m;
434
447