Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
selectionfuncs.c File Reference
#include <cgraph/alloc.h>
#include <limits.h>
#include "selectionfuncs.h"
#include "topviewfuncs.h"
#include "smyrna_utils.h"
Include dependency graph for selectionfuncs.c:

Go to the source code of this file.

Functions

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 void pick_objects_in_rect (Agraph_t *g, float x1, float y1, float x2, float y2)
 
static void * pick_object (Agraph_t *g, glCompPoint p)
 
void pick_object_xyz (Agraph_t *g, topview *t, float x, float y, float z)
 
void pick_objects_rect (Agraph_t *g)
 
void deselect_all (Agraph_t *g)
 
void clear_selpoly (glCompPoly *sp)
 
static int close_poly (glCompPoly *selPoly, glCompPoint pt)
 
static void select_polygon (Agraph_t *g, glCompPoly *selPoly)
 
void add_selpoly (Agraph_t *g, glCompPoly *selPoly, glCompPoint pt)
 

Function Documentation

◆ add_selpoly()

void add_selpoly ( Agraph_t g,
glCompPoly selPoly,
glCompPoint  pt 
)

Definition at line 268 of file selectionfuncs.c.

References clear_selpoly(), close_poly(), glCompPoly::cnt, gv_recalloc(), glCompPoly::pts, select_polygon(), glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by apply_actions().

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

◆ clear_selpoly()

void clear_selpoly ( glCompPoly sp)

Definition at line 233 of file selectionfuncs.c.

References glCompPoly::cnt, free(), NULL, and glCompPoly::pts.

Referenced by add_selpoly(), and appmouse_key_release().

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

◆ close_poly()

static int close_poly ( glCompPoly selPoly,
glCompPoint  pt 
)
static

Definition at line 239 of file selectionfuncs.c.

References glCompPoly::cnt, EPS, GetOGLDistance(), glCompPoly::pts, glCompPoint::x, and glCompPoint::y.

Referenced by add_selpoly().

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

◆ deselect_all()

void deselect_all ( Agraph_t g)

Definition at line 207 of file selectionfuncs.c.

References agattr(), AGEDGE, agfstnode(), agfstout(), AGNODE, agnxtnode(), agnxtout(), agxset(), cacheSelectedEdges(), cacheSelectedNodes(), ED_selected, GE_selected, GN_selected, ND_printLabel, ND_selected, _ViewInfo::Topview, and view.

Referenced by menu_click_pan().

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

◆ pick_object()

static void * pick_object ( Agraph_t g,
glCompPoint  p 
)
static

Definition at line 106 of file selectionfuncs.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), dist(), distBetweenPts(), ED_posHead, ED_posTail, topview::fitin_zoom, getAttrBool(), GetOGLDistance(), ND_A, ND_size, ND_visible, _ViewInfo::nodeScale, point_to_lineseg_dist(), _ViewInfo::Topview, view, and _ViewInfo::zoom.

Referenced by pick_object_xyz().

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

◆ pick_object_xyz()

void pick_object_xyz ( Agraph_t g,
topview t,
float  x,
float  y,
float  z 
)

Definition at line 152 of file selectionfuncs.c.

References AGEDGE, AGNODE, agobjkind(), cacheSelectedEdges(), cacheSelectedNodes(), ND_printLabel, pick_object(), select_edge(), select_node(), glCompPoint::x, glCompPoint::y, glCompPoint::z, and z.

Referenced by apply_actions().

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

◆ pick_objects_in_rect()

static void pick_objects_in_rect ( Agraph_t g,
float  x1,
float  y1,
float  x2,
float  y2 
)
static

Definition at line 74 of file selectionfuncs.c.

References agfstnode(), agfstout(), agnxtnode(), agnxtout(), ED_posHead, ED_posTail, is_point_in_rectangle(), ND_A, ND_visible, topview::sel, select_edge(), select_node(), _selection::selectEdges, _selection::selectNodes, _ViewInfo::Topview, view, glCompPoint::x, and glCompPoint::y.

Referenced by pick_objects_rect().

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

◆ pick_objects_rect()

void pick_objects_rect ( Agraph_t g)

Definition at line 173 of file selectionfuncs.c.

References cacheSelectedEdges(), cacheSelectedNodes(), glCompMouse::GLfinalPos, glCompMouse::GLinitPos, _ViewInfo::mouse, pick_objects_in_rect(), _ViewInfo::Topview, view, glCompPoint::x, and glCompPoint::y.

Referenced by apply_actions().

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

◆ select_edge()

static void select_edge ( Agraph_t g,
Agedge_t obj,
int  reverse 
)
static

Definition at line 46 of file selectionfuncs.c.

References agattr(), AGEDGE, agxset(), ED_selected, and GE_selected.

Referenced by pick_object_xyz(), and pick_objects_in_rect().

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

◆ select_node()

static void select_node ( Agraph_t g,
Agnode_t obj,
int  reverse 
)
static

Definition at line 17 of file selectionfuncs.c.

References agattr(), AGNODE, agxset(), GN_selected, ND_printLabel, and ND_selected.

Referenced by pick_object_xyz(), pick_objects_in_rect(), and select_polygon().

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

◆ select_polygon()

static void select_polygon ( Agraph_t g,
glCompPoly selPoly 
)
static

Definition at line 253 of file selectionfuncs.c.

References agfstnode(), agnxtnode(), cacheSelectedNodes(), ND_A, point_in_polygon(), select_node(), _ViewInfo::Topview, and view.

Referenced by add_selpoly().

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