00001 #ifndef _WINC_DATUM
00002 #define _WINC_DATUM
00003
00004 #include <WXP/EarthPoint.h>
00005
00006 namespace WXP {
00007 class Datum {
00008 char id[20];
00009 EarthPoint ept;
00010 int type;
00011 int index;
00012 char format[80];
00013 char data[40];
00014 float value[5];
00015
00016 public:
00017 Datum();
00018 int init();
00019 int initVals();
00020 int set( float rlat, float rlon, int type, const char *data, const char *format );
00021 int set( float rlat, float rlon, int type, float val, const char *format );
00022 int set( float rlat, float rlon, int type, float val1, float val2, const char *format );
00023 int set( EarthPoint ept, int type, const char *data, const char *format );
00024 int set( EarthPoint ept, int type, float val, const char *format );
00025 int set( EarthPoint ept, int type, float val1, float val2, const char *format );
00026 int setId( const char *rid );
00027 inline const char *getId(){ return id; };
00028 int setLoc( EarthPoint ept );
00029 int setLoc( float rlat, float rlon );
00030 inline EarthPoint getLoc(){ return ept; };
00031 inline float getLat(){ return ept.lat; };
00032 inline float getLon(){ return ept.lon; };
00033 inline int setIndex( int rindex ){ index = rindex; return 1; };
00034 inline int getIndex(){ return index; };
00035 int setType( int t );
00036 inline int getType(){ return type; };
00037 int setData( char str );
00038 int setData( const char *str );
00039 int clearData();
00040 int formatData( const char *format, ... );
00041 inline const char *getData(){ return data; };
00042 inline const char *getFormat(){ return format; };
00043 int setFormat( const char *str );
00044 int addFormat( const char *str );
00045 int setValue( int i, float val );
00046 int offsetValue( int i, float val );
00047 int scaleValue( int i, float val );
00048 int setValue( float val );
00049 int setValue( float val1, float val2 );
00050 float getValue( int i );
00051 int print();
00052
00053 friend class DatumPlot;
00054
00055
00056
00057 enum Type {
00058 NONE,
00059 DATA,
00060 VALUE,
00061 TEXT,
00062 MARK,
00063 INT,
00064 CLOUD,
00065 WBARB,
00066 CBARB,
00067 DBARB,
00068 VECT,
00069 AVECT,
00070 WTRACK,
00071 SYMB,
00072 LINE,
00073 CONST
00074 };
00075 };
00076 }
00077 #endif