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

TODO: insert short description here. More...

Go to the source code of this file.

Classes

class  Shape
 A class to store/manipulate directed graphs. More...
 
struct  Shape::back_data
 A structure to store back data for an edge. More...
 
struct  Shape::sTreeChange
 A structure that represents a change that took place in the sweepline. More...
 
struct  Shape::incidenceData
 
struct  Shape::dg_point
 A point or vertex in the directed graph. More...
 
struct  Shape::dg_arete
 An edge in the directed graph. More...
 
struct  Shape::edge_data
 Extra data that some algorithms use. More...
 
struct  Shape::sweep_src_data
 
struct  Shape::sweep_dest_data
 
struct  Shape::raster_data
 
struct  Shape::point_data
 Extra data for points used at various occasions. More...
 
struct  Shape::edge_list
 A structure to help with sorting edges around a point. More...
 

Enumerations

enum  { tweak_mode_grow , tweak_mode_push , tweak_mode_repel , tweak_mode_roughen }
 
enum  { shape_graph = 0 , shape_polygon = 1 }
 

Functions

bool directedEulerian (Shape const *s)
 Is the graph Eulerian?
 
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.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
tweak_mode_grow 
tweak_mode_push 
tweak_mode_repel 
tweak_mode_roughen 

Definition at line 30 of file Shape.h.

◆ anonymous enum

anonymous enum
Enumerator
shape_graph 
shape_polygon 

Definition at line 46 of file Shape.h.

Function Documentation

◆ directedEulerian()

bool directedEulerian ( Shape const *  s)

Is the graph Eulerian?

A directed graph is Eulerian if every vertex has equal indegree and outdegree. http://mathworld.wolfram.com/EulerianGraph.html

Parameters
sPointer to the shape object.
Returns
True if shape is Eulerian.

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.