2022-03-06 19:50:19 +01:00
|
|
|
Class {
|
|
|
|
#name : #DiyaPolygon,
|
|
|
|
#superclass : #Diya2DPrimShape,
|
2022-03-16 17:48:18 +01:00
|
|
|
#instVars : [
|
|
|
|
'points'
|
|
|
|
],
|
2022-03-06 19:50:19 +01:00
|
|
|
#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
|
|
|
]
|
|
|
|
|
2022-08-10 19:55:49 +02:00
|
|
|
{ #category : #accessing }
|
|
|
|
DiyaPolygon >> process [
|
2022-08-13 01:37:42 +02:00
|
|
|
bbox := Rectangle encompassing: points.
|
2022-08-10 19:55:49 +02:00
|
|
|
self calculateVertices.
|
|
|
|
^true
|
|
|
|
]
|