Skip to content

Picking refactoring from GeoView to OpenSmock.#158

Merged
LabordePierre merged 2 commits intomainfrom
dev-picking
Feb 16, 2026
Merged

Picking refactoring from GeoView to OpenSmock.#158
LabordePierre merged 2 commits intomainfrom
dev-picking

Conversation

@LabordePierre
Copy link
Contributor

@LabordePierre LabordePierre commented Feb 9, 2026

Start global refactoring to OpenSmock.
Works only with OpenSmock/OpenSmock#107
@LabordePierre LabordePierre self-assigned this Feb 9, 2026
@LabordePierre LabordePierre added enhancement New feature or request technical work Some technical stuff: technical debt, refactoring, cleanup, performance, writing unit tests, etc. pending Waiting for something labels Feb 9, 2026
@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

In this example:

exampleCirclesHover
	| geoView layer circle |
	geoView := GeoViewElement new.
	layer := GeoViewDShapesLayer new name: #shapes.
	geoView addLayer: layer.

        "Circle to add to the geoview"
	circle := (SmockDCircle key: #circle)
		          coordinates:
			          (geoView mapProjection projLatLonToCart:
					           AbsoluteCoordinates zero);
		          radius: 1000000;
		          strokeColor: Color green;
		          strokeWidth: 5.
	layer addDShape: circle.
	geoView addObject: circle.

        "My event"
	geoView addEventHandler: (BlEventHandler
			 on: BlPrimaryClickEvent
			 do: [ :evt |
					 | elements |
					 elements := geoView pickAt: evt position radius: 10.
					 elements results do: [ :each |
							 each dShape strokeColor: Color random.
							 geoView updateObject: each.
                                                         "Use the inspector to inspect the pick"
							 elements inspect ] ]).
	^ self openViewInWindow: geoView
image

When i click on 1 and change the zoom level: the circle change color.
When i click on 2 and change the zoom level: the circle do not change color.

I have 2 questions:

  • How do i say to my geoView that it need to be updated (without needing to update the zoom level) ?
  • Is this normal that the dShape has a radius of 1000000 but the associated gShapes only has a radius of 100 ?

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

For the review:

Better example

A simplier example than exampleCitiesHover would be nice.
Something simple, a circle when pressed or hovered that changed its color.

Remove the GeoViewPickingEvent

There is an event named GeoViewPickingEvent.
I found it very confusing.
This event is trigger by GeoViewInteractionsStrategy every time you try to select any (or zero) objects.
I would rename this event GeoCursorPressedEvent or GeoViewObjectSelectionPickingEvent

Fix the GeoViewLayerEvent

GeoViewLayerRemovedEvent and GeoViewLayerAddedEvent should herit GeoViewLayerEvent

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

I would change the methods #pickable: and #pickable with #isPickable and #isPickabe:.
With the prefix is i understand it is a boolean.

@Nyan11
Copy link

Nyan11 commented Feb 10, 2026

I think you should rename all the methods that contains the word pickingElement with the word pickedElement.
See:
https://www.wordreference.com/enfr/picking
https://www.wordreference.com/enfr/picked

pick = verbe
picking = nom
picked = adjectif

I am not an expert in english, so to verify.

@LabordePierre
Copy link
Contributor Author

LabordePierre commented Feb 13, 2026

I would change the methods #pickable: and #pickable with #isPickable and #isPickabe:. With the prefix is i understand it is a boolean.

Yes! I will rename. This is on OpenSmock too.

Copy link
Contributor

@ELePors ELePors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why adding reference to smock in GeoView hierarchy ?

@LabordePierre
Copy link
Contributor Author

This is on OpenSmock too.

You are right, I will deprecate old name.

@LabordePierre
Copy link
Contributor Author

LabordePierre commented Feb 13, 2026

Why adding reference to smock in GeoView hierarchy ?

I don't understand your question xD

@LabordePierre LabordePierre removed the pending Waiting for something label Feb 13, 2026
@LabordePierre LabordePierre merged commit c813aaf into main Feb 16, 2026
13 of 25 checks passed
@LabordePierre LabordePierre deleted the dev-picking branch February 16, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request technical work Some technical stuff: technical debt, refactoring, cleanup, performance, writing unit tests, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments