Struct Point.
More...
template<class T = int>
class smil::Point< T >
Struct Point.
#include <DCommon.h>
◆ Point() [1/4]
Contructor - an empty point.
All coordinates are set to 0
◆ Point() [2/4]
Constructor from another point.
- Note
- Both points shall be of the same data type
◆ Point() [3/4]
template<class T = int>
Point |
( |
T |
_x, |
|
|
T |
_y, |
|
|
T |
_z |
|
) |
| |
|
inline |
3D Point Constructor
- Parameters
-
[in] | _x,_y,_z | : initial coordinates |
◆ Point() [4/4]
2D Point Constructor
- Parameters
-
[in] | _x,_y | : initial coordinates |
◆ operator==()
template<class T = int>
bool operator== |
( |
const Point< T > & |
p2 | ) |
|
|
inline |
operator== - comparison
- Parameters
-
◆ operator-()
operator- - subtract two points
Example
import smilPython as sp
p1 = sp.IntPoint(10, 30, 40)
p2 = sp.IntPoint(40, 30, 10)
p3 = sp.IntPoint(p2 - p1)
p1.printSelf(" P1 : ")
p2.printSelf(" P2 : ")
p3.printSelf(" Difference : ")
p3 = sp.IntPoint(p2 + p1)
p3.printSelf(" Sum : ")
◆ operator+()
operator+ - add two points
Example
import smilPython as sp
p1 = sp.IntPoint(10, 30, 40)
p2 = sp.IntPoint(40, 30, 10)
p3 = sp.IntPoint(p2 - p1)
p1.printSelf(" P1 : ")
p2.printSelf(" P2 : ")
p3.printSelf(" Difference : ")
p3 = sp.IntPoint(p2 + p1)
p3.printSelf(" Sum : ")
◆ printSelf()
template<class T = int>
void printSelf |
( |
string |
indent = "" | ) |
|
|
inline |
printSelf() - Print point coordinates
- Parameters
-
[in] | indent | : prefix to add to each line |
The documentation for this class was generated from the following file: