114 int defaultNodeShape;
115 float dist = FLT_MAX;
121 defaultNodeShape=
getAttrBool(g,g,
"defaultnodeshape",0);
123 if(defaultNodeShape==0)
131 if(defaultNodeShape==1)
237 if (glCompPoly_size(selPoly) < 2)
239 if (glCompPoly_front(selPoly)->x - pt.
x <
EPS &&
240 glCompPoly_front(selPoly)->y - pt.
y <
EPS)
261 glCompPoly_append(selPoly, (
glCompPoint){.x = pt.
x, .y = pt.
y});
266 glCompPoly_free(selPoly);
Memory allocation wrappers that exit on failure.
static double dist(int dim, double *x, double *y)
float GetOGLDistance(float l)
float distBetweenPts(glCompPoint A, glCompPoint B, float R)
int is_point_in_rectangle(float X, float Y, float RX, float RY, float RW, float RH)
double point_to_lineseg_dist(glCompPoint p, glCompPoint a, glCompPoint b)
Agsym_t * agattr(Agraph_t *g, int kind, char *name, const char *value)
creates or looks up attributes of a graph
int agxset(void *obj, Agsym_t *sym, const char *value)
Agedge_t * agfstout(Agraph_t *g, Agnode_t *n)
Agedge_t * agnxtout(Agraph_t *g, Agedge_t *e)
Agnode_t * agnxtnode(Agraph_t *g, Agnode_t *n)
Agnode_t * agfstnode(Agraph_t *g)
void deselect_all(Agraph_t *g)
static void * pick_object(Agraph_t *g, glCompPoint p)
void add_selpoly(Agraph_t *g, glCompPoly_t *selPoly, glCompPoint pt)
static void pick_objects_in_rect(Agraph_t *g, float x1, float y1, float x2, float y2)
void pick_objects_rect(Agraph_t *g)
static void select_node(Agraph_t *g, Agnode_t *obj, int reverse)
static void select_edge(Agraph_t *g, Agedge_t *obj, int reverse)
static int close_poly(glCompPoly_t *selPoly, glCompPoint pt)
static void select_polygon(Agraph_t *g, glCompPoly_t *selPoly)
void pick_object_xyz(Agraph_t *g, topview *t, float x, float y, float z)
int getAttrBool(Agraph_t *g, void *obj, char *attr_name, int def)
int point_in_polygon(glCompPoly_t *selPoly, glCompPoint p)
void cacheSelectedEdges(Agraph_t *g, topview *t)
void cacheSelectedNodes(Agraph_t *g, topview *t)