-
Notifications
You must be signed in to change notification settings - Fork 14
/
use_xy.go
43 lines (35 loc) · 827 Bytes
/
use_xy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// +build !use_xyz
package clipper
import "fmt"
type IntPoint struct {
X CInt
Y CInt
}
func (p IntPoint) String() string {
return fmt.Sprintf("{%v, %v}", p.X, p.Y)
}
func NewIntPoint(X, Y CInt) *IntPoint {
ip := new(IntPoint)
ip.X, ip.Y = X, Y
return ip
}
func NewIntPointFromFloat(x, y float64) *IntPoint {
ip := new(IntPoint)
ip.X, ip.Y = CInt(x), CInt(y)
return ip
}
func (ip *IntPoint) Copy() IntPoint {
return IntPoint{
X: ip.X,
Y: ip.Y,
}
}
func (c *ClipperBase) ReverseHorizontal(e *TEdge) {
//swap horizontal edges' top and bottom x's so they follow the natural
//progression of the bounds - ie so their xbots will align with the
//adjoining lower edge. [Helpful in the ProcessHorizontal() method.]
c.Swap(&e.Top.X, &e.Bot.X)
}
func (c *Clipper) SetZ(pt *IntPoint, e1, e2 *TEdge) {
return
}