Exemple #1
0
func constructPlace(model *Place) *place {
	p := &place{
		Circle:  geometry.NewCircle(model.X, model.Y, PlaceRadius),
		id:      model.Id,
		timer:   model.Timer,
		counter: model.Counter,
		label:   model.Label,
	}
	return p
}
Exemple #2
0
func (t *transition) newControlPoint(center *geometry.Point, inbound bool) *controlPoint {
	circle := geometry.NewCircle(center.X, center.Y, PlaceRadius)
	if inbound {
		centerT := t.Center()
		point := circle.BorderPoint(centerT.X, centerT.Y, 15.0)
		return newControlPoint(point.X, point.Y, false)
	} else {
		centerT := t.Center()
		point := circle.BorderPoint(centerT.X, centerT.Y, 15.0)
		return newControlPoint(point.X, point.Y, false)
	}
}
Exemple #3
0
func newPlace(x, y float64) *place {
	return &place{
		Circle: geometry.NewCircle(x, y, PlaceRadius),
		id:     util.GenUUID(),
	}
}