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

Public Member Functions

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

Static Public Member Functions

static void reset ()

Data Fields

double _x
double _y

Static Public Attributes

static int nbCreated = 0
static int nbDeleted = 0

Detailed Description

Definition at line 346 of file testClone2.cpp.

Constructor & Destructor Documentation

◆ ~MyPointD()

MyPointD::~MyPointD ( )
inline

Definition at line 348 of file testClone2.cpp.

349 { nbDeleted++; }
static int nbDeleted

References nbDeleted.

◆ MyPointD() [1/3]

MyPointD::MyPointD ( const MyPointD & other)
inline

Definition at line 350 of file testClone2.cpp.

351 : _x( other._x ), _y( other._y )
352 { nbCreated++; }
double _y
double _x
static int nbCreated

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

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

◆ MyPointD() [2/3]

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

Definition at line 353 of file testClone2.cpp.

353 : _x( x ), _y( y )
354 { nbCreated++; }

References _x, _y, and nbCreated.

◆ MyPointD() [3/3]

MyPointD::MyPointD ( double x,
double y )
inline

Definition at line 355 of file testClone2.cpp.

355 : _x( x ), _y( y )
356 { nbCreated++; }

References _x, _y, and nbCreated.

Member Function Documentation

◆ norm()

double MyPointD::norm ( ) const
inline

Definition at line 361 of file testClone2.cpp.

362 {
363 double dx = (double) _x;
364 double dy = (double) _y;
365 return sqrt( dx * dx + dy * dy );
366 }

References _x, and _y.

Referenced by templated_signed_dist_to_unit_circle().

◆ operator-()

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

Definition at line 357 of file testClone2.cpp.

358 {
359 return MyPointD( _x - other._x, _y - other._y );
360 }
MyPointD(const MyPointD &other)

References _x, _y, and MyPointD().

◆ reset()

void MyPointD::reset ( )
inlinestatic

Definition at line 367 of file testClone2.cpp.

368 {
369 nbCreated = nbDeleted = 0;
370 }

References nbCreated, and nbDeleted.

Referenced by testCloneTimings().

Field Documentation

◆ _x

double MyPointD::_x

Definition at line 371 of file testClone2.cpp.

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

◆ _y

double MyPointD::_y

Definition at line 371 of file testClone2.cpp.

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

◆ nbCreated

int MyPointD::nbCreated = 0
static

Definition at line 373 of file testClone2.cpp.

Referenced by main(), MyPointD(), MyPointD(), MyPointD(), reset(), and testCloneTimings().

◆ nbDeleted

int MyPointD::nbDeleted = 0
static

Definition at line 374 of file testClone2.cpp.

Referenced by main(), reset(), testCloneTimings(), and ~MyPointD().


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