Public Member Functions | Private Attributes

MeshLib::CPoint2 Class Reference

CPoint2 class, two dimensional point. More...

#include <Point2.H>

Collaboration diagram for MeshLib::CPoint2:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CPoint2 ()
 CPoint2 (const CPoint2 &uv)
 ~CPoint2 ()
 CPoint2 (double x, double y)
double & operator[] (int i)
bool operator== (const CPoint2 &uv)
double operator[] (int i) const
void operator/= (double s)
double norm ()
double norm2 ()

Private Attributes

double m_c [2]

Detailed Description

CPoint2 class, two dimensional point.

Two dimensional point $(x,y)$

Definition at line 20 of file Point2.H.


Constructor & Destructor Documentation

MeshLib::CPoint2::CPoint2 (  )  [inline]

CPoint2 default constructor, it is initialized to be (0,0)

Definition at line 26 of file Point2.H.

{ m_c[0] = 0; m_c[1] = 0; };

MeshLib::CPoint2::CPoint2 ( const CPoint2 uv  )  [inline]

CPoint2 class copy operator

Definition at line 30 of file Point2.H.

{       m_c[0] = uv.m_c[0]; m_c[1] = uv.m_c[1];};

MeshLib::CPoint2::~CPoint2 (  )  [inline]

CPoint2 class destructor

Definition at line 34 of file Point2.H.

{};

MeshLib::CPoint2::CPoint2 ( double  x,
double  y 
) [inline]

CPoint2 constructor with $(x,y)$

Definition at line 39 of file Point2.H.

{ m_c[0] = x; m_c[1] = y; };


Member Function Documentation

double MeshLib::CPoint2::norm (  )  [inline]

The norm of CPoint2 $\sqrt{x^2+y^2}$

Definition at line 68 of file Point2.H.

{ return sqrt( m_c[0] * m_c[0] + m_c[1] * m_c[1] ); };

double MeshLib::CPoint2::norm2 (  )  [inline]

The square norm of CPoint2 $x^2+y^2$

Definition at line 73 of file Point2.H.

{ return  m_c[0] * m_c[0] + m_c[1] * m_c[1]; };

void MeshLib::CPoint2::operator/= ( double  s  )  [inline]

Divide by a scalor

Definition at line 59 of file Point2.H.

    {
      m_c[0]/=s;
      m_c[1]/=s;
    }

bool MeshLib::CPoint2::operator== ( const CPoint2 uv  )  [inline]

Definition at line 46 of file Point2.H.

                {
                        return ( m_c[0] == uv.m_c[0] && m_c[1] == uv.m_c[1] );
                }

double MeshLib::CPoint2::operator[] ( int  i  )  const [inline]

constant values, CPoint2[0] x value ; CPoint2[1] y value;

Definition at line 54 of file Point2.H.

{       assert( i < 2 && i >= 0 ); return m_c[i]; };

double& MeshLib::CPoint2::operator[] ( int  i  )  [inline]

reference to the values, CPoint2[0] x value ; CPoint2[1] y value;

Definition at line 44 of file Point2.H.

{       assert( i < 2 && i >= 0 ); return m_c[i]; };


Member Data Documentation

double MeshLib::CPoint2::m_c[2] [private]

(x,y) value

Definition at line 73 of file Point2.H.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Defines