📄 point.hh
字号:
#ifndef __Point_h__#define __Point_h__ // Simple point template classes. // Probably only make sense for intrinsic types. // 2D Points template < class T > class Point2D { public:Point2D() { x = 0; y = 0; } Point2D(T x, T y) { this->x = x; this->y = y; } T x, y;};template < class T > inline int operator==(const Point2D < T > &a, const Point2D < T > &b) { return (a.x == b.x) && (a.y == b.y);}template < class T > inline int operator!=(const Point2D < T > &a, const Point2D < T > &b) { return (a.x != b.x) || (a.y != b.y);}typedef Point2D < int >Pixel;// 3D Points template < class T > class Point3D { public:Point3D() { x = 0; y = 0; z = 0; } Point3D(T x, T y) { this->x = x; this->y = y; this->z = z; } T x, y, z;};template < class T > inline int operator==(const Point3D < T > &a, const Point3D < T > &b) { return (a.x == b.x) && (a.y == b.y) && (a.z == b.z);}template < class T > inline int operator!=(const Point3D < T > &a, const Point3D < T > &b) { return (a.x != b.x) || (a.y != b.y) || (a.z != b.z);}typedef Point3D < int >Voxel;#endif // __Point_h__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -