OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimFpt.h
Go to the documentation of this file.
1 //*******************************************************************
2 //
3 // License: See top level LICENSE.txt file.
4 //
5 // Author: David Burken
6 //
7 // Description:
8 //
9 // Contains class declaration for fpt.
10 // Used to represent a two dimensional point containing data members x and y.
11 //*******************************************************************
12 // $Id: ossimFpt.h 14789 2009-06-29 16:48:14Z dburken $
13 
14 #ifndef ossimFpt_HEADER
15 #define ossimFpt_HEADER
16 #include <iosfwd>
17 #include <ossim/base/ossimCommon.h>
18 
19 // Forward class declarations.
20 class ossimIpt;
21 class ossimDpt;
22 
23 
25 {
26 public:
27 
28  ossimFpt() : x(0), y(0) {}
29 
31  : x(x), y(y)
32  {}
33 
36  {}
37 
38  ossimFpt(const ossimFpt& pt) : x(pt.x), y(pt.y) {}
39 
40  ossimFpt(const ossimDpt& pt);
41 
42  ossimFpt(const ossimIpt& pt);
43 
44  const ossimFpt& operator=(const ossimFpt& pt);
45 
46  const ossimFpt& operator=(const ossimDpt&);
47 
48  const ossimFpt& operator=(const ossimIpt&);
49 
50  bool operator==(const ossimFpt& pt) const
51  { return ( (x == pt.x) && (y == pt.y) ); }
52 
53  bool operator!=(const ossimFpt& pt) const
54  { return ( (x != pt.x) || (y != pt.y) ); }
55 
56  void makeNan(){x = ossim::nan(); y=ossim::nan();}
57 
58  bool hasNans()const
59  {
60  return (ossim::isnan(x) || ossim::isnan(y));
61  }
62 
63  void print(std::ostream& os) const;
64 
65  friend std::ostream& operator<<(std::ostream& os, const ossimFpt& pt);
66 
67  //***
68  // Public data members:
69  //***
72 };
73 
74 inline const ossimFpt& ossimFpt::operator=(const ossimFpt& pt)
75 {
76  if (this != &pt)
77  {
78  x = pt.x;
79  y = pt.y;
80  }
81 
82  return *this;
83 }
84 
85 #endif
ossim_uint32 x
ossimFpt(ossim_float32 x, ossim_float32 y)
Definition: ossimFpt.h:30
#define OSSIMDLLEXPORT
ossimFpt(ossim_float64 x, ossim_float64 y)
Definition: ossimFpt.h:34
void makeNan()
Definition: ossimFpt.h:56
ossim_uint32 y
float ossim_float32
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
std::ostream & print(H5::H5File *file, std::ostream &out)
Print method.
Definition: ossimH5Util.cpp:41
double ossim_float64
ostream & operator<<(ostream &out, const ossimAxes &axes)
Definition: ossimAxes.h:88
ossim_float32 x
Definition: ossimFpt.h:70
ossimFpt()
Definition: ossimFpt.h:28
bool hasNans() const
Definition: ossimFpt.h:58
const ossimFpt & operator=(const ossimFpt &pt)
Definition: ossimFpt.h:74
bool operator!=(const ossimFpt &pt) const
Definition: ossimFpt.h:53
bool operator==(const ossimFpt &pt) const
Definition: ossimFpt.h:50
ossim_float32 y
Definition: ossimFpt.h:71
std::basic_ostream< char > ostream
Base class for char output streams.
Definition: ossimIosFwd.h:23
ossimFpt(const ossimFpt &pt)
Definition: ossimFpt.h:38
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91