Skip to content

Commit

Permalink
Merge pull request #46 from OpenSmock/dev-pla
Browse files Browse the repository at this point in the history
Cleaning and refactoring
  • Loading branch information
labordep authored Oct 24, 2024
2 parents c4c2968 + caa5c7c commit 2a7bdca
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 172 deletions.
12 changes: 0 additions & 12 deletions src/GeoView-Molecule-Tests/GeoViewUserTest.trait.st

This file was deleted.

43 changes: 0 additions & 43 deletions src/GeoView-Molecule-Tests/GeoViewUserTestImpl.class.st

This file was deleted.

5 changes: 0 additions & 5 deletions src/GeoView-Tests/GeoViewObjectTestLayer.class.st

This file was deleted.

53 changes: 1 addition & 52 deletions src/GeoView-Tests/GeoViewTestLayer.class.st
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
Class {
#name : #GeoViewTestLayer,
#superclass : #AbstractGeoViewLayer,
#instVars : [
'graphicProjection',
'mapProjection',
'viewInfos'
],
#superclass : #AbstractGeoViewBasicLayer,
#category : #'GeoView-Tests-Utils'
}

Expand All @@ -14,49 +9,3 @@ GeoViewTestLayer >> aeDrawOn: aeCanvas [

"do nothing"
]

{ #category : #'API -- projection' }
GeoViewTestLayer >> graphicProjection [

^ graphicProjection
]

{ #category : #'API -- projection' }
GeoViewTestLayer >> graphicProjection: aGraphicProjection [

graphicProjection := aGraphicProjection
]

{ #category : #'API -- projection' }
GeoViewTestLayer >> mapProjection [

^ mapProjection
]

{ #category : #'API -- projection' }
GeoViewTestLayer >> mapProjection: aMapProjection [

mapProjection := aMapProjection
]

{ #category : #'API -- symbology' }
GeoViewTestLayer >> symbologyProvider [
"do nothing"
]

{ #category : #'API -- symbology' }
GeoViewTestLayer >> symbologyProvider: aSymbologyProvider [
"do nothing"
]

{ #category : #accessing }
GeoViewTestLayer >> viewInfos [

^ viewInfos
]

{ #category : #accessing }
GeoViewTestLayer >> viewInfos: anObject [

viewInfos := anObject
]
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class {
#name : #GeoViewLayer,
#name : #AbstractGeoViewBasicLayer,
#superclass : #AbstractGeoViewLayer,
#instVars : [
'symbologyProvider',
Expand All @@ -11,67 +11,67 @@ Class {
}

{ #category : #testing }
GeoViewLayer class >> isAbstract [
AbstractGeoViewBasicLayer class >> isAbstract [

^ self == GeoViewLayer
^ self == AbstractGeoViewBasicLayer
]

{ #category : #'API -- projection' }
GeoViewLayer >> graphicProjection [
AbstractGeoViewBasicLayer >> graphicProjection [

^ graphicProjection
]

{ #category : #'API -- projection' }
GeoViewLayer >> graphicProjection: aGraphicProjection [
AbstractGeoViewBasicLayer >> graphicProjection: aGraphicProjection [

graphicProjection := aGraphicProjection
]

{ #category : #'API -- projection' }
GeoViewLayer >> mapProjection [
AbstractGeoViewBasicLayer >> mapProjection [

^ mapProjection
]

{ #category : #'API -- projection' }
GeoViewLayer >> mapProjection: aMapProjection [
AbstractGeoViewBasicLayer >> mapProjection: aMapProjection [

mapProjection := aMapProjection
]

{ #category : #'API -- picking' }
GeoViewLayer >> populatePickingResult: aPickingResult [
AbstractGeoViewBasicLayer >> populatePickingResult: aPickingResult [

"do nothing"
]

{ #category : #'API -- symbology' }
GeoViewLayer >> symbologyProvider [
AbstractGeoViewBasicLayer >> symbologyProvider [

^ symbologyProvider
]

{ #category : #'API -- symbology' }
GeoViewLayer >> symbologyProvider: aSymbologyProvider [
AbstractGeoViewBasicLayer >> symbologyProvider: aSymbologyProvider [

symbologyProvider := aSymbologyProvider
]

{ #category : #private }
GeoViewLayer >> updateModel: aContext [
AbstractGeoViewBasicLayer >> updateModel: aContext [

"do nothing"
]

{ #category : #'API -- graphic properties' }
GeoViewLayer >> viewInfos [
AbstractGeoViewBasicLayer >> viewInfos [

^ viewInfos
]

{ #category : #'API -- graphic properties' }
GeoViewLayer >> viewInfos: aViewInfos [
AbstractGeoViewBasicLayer >> viewInfos: aViewInfos [

viewInfos := aViewInfos
]
22 changes: 6 additions & 16 deletions src/GeoView/AbstractGeoViewGraphicModelLayer.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -93,19 +93,18 @@ AbstractGeoViewGraphicModelLayer >> graphicalOrderSortBlock [
{ #category : #'API -- drawing' }
AbstractGeoViewGraphicModelLayer >> graphicalOrderSortBlock: aBlockClosure [
"Setup a sort block to change the order of graphic element stack"

graphicalOrderSortBlock := aBlockClosure.
sortedDatas ifNotNil:[ :e |
e sortBlock: self graphicalOrderSortBlock.
]
sortedDatas ifNotNil: [ :e |
e sortBlock: self graphicalOrderSortBlock.
self isDatasChanged: true.
self sendRepaintRequest ]
]

{ #category : #'API -- DShapes' }
AbstractGeoViewGraphicModelLayer >> haveDShapeKey: aKey [
"check in the graphic model because if not present here, the object is not managed"

"be carrefull this model can be asynchronous due to an update in bloc task"

aKey ifNil: [ ^ self ].
^ self graphicModel haveDataIndex: aKey
]
Expand All @@ -121,7 +120,7 @@ AbstractGeoViewGraphicModelLayer >> initialize [

super initialize.
self initializeGraphicModel.
self initializeSortedDatas.
self initializeSortedDatas
]

{ #category : #initialization }
Expand Down Expand Up @@ -267,15 +266,6 @@ AbstractGeoViewGraphicModelLayer >> updateDShapes: aDShapeList [
self sendRepaintRequest
]

{ #category : #private }
AbstractGeoViewGraphicModelLayer >> updateGraphicModelWith: aDShape [
"Update the graphic model with a DShape"

"Call only on the mutex critical block"

^ self graphicModel updated: aDShape
]

{ #category : #accessing }
AbstractGeoViewGraphicModelLayer >> userDataChangesMutex [

Expand Down
4 changes: 1 addition & 3 deletions src/GeoView/GeoViewAbstractElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ GeoViewAbstractElement >> globalPointFromLocalPoint: aLocalPoint [

{ #category : #'API -- objects management' }
GeoViewAbstractElement >> haveObjectIndex: anIndex [
"Pay attention before using it because graphical model is out of sync real user model due to usage of BlTask (asynchronous)"


anIndex ifNil:[ ^ nil ].

^ self layers anySatisfy: [ :e | e haveDomainObjects ifTrue:[ e haveObjectIndex: anIndex ] ]
Expand Down Expand Up @@ -467,7 +466,6 @@ GeoViewAbstractElement >> removeObject: anUserObject [

anUserObject ifNil: [ ^ self ].


self layers do: [ :e |
e haveDomainObjects ifTrue: [ e removeObject: anUserObject ] ]
]
Expand Down
28 changes: 0 additions & 28 deletions src/GeoView/GeoViewPickingElement.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,6 @@ Class {
#category : #'GeoView-Core'
}

{ #category : #accessing }
GeoViewPickingElement >> geoObject [

self deprecated: 'use object'.
^ self object
]

{ #category : #accessing }
GeoViewPickingElement >> geoObject: anObject [

self deprecated: 'use object:'.
self object: anObject
]

{ #category : #accessing }
GeoViewPickingElement >> geoObjectKey [

self deprecated: 'use objectKey'.
^ self objectKey
]

{ #category : #accessing }
GeoViewPickingElement >> geoObjectKey: anObject [

self deprecated: 'use objectKey:'.
self objectKey: anObject
]

{ #category : #accessing }
GeoViewPickingElement >> geodesicDistanceInM [

Expand Down

0 comments on commit 2a7bdca

Please sign in to comment.