Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
683e8b4
base impl
NailxSharipov May 2, 2026
8d01f8f
add vector shape extraction
NailxSharipov May 3, 2026
71275ec
draft migration to new int api
NailxSharipov May 17, 2026
dfddf67
fix clippy
NailxSharipov May 17, 2026
9d9ed8b
replace i32
NailxSharipov May 17, 2026
2c068f1
migrate to int api
NailxSharipov May 19, 2026
144e842
draft int api
NailxSharipov May 20, 2026
09363bc
code clean
NailxSharipov May 20, 2026
bcf9e85
fix
NailxSharipov May 20, 2026
ae336dc
fix
NailxSharipov May 20, 2026
4307c84
fix grammar
NailxSharipov May 21, 2026
9d1124b
update float api
NailxSharipov May 21, 2026
e65c175
convert performance app
NailxSharipov May 21, 2026
c3f7322
update performance app
NailxSharipov May 21, 2026
10602ce
update documentation
NailxSharipov May 21, 2026
7aefd94
sugar as api
NailxSharipov May 21, 2026
916759d
doc +
NailxSharipov May 21, 2026
5ab7095
rename
NailxSharipov May 21, 2026
1780a82
run tests
NailxSharipov May 22, 2026
2403b71
fix
NailxSharipov May 22, 2026
52df21e
fix empty segments after merge
NailxSharipov May 22, 2026
51dc099
add tests
NailxSharipov May 22, 2026
9c8892c
fix empty segmeents
NailxSharipov May 22, 2026
05d3fda
empty segments fix
NailxSharipov May 22, 2026
7324143
fix div cell
NailxSharipov May 22, 2026
4457b95
reduce test step
NailxSharipov May 22, 2026
447e512
update tests results
NailxSharipov May 22, 2026
5dff0d3
update readme
NailxSharipov May 23, 2026
f1bcd8c
fix area sign
NailxSharipov May 25, 2026
606ca51
remove unused traits
NailxSharipov May 29, 2026
045f71d
clean api
NailxSharipov May 29, 2026
e242b7c
update edge data api
NailxSharipov May 29, 2026
7b33a77
fix init
NailxSharipov May 31, 2026
44cfaf6
fmt
NailxSharipov May 31, 2026
f77acfe
Merge branch 'main' of github.com:iShape-Rust/iOverlay into feature/i…
NailxSharipov May 31, 2026
b88950d
up ver
NailxSharipov May 31, 2026
3d1997a
fix dep
NailxSharipov Jun 1, 2026
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
69 changes: 40 additions & 29 deletions examples/overlay_editor/src/app/boolean/content.rs
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
use std::collections::HashMap;
use i_triangle::i_overlay::core::overlay::Overlay;
use i_triangle::i_overlay::i_shape::int::count::PointsCount;
use i_triangle::i_overlay::i_float::int::rect::IntRect;
use iced::widget::scrollable;
use iced::{Alignment, Length, Padding, Size, Vector};
use iced::widget::{Button, Column, Container, Row, Space, Text};
use crate::app::design;
use crate::app::boolean::control::ModeOption;
use crate::app::boolean::workspace::WorkspaceState;
use crate::app::design;
use crate::app::fill_option::FillOption;
use crate::app::main::{EditorApp, AppMessage};
use crate::app::main::{AppMessage, EditorApp};
use crate::app::solver_option::SolverOption;
use crate::geom::camera::Camera;
use crate::data::boolean::BooleanResource;
use crate::geom::camera::Camera;
use crate::point_editor::point::PathsToEditorPoints;
use crate::point_editor::widget::PointEditUpdate;
use i_triangle::i_overlay::core::overlay::Overlay;
use i_triangle::i_overlay::i_float::int::rect::IntRect;
use i_triangle::i_overlay::i_shape::int::count::PointsCount;
use iced::widget::scrollable;
use iced::widget::{Button, Column, Container, Row, Space, Text};
use iced::{Alignment, Length, Padding, Size, Vector};
use std::collections::HashMap;

pub(crate) struct BooleanState {
pub(crate) test: usize,
Expand All @@ -41,25 +41,31 @@ pub(crate) enum BooleanMessage {
impl EditorApp {
fn boolean_sidebar(&self) -> Column<'_, AppMessage> {
let count = self.app_resource.boolean.count;
let mut column = Column::new().push(
Space::new()
.width(Length::Fill)
.height(Length::Fixed(2.0)),
);
let mut column =
Column::new().push(Space::new().width(Length::Fill).height(Length::Fixed(2.0)));
for index in 0..count {
let is_selected = self.state.boolean.test == index;

column = column.push(
Container::new(
Button::new(
Text::new(format!("test_{}", index))
.style(if is_selected { design::style_sidebar_text_selected } else { design::style_sidebar_text })
.size(14)
.style(if is_selected {
design::style_sidebar_text_selected
} else {
design::style_sidebar_text
})
.size(14),
)
.width(Length::Fill)
.on_press(AppMessage::Bool(BooleanMessage::TestSelected(index)))
.style(if is_selected { design::style_sidebar_button_selected } else { design::style_sidebar_button })
).padding(self.design.action_padding())
.width(Length::Fill)
.on_press(AppMessage::Bool(BooleanMessage::TestSelected(index)))
.style(if is_selected {
design::style_sidebar_button_selected
} else {
design::style_sidebar_button
}),
)
.padding(self.design.action_padding()),
);
}

Expand All @@ -75,14 +81,15 @@ impl EditorApp {
.height(Length::Shrink)
.align_x(Alignment::Start)
.padding(Padding::new(0.0).right(8))
.style(design::style_sidebar_background)
).direction(scrollable::Direction::Vertical(
.style(design::style_sidebar_background),
)
.direction(scrollable::Direction::Vertical(
scrollable::Scrollbar::new()
.width(4)
.margin(0)
.scroller_width(4)
.anchor(scrollable::Anchor::Start),
))
)),
)
.push(self.boolean_workspace())
}
Expand All @@ -101,7 +108,9 @@ impl EditorApp {
}

