1
0
mirror of https://github.com/lxsang/Diya-API.git synced 2024-12-27 20:08:22 +01:00
Diya-API/Diya/DiyaPolygon.class.st

49 lines
879 B
Smalltalk
Raw Normal View History

Class {
#name : #DiyaPolygon,
#superclass : #Diya2DPrimShape,
2022-03-16 17:48:18 +01:00
#instVars : [
'points'
],
#category : #'Diya-Graphics'
}
2022-03-16 17:48:18 +01:00
{ #category : #'as yet unclassified' }
DiyaPolygon class >> points: points [
^self new points: points; yourself
]
{ #category : #'as yet unclassified' }
DiyaPolygon class >> points: points shader:s [
^self new points: points; shader:s; yourself
]
{ #category : #accessing }
DiyaPolygon >> calculateVertices [
^self subclassResponsibility
]
{ #category : #initialization }
DiyaPolygon >> initialize [
super initialize.
points := {}.
vbuffer := nil.
]
{ #category : #accessing }
DiyaPolygon >> points [
^ points
]
{ #category : #accessing }
DiyaPolygon >> points: anObject [
points := anObject.
2022-08-07 20:43:16 +02:00
self setDirty
2022-03-16 17:48:18 +01:00
]
{ #category : #accessing }
DiyaPolygon >> process [
bbox := Rectangle encompassing: points.
self calculateVertices.
^true
]