mirror of
https://github.com/lxsang/Diya-API.git
synced 2024-12-27 03:48:21 +01:00
49 lines
879 B
Smalltalk
49 lines
879 B
Smalltalk
Class {
|
|
#name : #DiyaPolygon,
|
|
#superclass : #Diya2DPrimShape,
|
|
#instVars : [
|
|
'points'
|
|
],
|
|
#category : #'Diya-Graphics'
|
|
}
|
|
|
|
{ #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.
|
|
self setDirty
|
|
]
|
|
|
|
{ #category : #accessing }
|
|
DiyaPolygon >> process [
|
|
bbox := Rectangle encompassing: points.
|
|
self calculateVertices.
|
|
^true
|
|
]
|