21 #include <tqdatastream.h>
28 : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false )
40 if ( latitude >= -90 && latitude <= 90 ) {
56 if ( longitude >= -180 && longitude <= 180 ) {
72 return mValidLat && mValidLong;
75 bool Geo::operator==(
const Geo &g )
const
79 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return true;
83 bool Geo::operator!=(
const Geo &g )
const
87 if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude )
return false;
93 return "(" + TQString::number(mLatitude) +
"," + TQString::number(mLongitude) +
")";
96 TQDataStream &TDEABC::operator<<( TQDataStream &s,
const Geo &geo )
98 return s << (float)geo.mLatitude << (
float)geo.mLongitude;
101 TQDataStream &TDEABC::operator>>( TQDataStream &s,
Geo &geo )
103 s >> geo.mLatitude >> geo.mLongitude;
105 geo.mValidLat =
true;
106 geo.mValidLong =
true;
float latitude() const
Returns the latitude.
void setLongitude(float)
Sets the longitude.
bool isValid() const
Returns, if this object contains a valid geographical position.
Geo()
Construct invalid geographics position object.
static data, shared by ALL addressee objects
TQString asString() const
Returns string representation of geographical position.
void setLatitude(float)
Sets the latitude.
float longitude() const
Returns the longitude.