pandore::Point2d Class Reference

#include <point.h>

Inheritance diagram for pandore::Point2d:

pandore::Point List of all members.

Detailed Description

A 2D point.

A point2d represents a 2D location in (x, y) coordinate space, specified in Long precision. A Point2d is a Pobject, and thus can be saved in and loaded from a file.
Use of a Point2d:

 Point2d p1(10, 15);
 Point2d * p2 = new Point2d(10, 15);
 Point2d p3; p.y = 10; p3.x = 15;
 Point2d p4 = p3 * 2;

For the use of Point2d see The Points.


Public Member Functions

Typobj Type () const
std::string Name () const
 Point2d ()
 Point2d (Long i)
 Point2d (Long y, Long x)
 Point2d (const Point2d &p)
 Point2d (const Dimension2d &p)
const Point2doperator= (const Point2d &pt)
bool operator== (const Point2d &pt) const
bool operator!= (const Point2d &pt) const
Point2doperator+= (const Point2d &pt)
Point2doperator-= (const Point2d &pt)
Point2doperator/= (const Point2d &pt)
Point2doperator *= (const Point2d &pt)
Point2d operator+ (const Point2d &pt) const
Point2d operator- (const Point2d &pt) const
Point2d operator * (const Point2d &pt) const
Point2d operator/ (const Point2d &pt) const
Pobject * Clone () const
Errc LoadData (FILE *df)
Errc SaveData (FILE *df) const

Public Attributes

Long x
Long y


Constructor & Destructor Documentation

pandore::Point2d::Point2d  )  [inline]
 

Constructs and initializes a point at the origin (0, 0) of the coordinate space.

pandore::Point2d::Point2d Long  i  )  [inline]
 

Constructs and initializes a point at the specified (i, i) location in the coordinate space.

Parameters:
i the value for x and y coordinates.

pandore::Point2d::Point2d Long  y,
Long  x
[inline]
 

Constructs and initializes a point at the specified (y, x) location in the coordinate space.

Parameters:
y the y coordinate.
x the x coordinate.

pandore::Point2d::Point2d const Point2d p  )  [inline]
 

Constructs and initializes a point with the same location as the reference point.

Parameters:
p a point.

pandore::Point2d::Point2d const Dimension2d p  )  [inline]
 

Constructs and initializes a point with a specified dimension.

Parameters:
p a dimension.


Member Function Documentation

Pobject* pandore::Point2d::Clone  )  const [inline]
 

Creates and returns a distinct copy of this object.

Errc pandore::Point2d::LoadData FILE *  df  )  [inline]
 

Loads data from the given file.

Parameters:
df the file where to read data.
Returns:
SUCCESS or FAILURE in case of IO errors.

std::string pandore::Point2d::Name  )  const [inline]
 

Returns the type name (for instance "Point2d").

Returns:
the name in a string.

Point2d pandore::Point2d::operator * const Point2d pt  )  const [inline]
 

Returns a new point from the multiplication of the coordinates of the object with the coordinates of the specified point.

Parameters:
pt the specified point.
Returns:
a new point.

Point2d& pandore::Point2d::operator *= const Point2d pt  )  [inline]
 

Multiplies the coordinates with the coordinates of the specified point.

Parameters:
pt a point.
Returns:
the objet itself.

bool pandore::Point2d::operator!= const Point2d pt  )  const [inline]
 

Checks if the coordinates are different from the specified coordinates.

Parameters:
pt a point.
Returns:
true if coordinates are different.

Point2d pandore::Point2d::operator+ const Point2d pt  )  const [inline]
 

Returns a new point from the addition of the coordinates of the object with the coordinates of the specified point.

Parameters:
pt the specified point.
Returns:
a new point.

Point2d& pandore::Point2d::operator+= const Point2d pt  )  [inline]
 

Adds the coordinates with the coordinates of the specified point.

Parameters:
pt a point.
Returns:
the objet itself.

Point2d pandore::Point2d::operator- const Point2d pt  )  const [inline]
 

Returns a new point from the subtraction of the coordinates of the object with the coordinates of the specified point.

Parameters:
pt the specified point.
Returns:
a new point.

Point2d& pandore::Point2d::operator-= const Point2d pt  )  [inline]
 

Subtracts the coordinates with the coordinates of the specified point.

Parameters:
pt a point.
Returns:
the objet itself.

Point2d pandore::Point2d::operator/ const Point2d pt  )  const [inline]
 

Returns a new point from the division of the coordinates of the object with the coordinates of the specified point.

Parameters:
pt the specified point.
Returns:
a new point.

Point2d& pandore::Point2d::operator/= const Point2d pt  )  [inline]
 

Divides the coordinates with the coordinates of the specified point.

Parameters:
pt a point.
Returns:
the objet itself.

const Point2d& pandore::Point2d::operator= const Point2d pt  )  [inline]
 

Sets the coordinates with the coordinates of specified point.

Parameters:
pt a point.
Returns:
the point itself.

bool pandore::Point2d::operator== const Point2d pt  )  const [inline]
 

Checks if the coordinates are equal to the coordinates of the specified point.

Parameters:
pt a point.
Returns:
true if coordinates are equal.

Errc pandore::Point2d::SaveData FILE *  df  )  const [inline]
 

Saves data in the given file.

Parameters:
df the file where to save data.
Returns:
SUCCESS or FAILURE in case of IO errors.

Typobj pandore::Point2d::Type  )  const [inline]
 

Returns the magic number of the object (for instance Po_Point2d).

Returns:
the magic number.


Member Data Documentation

Long pandore::Point2d::x
 

The x coordinate -abscissa.

Long pandore::Point2d::y
 

The y coordinate -ordinate.


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

The Pantheon project
Image Team GREYC Laboratory
UMR CNRS 6072 - ENSICAEN - University of Caen, France
This page was last modified on 19 June 2015