Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get evolutions from dev #4

Merged
merged 5 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions BaselineOfGeoView/BaselineOfGeoView.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
Class {
#name : #BaselineOfGeoView,
#superclass : #BaselineOf,
#category : #BaselineOfGeoView
}

{ #category : #baselines }
BaselineOfGeoView >> baseline: spec [

<baseline>
"Common baseline for all Pharo versions"
spec for: #common do: [ self baselineForCommon: spec ]
]

{ #category : #baselines }
BaselineOfGeoView >> baselineForCommon: spec [
<baseline>

spec preLoadDoIt: #'preload:package:'.
spec postLoadDoIt: #'postload:package:'.

"Dependencies"
self coreDependencies: spec.

"Packages"
self corePackages: spec

]

{ #category : #dependencies }
BaselineOfGeoView >> coreDependencies: spec [

"OpenSmock core workshop"
spec baseline: 'OpenSmock' with: [ spec loads: #('Core'); repository: 'github://OpenSmock/OpenSmock' ].

"GeoTools"
spec baseline: 'GeoTools' with: [ spec repository: 'github://OpenSmock/GeoTools:main' ].
]

{ #category : #packages }
BaselineOfGeoView >> corePackages: spec [

spec
package: 'GeoView' with:[ spec requires: #('OpenSmock' 'GeoTools') ];
package: 'GeoView-GeoObjects' with:[ spec requires: #('GeoView') ];
package: 'GeoView-Examples' with:[ spec requires: #('GeoView' 'GeoView-GeoObjects') ].

"Tests packages"
spec
package: 'GeoView-Tests' with: [ spec requires: #('GeoView' 'GeoView-GeoObjects') ].
]

{ #category : #baselines }
BaselineOfGeoView >> postload: loader package: packageSpec [

"do nothing"
]

{ #category : #baselines }
BaselineOfGeoView >> preload: loader package: packageSpec [

"do nothing"
]
1 change: 1 addition & 0 deletions BaselineOfGeoView/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #BaselineOfGeoView }
40 changes: 40 additions & 0 deletions GeoView-Examples/GeoRocket.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"
I am a rocket.
I am used for Geoplot Examples of rich object.
"
Class {
#name : #GeoRocket,
#superclass : #GeoObject,
#instVars : [
'kinematics',
'name'
],
#category : #'GeoView-Examples'
}

{ #category : #accessing }
GeoRocket >> kinematics [
^ kinematics
]

{ #category : #accessing }
GeoRocket >> kinematics: aKinematics [
kinematics := aKinematics
]

{ #category : #accessing }
GeoRocket >> name [
^ name
]

{ #category : #accessing }
GeoRocket >> name: anObject [
name := anObject
]

{ #category : #updating }
GeoRocket >> updateWith: aGeoRocket [
super updateWith: aGeoRocket.
self name: aGeoRocket name copy.
self kinematics: aGeoRocket kinematics copy.
]
55 changes: 55 additions & 0 deletions GeoView-Examples/GeoRocketProcessData.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
Class {
#name : #GeoRocketProcessData,
#superclass : #GeoObjectProcessData,
#category : #'GeoView-Examples'
}

{ #category : #processing }
GeoRocketProcessData >> processCreatedData: aKey incoming: aGeoRocket with: aDCompositeShape context: aContext [
| dCompositeShape dCircle dLabel |
dCompositeShape := aDCompositeShape ifNil:[DCompositeShape new].
super processCreatedData: aKey incoming: aGeoRocket with: dCompositeShape context: aContext.
dCompositeShape key: aKey.

"create a symbol as a circle"
dCircle := DCircle new.
dCircle key: #symbol.
dCircle radius: 1000000.
dCircle fillColor: Color black.
dCompositeShape addDShape: dCircle.

"create a label"
dLabel := DText new.
dLabel key: #label.
dLabel fillColor: Color black.
dLabel fontSize: 11.
dLabel text: 'Rocket A'.
dCompositeShape addDShape: dLabel.

^dCompositeShape
]

{ #category : #processing }
GeoRocketProcessData >> processDeletedData: aKey incoming: aGeoRocket with: aDCompositeShape context: aContext [
^aDCompositeShape
]

{ #category : #processing }
GeoRocketProcessData >> processUpdatedData: aKey incoming: aGeoRocket with: aDCompositeShape context: aContext [
| dCompositeShape dCircle dLabel |
dCompositeShape := aDCompositeShape.
super processUpdatedData: aKey incoming: aGeoRocket with: dCompositeShape context: aContext.

"update symbol"
dCircle := dCompositeShape getDShape: #symbol.
dCircle radius: 1000000.
dCircle fillColor: Color random.
dCompositeShape updateDShape: dCircle.

"update label"
dLabel := dCompositeShape getDShape: #label.
dLabel text: 'Rocket A'.
dCompositeShape updateDShape: dLabel.

^dCompositeShape
]
49 changes: 49 additions & 0 deletions GeoView-Examples/ShapeFileReader.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
Class {
#name : #ShapeFileReader,
#superclass : #Object,
#category : #'GeoView-Examples'
}

{ #category : #'instance creation' }
ShapeFileReader class >> fromShapeMap: aShapeMap [

aShapeMap hasPolygons ifTrue: [ ^ self fromShapeMapPolygons: aShapeMap ].
aShapeMap hasLines ifTrue: [ ^ self fromShapeMapLines: aShapeMap ].
aShapeMap hasPoints ifTrue: [ ^ self fromShapeMapPoints: aShapeMap ].
]

{ #category : #'instance creation' }
ShapeFileReader class >> fromShapeMapLines: aShapeMap [

^ (1 to: aShapeMap numberOfShapes) collect: [ :i |
(aShapeMap vertices2DByPartsForShapeIndex: i) collect: [ :part | | polyline |
polyline := GeoPolyline new.
polyline absolutePositions: (part collect:
[ :point | AbsoluteCoordinates latitudeInDegrees: point y longitudeInDegrees: point x]).
polyline strokeColor: aShapeMap arcColor.
polyline strokeColor ifNotNil: [ polyline strokeWidth: 1 ].
polyline]].

]

{ #category : #'instance creation' }
ShapeFileReader class >> fromShapeMapPoints: aShapeMap [

self notYetImplemented
]

{ #category : #'instance creation' }
ShapeFileReader class >> fromShapeMapPolygons: aShapeMap [

^ (1 to: aShapeMap numberOfShapes) collect: [ :i |
(aShapeMap vertices2DByPartsForShapeIndex: i) collect: [ :part | | polygon |
polygon := GeoPolygon new.
polygon absolutePositions: (part collect:
[ :point | AbsoluteCoordinates latitudeInDegrees: point y longitudeInDegrees: point x]).
polygon fillColor: aShapeMap polygonColor.
polygon strokeColor: aShapeMap arcColor.
polygon strokeColor ifNotNil: [ polygon strokeWidth: 1 ].
polygon]].


]
1 change: 1 addition & 0 deletions GeoView-Examples/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'GeoView-Examples' }
64 changes: 64 additions & 0 deletions GeoView-GeoObjects/GeoArcBand.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
"
I am a Geo Arc Band.
"
Class {
#name : #GeoArcBand,
#superclass : #GeoShape,
#instVars : [
'radiusInMeters1',
'radiusInMeters2',
'orientationInAzimuths',
'apertureInRadians'
],
#category : #'GeoView-GeoObjects-GeoObjects'
}

{ #category : #accessing }
GeoArcBand >> apertureInRadians [
^ apertureInRadians
]

{ #category : #accessing }
GeoArcBand >> apertureInRadians: anObject [
apertureInRadians := anObject
]

{ #category : #accessing }
GeoArcBand >> orientationInAzimuths [
^ orientationInAzimuths
]

{ #category : #accessing }
GeoArcBand >> orientationInAzimuths: anObject [
orientationInAzimuths := anObject
]

{ #category : #accessing }
GeoArcBand >> radiusInMeters1 [
^ radiusInMeters1
]

{ #category : #accessing }
GeoArcBand >> radiusInMeters1: anObject [
radiusInMeters1 := anObject
]

{ #category : #accessing }
GeoArcBand >> radiusInMeters2 [
^ radiusInMeters2
]

{ #category : #accessing }
GeoArcBand >> radiusInMeters2: anObject [
radiusInMeters2 := anObject
]

{ #category : #updating }
GeoArcBand >> updateWith: aGeoArcBand [
super updateWith: aGeoArcBand.

self radiusInMeters1: aGeoArcBand radiusInMeters1.
self radiusInMeters2: aGeoArcBand radiusInMeters2.
self orientationInAzimuths: aGeoArcBand orientationInAzimuths.
self apertureInRadians: aGeoArcBand apertureInRadians.
]
33 changes: 33 additions & 0 deletions GeoView-GeoObjects/GeoArcBandProcessData.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Class {
#name : #GeoArcBandProcessData,
#superclass : #GeoShapeProcessData,
#category : #'GeoView-GeoObjects-ProcessData'
}

{ #category : #processing }
GeoArcBandProcessData >> processCreatedData: aKey incoming: aGeoArcBand with: aDArcBand context: aContext [
| dArcBand |
dArcBand := aDArcBand ifNil:[DArcBand new].
super processCreatedData: aKey incoming: aGeoArcBand with: dArcBand context: aContext.

aGeoArcBand radiusInMeters1 < aGeoArcBand radiusInMeters2
ifTrue: [ dArcBand radiusMin: aGeoArcBand radiusInMeters1. dArcBand radiusMax: aGeoArcBand radiusInMeters2 ]
ifFalse: [ dArcBand radiusMin: aGeoArcBand radiusInMeters2. dArcBand radiusMax: aGeoArcBand radiusInMeters1 ].
dArcBand aperture: aGeoArcBand apertureInRadians.
dArcBand orientation: aGeoArcBand orientationInAzimuths.
^dArcBand
]

{ #category : #processing }
GeoArcBandProcessData >> processUpdatedData: aKey incoming: aGeoArcBand with: aDArcBand context: aContext [
| dArcBand |
dArcBand := aDArcBand.
super processUpdatedData: aKey incoming: aGeoArcBand with: dArcBand context: aContext.

aGeoArcBand radiusInMeters1 < aGeoArcBand radiusInMeters2
ifTrue: [ dArcBand radiusMin: aGeoArcBand radiusInMeters1. dArcBand radiusMax: aGeoArcBand radiusInMeters2 ]
ifFalse: [ dArcBand radiusMin: aGeoArcBand radiusInMeters2. dArcBand radiusMax: aGeoArcBand radiusInMeters1 ].
dArcBand aperture: aGeoArcBand apertureInRadians.
dArcBand orientation: aGeoArcBand orientationInAzimuths.
^dArcBand
]
28 changes: 28 additions & 0 deletions GeoView-GeoObjects/GeoCircle.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
"
I am a Geo Circle.
"
Class {
#name : #GeoCircle,
#superclass : #GeoShape,
#instVars : [
'radiusInMeters'
],
#category : #'GeoView-GeoObjects-GeoObjects'
}

{ #category : #accessing }
GeoCircle >> radiusInMeters [
^ radiusInMeters
]

{ #category : #accessing }
GeoCircle >> radiusInMeters: anObject [
radiusInMeters := anObject
]

{ #category : #updating }
GeoCircle >> updateWith: aGeoCircle [
super updateWith: aGeoCircle.

self radiusInMeters: aGeoCircle radiusInMeters.
]
25 changes: 25 additions & 0 deletions GeoView-GeoObjects/GeoCircleProcessData.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Class {
#name : #GeoCircleProcessData,
#superclass : #GeoShapeProcessData,
#category : #'GeoView-GeoObjects-ProcessData'
}

{ #category : #processing }
GeoCircleProcessData >> processCreatedData: aKey incoming: aGeoCircle with: aDCircle context: aContext [
| dCircle |
dCircle := aDCircle ifNil:[DCircle new].
super processCreatedData: aKey incoming: aGeoCircle with: dCircle context: aContext.

dCircle radius: aGeoCircle radiusInMeters.
^dCircle
]

{ #category : #processing }
GeoCircleProcessData >> processUpdatedData: aKey incoming: aGeoCircle with: aDCircle context: aContext [
| dCircle |
dCircle := aDCircle.
super processUpdatedData: aKey incoming: aGeoCircle with: dCircle context: aContext.

dCircle radius: aGeoCircle radiusInMeters.
^dCircle
]
Loading