OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | Public Attributes | Friends | List of all members
ossimFpt Class Reference

#include <ossimFpt.h>

Public Member Functions

 ossimFpt ()
 
 ossimFpt (ossim_float32 x, ossim_float32 y)
 
 ossimFpt (ossim_float64 x, ossim_float64 y)
 
 ossimFpt (const ossimFpt &pt)
 
 ossimFpt (const ossimDpt &pt)
 
 ossimFpt (const ossimIpt &pt)
 
const ossimFptoperator= (const ossimFpt &pt)
 
const ossimFptoperator= (const ossimDpt &)
 
const ossimFptoperator= (const ossimIpt &)
 
bool operator== (const ossimFpt &pt) const
 
bool operator!= (const ossimFpt &pt) const
 
void makeNan ()
 
bool hasNans () const
 
void print (std::ostream &os) const
 

Public Attributes

ossim_float32 x
 
ossim_float32 y
 

Friends

std::ostream & operator<< (std::ostream &os, const ossimFpt &pt)
 

Detailed Description

Definition at line 24 of file ossimFpt.h.

Constructor & Destructor Documentation

◆ ossimFpt() [1/6]

ossimFpt::ossimFpt ( )
inline

Definition at line 28 of file ossimFpt.h.

28 : x(0), y(0) {}
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ ossimFpt() [2/6]

ossimFpt::ossimFpt ( ossim_float32  x,
ossim_float32  y 
)
inline

Definition at line 30 of file ossimFpt.h.

31  : x(x), y(y)
32  {}
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ ossimFpt() [3/6]

ossimFpt::ossimFpt ( ossim_float64  x,
ossim_float64  y 
)
inline

Definition at line 34 of file ossimFpt.h.

36  {}
double ossim_float64
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ ossimFpt() [4/6]

ossimFpt::ossimFpt ( const ossimFpt pt)
inline

Definition at line 38 of file ossimFpt.h.

38 : x(pt.x), y(pt.y) {}
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ ossimFpt() [5/6]

ossimFpt::ossimFpt ( const ossimDpt pt)

Definition at line 36 of file ossimFpt.cpp.

References ossimDpt::hasNans(), and makeNan().

37  :
38  x(pt.x), y(pt.y)
39 {
40  if(pt.hasNans())
41  {
42  makeNan();
43  }
44 }
void makeNan()
Definition: ossimFpt.h:56
double y
Definition: ossimDpt.h:165
ossim_float32 x
Definition: ossimFpt.h:70
bool hasNans() const
Definition: ossimDpt.h:67
double x
Definition: ossimDpt.h:164
ossim_float32 y
Definition: ossimFpt.h:71

◆ ossimFpt() [6/6]

ossimFpt::ossimFpt ( const ossimIpt pt)

Definition at line 23 of file ossimFpt.cpp.

References ossimIpt::hasNans(), and makeNan().

24  :
25  x(pt.x), y(pt.y)
26 {
27  if(pt.hasNans())
28  {
29  makeNan();
30  }
31 }
void makeNan()
Definition: ossimFpt.h:56
ossim_float32 x
Definition: ossimFpt.h:70
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
bool hasNans() const
Definition: ossimIpt.h:58
ossim_float32 y
Definition: ossimFpt.h:71

Member Function Documentation

◆ hasNans()

bool ossimFpt::hasNans ( ) const
inline

Definition at line 58 of file ossimFpt.h.

References ossim::isnan(), x, and y.

Referenced by ossimIpt::operator=(), ossimDpt::operator=(), ossimDpt::ossimDpt(), and ossimIpt::ossimIpt().

59  {
60  return (ossim::isnan(x) || ossim::isnan(y));
61  }
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71
bool isnan(const float &v)
isnan Test for floating point Not A Number (NAN) value.
Definition: ossimCommon.h:91

◆ makeNan()

void ossimFpt::makeNan ( )
inline

Definition at line 56 of file ossimFpt.h.

References ossim::nan(), x, and y.

Referenced by operator=(), and ossimFpt().

56 {x = ossim::nan(); y=ossim::nan();}
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ operator!=()

bool ossimFpt::operator!= ( const ossimFpt pt) const
inline

Definition at line 53 of file ossimFpt.h.

References x, x, y, and y.

54  { return ( (x != pt.x) || (y != pt.y) ); }
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ operator=() [1/3]

const ossimFpt & ossimFpt::operator= ( const ossimFpt pt)
inline

Definition at line 74 of file ossimFpt.h.

References x, and y.

75 {
76  if (this != &pt)
77  {
78  x = pt.x;
79  y = pt.y;
80  }
81 
82  return *this;
83 }
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ operator=() [2/3]

const ossimFpt & ossimFpt::operator= ( const ossimDpt pt)

Definition at line 49 of file ossimFpt.cpp.

References ossimDpt::hasNans(), makeNan(), x, ossimDpt::x, y, and ossimDpt::y.

50 {
51  x = pt.x;
52  y = pt.y;
53 
54  if(pt.hasNans())
55  {
56  makeNan();
57  }
58  return *this;
59 }
void makeNan()
Definition: ossimFpt.h:56
double y
Definition: ossimDpt.h:165
ossim_float32 x
Definition: ossimFpt.h:70
bool hasNans() const
Definition: ossimDpt.h:67
double x
Definition: ossimDpt.h:164
ossim_float32 y
Definition: ossimFpt.h:71

◆ operator=() [3/3]

const ossimFpt & ossimFpt::operator= ( const ossimIpt pt)

Definition at line 64 of file ossimFpt.cpp.

References ossimIpt::hasNans(), makeNan(), x, ossimIpt::x, y, and ossimIpt::y.

65 {
66  x = pt.x;
67  y = pt.y;
68  if(pt.hasNans())
69  {
70  makeNan();
71  }
72 
73  return *this;
74 }
void makeNan()
Definition: ossimFpt.h:56
ossim_float32 x
Definition: ossimFpt.h:70
ossim_int32 y
Definition: ossimIpt.h:142
ossim_int32 x
Definition: ossimIpt.h:141
bool hasNans() const
Definition: ossimIpt.h:58
ossim_float32 y
Definition: ossimFpt.h:71

◆ operator==()

bool ossimFpt::operator== ( const ossimFpt pt) const
inline

Definition at line 50 of file ossimFpt.h.

References x, x, y, and y.

51  { return ( (x == pt.x) && (y == pt.y) ); }
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

◆ print()

void ossimFpt::print ( std::ostream &  os) const

Definition at line 79 of file ossimFpt.cpp.

References x, and y.

Referenced by operator<<().

80 {
81  os << std::setiosflags(std::ios::fixed) << std::setprecision(15)
82  << "( " << x << " " << y << " )";
83 }
ossim_float32 x
Definition: ossimFpt.h:70
ossim_float32 y
Definition: ossimFpt.h:71

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const ossimFpt pt 
)
friend

Definition at line 88 of file ossimFpt.cpp.

89 {
90  pt.print(os);
91 
92  return os;
93 }
void print(std::ostream &os) const
Definition: ossimFpt.cpp:79

Member Data Documentation

◆ x

ossim_float32 ossimFpt::x

◆ y

ossim_float32 ossimFpt::y

The documentation for this class was generated from the following files: