Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | Public Attributes | Friends | List of all members
bentleyottmann::Point Struct Reference

#include <Point.h>

Static Public Member Functions

static Point Smallest ()
 
static Point Largest ()
 
static bool DifferenceTooBig (Point p0, Point p1)
 

Public Attributes

int32_t x
 
int32_t y
 

Friends

bool operator< (const Point &p0, const Point &p1)
 
bool operator> (const Point &p0, const Point &p1)
 
bool operator>= (const Point &p0, const Point &p1)
 
bool operator<= (const Point &p0, const Point &p1)
 
bool operator== (const Point &p0, const Point &p1)
 
bool operator!= (const Point &p0, const Point &p1)
 
Point operator+ (const Point &p0, const Point &p1)
 
Point operator- (const Point &p0, const Point &p1)
 

Detailed Description

Definition at line 10 of file Point.h.

Member Function Documentation

◆ DifferenceTooBig()

bool bentleyottmann::Point::DifferenceTooBig ( Point  p0,
Point  p1 
)
static

Definition at line 46 of file Point.cpp.

46 {
47 auto tooBig = [](int32_t a, int32_t b) {
48 return (b > 0 && a < std::numeric_limits<int32_t>::min() + b) ||
49 (b < 0 && a > std::numeric_limits<int32_t>::max() + b);
50 };
51
52 return tooBig(p0.x, p1.x) || tooBig(p0.y, p1.y);
53}
static bool b
struct MyStruct a[10]

◆ Largest()

Point bentleyottmann::Point::Largest ( )
static

Definition at line 41 of file Point.cpp.

41 {
42 const int32_t kMaxCoordinate = std::numeric_limits<int32_t>::max();
43 return {kMaxCoordinate, kMaxCoordinate};
44}

◆ Smallest()

Point bentleyottmann::Point::Smallest ( )
static

Definition at line 36 of file Point.cpp.

36 {
37 const int32_t kMinCoordinate = std::numeric_limits<int32_t>::min();
38 return {kMinCoordinate, kMinCoordinate};
39}

Friends And Related Symbol Documentation

◆ operator!=

bool operator!= ( const Point p0,
const Point p1 
)
friend

Definition at line 32 of file Point.cpp.

32 {
33 return !(p0 == p1);
34}

◆ operator+

Point operator+ ( const Point p0,
const Point p1 
)
friend

Definition at line 30 of file Point.h.

30 {
31 return {p0.x + p1.x, p0.y + p1.y};
32 }

◆ operator-

Point operator- ( const Point p0,
const Point p1 
)
friend

Definition at line 33 of file Point.h.

33 {
34 return {p0.x - p1.x, p0.y - p1.y};
35 }

◆ operator<

bool operator< ( const Point p0,
const Point p1 
)
friend

Definition at line 12 of file Point.cpp.

12 {
13 return std::tie(p0.y, p0.x) < std::tie(p1.y, p1.x);
14}

◆ operator<=

bool operator<= ( const Point p0,
const Point p1 
)
friend

Definition at line 24 of file Point.cpp.

24 {
25 return !(p0 > p1);
26}

◆ operator==

bool operator== ( const Point p0,
const Point p1 
)
friend

Definition at line 28 of file Point.cpp.

28 {
29 return std::tie(p0.y, p0.x) == std::tie(p1.y, p1.x);
30}

◆ operator>

bool operator> ( const Point p0,
const Point p1 
)
friend

Definition at line 16 of file Point.cpp.

16 {
17 return p1 < p0;
18}

◆ operator>=

bool operator>= ( const Point p0,
const Point p1 
)
friend

Definition at line 20 of file Point.cpp.

20 {
21 return !(p0 < p1);
22}

Member Data Documentation

◆ x

int32_t bentleyottmann::Point::x

Definition at line 11 of file Point.h.

◆ y

int32_t bentleyottmann::Point::y

Definition at line 12 of file Point.h.


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