Skip to content

feat(segmentation): add interactive edition methods to islands segmen…#75

Merged
Thibault-Pelletier merged 1 commit intomainfrom
islands-segmentation-effect-pipeline
Mar 23, 2026
Merged

feat(segmentation): add interactive edition methods to islands segmen…#75
Thibault-Pelletier merged 1 commit intomainfrom
islands-segmentation-effect-pipeline

Conversation

@Jo-Byr
Copy link
Copy Markdown
Collaborator

@Jo-Byr Jo-Byr commented Mar 18, 2026

…tation effect

Add Keep/Remove/Add island at [coordinates] methods to islands segmentation effect

@Jo-Byr Jo-Byr self-assigned this Mar 18, 2026
def set_minimum_island_size(self, minimum_island_size: int):
self._minimum_island_size = minimum_island_size

def apply(self, world_pos: tuple[float, float, float] | None = None):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a fan of a generic apply method.

  • For the pipeline, it would be better to have a select_island_at_position(self, world_pos) world pos shouldn't be optional. select shouldn't do anything if current mod is not on in Select ...
  • Effect should have a is_interactive_select -> bool to check if the mode is select (apply doesn't make sense from the UI when in interactive selection
  • Pipeline should be disabled when not in interactive mode (otherwise it swallows interactions)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I don't get the point of disabling the pipeline if we filter the events through CanProcessInteractionEvent

Concerning select_island_at_position, should it do nothing if we are in a non-interactive mode and process the event in the same way apply does currently if the mode is interactive ?

self.effect.remove_small_islands(self._typed_state.data.minimum_size)
elif self._typed_state.data.mode == IslandsSegmentationMode.SPLIT_TO_SEGMENTS:
self.effect.split_islands_to_segments()
self.effect.apply()
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not a fan of generic apply.
I think it's much better to keep the effect API as specialized to make intent clearer for consuming code (suggestions in the effect.apply section of the PR)

@Jo-Byr Jo-Byr force-pushed the islands-segmentation-effect-pipeline branch from fdd484b to 15256b6 Compare March 18, 2026 15:01
…tation effect

Add Keep/Remove/Add island at [coordinates] methods to islands
segmentation effect
@Thibault-Pelletier Thibault-Pelletier force-pushed the islands-segmentation-effect-pipeline branch from 15256b6 to b83cf89 Compare March 23, 2026 12:31
@Thibault-Pelletier Thibault-Pelletier merged commit 1ee0ffc into main Mar 23, 2026
3 checks passed
@Thibault-Pelletier Thibault-Pelletier deleted the islands-segmentation-effect-pipeline branch March 23, 2026 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants