Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
geom.cpp File Reference

Go to the source code of this file.

Functions

static void cubic_bbox (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y001, Geom::Coord x011, Geom::Coord y011, Geom::Coord x111, Geom::Coord y111, Geom::Rect &bbox)
 
Geom::OptRect bounds_fast_transformed (Geom::PathVector const &pv, Geom::Affine const &t)
 
Geom::OptRect bounds_exact_transformed (Geom::PathVector const &pv, Geom::Affine const &t)
 
bool pathv_similar (Geom::PathVector const &apv, Geom::PathVector const &bpv, double precision)
 
Geom::OptRect check_simple_rect (Geom::PathVector const &pathv, double precision)
 
static void geom_line_wind_distance (Geom::Coord x0, Geom::Coord y0, Geom::Coord x1, Geom::Coord y1, Geom::Point const &pt, int *wind, Geom::Coord *best)
 
static void geom_cubic_bbox_wind_distance (Geom::Coord x000, Geom::Coord y000, Geom::Coord x001, Geom::Coord y001, Geom::Coord x011, Geom::Coord y011, Geom::Coord x111, Geom::Coord y111, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *best, Geom::Coord tolerance)
 
static void geom_curve_bbox_wind_distance (Geom::Curve const &c, Geom::Affine const &m, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *dist, Geom::Coord tolerance, Geom::Rect const *viewbox, Geom::Point &p0)
 
bool pointInTriangle (Geom::Point const &p, Geom::Point const &p1, Geom::Point const &p2, Geom::Point const &p3)
 
void pathv_matrix_point_bbox_wind_distance (Geom::PathVector const &pathv, Geom::Affine const &m, Geom::Point const &pt, Geom::Rect *bbox, int *wind, Geom::Coord *dist, Geom::Coord tolerance, Geom::Rect const *viewbox)
 
bool pathvs_have_nonempty_overlap (Geom::PathVector const &a, Geom::PathVector const &b)
 An exact check for whether the two pathvectors intersect or overlap, including the case of a line crossing through a solid shape.
 
bool pathv_fully_contains (Geom::PathVector const &a, Geom::PathVector const &b, FillRule fill_rule, double precision)
 Checks whether the filled region defined by pathvector a and fill rule fill_rule completely contains pathvector b.
 
Geom::PathVector pathv_to_linear_and_cubic_beziers (Geom::PathVector const &pathv)
 
Geom::PathVector pathv_to_linear (Geom::PathVector const &pathv, double)
 
Geom::PathVector pathv_to_cubicbezier (Geom::PathVector const &pathv, bool nolines)
 
size_t count_pathvector_nodes (Geom::PathVector const &pathv)
 
size_t count_pathvector_curves (Geom::PathVector const &pathv)
 
size_t count_pathvector_degenerations (Geom::PathVector const &pathv)
 
size_t count_path_degenerations (Geom::Path const &path)
 
size_t count_path_nodes (Geom::Path const &path)
 
size_t count_path_curves (Geom::Path const &path)
 
void recursive_bezier4 (const double x1, const double y1, const double x2, const double y2, const double x3, const double y3, const double x4, const double y4, std::vector< Geom::Point > &m_points, int level)
 
bool approx_dihedral (Geom::Affine const &affine, double eps)
 Returns whether an affine transformation is approximately a dihedral transformation, i.e.
 

Function Documentation

◆ approx_dihedral()

bool approx_dihedral ( Geom::Affine const &  affine,
double  eps 
)

Returns whether an affine transformation is approximately a dihedral transformation, i.e.

it maps the axis-aligned unit square centred at the origin to itself.

Definition at line 1097 of file geom.cpp.

◆ bounds_exact_transformed()

◆ bounds_fast_transformed()

Geom::OptRect bounds_fast_transformed ( Geom::PathVector const &  pv,
Geom::Affine const &  t 
)

Definition at line 147 of file geom.cpp.

References bounds_exact_transformed().

◆ check_simple_rect()

Geom::OptRect check_simple_rect ( Geom::PathVector const &  pathv,
double  precision 
)

◆ count_path_curves()

◆ count_path_degenerations()

◆ count_path_nodes()

◆ count_pathvector_curves()

◆ count_pathvector_degenerations()

size_t count_pathvector_degenerations ( Geom::PathVector const &  pathv)

Definition at line 756 of file geom.cpp.

References count_path_degenerations().

◆ count_pathvector_nodes()

size_t count_pathvector_nodes ( Geom::PathVector const &  pathv)

Definition at line 738 of file geom.cpp.

References count_path_nodes().

◆ cubic_bbox()

static void cubic_bbox ( Geom::Coord  x000,
Geom::Coord  y000,
Geom::Coord  x001,
Geom::Coord  y001,
Geom::Coord  x011,
Geom::Coord  y011,
Geom::Coord  x111,
Geom::Coord  y111,
Geom::Rect bbox 
)
static

◆ geom_cubic_bbox_wind_distance()

static void geom_cubic_bbox_wind_distance ( Geom::Coord  x000,
Geom::Coord  y000,
Geom::Coord  x001,
Geom::Coord  y001,
Geom::Coord  x011,
Geom::Coord  y011,
Geom::Coord  x111,
Geom::Coord  y111,
Geom::Point const &  pt,
Geom::Rect bbox,
int *  wind,
Geom::Coord best,
Geom::Coord  tolerance 
)
static

◆ geom_curve_bbox_wind_distance()

