Skip to content

Commit

Permalink
Merge pull request #340 from pharo-graphics/257-whendodepreciation
Browse files Browse the repository at this point in the history
257 whendodepreciation
  • Loading branch information
tinchodias authored Dec 13, 2023
2 parents 198383c + 32fa182 commit 85ee573
Show file tree
Hide file tree
Showing 702 changed files with 8,111 additions and 9,459 deletions.
14 changes: 6 additions & 8 deletions src/Bloc/AtomicSharedPriorityQueue.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,12 @@ Internal Representation and Key Implementation Points.
"
Class {
#name : 'AtomicSharedPriorityQueue',
#superclass : 'AtomicSharedQueue',
#category : 'Bloc-DataStructure - Priority Queue',
#package : 'Bloc',
#tag : 'DataStructure - Priority Queue'
#name : #AtomicSharedPriorityQueue,
#superclass : #AtomicSharedQueue,
#category : 'Bloc-DataStructure - Priority Queue'
}

{ #category : 'accessing' }
{ #category : #accessing }
AtomicSharedPriorityQueue >> next [

| result |
Expand All @@ -46,7 +44,7 @@ AtomicSharedPriorityQueue >> next [

]

{ #category : 'accessing' }
{ #category : #accessing }
AtomicSharedPriorityQueue >> nextIfNone: aBlock [
"Attempt to fetch the next highest priority item from queue (0 = highest priority).
Evaluate a block if attempt is failed i.e. there is no items available or queue is locked by another process"
Expand Down Expand Up @@ -114,7 +112,7 @@ AtomicSharedPriorityQueue >> nextIfNone: aBlock [
] repeat.
]

{ #category : 'accessing' }
{ #category : #accessing }
AtomicSharedPriorityQueue >> nextOrNilSuchThat: aBlock [
"Fetch an object from queue that satisfies aBlock, skipping (but not removing) any intermediate objects.
If no object has been found, answer <nil> and leave me intact.
Expand Down
10 changes: 4 additions & 6 deletions src/Bloc/BlActionHandler.class.st
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
Class {
#name : 'BlActionHandler',
#superclass : 'Object',
#name : #BlActionHandler,
#superclass : #Object,
#traits : 'TBlDebug',
#classTraits : 'TBlDebug classTrait',
#category : 'Bloc-Events-Handler',
#package : 'Bloc',
#tag : 'Events-Handler'
#category : 'Bloc-Events-Handler'
}

{ #category : 'as yet unclassified' }
{ #category : #'as yet unclassified' }
BlActionHandler >> actionPerformed [
]
30 changes: 14 additions & 16 deletions src/Bloc/BlAffineCompositeTransformation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,80 @@ I composite `BlAffineTransformation` objects.
There can be only one transformation instance per type.
"
Class {
#name : 'BlAffineCompositeTransformation',
#superclass : 'BlAffineTransformation',
#name : #BlAffineCompositeTransformation,
#superclass : #BlAffineTransformation,
#instVars : [
'transformations'
],
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'adding' }
{ #category : #adding }
BlAffineCompositeTransformation >> addTransformation: aBlAffineTransformation [
"There can be only one transformation instance per type"

transformations add: aBlAffineTransformation
]

{ #category : 'enumerating' }
{ #category : #enumerating }
BlAffineCompositeTransformation >> do: aBlock [

transformations do: [ :each | each do: aBlock ]
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> hasTransformations [

^ transformations isNotEmpty
]

{ #category : 'initialization' }
{ #category : #initialization }
BlAffineCompositeTransformation >> initialize [

super initialize.

transformations := OrderedCollection new
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> is2D [

^ transformations allSatisfy: [ :each | each is2D ]
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> isIdentity [

^ self hasTransformations not
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> isTranslation [

^ transformations allSatisfy: [ :each | each isTranslation ]
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> multiplyOn: aBlMatrix [

transformations do: [ :each |
each multiplyOn: aBlMatrix ]
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineCompositeTransformation >> multiplyOn: aBlMatrix in: aBlElement [

transformations do: [ :each |
each multiplyOn: aBlMatrix in: aBlElement ]
]

{ #category : 'printing' }
{ #category : #printing }
BlAffineCompositeTransformation >> printOn: aStream [

aStream nextPutAll: 'Composition'
]

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineCompositeTransformation >> transformations [

^ transformations
Expand Down
30 changes: 14 additions & 16 deletions src/Bloc/BlAffineTransformation.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,15 @@ https://en.wikipedia.org/wiki/Affine_transformation
"
Class {
#name : 'BlAffineTransformation',
#superclass : 'Object',
#name : #BlAffineTransformation,
#superclass : #Object,
#instVars : [
'origin'
],
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'converting' }
{ #category : #converting }
BlAffineTransformation >> asMatrix [

| aMatrix |
Expand All @@ -30,55 +28,55 @@ BlAffineTransformation >> asMatrix [
^ aMatrix
]

{ #category : 'enumerating' }
{ #category : #enumerating }
BlAffineTransformation >> do: aBlock [

aBlock value: self
]

{ #category : 'initialization' }
{ #category : #initialization }
BlAffineTransformation >> initialize [

super initialize.

origin := BlAffineTransformationCenterOrigin defaultInstance
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineTransformation >> is2D [
"Return true if transformation happens in x-y plane, hence 2D"

^ self subclassResponsibility
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineTransformation >> is3D [
"Return true if transformation happens in x-y-z plane, hence 3D"

^ self is2D not
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineTransformation >> isIdentity [
"Return true if thiss transformation is identity"

^ false
]

{ #category : 'testing' }
{ #category : #testing }
BlAffineTransformation >> isTranslation [
"Return true if this transformation is translation"

^ false
]

{ #category : 'mathematical functions' }
{ #category : #'mathematical functions' }
BlAffineTransformation >> multiplyOn: aBlMatrix [

self subclassResponsibility
]

{ #category : 'mathematical functions' }
{ #category : #'mathematical functions' }
BlAffineTransformation >> multiplyOn: aBlMatrix in: aBlElement [

| aBlVector |
Expand All @@ -89,13 +87,13 @@ BlAffineTransformation >> multiplyOn: aBlMatrix in: aBlElement [
aBlMatrix translateBy: aBlVector
]

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineTransformation >> origin [

^ origin
]

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineTransformation >> origin: aBlAffineTransformationOrigin [

origin := aBlAffineTransformationOrigin
Expand Down
12 changes: 5 additions & 7 deletions src/Bloc/BlAffineTransformationCenterOrigin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,21 @@ I am a relative transformation origin which is attached to the center of an elem
"
Class {
#name : 'BlAffineTransformationCenterOrigin',
#superclass : 'BlAffineTransformationOrigin',
#name : #BlAffineTransformationCenterOrigin,
#superclass : #BlAffineTransformationOrigin,
#classInstVars : [
'defaultInstance'
],
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineTransformationCenterOrigin class >> defaultInstance [

^ defaultInstance ifNil: [ defaultInstance := self new ]
]

{ #category : 'math' }
{ #category : #math }
BlAffineTransformationCenterOrigin >> originIn: anElement [

^ anElement extent / 2.0
Expand Down
10 changes: 4 additions & 6 deletions src/Bloc/BlAffineTransformationLeftCenterOrigin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ I am a relative transformation origin which is attached to the left center of an
"
Class {
#name : 'BlAffineTransformationLeftCenterOrigin',
#superclass : 'BlAffineTransformationOrigin',
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#name : #BlAffineTransformationLeftCenterOrigin,
#superclass : #BlAffineTransformationOrigin,
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'math' }
{ #category : #math }
BlAffineTransformationLeftCenterOrigin >> originIn: anElement [

^ 0 @ (anElement height / 2.0)
Expand Down
16 changes: 7 additions & 9 deletions src/Bloc/BlAffineTransformationNormalizedPositionOrigin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,37 @@ I allow users to provide a fixed normalized location (top left is 0@0 and bottom
"
Class {
#name : 'BlAffineTransformationNormalizedPositionOrigin',
#superclass : 'BlAffineTransformationOrigin',
#name : #BlAffineTransformationNormalizedPositionOrigin,
#superclass : #BlAffineTransformationOrigin,
#instVars : [
'position'
],
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'instance creation' }
{ #category : #'instance creation' }
BlAffineTransformationNormalizedPositionOrigin class >> position: aPoint [

^ self new
position: aPoint;
yourself
]

{ #category : 'math' }
{ #category : #math }
BlAffineTransformationNormalizedPositionOrigin >> originIn: anElement [
"Return a point describing an origin of a transformation within a given element.
Origin can be either a 2D or 3D points and should be given in local coordinates of the element"

^ position * anElement extent
]

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineTransformationNormalizedPositionOrigin >> position [

^ position
]

{ #category : 'accessing' }
{ #category : #accessing }
BlAffineTransformationNormalizedPositionOrigin >> position: aPoint [

position := aPoint
Expand Down
10 changes: 4 additions & 6 deletions src/Bloc/BlAffineTransformationOrigin.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,12 @@ I can be very useful when users want to rotate / scale or shear an element about
"
Class {
#name : 'BlAffineTransformationOrigin',
#superclass : 'Object',
#category : 'Bloc-Basic-Transformations',
#package : 'Bloc',
#tag : 'Basic-Transformations'
#name : #BlAffineTransformationOrigin,
#superclass : #Object,
#category : 'Bloc-Basic-Transformations'
}

{ #category : 'math' }
{ #category : #math }
BlAffineTransformationOrigin >> originIn: anElement [
"Return a point describing an origin of a transformation within a given element.
Origin can be either a 2D or 3D point (`Point` or `BlPoint3D`) and should be given in local coordinates of the element"
Expand Down
Loading

0 comments on commit 85ee573

Please sign in to comment.