-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from OpenSmock/21-Separatation-between-Molecul…
…e-and-GeoView-core Better separation between Core and Molecule
- Loading branch information
Showing
82 changed files
with
1,798 additions
and
1,284 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
GeoView-Bloc-Alexandrie-Molecule/GeoViewManagerBlocAeImpl.class.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Class { | ||
#name : #GeoViewManagerBlocAeImpl, | ||
#superclass : #GeoViewManagerImpl, | ||
#category : #'GeoView-Bloc-Alexandrie-Molecule' | ||
} | ||
|
||
{ #category : #'layer creation' } | ||
GeoViewManagerBlocAeImpl >> createGeoObjectsLayer: aName [ | ||
|
||
| layer | | ||
layer := GeoViewGeoObjectsLayer new. | ||
layer name: aName. | ||
layer displayModel indexAccessor: self getObjectIndexAccessor. | ||
|
||
^ layer | ||
] | ||
|
||
{ #category : #initialization } | ||
GeoViewManagerBlocAeImpl >> createView [ | ||
|
||
| element | | ||
element := BlGeoViewAeElement new. | ||
self installEventHandlers: element. | ||
|
||
self view: element. | ||
] | ||
|
||
{ #category : #initialization } | ||
GeoViewManagerBlocAeImpl >> installEventHandlers: aBlElement [ | ||
|
||
aBlElement addEventHandlerOn: GeoViewLayerProcessDataChanged do: [ :e | self layerHasBeenUpdated: e layerName ] | ||
] | ||
|
||
{ #category : #'services - drawing' } | ||
GeoViewManagerBlocAeImpl >> requestViewUpdate [ | ||
|
||
self view requestRepaint | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Package { #name : #'GeoView-Bloc-Alexandrie-Molecule' } |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
" | ||
I am a BlElement which display a GeoViewWidget using Alexandrie backend drawing. | ||
" | ||
Class { | ||
#name : #BlGeoViewAeElement, | ||
#superclass : #BlAbstractGeoViewElement, | ||
#instVars : [ | ||
'inputContext' | ||
], | ||
#category : #'GeoView-Bloc-Alexandrie-Core' | ||
} | ||
|
||
{ #category : #drawing } | ||
BlGeoViewAeElement >> aeDrawOn: aeCanvas [ | ||
"drawing native bloc elements" | ||
|
||
| sort | | ||
super aeDrawOn: aeCanvas. | ||
|
||
sort := self isMarkedForSortDatas. | ||
self layers do: [ :l | | ||
sort ifTrue: [ l sortDatas ]. | ||
l aeDrawOn: aeCanvas ]. | ||
|
||
isMarkedForSortDatas := false | ||
] | ||
|
||
{ #category : #'API -- picking' } | ||
BlGeoViewAeElement >> pickAt: aGlobalPoint radius: aRadiusInPixels [ | ||
"prepare the picking result" | ||
|
||
| pickingResult distanceBlock radius | | ||
pickingResult := (super pickAt: aGlobalPoint radius: aRadiusInPixels) ifNil:[ ^ nil ]. | ||
|
||
"labordep: prepare to be setup with others blocks" | ||
distanceBlock := [ :gShape :point | gShape distanceTo: point ]. | ||
radius := aRadiusInPixels ifNil:[ 0 ]. | ||
|
||
"Collect all picked elements" | ||
self getLayers do:[ :l | | ||
l graphicModel datas keysAndValuesDo:[ :key :gShape | | distanceInPixels pickingElement | | ||
|
||
"Way to detect if the gShape is picked" | ||
distanceInPixels := distanceBlock value: gShape value: pickingResult localPoint. | ||
distanceInPixels <= radius ifTrue:[ | ||
|
||
"Store the element into the result" | ||
pickingElement := GeoViewPickingElement new. | ||
pickingElement layerName: l name. | ||
pickingElement layerLevel: nil. self flag:'labordep: put the level of the layer'. | ||
pickingElement distanceInPixels: distanceInPixels. | ||
pickingElement objectKey: key. | ||
pickingElement dShape: (l displayModel getData: key). | ||
pickingElement gShape: gShape. | ||
|
||
pickingResult addPickingElement: pickingElement. | ||
|
||
]. | ||
]. | ||
]. | ||
|
||
pickingResult applyOrder: [ :a :b | a distanceInPixels < b distanceInPixels ]. | ||
^ pickingResult | ||
] |
4 changes: 2 additions & 2 deletions
4
...wUserToDisplayToGraphicLayer.extension.st → ...ndrie/GeoViewGeoObjectsLayer.extension.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.