Changeset 15195


Ignore:
Timestamp:
03/30/13 15:34:37 (12 years ago)
Author:
tbretz
Message:
Added some functions for export and a C++ wrapper.
Location:
trunk/Mars/libnova
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/libnova/NovaLinkDef.h

    r15191 r15195  
    55#pragma link off all functions;
    66
    7 // transform
     7#pragma link C++ global LN_SOLAR_STANDART_HORIZON;
     8
    89#pragma link C++ struct ln_lnlat_posn;
    910#pragma link C++ struct ln_hrz_posn;
     
    2122
    2223// lunar
     24#pragma link C++ function ln_get_lunar_equ_coords;
    2325#pragma link C++ function ln_get_lunar_equ_coords_prec;
    2426#pragma link C++ function ln_get_lunar_disk;
     27#pragma link C++ function ln_get_lunar_rst;
     28
     29// Nova wrapper
     30#pragma link C++ namespace Nova;
    2531
    2632#endif
  • trunk/Mars/libnova/nova.cc

    r15180 r15195  
    1 #include "nova.h"
     1//#include "nova.h"
  • trunk/Mars/libnova/nova.h

    r15180 r15195  
     1#ifndef MARS_Nova
     2#define MARS_Nova
     3
    14#include <libnova/solar.h>
    25#include <libnova/lunar.h>
    36#include <libnova/rise_set.h>
    47#include <libnova/transform.h>
     8
     9namespace Nova
     10{
     11    typedef ln_lnlat_posn LnLatPosn;
     12    typedef ln_hrz_posn   HrzPosn;
     13    typedef ln_equ_posn   EquPosn;
     14    typedef ln_rst_time   RstTime;
     15
     16    HrzPosn GetHrzFromEqu(const EquPosn &obj, const LnLatPosn &obs, double jd)
     17    {
     18        HrzPosn hrz;
     19        ln_get_hrz_from_equ(const_cast<EquPosn*>(&obj), const_cast<LnLatPosn*>(&obs), jd, &hrz);
     20        return hrz;
     21    }
     22
     23    RstTime GetSolarRst(double jd, const LnLatPosn &obs, double hrz=LN_SOLAR_STANDART_HORIZON)
     24    {
     25        RstTime rst;
     26        ln_get_solar_rst_horizon(jd, const_cast<LnLatPosn*>(&obs), hrz, &rst);
     27        return rst;
     28    }
     29
     30    RstTime GetLunarRst(double jd, const LnLatPosn &obs)
     31    {
     32        RstTime rst;
     33        ln_get_lunar_rst(jd, const_cast<LnLatPosn*>(&obs), &rst);
     34        return rst;
     35    }
     36
     37    double GetLunarDisk(double jd)
     38    {
     39        return ln_get_lunar_disk(jd);
     40    }
     41
     42    EquPosn GetLunarEquCoords(double jd, double precision=0)
     43    {
     44        EquPosn equ;
     45        ln_get_lunar_equ_coords_prec(jd, &equ, precision);
     46        return equ;
     47    }
     48}
     49
     50#endif
Note: See TracChangeset for help on using the changeset viewer.