Exemple #1
0
func (f *Imp) Invert() {
	//
	if f.Empty() {
		return
	}
	switch f.sort {
	case Pointset:
		scr.PointsetInv(f.x, f.y)
	case Segments:
		scr.SegmentsInv(f.x, f.y)
	case Polygon:
		if f.filled {
			scr.PolygonInv /* TODO Full */ (f.x, f.y)
		} else {
			scr.PolygonInv(f.x, f.y)
		}
	case Curve:
		scr.CurveInv(f.x, f.y)
		if f.filled {
			n := len(f.x) - 1
			scr.CircleInv(f.x[n], f.y[n], 4)
		}
	case InfLine:
		scr.InfLineInv(f.x[0], f.y[0], f.x[1], f.y[1])
	case Rectangle:
		if f.filled {
			scr.RectangleFullInv(f.x[0], f.y[0], f.x[1], f.y[1])
		} else {
			scr.RectangleInv(f.x[0], f.y[0], f.x[1], f.y[1])
		}
	case Circle:
		if f.filled {
			scr.CircleFullInv(f.x[0], f.y[0], uint(f.x[1]))
		} else {
			scr.CircleInv(f.x[0], f.y[0], uint(f.x[1]))
		}
	case Ellipse:
		if f.filled {
			scr.EllipseFullInv(f.x[0], f.y[0], uint(f.x[1]), uint(f.y[1]))
		} else {
			scr.EllipseInv(f.x[0], f.y[0], uint(f.x[1]), uint(f.y[1]))
		}
	case Text:
		// >>>  sollte in bx integriert werden:
		//  bx.WriteInvGr (tx, x[0], y[0])
		scr.SwitchTransparence(true)
		scr.WriteInvGr(f.tx, f.x[0], f.y[0])
	case Image:
		scr.RectangleInv(f.x[0], f.y[0], f.x[1], f.y[1])
	}
}
Exemple #2
0
func (x *Imp) Write(N, N1 node.Node, directed, vis, inv bool) {
	//
	n, n1 := N.(*node.Imp), N1.(*node.Imp)
	if inv {
		_, _, x1, y1, ok := x.pos(n, n1, directed)
		if !ok {
			return
		}
		scr.InfLineInv(int(x.x), int(x.y), int(x.x1), int(x.y1))
		if directed {
			scr.CircleInv(int(x1), int(y1), r0)
		}
		return
	}
	b := col.ScreenB
	if vis {
		b = Farbe[0]
	}
	bx.ColourF(b)
	if vis {
		scr.Colour(col.ScreenB)
		x.aus(n, n, directed)
	}
	scr.Colour(b)
	x.aus(n, n1, directed)
}
Exemple #3
0
func (f *Imp) mark(i uint) {
	//
	//  if f.sort != Curve { return }
	for r := uint(3); r <= 4; r++ {
		scr.CircleInv(f.x[i], f.y[i], r)
	}
}
Exemple #4
0
func (x *Imp) Write(vis, inv bool) {
	//
	if inv {
		scr.CircleInv(int(x.x), int(x.y), x.Radius())
		return
	}
	b := col.ScreenB
	if vis {
		b = Farbe[0]
	}
	scr.Colour(b)
	bx.ColourF(b)
	x.write()
}
Exemple #5
0
func (f *Imp) invertN() {
	//
	switch f.sort {
	case Pointset:
		scr.PointsetInv(f.x, f.y)
	case Segments:
		scr.SegmentsInv(f.x, f.y)
	case Polygon:
		scr.PolygonInv(f.x, f.y)
	case Curve:
		scr.CurveInv(f.x, f.y)
		if f.filled {
			n := len(f.x) - 1
			scr.CircleInv(f.x[n], f.y[n], 4)
		}
	}
}
Exemple #6
0
func paint(f figure, fo format, x0, y0, x, y int) {
	//
	var a, b uint
	if x >= x0 {
		a = uint(x - x0)
	} else {
		a = uint(x0 - x)
	}
	if y >= y0 {
		b = uint(y - y0)
	} else {
		b = uint(y0 - y)
	}
	switch f {
	case line:
		switch fo {
		case border:
			scr.Line(x0, y0, x, y)
		case inv:
			scr.LineInv(x0, y0, x, y)
		case full:
			// scr.StrichAusgeben (x0, y0, x, y, Staerke)
		}
	case rectangle:
		switch fo {
		case border:
			scr.Rectangle(x0, y0, x, y)
		case inv:
			scr.RectangleInv(x0, y0, x, y)
		case full:
			scr.RectangleFull(x0, y0, x, y)
		}
	case circle:
		if b > a {
			a = b
		}
		switch fo {
		case border:
			scr.Circle(x0, y0, a)
		case inv:
			scr.CircleInv(x0, y0, a)
		case full:
			scr.CircleFull(x0, y0, a)
		}
	case ellipse:
		switch fo {
		case border:
			/*
			     scr.Ellipse ((x0 + x) / 2, (y0 + y) / 2, a, b)
			   case invers:
			     scr.EllipseInv ((x0 + x) / 2, (y + y0) / 2, a, b)
			   case full:
			     scr.EllipseFull ((x0 + x) / 2, (y0 + y) / 2, a, b)
			*/
			scr.Ellipse(x0, y0, a, b)
		case inv:
			scr.EllipseInv(x0, y0, a, b)
		case full:
			scr.EllipseFull(x0, y0, a, b)
		}
	}
	//  scr.Colour (paintColour), (* Wörkeraund: Bildschirm....Invertieren f *)
}