use crate::int::solver::{ContourSolver, ShapeSolver, ShapesSolver};
use crate::int::triangulation::RawIntTriangulation;
use i_overlay::i_float::int::point::IntPoint;
use i_overlay::i_shape::int::shape::{IntContour, IntShape, IntShapes};
pub trait IntTriangulatable {
fn triangulate(&self) -> RawIntTriangulation;
fn triangulate_with_steiner_points(&self, points: &[IntPoint]) -> RawIntTriangulation;
}
impl IntTriangulatable for IntContour {
#[inline]
fn triangulate(&self) -> RawIntTriangulation {
ContourSolver::triangulate(Default::default(), self)
}
#[inline]
fn triangulate_with_steiner_points(&self, points: &[IntPoint]) -> RawIntTriangulation {
ContourSolver::triangulate_with_steiner_points(Default::default(), self, points)
}
}
impl IntTriangulatable for IntShape {
#[inline]
fn triangulate(&self) -> RawIntTriangulation {
ShapeSolver::triangulate(Default::default(), self)
}
#[inline]
fn triangulate_with_steiner_points(&self, points: &[IntPoint]) -> RawIntTriangulation {
ShapeSolver::triangulate_with_steiner_points(Default::default(), self, points)
}
}
impl IntTriangulatable for IntShapes {
#[inline]
fn triangulate(&self) -> RawIntTriangulation {
ShapesSolver::triangulate(Default::default(), self)
}
#[inline]
fn triangulate_with_steiner_points(&self, points: &[IntPoint]) -> RawIntTriangulation {
ShapesSolver::triangulate_with_steiner_points(Default::default(), self, points)
}
}