fn boolean_set_test(&mut self, index: usize) {
self.state.boolean.load_test(index, &mut self.app_resource.boolean);
self.state
.boolean
.load_test(index, &mut self.app_resource.boolean);
self.state.boolean.update_solution();
}

Expand Down Expand Up @@ -174,7 +183,8 @@ impl BooleanState {
let editor_points = &mut self.workspace.points;

if editor_points.is_empty() {
editor_points.reserve(test.clip_paths.points_count() + test.subj_paths.points_count())
editor_points
.reserve(test.clip_paths.points_count() + test.subj_paths.points_count())
} else {
editor_points.clear();
}
Expand Down Expand Up @@ -204,10 +214,11 @@ impl BooleanState {
let clip = &self.workspace.clip;
let fill_rule = self.fill.fill_rule();
match self.mode {
ModeOption::Edit => {},
ModeOption::Edit => {}
ModeOption::Debug => {
self.workspace.vectors = Overlay::with_contours(subj, clip).build_separate_vectors(fill_rule);
},
self.workspace.vectors =
Overlay::with_contours(subj, clip).build_separate_vectors(fill_rule);
}
_ => {
let overlay_rule = self.mode.overlay_rule().unwrap();
let solution = Overlay::with_contours(subj, clip).overlay(overlay_rule, fill_rule);
Expand Down
101 changes: 55 additions & 46 deletions examples/overlay_editor/src/app/boolean/control.rs
Original file line number Diff line number Diff line change
@@ -1,66 +1,75 @@
use i_triangle::i_overlay::core::overlay_rule::OverlayRule;
use crate::app::boolean::content::BooleanMessage;
use crate::app::fill_option::FillOption;
use crate::app::main::{EditorApp, AppMessage};
use crate::app::main::{AppMessage, EditorApp};
use crate::app::solver_option::SolverOption;
use i_triangle::i_overlay::core::overlay_rule::OverlayRule;
use iced::widget::{pick_list, Column, Container, Row, Space, Text};
use iced::{Alignment, Length};
use iced::widget::{Column, Container, pick_list, Row, Space, Text};

impl EditorApp {
pub(crate) fn boolean_control(&self) -> Column<'_, AppMessage> {
let solver_pick_list =
Row::new()
.push(Text::new("Solver:")
let solver_pick_list = Row::new()
.push(
Text::new("Solver:")
.width(Length::Fixed(90.0))
.height(Length::Fill)
.align_y(Alignment::Center))
.push(
Container::new(
pick_list(
&SolverOption::ALL[..],
Some(self.state.boolean.solver),
on_select_solver,
).width(Length::Fixed(160.0))
.align_y(Alignment::Center),
)
.push(
Container::new(
pick_list(
&SolverOption::ALL[..],
Some(self.state.boolean.solver),
on_select_solver,
)
.height(Length::Fill)
.align_y(Alignment::Center)
).height(Length::Fixed(40.0));
.width(Length::Fixed(160.0)),
)
.height(Length::Fill)
.align_y(Alignment::Center),
)
.height(Length::Fixed(40.0));

let fill_pick_list =
Row::new()
.push(Text::new("Fill Rule:")
let fill_pick_list = Row::new()
.push(
Text::new("Fill Rule:")
.width(Length::Fixed(90.0))
.height(Length::Fill)
.align_y(Alignment::Center))
.push(
Container::new(
pick_list(
&FillOption::ALL[..],
Some(self.state.boolean.fill),
on_select_fill,
).width(Length::Fixed(160.0))
.align_y(Alignment::Center),
)
.push(
Container::new(
pick_list(
&FillOption::ALL[..],
Some(self.state.boolean.fill),
on_select_fill,
)
.height(Length::Fill)
.align_y(Alignment::Center)
).height(Length::Fixed(40.0));
.width(Length::Fixed(160.0)),
)
.height(Length::Fill)
.align_y(Alignment::Center),
)
.height(Length::Fixed(40.0));

let mode_pick_list =
Row::new()
.push(Text::new("Mode:")
let mode_pick_list = Row::new()
.push(
Text::new("Mode:")
.width(Length::Fixed(90.0))
.height(Length::Fill)
.align_y(Alignment::Center))
.push(
Container::new(
pick_list(
&ModeOption::ALL[..],
Some(self.state.boolean.mode),
on_select_mode,
).width(Length::Fixed(160.0))
.align_y(Alignment::Center),
)
.push(
Container::new(
pick_list(
&ModeOption::ALL[..],
Some(self.state.boolean.mode),
on_select_mode,
)
.height(Length::Fill)
.align_y(Alignment::Center)
).height(Length::Fixed(40.0));
.width(Length::Fixed(160.0)),
)
.height(Length::Fill)
.align_y(Alignment::Center),
)
.height(Length::Fixed(40.0));

Column::new()
.push(solver_pick_list)
Expand Down Expand Up @@ -127,7 +136,7 @@ impl ModeOption {
ModeOption::Difference => Some(OverlayRule::Difference),
ModeOption::InverseDifference => Some(OverlayRule::InverseDifference),
ModeOption::Xor => Some(OverlayRule::Xor),
_ => None
_ => None,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/overlay_editor/src/app/boolean/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub(crate) mod content;
mod control;
mod workspace;
mod control;
Loading
Loading