Gamp v0.0.7-36-g24b1eb6
Gamp: Graphics, Audio, Multimedia and Processing
Loading...
Searching...
No Matches
Gamp Graph

Basic Graph Framework. More...

Namespaces

namespace  gamp::graph::impl
 

Classes

class  gamp::graph::tess::CDTriangulator2D
 Constrained Delaunay Triangulation implementation of a list of Outlines that define a set of Closed Regions with optional n holes. More...
 
class  gamp::graph::tess::GLUtilTesselator
 GLUtilTesselator transform OutlineShapes to triangles using glutess2. More...
 
class  gamp::graph::Graph
 
class  gamp::graph::Outline
 Define a single continuous stroke by control vertices. More...
 
class  gamp::graph::OutlineShape
 A Generic shape objects which is defined by a list of Outlines. More...
 
class  gamp::graph::gl::RegionRenderer
 OpenGL Region renderer. More...
 
class  gamp::graph::Triangle
 
class  gamp::graph::Vertex
 

Typedefs

typedef jau::darray< Outline, jau::nsize_tgamp::graph::OutlineList
 
typedef std::shared_ptr< Trianglegamp::graph::TriangleRef
 
typedef jau::darray< TriangleRef, uint32_t > gamp::graph::TriangleRefList
 
typedef jau::darray< Vertex, uint32_t > gamp::graph::VertexList
 

Functions

constexpr double gamp::graph::area2D (const VertexList &vertices) noexcept
 Computes the area of a list of vertices via shoelace formula.
 
constexpr Winding gamp::graph::getWinding (const VertexList &vertices) noexcept
 Compute the winding using the area2D() function over all vertices for complex shapes.
 
static bool gamp::graph::isConvex1 (const VertexList &polyline, bool shortIsConvex) noexcept
 Returns whether the given on-curve polyline points denotes a convex shape with O(n) complexity.
 
constexpr bool gamp::graph::testTri2SegIntersection2D (const Vertex &a, const Vertex &b, const Vertex &c, const Vertex &d, const Vertex &e)
 Check if a segment intersects with a triangle using FloatUtil#EPSILON w/o considering collinear-case.
 

Detailed Description

Basic Graph Framework.

Typedef Documentation

◆ OutlineList

◆ VertexList

Examples
GraphShapes01.cpp.

Definition at line 124 of file PrimTypes.hpp.

◆ TriangleRef

typedef std::shared_ptr<Triangle> gamp::graph::TriangleRef
Examples
GraphShapes01.cpp.

Definition at line 127 of file PrimTypes.hpp.

◆ TriangleRefList

Examples
GraphShapes01.cpp.

Definition at line 128 of file PrimTypes.hpp.

Function Documentation

◆ area2D()

double gamp::graph::area2D ( const VertexList & vertices)
constexprnoexcept

Computes the area of a list of vertices via shoelace formula.

This method is utilized e.g. to reliably compute the Winding of complex shapes.

Implementation uses double precision.

Parameters
vertices
Returns
positive area if ccw else negative area value
See also
getWinding()

Definition at line 52 of file VertexMath.hpp.

◆ getWinding()

Winding gamp::graph::getWinding ( const VertexList & vertices)
constexprnoexcept

Compute the winding using the area2D() function over all vertices for complex shapes.

Uses the area(List) function over all points on complex shapes for a reliable result!

Implementation uses double precision.

Parameters
verticesarray of Vertices
Returns
Winding::CCW or Winding::CLW
See also
area2D()

Definition at line 75 of file VertexMath.hpp.

Here is the caller graph for this function:

◆ isConvex1()

static bool gamp::graph::isConvex1 ( const VertexList & polyline,
bool shortIsConvex )
staticnoexcept

Returns whether the given on-curve polyline points denotes a convex shape with O(n) complexity.

See Determine whether a polygon is convex based on its vertices

All off-curve points are ignored.

Parameters
polylineconnected Vert2fImmutable, i.e. a poly-line
shortIsConvexreturn value if vertices have less than three elements, allows simplification

Definition at line 100 of file VertexMath.hpp.

Here is the caller graph for this function:

◆ testTri2SegIntersection2D()

bool gamp::graph::testTri2SegIntersection2D ( const Vertex & a,
const Vertex & b,
const Vertex & c,
const Vertex & d,
const Vertex & e )
constexpr

Check if a segment intersects with a triangle using FloatUtil#EPSILON w/o considering collinear-case.

Implementation uses float precision.

Parameters
avertex 1 of the triangle
bvertex 2 of the triangle
cvertex 3 of the triangle
dvertex 1 of first segment
evertex 2 of first segment
Returns
true if the segment intersects at least one segment of the triangle, false otherwise
See also
#testSeg2SegIntersection(Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, Vert2fImmutable, float, boolean)

Definition at line 237 of file VertexMath.hpp.