Graphviz 12.0.1~dev.20240715.2254
Loading...
Searching...
No Matches
pointset.c File Reference
#include <cgraph/alloc.h>
#include <common/render.h>
#include <common/pointset.h>
#include <stddef.h>
Include dependency graph for pointset.c:

Go to the source code of this file.

Data Structures

struct  pair
 
struct  mpair
 
struct  MPairDisc
 

Functions

static pairmkPair (pointf p)
 
static int cmppair (void *k1, void *k2)
 
PointSetnewPS (void)
 
void freePS (PointSet *ps)
 
void insertPS (PointSet *ps, pointf pt)
 
void addPS (PointSet *ps, double x, double y)
 
int inPS (PointSet *ps, pointf pt)
 
int isInPS (PointSet *ps, double x, double y)
 
int sizeOf (PointSet *ps)
 
pointfpointsOf (PointSet *ps)
 
static mpairmkMPair (mpair *obj, MPairDisc *disc)
 
PointMapnewPM (void)
 
void clearPM (PointMap *ps)
 
void freePM (PointMap *ps)
 
int insertPM (PointMap *pm, int x, int y, int value)
 

Variables

static Dtdisc_t intPairDisc
 
static Dtdisc_t intMPairDisc
 

Function Documentation

◆ addPS()

void addPS ( PointSet ps,
double  x,
double  y 
)

Definition at line 71 of file pointset.c.

References dtinsert, free(), mkPair(), ps, and pointf_s::x.

Referenced by fillLine(), findCol(), genBox(), genPoly(), and orthoEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearPM()

void clearPM ( PointMap ps)

Definition at line 139 of file pointset.c.

References dtclear, and ps.

Referenced by makeGraphData().

Here is the caller graph for this function:

◆ cmppair()

static int cmppair ( void *  k1,
void *  k2 
)
static

Definition at line 29 of file pointset.c.

References pointf_s::x, and pointf_s::y.

◆ freePM()

void freePM ( PointMap ps)

Definition at line 144 of file pointset.c.

References dtclose(), and ps.

Referenced by bundle(), and makeGraphData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freePS()

void freePS ( PointSet ps)

Definition at line 58 of file pointset.c.

References dtclose(), and ps.

Referenced by genBox(), genPoly(), orthoEdges(), polyGraphs(), polyRects(), and processTbl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ inPS()

int inPS ( PointSet ps,
pointf  pt 
)

Definition at line 78 of file pointset.c.

References dtsearch, pair::id, and ps.

Referenced by fits(), and isInPS().

Here is the caller graph for this function:

◆ insertPM()

int insertPM ( PointMap pm,
int  x,
int  y,
int  value 
)

Definition at line 149 of file pointset.c.

References dtinsert, mpair::id, mpair::v, point::x, and point::y.

Referenced by bundle(), and checkEdge().

Here is the caller graph for this function:

◆ insertPS()

void insertPS ( PointSet ps,
pointf  pt 
)

Definition at line 63 of file pointset.c.

References dtinsert, free(), mkPair(), and ps.

Referenced by fits(), and placeFixed().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInPS()

int isInPS ( PointSet ps,
double  x,
double  y 
)

Definition at line 84 of file pointset.c.

References inPS(), and ps.

Referenced by findCol(), and orthoEdges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mkMPair()

static mpair * mkMPair ( mpair obj,
MPairDisc disc 
)
static

Definition at line 117 of file pointset.c.

References gv_alloc(), mpair::id, and mpair::v.

Here is the call graph for this function:

◆ mkPair()

static pair * mkPair ( pointf  p)
static

Definition at line 23 of file pointset.c.

References gv_alloc(), and pair::id.

Referenced by addPS(), and insertPS().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newPM()

PointMap * newPM ( void  )

Definition at line 134 of file pointset.c.

References dtopen(), Dtoset, and intMPairDisc.

Referenced by bundle(), and makeGraphData().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ newPS()

PointSet * newPS ( void  )

Definition at line 53 of file pointset.c.

References dtopen(), Dtoset, and intPairDisc.

Referenced by genBox(), genPoly(), orthoEdges(), polyGraphs(), polyRects(), and processTbl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pointsOf()

pointf * pointsOf ( PointSet ps)

Definition at line 93 of file pointset.c.

References dtflatten(), dtlink, dtsize(), gv_calloc(), pair::id, and ps.

Referenced by genBox(), and genPoly().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sizeOf()

int sizeOf ( PointSet ps)

Definition at line 88 of file pointset.c.

References dtsize(), and ps.

Referenced by genBox(), and genPoly().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ intMPairDisc

Dtdisc_t intMPairDisc
static
Initial value:
= {
offsetof(mpair, id),
sizeof(point),
offsetof(mpair, link),
}
void *(* Dtmake_f)(void *, Dtdisc_t *)
Definition cdt.h:50
void free(void *)
static mpair * mkMPair(mpair *obj, MPairDisc *disc)
Definition pointset.c:117
static int cmppair(void *k1, void *k2)
Definition pointset.c:29
Definition geom.h:27

Definition at line 125 of file pointset.c.

Referenced by newPM().

◆ intPairDisc

Dtdisc_t intPairDisc
static
Initial value:
= {
offsetof(pair, id),
sizeof(pointf),
offsetof(pair, link),
0,
}
struct pointf_s pointf

Definition at line 44 of file pointset.c.

Referenced by newPS().