DGtal 2.0.0
Loading...
Searching...
No Matches
MyPoint Class Reference

Public Member Functions

 ~MyPoint ()
 MyPoint (const MyPoint &other)
 MyPoint (int x, int y)
MyPoint operator- (const MyPoint &other) const
double norm () const
 ~MyPoint ()
 MyPoint (const MyPoint &other)
 MyPoint (int x, int y)
MyPoint operator- (const MyPoint &other) const
double norm () const

Static Public Member Functions

static void reset ()
static void reset ()

Data Fields

int _x
int _y

Static Public Attributes

static int nbCreated = 0
static int nbDeleted = 0

Detailed Description

Constructor & Destructor Documentation

◆ ~MyPoint() [1/2]

MyPoint::~MyPoint ( )
inline

Definition at line 316 of file testClone2.cpp.

317 { nbDeleted++; }
static int nbDeleted

References nbDeleted.

◆ MyPoint() [1/4]

MyPoint::MyPoint ( const MyPoint & other)
inline

Definition at line 318 of file testClone2.cpp.

319 : _x( other._x ), _y( other._y )
320 { nbCreated++; }
static int nbCreated

References _x, _y, MyPoint(), and nbCreated.

Referenced by MyPoint(), and operator-().

◆ MyPoint() [2/4]

MyPoint::MyPoint ( int x,
int y )
inline

Definition at line 321 of file testClone2.cpp.

321 : _x( x ), _y( y )
322 { nbCreated++; }

References _x, _y, and nbCreated.

◆ ~MyPoint() [2/2]

MyPoint::~MyPoint ( )
inline

Definition at line 154 of file testCloneAndAliases.cpp.

155 { nbDeleted++; }

References nbDeleted.

◆ MyPoint() [3/4]

MyPoint::MyPoint ( const MyPoint & other)
inline

Definition at line 156 of file testCloneAndAliases.cpp.

157 : _x( other._x ), _y( other._y )
158 { nbCreated++; }

References _x, _y, MyPoint(), and nbCreated.

◆ MyPoint() [4/4]

MyPoint::MyPoint ( int x,
int y )
inline

Definition at line 159 of file testCloneAndAliases.cpp.

159 : _x( x ), _y( y )
160 { nbCreated++; }

References _x, _y, and nbCreated.

Member Function Documentation

◆ norm() [1/2]

double MyPoint::norm ( ) const
inline

Definition at line 327 of file testClone2.cpp.

328 {
329 double dx = (double) _x;
330 double dy = (double) _y;
331 return sqrt( dx * dx + dy * dy );
332 }

References _x, and _y.

◆ norm() [2/2]

double MyPoint::norm ( ) const
inline

Definition at line 165 of file testCloneAndAliases.cpp.

166 {
167 double dx = (double) _x;
168 double dy = (double) _y;
169 return sqrt( dx * dx + dy * dy );
170 }

References _x, and _y.

◆ operator-() [1/2]

MyPoint MyPoint::operator- ( const MyPoint & other) const
inline

Definition at line 323 of file testClone2.cpp.

324 {
325 return MyPoint( _x - other._x, _y - other._y );
326 }
MyPoint(const MyPoint &other)

References _x, _y, and MyPoint().

◆ operator-() [2/2]

MyPoint MyPoint::operator- ( const MyPoint & other) const
inline

Definition at line 161 of file testCloneAndAliases.cpp.

162 {
163 return MyPoint( _x - other._x, _y - other._y );
164 }

References _x, _y, and MyPoint().

◆ reset() [1/2]

void MyPoint::reset ( )
inlinestatic

Definition at line 333 of file testClone2.cpp.

334 {
335 nbCreated = nbDeleted = 0;
336 }

References nbCreated, and nbDeleted.

Referenced by main().

◆ reset() [2/2]

void MyPoint::reset ( )
inlinestatic

Definition at line 171 of file testCloneAndAliases.cpp.

172 {
173 nbCreated = nbDeleted = 0;
174 }

References nbCreated, and nbDeleted.

Field Documentation

◆ _x

int MyPoint::_x

Definition at line 337 of file testClone2.cpp.

Referenced by MyPoint(), MyPoint(), norm(), and operator-().

◆ _y

int MyPoint::_y

Definition at line 337 of file testClone2.cpp.

Referenced by MyPoint(), MyPoint(), norm(), and operator-().

◆ nbCreated

int MyPoint::nbCreated = 0
static

Definition at line 339 of file testClone2.cpp.

Referenced by MyPoint(), MyPoint(), and reset().

◆ nbDeleted

int MyPoint::nbDeleted = 0
static

Definition at line 340 of file testClone2.cpp.

Referenced by reset(), and ~MyPoint().


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