static void geom_curve_bbox_wind_distance ( Geom::Curve const &  c,
Geom::Affine const &  m,
Geom::Point const &  pt,
Geom::Rect bbox,
int *  wind,
Geom::Coord dist,
Geom::Coord  tolerance,
Geom::Rect const *  viewbox,
Geom::Point p0 
)
static

◆ geom_line_wind_distance()

static void geom_line_wind_distance ( Geom::Coord  x0,
Geom::Coord  y0,
Geom::Coord  x1,
Geom::Coord  y1,
Geom::Point const &  pt,
int *  wind,
Geom::Coord best 
)
static

◆ pathv_fully_contains()

bool pathv_fully_contains ( Geom::PathVector const &  a,
Geom::PathVector const &  b,
FillRule  fill_rule,
double  precision 
)

Checks whether the filled region defined by pathvector a and fill rule fill_rule completely contains pathvector b.

Definition at line 551 of file geom.cpp.

References Geom::PathVector::boundsExact(), check_simple_rect(), Geom::GenericOptRect< C >::contains(), Geom::PathVector::intersect(), is_point_inside(), and Geom::PathVector::winding().

Referenced by Inkscape::Extension::Internal::SvgBuilder::_shouldClip().

◆ pathv_matrix_point_bbox_wind_distance()

void pathv_matrix_point_bbox_wind_distance ( Geom::PathVector const &  pathv,
Geom::Affine const &  m,
Geom::Point const &  pt,
Geom::Rect bbox,
int *  wind,
Geom::Coord dist,
Geom::Coord  tolerance,
Geom::Rect const *  viewbox 
)

◆ pathv_similar()

bool pathv_similar ( Geom::PathVector const &  apv,
Geom::PathVector const &  bpv,
double  precision 
)

Definition at line 176 of file geom.cpp.

References Geom::are_near(), Geom::PathVector::curveCount(), and Geom::PathVector::pointAt().

Referenced by equal_clip().

◆ pathv_to_cubicbezier()

◆ pathv_to_linear()

◆ pathv_to_linear_and_cubic_beziers()

Geom::PathVector pathv_to_linear_and_cubic_beziers ( Geom::PathVector const &  pathv)

Definition at line 586 of file geom.cpp.

References Geom::Path::append(), Geom::PathVector::back(), Geom::Path::close(), Geom::cubicbezierpath_from_sbasis(), is_straight_curve(), Geom::PathVector::push_back(), Geom::Path::setStitching(), Geom::Path::start(), and Geom::Exception::what().

Referenced by Inkscape::UI::PathManipulator::_createControlPointsFromGeometry(), Inkscape::LivePathEffect::collectPathsAndWidths(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPEFilletChamfer::doBeforeEffect(), Inkscape::LivePathEffect::LPEMeasureSegments::doBeforeEffect(), Inkscape::LivePathEffect::LPETaperStroke::doBeforeEffect(), Inkscape::Extension::Internal::PovOutput::doCurve(), Inkscape::LivePathEffect::LPEPerspectiveEnvelope::doEffect(), Inkscape::LivePathEffect::LPERoughen::doEffect(), Inkscape::LivePathEffect::LPESimplify::doEffect(), Inkscape::LivePathEffect::LPEKnot::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPEDashedStroke::doEffect_path(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), Inkscape::LivePathEffect::LPEPowerStroke::doEffect_path(), Inkscape::LivePathEffect::LPEShowHandles::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path_post(), Inkscape::LivePathEffect::LPETiling::doEffect_path_post(), Inkscape::LivePathEffect::LPEFilletChamfer::doOnApply(), Inkscape::LivePathEffect::LPEPowerStroke::doOnApply(), Inkscape::Extension::Internal::PrintEmf::draw_pathv_to_EMF(), item_find_paths(), pathv_to_linear(), Inkscape::Extension::Internal::PrintEmf::pathv_to_simple_polygon(), Inkscape::Extension::Internal::PrintEmf::print_simple_shape(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), Inkscape::LivePathEffect::sp_pathvector_boolop_remove_inner(), Inkscape::LivePathEffect::sp_pathvector_boolop_slice_intersect(), Inkscape::LivePathEffect::LPESlice::splititem(), and Inkscape::Extension::Internal::writePath().

◆ pathvs_have_nonempty_overlap()

bool pathvs_have_nonempty_overlap ( Geom::PathVector const &  a,
Geom::PathVector const &  b 
)

An exact check for whether the two pathvectors intersect or overlap, including the case of a line crossing through a solid shape.

Definition at line 513 of file geom.cpp.

References Geom::PathVector::boundsFast(), Geom::SimpleCrosser::crossings(), node, Geom::PathVector::nodes(), and Geom::PathVector::winding().

Referenced by SPItem::collidesWith().

◆ pointInTriangle()

bool pointInTriangle ( Geom::Point const &  p,
Geom::Point const &  p1,
Geom::Point const &  p2,
Geom::Point const &  p3 
)

Definition at line 446 of file geom.cpp.

References Geom::X, and Geom::Y.

◆ recursive_bezier4()

void recursive_bezier4 ( const double  x1,
const double  y1,
const double  x2,
const double  y2,
const double  x3,
const double  y3,
const double  x4,
const double  y4,
std::vector< Geom::Point > &  m_points,
int  level 
)

Definition at line 869 of file geom.cpp.

References recursive_bezier4().

Referenced by pathv_to_linear(), and recursive_bezier4().