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

TODO: insert short description here. More...

Go to the source code of this file.

Functions

bool directedEulerian (Shape const *s)
 A directed graph is Eulerian iff every vertex has equal indegree and outdegree.
 
double distance (Shape const *s, Geom::Point const &p)
 
bool distanceLessThanOrEqual (Shape const *s, Geom::Point const &p, double const max_l2)
 Returns true iff the L2 distance from thePt to this shape is <= max_l2.
 

Detailed Description

TODO: insert short description here.

Definition in file Shape.cpp.

Function Documentation

◆ directedEulerian()

bool directedEulerian ( Shape const *  s)

A directed graph is Eulerian iff every vertex has equal indegree and outdegree.

Is the graph Eulerian?

http://mathworld.wolfram.com/EulerianGraph.html

Parameters
sDirected shape.
Returns
true if s is Eulerian.

Definition at line 2117 of file Shape.cpp.

References Shape::dg_point::dI, Shape::dg_point::dO, Shape::getPoint(), and Shape::numberOfPoints().

Referenced by Shape::Booleen(), Shape::ConvertToShape(), and Shape::Reoriente().

◆ distance()

◆ distanceLessThanOrEqual()

bool distanceLessThanOrEqual ( Shape const *  s,
Geom::Point const &  p,
double const  max_l2 
)

Returns true iff the L2 distance from thePt to this shape is <= max_l2.

Distance = the min of distance to its points and distance to its edges. Points without edges are considered, which is maybe unwanted...

This is largely similar to distance().

Parameters
sShape.
pPoint.
max_l2L2 distance.

Definition at line 2198 of file Shape.cpp.

References Geom::cross(), Geom::dot(), Shape::dg_arete::en, Shape::getEdge(), Shape::getPoint(), Shape::hasPoints(), Geom::L1(), Geom::L2(), Shape::numberOfEdges(), Shape::numberOfPoints(), offset, Shape::dg_arete::st, and Shape::dg_point::x.