Professional Documents
Culture Documents
Комп Графіка, 5 Лаба - word
Комп Графіка, 5 Лаба - word
ЛАБОРАТОРНА РОБОТА № 5
ВИКОНАЛИ:
студенти 4 курсу ФІОТ
групи ІП-64
Соляніков
Вінницький
Варіант – 4
ПЕРЕВІРИВ:
Старший викладач
Саверченко В.Г.
Київ – 2019
ЗАВДАННЯ
Програмний код
mainView.layerContentsRedrawPolicy = .onSetNeedsDisplay
NSAnimationContext.runAnimationGroup({ context in
context.duration = 5.0
//mainView.animator().rotate(byDegrees: 10)
func makeOrnament2(){
removeAllSubViews()
removeAllSubLayers()
for i in 2...slider!.integerValue{
self.createGraphics1(A: Double(i), B: 1, R: 10, from: 0, to: 2 * 3.14)
}
mainView.wantsLayer = true
mainView.layerContentsRedrawPolicy = .onSetNeedsDisplay
NSAnimationContext.runAnimationGroup({ context in
context.duration = 5.0
//mainView.animator().rotate(byDegrees: 10)
mainView.wantsLayer = true
mainView.layer?.backgroundColor = NSColor.white.cgColor
self.view.addSubview(mainView)
//addMultipleOrnament(30, size : 4)
//addOrnament(4, size : 1)
//addFigure(size: 2)
removeAllSubViews()
removeAllSubLayers()
mainView.frame = NSMakeRect(50, 50, CGFloat(figureSize * size), CGFloat(figureSize * size))
let frame = CGRect(x:0, y: 0, width: figureSize * size, height: figureSize * size)
let line = Figure(frame: frame)
line.size = size
//line.layer?.backgroundColor = .clear
mainView.addSubview(line)
}
for i in 0..<index {
for j in 0..<index{
let frame = CGRect(x: i * figureSize * size, y: j * figureSize * size, width: figureSize * size,
height: figureSize * size)
let line = Figure(frame: frame)
line.size = size
line.layer?.backgroundColor = .clear
mainView.addSubview(line)
}
}
}
for i in 0..<index {
let frame = CGRect(x: i * 10, y:10, width: figureSize * size, height: figureSize * size)
let line = Figure(frame: frame)
line.size = size
line.layer?.backgroundColor = .clear
mainView.addSubview(line)
}
}
}
}
}
}
import UIKit
animator.removeBehavior(snap)
}
override func viewDidLoad() {
super.viewDidLoad()
square.backgroundColor = UIColor.white
view.addSubview(square)