Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (6 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

Location:
trunk/lib/FlairSensorActuator/src/unexported
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairSensorActuator/src/unexported/AfroBldc_impl.h

    r3 r15  
    1616/*********************************************************************/
    1717
    18 
    1918#ifndef AFROBLDC_IMPL_H
    2019#define AFROBLDC_IMPL_H
     
    2524#define MAX_MOTORS 8
    2625
    27 namespace flair
    28 {
    29     namespace core
    30     {
    31         class I2cPort;
    32     }
    33     namespace gui
    34     {
    35         class SpinBox;
    36         class GroupBox;
    37         class Layout;
    38     }
    39     namespace actuator
    40     {
    41         class AfroBldc;
    42     }
    43     namespace sensor
    44     {
    45         class BatteryMonitor;
    46     }
     26namespace flair {
     27namespace core {
     28class I2cPort;
     29}
     30namespace gui {
     31class SpinBox;
     32class GroupBox;
     33class Layout;
     34}
     35namespace actuator {
     36class AfroBldc;
     37}
     38namespace sensor {
     39class BatteryMonitor;
     40}
    4741}
    4842
    49 class AfroBldc_impl
    50 {
    51     public:
    52         AfroBldc_impl(flair::actuator::AfroBldc* self,flair::gui::Layout *layout,flair::core::I2cPort* i2cport);
    53         ~AfroBldc_impl();
    54         void SetMotors(float* value);
     43class AfroBldc_impl {
     44public:
     45  AfroBldc_impl(flair::actuator::AfroBldc *self, flair::gui::Layout *layout,
     46                flair::core::I2cPort *i2cport);
     47  ~AfroBldc_impl();
     48  void SetMotors(float *value);
    5549
    56     private:
    57         void WriteValue(uint16_t value);//I2cPort mutex must be taken before calling this function
    58         int nb_mot;
    59         flair::core::I2cPort* i2cport;
    60         flair::actuator::AfroBldc* self;
     50private:
     51  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
     52                                   // this function
     53  int nb_mot;
     54  flair::core::I2cPort *i2cport;
     55  flair::actuator::AfroBldc *self;
    6156};
    6257
  • trunk/lib/FlairSensorActuator/src/unexported/BlCtrlV2_impl.h

    r3 r15  
    1616/*********************************************************************/
    1717
    18 
    1918#ifndef BLCTRLV2_IMPL_H
    2019#define BLCTRLV2_IMPL_H
     
    2524#define MAX_MOTORS 8
    2625
    27 namespace flair
    28 {
    29     namespace core
    30     {
    31         class I2cPort;
    32     }
    33     namespace gui
    34     {
    35         class SpinBox;
    36         class GroupBox;
    37         class Layout;
    38     }
    39     namespace actuator
    40     {
    41         class BlCtrlV2;
    42     }
    43     namespace sensor
    44     {
    45         class BatteryMonitor;
    46     }
     26namespace flair {
     27namespace core {
     28class I2cPort;
     29}
     30namespace gui {
     31class SpinBox;
     32class GroupBox;
     33class Layout;
     34}
     35namespace actuator {
     36class BlCtrlV2;
     37}
     38namespace sensor {
     39class BatteryMonitor;
     40}
    4741}
    4842
    49 class BlCtrlV2_impl
    50 {
    51     public:
    52         BlCtrlV2_impl(flair::actuator::BlCtrlV2* self,flair::gui::Layout *layout,flair::core::I2cPort* i2cport);
    53         ~BlCtrlV2_impl();
    54         void SetMotors(float* value);
    55         flair::sensor::BatteryMonitor *battery;
    56         flair::gui::SpinBox *poles;
     43class BlCtrlV2_impl {
     44public:
     45  BlCtrlV2_impl(flair::actuator::BlCtrlV2 *self, flair::gui::Layout *layout,
     46                flair::core::I2cPort *i2cport);
     47  ~BlCtrlV2_impl();
     48  void SetMotors(float *value);
     49  flair::sensor::BatteryMonitor *battery;
     50  flair::gui::SpinBox *poles;
    5751
    58     private:
    59         void WriteValue(uint16_t value);//I2cPort mutex must be taken before calling this function
    60         void DetectMotors(void);
    61         void GetCurrentSpeedAndVoltage(float &current,float &speed,float &voltage);//I2cPort mutex must be taken before calling this function
    62         void GetCurrentAndSpeed(float &current,float &speed);//I2cPort mutex must be taken before calling this function
    63         flair::core::Time last_voltage_time;
    64         int nb_mot;
    65         flair::core::I2cPort* i2cport;
    66         flair::actuator::BlCtrlV2* self;
     52private:
     53  void WriteValue(uint16_t value); // I2cPort mutex must be taken before calling
     54                                   // this function
     55  void DetectMotors(void);
     56  void GetCurrentSpeedAndVoltage(float &current, float &speed,
     57                                 float &voltage); // I2cPort mutex must be taken
     58                                                  // before calling this
     59                                                  // function
     60  void GetCurrentAndSpeed(
     61      float &current,
     62      float &speed); // I2cPort mutex must be taken before calling this function
     63  flair::core::Time last_voltage_time;
     64  int nb_mot;
     65  flair::core::I2cPort *i2cport;
     66  flair::actuator::BlCtrlV2 *self;
    6767};
    6868
  • trunk/lib/FlairSensorActuator/src/unexported/Bldc_impl.h

    r3 r15  
    2222#include <stdint.h>
    2323
    24 namespace flair
    25 {
    26     namespace gui
    27     {
    28         class DoubleSpinBox;
    29         class Layout;
    30         class Label;
    31         class DataPlot1D;
    32         class TabWidget;
    33         class PushButton;
    34     }
    35     namespace actuator
    36     {
    37         class Bldc;
    38     }
     24namespace flair {
     25namespace gui {
     26class DoubleSpinBox;
     27class Layout;
     28class Label;
     29class DataPlot1D;
     30class TabWidget;
     31class PushButton;
     32}
     33namespace actuator {
     34class Bldc;
     35}
    3936}
    4037
    41 class Bldc_impl
    42 {
    43     public:
    44         Bldc_impl(flair::actuator::Bldc* self,flair::gui::Layout* layout,std::string name,uint8_t motors_count);
    45         Bldc_impl(flair::actuator::Bldc* self,uint8_t motors_count);//simulation
    46         ~Bldc_impl();
    47         void UpdateFrom(const flair::core::io_data *data);
    48         void LockUserInterface(void) const;
    49         void UnlockUserInterface(void) const;
    50         bool are_enabled;
    51         float* power;
    52         void UseDefaultPlot(flair::gui::TabWidget* tab);
    53         uint8_t motors_count;
    54         flair::gui::Layout* layout;
     38class Bldc_impl {
     39public:
     40  Bldc_impl(flair::actuator::Bldc *self, flair::gui::Layout *layout,
     41            std::string name, uint8_t motors_count);
     42  Bldc_impl(flair::actuator::Bldc *self, uint8_t motors_count); // simulation
     43  ~Bldc_impl();
     44  void UpdateFrom(const flair::core::io_data *data);
     45  void LockUserInterface(void) const;
     46  void UnlockUserInterface(void) const;
     47  bool are_enabled;
     48  float *power;
     49  void UseDefaultPlot(flair::gui::TabWidget *tab);
     50  uint8_t motors_count;
     51  flair::gui::Layout *layout;
    5552
    56     private:
    57         float *values;
    58         float Sat(float value);
    59         flair::actuator::Bldc* self;
    60         flair::gui::DoubleSpinBox *min_value,*max_value,*test_value;
    61         flair::gui::Label *flight_time;
    62         flair::gui::DataPlot1D *plots;
    63         flair::core::Time flight_start_time;
    64         flair::gui::PushButton **button_test;
    65         int time_sec;
    66         bool is_running;
    67         flair::core::Time test_start_time;
    68         int tested_motor;//=-1 if no motor is tested
     53private:
     54  float *values;
     55  float Sat(float value);
     56  flair::actuator::Bldc *self;
     57  flair::gui::DoubleSpinBox *min_value, *max_value, *test_value;
     58  flair::gui::Label *flight_time;
     59  flair::gui::DataPlot1D *plots;
     60  flair::core::Time flight_start_time;
     61  flair::gui::PushButton **button_test;
     62  int time_sec;
     63  bool is_running;
     64  flair::core::Time test_start_time;
     65  int tested_motor; //=-1 if no motor is tested
    6966};
    7067
  • trunk/lib/FlairSensorActuator/src/unexported/Gx3_25_imu_impl.h

    r3 r15  
    1818
    1919namespace flair {
    20     namespace core {
    21         class FrameworkManager;
    22         class SerialPort;
    23         class AhrsData;
    24     }
    25     namespace gui {
    26         class SpinBox;
    27         class CheckBox;
    28         class PushButton;
    29         class Label;
    30     }
     20namespace core {
     21class FrameworkManager;
     22class SerialPort;
     23class AhrsData;
     24}
     25namespace gui {
     26class SpinBox;
     27class CheckBox;
     28class PushButton;
     29class Label;
     30}
    3131}
    3232
     
    3838class Gx3_25_imu_impl {
    3939
    40     public:
    41         Gx3_25_imu_impl(flair::sensor::Gx3_25_imu* self,std::string name,flair::core::SerialPort *serialport,flair::sensor::Gx3_25_imu::Command_t command,flair::gui::GroupBox* setupgroupbox);
    42         ~Gx3_25_imu_impl();
    43         void Run(void);
     40public:
     41  Gx3_25_imu_impl(flair::sensor::Gx3_25_imu *self, std::string name,
     42                  flair::core::SerialPort *serialport,
     43                  flair::sensor::Gx3_25_imu::Command_t command,
     44                  flair::gui::GroupBox *setupgroupbox);
     45  ~Gx3_25_imu_impl();
     46  void Run(void);
    4447
    45     private:
    46         void DeviceReset(void);
    47         void GetData(uint8_t* buf,ssize_t buf_size,flair::core::Time *time);
    48         float Dequeue(uint8_t** buf);
    49         void GyrosBias(void);
    50         void SamplingSettings(void);
    51         void SetBaudrate(int value);
    52         bool CalcChecksum(uint8_t *buf,int size);
    53         int FirmwareNumber(void);
    54         void PrintModelInfo(void);
    55         void RealignUpNorth(bool realign_up,bool realign_north);
     48private:
     49  void DeviceReset(void);
     50  void GetData(uint8_t *buf, ssize_t buf_size, flair::core::Time *time);
     51  float Dequeue(uint8_t **buf);
     52  void GyrosBias(void);
     53  void SamplingSettings(void);
     54  void SetBaudrate(int value);
     55  bool CalcChecksum(uint8_t *buf, int size);
     56  int FirmwareNumber(void);
     57  void PrintModelInfo(void);
     58  void RealignUpNorth(bool realign_up, bool realign_north);
    5659
    57         void SetContinuousMode(uint8_t continuous_command);
     60  void SetContinuousMode(uint8_t continuous_command);
    5861
    59         flair::gui::GroupBox *setupgroupbox;
    60         flair::gui::SpinBox *data_rate,*gyro_acc_size,*mag_size,*up_comp,*north_comp;
    61         flair::gui::CheckBox *coning,*disable_magn,*disable_north_comp,*disable_grav_comp;
    62         flair::gui::PushButton *button_bias;
    63         flair::gui::Label *data_rate_label;
     62  flair::gui::GroupBox *setupgroupbox;
     63  flair::gui::SpinBox *data_rate, *gyro_acc_size, *mag_size, *up_comp,
     64      *north_comp;
     65  flair::gui::CheckBox *coning, *disable_magn, *disable_north_comp,
     66      *disable_grav_comp;
     67  flair::gui::PushButton *button_bias;
     68  flair::gui::Label *data_rate_label;
    6469
    65         flair::core::SerialPort *serialport;
    66         uint8_t command;
    67         flair::sensor::Gx3_25_imu *self;
    68         flair::core::AhrsData *ahrsData;
     70  flair::core::SerialPort *serialport;
     71  uint8_t command;
     72  flair::sensor::Gx3_25_imu *self;
     73  flair::core::AhrsData *ahrsData;
    6974};
    7075
  • trunk/lib/FlairSensorActuator/src/unexported/VrpnClient_impl.h

    r3 r15  
    2222#include <vector>
    2323
    24 namespace flair
    25 {
    26     namespace core
    27     {
    28         class OneAxisRotation;
    29         class Vector3D;
    30         class Quaternion;
    31         class Mutex;
    32         class SerialPort;
    33     }
    34     namespace gui
    35     {
    36         class TabWidget;
    37         class Tab;
    38         class Layout;
    39     }
    40     namespace sensor
    41     {
    42         class VrpnClient;
    43         class VrpnObject;
    44     }
     24namespace flair {
     25namespace core {
     26class OneAxisRotation;
     27class Vector3D;
     28class Quaternion;
     29class Mutex;
     30class SerialPort;
     31}
     32namespace gui {
     33class TabWidget;
     34class Tab;
     35class Layout;
     36}
     37namespace sensor {
     38class VrpnClient;
     39class VrpnObject;
     40}
    4541}
    4642
     
    4844class vrpn_Connection;
    4945
    50 class VrpnClient_impl
    51 {
    52     public:
    53         VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,std::string address,uint16_t us_period);
    54         VrpnClient_impl(flair::sensor::VrpnClient* self,std::string name,flair::core::SerialPort* serialport,uint16_t us_period);
    55         ~VrpnClient_impl();
    56         void AddTrackable(flair::sensor::VrpnObject* obj);//normal
    57         void RemoveTrackable(flair::sensor::VrpnObject* obj);//normal
    58         void AddTrackable(VrpnObject_impl* obj,uint8_t id);//xbee
    59         void RemoveTrackable(VrpnObject_impl* obj);//xbee
    60         void ComputeRotations(flair::core::Vector3D& point);
    61         void ComputeRotations(flair::core::Quaternion& quat);
    62         bool UseXbee(void);
    63         void Run(void);
    64         flair::gui::Tab* setup_tab;
    65         flair::gui::TabWidget* tab;
    66         vrpn_Connection *connection;
     46class VrpnClient_impl {
     47public:
     48  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
     49                  std::string address, uint16_t us_period);
     50  VrpnClient_impl(flair::sensor::VrpnClient *self, std::string name,
     51                  flair::core::SerialPort *serialport, uint16_t us_period);
     52  ~VrpnClient_impl();
     53  void AddTrackable(flair::sensor::VrpnObject *obj); // normal
     54  void RemoveTrackable(flair::sensor::VrpnObject *obj); // normal
     55  void AddTrackable(VrpnObject_impl *obj, uint8_t id); // xbee
     56  void RemoveTrackable(VrpnObject_impl *obj); // xbee
     57  void ComputeRotations(flair::core::Vector3D &point);
     58  void ComputeRotations(flair::core::Quaternion &quat);
     59  bool UseXbee(void);
     60  void Run(void);
     61  flair::gui::Tab *setup_tab;
     62  flair::gui::TabWidget *tab;
     63  vrpn_Connection *connection;
    6764
    68     private:
    69         flair::sensor::VrpnClient* self;
    70         flair::core::Mutex* mutex;
    71         uint16_t us_period;
    72         std::vector<flair::sensor::VrpnObject*> trackables;
    73         typedef struct xbee_object{
    74             VrpnObject_impl* vrpnobject;
    75             uint8_t id;
    76         } xbee_object;
     65private:
     66  flair::sensor::VrpnClient *self;
     67  flair::core::Mutex *mutex;
     68  uint16_t us_period;
     69  std::vector<flair::sensor::VrpnObject *> trackables;
     70  typedef struct xbee_object {
     71    VrpnObject_impl *vrpnobject;
     72    uint8_t id;
     73  } xbee_object;
    7774
    78         std::vector<xbee_object> xbee_objects;
    79         flair::gui::Tab* main_tab;
    80         flair::core::OneAxisRotation *rotation_1,*rotation_2;
    81         flair::core::SerialPort* serialport;
     75  std::vector<xbee_object> xbee_objects;
     76  flair::gui::Tab *main_tab;
     77  flair::core::OneAxisRotation *rotation_1, *rotation_2;
     78  flair::core::SerialPort *serialport;
    8279};
    8380
  • trunk/lib/FlairSensorActuator/src/unexported/VrpnObject_impl.h

    r3 r15  
    2525#include "Quaternion.h"
    2626
    27 namespace flair
    28 {
    29     namespace core
    30     {
    31         class cvmatrix;
    32         class Vector3D;
    33         class Euler;
    34     }
    35     namespace gui
    36     {
    37         class TabWidget;
    38         class Tab;
    39         class DataPlot1D;
    40     }
    41     namespace sensor
    42     {
    43         class VrpnClient;
    44         class VrpnObject;
    45     }
     27namespace flair {
     28namespace core {
     29class cvmatrix;
     30class Vector3D;
     31class Euler;
     32}
     33namespace gui {
     34class TabWidget;
     35class Tab;
     36class DataPlot1D;
     37}
     38namespace sensor {
     39class VrpnClient;
     40class VrpnObject;
     41}
    4642}
    4743
    48 class VrpnObject_impl
    49 {
    50     friend class VrpnClient_impl;
     44class VrpnObject_impl {
     45  friend class VrpnClient_impl;
    5146
    52     public:
    53         VrpnObject_impl(flair::sensor::VrpnObject* self,const flair::sensor::VrpnClient *parent,std::string name,int id,const flair::gui::TabWidget* tab);
    54         ~VrpnObject_impl(void);
     47public:
     48  VrpnObject_impl(flair::sensor::VrpnObject *self,
     49                  const flair::sensor::VrpnClient *parent, std::string name,
     50                  int id, const flair::gui::TabWidget *tab);
     51  ~VrpnObject_impl(void);
    5552
    56         void mainloop(void);
    57         void GetEuler(flair::core::Euler &euler);
    58         void GetQuaternion(flair::core::Quaternion &quaternion);
    59         void GetPosition(flair::core::Vector3D &point);
    60         bool IsTracked(unsigned int timeout_ms);
     53  void mainloop(void);
     54  void GetEuler(flair::core::Euler &euler);
     55  void GetQuaternion(flair::core::Quaternion &quaternion);
     56  void GetPosition(flair::core::Vector3D &point);
     57  bool IsTracked(unsigned int timeout_ms);
    6158
    62         flair::gui::Tab* plot_tab;
    63         flair::gui::DataPlot1D* x_plot;
    64         flair::gui::DataPlot1D* y_plot;
    65         flair::gui::DataPlot1D* z_plot;
    66         flair::core::cvmatrix *output,*state;
     59  flair::gui::Tab *plot_tab;
     60  flair::gui::DataPlot1D *x_plot;
     61  flair::gui::DataPlot1D *y_plot;
     62  flair::gui::DataPlot1D *z_plot;
     63  flair::core::cvmatrix *output, *state;
    6764
    68         static void     VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
     65  static void VRPN_CALLBACK handle_pos(void *userdata, const vrpn_TRACKERCB t);
    6966
    70     private:
    71         flair::sensor::VrpnObject* self;
    72         const flair::sensor::VrpnClient *parent;
    73         vrpn_Tracker_Remote* tracker;
    74         flair::core::Quaternion quaternion;//todo: quaternion should be included in the output to replace euler angles
    75         void Update(void);
     67private:
     68  flair::sensor::VrpnObject *self;
     69  const flair::sensor::VrpnClient *parent;
     70  vrpn_Tracker_Remote *tracker;
     71  flair::core::Quaternion quaternion; // todo: quaternion should be included in
     72                                      // the output to replace euler angles
     73  void Update(void);
    7674};
    7775
  • trunk/lib/FlairSensorActuator/src/unexported/XBldc_impl.h

    r3 r15  
    1616/*********************************************************************/
    1717
    18 
    1918#ifndef XBLDC_IMPL_H
    2019#define XBLDC_IMPL_H
     
    2322#include <stdint.h>
    2423
    25 namespace flair
    26 {
    27     namespace core
    28     {
    29         class I2cPort;
    30     }
    31     namespace actuator
    32     {
    33         class XBldc;
    34     }
     24namespace flair {
     25namespace core {
     26class I2cPort;
     27}
     28namespace actuator {
     29class XBldc;
     30}
    3531}
    3632
     33class XBldc_impl {
    3734
    38 class XBldc_impl
    39 {
     35public:
     36  XBldc_impl(flair::actuator::XBldc *self, flair::core::I2cPort *i2cport);
     37  ~XBldc_impl();
     38  void UpdateFrom(flair::core::io_data *data);
     39  void SetMotors(float *value);
    4040
    41     public:
    42         XBldc_impl(flair::actuator::XBldc* self,flair::core::I2cPort* i2cport);
    43         ~XBldc_impl();
    44         void UpdateFrom(flair::core::io_data *data);
    45         void SetMotors(float* value);
    46 
    47     private:
    48         uint8_t Sat(float value,uint8_t min,uint8_t max);
    49         //void StartTest(uint8_t moteur);
    50         void ChangeDirection(uint8_t moteur);
    51         void ChangeAdress(uint8_t old_add,uint8_t new_add);
    52         flair::actuator::XBldc* self;
    53         flair::core::I2cPort* i2cport;
     41private:
     42  uint8_t Sat(float value, uint8_t min, uint8_t max);
     43  // void StartTest(uint8_t moteur);
     44  void ChangeDirection(uint8_t moteur);
     45  void ChangeAdress(uint8_t old_add, uint8_t new_add);
     46  flair::actuator::XBldc *self;
     47  flair::core::I2cPort *i2cport;
    5448};
    5549
  • trunk/lib/FlairSensorActuator/src/unexported/geodesie.h

    r3 r15  
    1313
    1414#ifndef M_PI
    15 #   define M_PI 3.14159265358979323846
     15#define M_PI 3.14159265358979323846
    1616#endif
    1717#ifndef M_PI_2
    18 #   define M_PI_2 1.57079632679489661923
     18#define M_PI_2 1.57079632679489661923
    1919#endif
    2020#ifndef M_PI_4
    21 #   define M_PI_4 0.78539816339744830962
     21#define M_PI_4 0.78539816339744830962
    2222#endif
    2323
    2424////////////////////////////////////////////////////////////////////////
    2525struct Matrice {
    26     Matrice(const Matrice & A);
    27     Matrice();
    28     void Apply(double v0, double v1, double v2, double & Mv0, double & Mv1, double & Mv2);
    29     double c0_l0;double c1_l0;double c2_l0;
    30     double c0_l1;double c1_l1;double c2_l1;
    31     double c0_l2;double c1_l2;double c2_l2;
     26  Matrice(const Matrice &A);
     27  Matrice();
     28  void Apply(double v0, double v1, double v2, double &Mv0, double &Mv1,
     29             double &Mv2);
     30  double c0_l0;
     31  double c1_l0;
     32  double c2_l0;
     33  double c0_l1;
     34  double c1_l1;
     35  double c2_l1;
     36  double c0_l2;
     37  double c1_l2;
     38  double c2_l2;
    3239}; // class
    3340
    3441Matrice TransMat(const Matrice A);
    3542
    36 Matrice ProdMat(const Matrice A,const Matrice B);
    37 void Write(const Matrice A,std::ostream& out);
     43Matrice ProdMat(const Matrice A, const Matrice B);
     44void Write(const Matrice A, std::ostream &out);
    3845
    3946////////////////////////////////////////////////////////////////////////
    4047class Raf98 {
    41 private :
    42     std::vector<double> m_dvalues;
    43     double LitGrille(unsigned int c,unsigned int l) const;
    44 public :
    45     ~Raf98();
    46     Raf98() {}
    47     bool Load(const std::string & s);
    48     bool Interpol(double longitude/*deg*/, double latitude/*deg*/, double* Hwgs84) const;
     48private:
     49  std::vector<double> m_dvalues;
     50  double LitGrille(unsigned int c, unsigned int l) const;
     51
     52public:
     53  ~Raf98();
     54  Raf98() {}
     55  bool Load(const std::string &s);
     56  bool Interpol(double longitude /*deg*/, double latitude /*deg*/,
     57                double *Hwgs84) const;
    4958}; // class
    5059////////////////////////////////////////////////////////////////////////
    5160
    5261////////////////////////////////////////////////////////////////////////
    53 inline double Deg2Rad(double deg) {return deg*M_PI/180.0;}
    54 inline double Rad2Deg(double rad) {return rad*180.0/M_PI;}
     62inline double Deg2Rad(double deg) { return deg * M_PI / 180.0; }
     63inline double Rad2Deg(double rad) { return rad * 180.0 / M_PI; }
    5564////////////////////////////////////////////////////////////////////////
    5665
    57 const double a_Lambert93=6378137;
    58 const double f_Lambert93=1 / 298.257222101;
    59 const double e_Lambert93=sqrt(f_Lambert93*(2-f_Lambert93));
    60 const double lambda0_Lambert93=Deg2Rad(3.0);//degres
    61 const double phi0_Lambert93=Deg2Rad(46.5);
    62 const double phi1_Lambert93=Deg2Rad(44.0);
    63 const double phi2_Lambert93=Deg2Rad(49.0);//degres
    64 const double X0_Lambert93=700000;//
    65 const double Y0_Lambert93=6600000;//
     66const double a_Lambert93 = 6378137;
     67const double f_Lambert93 = 1 / 298.257222101;
     68const double e_Lambert93 = sqrt(f_Lambert93 * (2 - f_Lambert93));
     69const double lambda0_Lambert93 = Deg2Rad(3.0); // degres
     70const double phi0_Lambert93 = Deg2Rad(46.5);
     71const double phi1_Lambert93 = Deg2Rad(44.0);
     72const double phi2_Lambert93 = Deg2Rad(49.0); // degres
     73const double X0_Lambert93 = 700000;  //
     74const double Y0_Lambert93 = 6600000; //
    6675const double n_Lambert93 = 0.7256077650;
    6776const double c_Lambert93 = 11754255.426;
     
    7079
    7180const double GRS_a = 6378137;
    72 const double GRS_f = 1/298.257222101;
    73 const double GRS_b = GRS_a*(1-GRS_f);
    74 const double GRS_e = sqrt((pow(GRS_a,2) - pow(GRS_b,2)) / pow(GRS_a,2));
     81const double GRS_f = 1 / 298.257222101;
     82const double GRS_b = GRS_a * (1 - GRS_f);
     83const double GRS_e = sqrt((pow(GRS_a, 2) - pow(GRS_b, 2)) / pow(GRS_a, 2));
    7584
    7685////////////////////////////////////////////////////////////////////////
    77 void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,Matrice in,double& E,double& N,double& h,Matrice& out);
    78 void Geographique_2_Lambert93(const Raf98& raf98,double lambda,double phi,double he,double& E,double& N,double& h);
    79 void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,double& lambda,double& phi,double& he);
    80 void Lambert93_2_Geographique(const Raf98& raf98,double E,double N,double h,Matrice in,double& lambda,double& phi,double& he,Matrice& out);
     86void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
     87                              double he, Matrice in, double &E, double &N,
     88                              double &h, Matrice &out);
     89void Geographique_2_Lambert93(const Raf98 &raf98, double lambda, double phi,
     90                              double he, double &E, double &N, double &h);
     91void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
     92                              double &lambda, double &phi, double &he);
     93void Lambert93_2_Geographique(const Raf98 &raf98, double E, double N, double h,
     94                              Matrice in, double &lambda, double &phi,
     95                              double &he, Matrice &out);
    8196/** Convert from geographique to ECEF.
    8297 * @param[in] longitude Longitude in radian.
     
    8499 * @param[in] he Height in meter.
    85100 */
    86 void Geographique_2_ECEF(double longitude, double latitude, double he, double& x, double& y, double& z);
     101void Geographique_2_ECEF(double longitude, double latitude, double he,
     102                         double &x, double &y, double &z);
    87103/** Convert from ECEF two ENU.
    88104 * @param[in] lon0 Longitude of the origin in radian.
     
    90106 * @param[in] he0 Height of the origin in radian.
    91107 */
    92 void ECEF_2_ENU(double x,double y,double z,double& e,double& n,double& u,double lon0,double lat0,double he0);
     108void ECEF_2_ENU(double x, double y, double z, double &e, double &n, double &u,
     109                double lon0, double lat0, double he0);
    93110////////////////////////////////////////////////////////////////////////
    94111
    95 //ALGO0001
    96 double LatitueIsometrique(double latitude,double e);
    97 //ALGO0002
    98 double LatitueIsometrique2Lat(double latitude_iso,double e,double epsilon);
     112// ALGO0001
     113double LatitueIsometrique(double latitude, double e);
     114// ALGO0002
     115double LatitueIsometrique2Lat(double latitude_iso, double e, double epsilon);
    99116
    100 //ALGO0003
    101 void Geo2ProjLambert(
    102     double lambda,double phi,
    103     double n, double c,double e,
    104     double lambdac,double xs,double ys,
    105     double& X,double& Y);
    106 //ALGO0004
    107 void Proj2GeoLambert(
    108     double X,double Y,
    109     double n, double c,double e,
    110     double lambdac,double xs,double ys,
    111     double epsilon,
    112     double& lambda,double& phi);
     117// ALGO0003
     118void Geo2ProjLambert(double lambda, double phi, double n, double c, double e,
     119                     double lambdac, double xs, double ys, double &X,
     120                     double &Y);
     121// ALGO0004
     122void Proj2GeoLambert(double X, double Y, double n, double c, double e,
     123                     double lambdac, double xs, double ys, double epsilon,
     124                     double &lambda, double &phi);
    113125
    114126double ConvMerApp(double longitude);
     
    118130*/
    119131template <typename _T1, typename _T2>
    120 void cartesianToPolar(const _T1 x, const _T1 y, _T2 & r, _T2 & theta) {
    121     r = std::sqrt(x*x + y*y);
    122     theta = std::atan2(x, y);
     132void cartesianToPolar(const _T1 x, const _T1 y, _T2 &r, _T2 &theta) {
     133  r = std::sqrt(x * x + y * y);
     134  theta = std::atan2(x, y);
    123135}
    124136
     
    127139*/
    128140template <typename _T1, typename _T2>
    129 void polarToCartesian(const _T1 r, const _T1 theta, _T2 & x, _T2 & y) {
    130     x = r * std::cos(theta);
    131     y = r * std::sin(theta);
     141void polarToCartesian(const _T1 r, const _T1 theta, _T2 &x, _T2 &y) {
     142  x = r * std::cos(theta);
     143  y = r * std::sin(theta);
    132144}
    133145
    134146/**
    135 Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta, phi)
     147Converts Cartesian (x, y, z) coordinates to spherical coordinates (r, theta,
     148phi)
    136149Angles expressed in radians.
    137150*/
    138151template <typename _T1, typename _T2>
    139 void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 & r, _T2 & theta, _T2 & phi) {
    140     r = std::sqrt(x*x + y*y + z*z);
    141     theta = std::acos(z / r);
    142     phi = std::atan2(y, x);
     152void cartesianToSpherical(const _T1 x, const _T1 y, const _T1 z, _T2 &r,
     153                          _T2 &theta, _T2 &phi) {
     154  r = std::sqrt(x * x + y * y + z * z);
     155  theta = std::acos(z / r);
     156  phi = std::atan2(y, x);
    143157}
    144158
    145159/**
    146 Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z) coordinates.
     160Converts spherical coordinates (r, theta, phi) to Cartesian (x, y, z)
     161coordinates.
    147162Angles expressed in radians.
    148163*/
    149164template <typename _T1, typename _T2>
    150 void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 & x, _T2 & y, _T2 & z) {
    151     x = r * std::sin(theta) * std::cos(phi);
    152     y = r * std::sin(theta) * std::sin(phi);
    153     z = r * std::cos(theta);
     165void sphericalToCartesian(const _T1 r, const _T1 theta, const _T1 phi, _T2 &x,
     166                          _T2 &y, _T2 &z) {
     167  x = r * std::sin(theta) * std::cos(phi);
     168  y = r * std::sin(theta) * std::sin(phi);
     169  z = r * std::cos(theta);
    154170}
    155171
Note: See TracChangeset for help on using the changeset viewer.