BLI: IndexMask: Merge ranges in different segments #117878

Open
Iliya Katushenock wants to merge 3 commits from mod_moder/blender:foreach_real_range into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

IndexMask store indices in segments. Each segment can form ranges of its indices.
foreach_range is used to iterate over mask ranges. But technically this is segment
ranges. foreach_real_range is method to iterate over all real range in mask, with
merging of ranges in different mask segment.

IndexMask store indices in segments. Each segment can form ranges of its indices. `foreach_range` is used to iterate over mask ranges. But technically this is segment ranges. `foreach_real_range` is method to iterate over all real range in mask, with merging of ranges in different mask segment.
Iliya Katushenock added 1 commit 2024-02-06 03:14:16 +01:00
Iliya Katushenock added this to the Core project 2024-02-06 03:14:52 +01:00
Iliya Katushenock added a new dependency 2024-02-06 03:15:13 +01:00
Hans Goudey requested review from Jacques Lucke 2024-02-06 14:46:37 +01:00
Jacques Lucke requested changes 2024-02-06 16:25:20 +01:00
Jacques Lucke left a comment
Member

I mainly wonder how you want to use this. Feels like something that shouldn't necessarily be an inline function. At this complexity level it becomes reasonable to just put it into the .cc file instead (and to take a FunctionRef parameter).

I mainly wonder how you want to use this. Feels like something that shouldn't necessarily be an inline function. At this complexity level it becomes reasonable to just put it into the `.cc` file instead (and to take a `FunctionRef` parameter).
@ -853,0 +858,4 @@
template<typename Fn> inline void IndexMask::foreach_real_range(Fn &&fn) const
{
if (const std::optional<IndexRange> range = this->to_range()) {
fn(*range);
Member

this is missing a return

this is missing a return
mod_moder marked this conversation as resolved
Author
Member

Points of curve can be gathered in new curves as just ranges of this curve (see #117869). One of reason to put this in header is was to have optimizations for case of IndexRange argument is useless (to just count ranges) (but not sure if this really expensive one...).

Points of curve can be gathered in new curves as just ranges of this curve (see #117869). One of reason to put this in header is was to have optimizations for case of `IndexRange` argument is useless (to just count ranges) (but not sure if this really expensive one...).
Iliya Katushenock added 2 commits 2024-02-06 20:17:52 +01:00
Iliya Katushenock requested review from Jacques Lucke 2024-02-06 20:17:54 +01:00
This pull request has changes conflicting with the target branch.
  • source/blender/blenlib/intern/index_mask.cc

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u foreach_real_range:mod_moder-foreach_real_range
git checkout mod_moder-foreach_real_range
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: blender/blender#117878
No description provided.