Graphviz 12.0.1~dev.20240716.0800
Loading...
Searching...
No Matches
draw.c File Reference
#include "draw.h"
#include <cgraph/unreachable.h>
#include <common/colorprocs.h>
#include <common/types.h>
#include <common/utils.h>
#include "smyrna_utils.h"
#include <glcomp/glutils.h>
#include <math.h>
#include <stdbool.h>
#include <stdlib.h>
#include <xdot/xdot.h>
#include "viewport.h"
#include "topfisheyeview.h"
#include "appmouse.h"
#include "hotkeymap.h"
#include "polytess.h"
#include <glcomp/glcompimage.h>
Include dependency graph for draw.c:

Go to the source code of this file.

Macros

#define LAYER_DIFF   0.001
 

Functions

static void DrawBezier (xdot_point *pts, int filled, int param)
 
static void set_options (int param)
 
static void DrawBeziers (sdot_op *o, int param)
 
static void DrawEllipse (sdot_op *o, int param)
 
static void DrawPolygon (sdot_op *o, int param)
 
static void DrawPolyline (sdot_op *o, int param)
 
static glCompColor GetglCompColor (char *color)
 
static void SetFillColor (sdot_op *o, int param)
 
static void SetPenColor (sdot_op *o, int param)
 
static void SetStyle (sdot_op *o, int param)
 
static void SetFont (sdot_op *o, int param)
 
static void InsertImage (sdot_op *o, int param)
 
static int put (void *buffer, const char *s)
 
static void EmbedText (sdot_op *o, int param)
 
void drawBorders (ViewInfo *vi)
 
void drawCircle (float x, float y, float radius, float zdepth)
 
void draw_selpoly (glCompPoly *selPoly)
 

Variables

static float dx = 0.0
 
static float dy = 0.0
 
static sdot_opfont_op
 
drawfunc_t OpFns []
 

Macro Definition Documentation

◆ LAYER_DIFF

#define LAYER_DIFF   0.001

Definition at line 39 of file draw.c.

Function Documentation

◆ draw_selpoly()

void draw_selpoly ( glCompPoly selPoly)

Definition at line 416 of file draw.c.

References glCompPoly::cnt, glCompMouse::GLpos, _ViewInfo::mouse, glCompPoly::pts, view, glCompPoint::x, glCompPoint::y, and glCompPoint::z.

Referenced by glexpose_main().

Here is the caller graph for this function:

◆ DrawBezier()

static void DrawBezier ( xdot_point pts,
int  filled,
int  param 
)
static

Definition at line 41 of file draw.c.

References glCompColor::A, glCompColor::B, _ViewInfo::fillColor, glCompColor::G, topview::global_z, _ViewInfo::LineWidth, _ViewInfo::penColor, glCompColor::R, _ViewInfo::selectedNodeColor, _ViewInfo::Topview, view, X, xdot_point::x, Y, xdot_point::y, and xdot_point::z.

Referenced by DrawBeziers().

Here is the caller graph for this function:

◆ DrawBeziers()

static void DrawBeziers ( sdot_op o,
int  param 
)
static

Definition at line 123 of file draw.c.

References _xdot_op::bezier, xdot_polyline::cnt, DrawBezier(), topview::global_z, _xdot_op::kind, sdot_op::layer, LAYER_DIFF, sdot_op::op, ps, xdot_polyline::pts, _ViewInfo::Topview, _xdot_op::u, view, and xd_filled_bezier.

Here is the call graph for this function:

◆ drawBorders()

void drawBorders ( ViewInfo vi)

Definition at line 370 of file draw.c.

References glCompColor::A, glCompColor::B, _ViewInfo::bdVisible, _ViewInfo::bdxLeft, _ViewInfo::bdxRight, _ViewInfo::bdyBottom, _ViewInfo::bdyTop, _ViewInfo::borderColor, glCompColor::G, and glCompColor::R.

Referenced by glexpose_main().

Here is the caller graph for this function:

◆ drawCircle()

void drawCircle ( float  x,
float  y,
float  radius,
float  zdepth 
)

Definition at line 387 of file draw.c.

References DEG2RAD, topview::global_z, _ViewInfo::Topview, and view.

Referenced by renderNodes(), and renderSelectedNodes().

Here is the caller graph for this function:

◆ DrawEllipse()

static void DrawEllipse ( sdot_op o,
int  param 
)
static

Definition at line 143 of file draw.c.

References glCompColor::A, glCompColor::B, DEG2RAD, dx, dy, _xdot_op::ellipse, _ViewInfo::fillColor, glCompColor::G, topview::global_z, xdot_rect::h, _xdot_op::kind, sdot_op::layer, LAYER_DIFF, sdot_op::op, _ViewInfo::penColor, glCompColor::R, _ViewInfo::selectedNodeColor, set_options(), _ViewInfo::Topview, _xdot_op::u, view, xdot_rect::w, xdot_rect::x, xd_filled_ellipse, and xdot_rect::y.

Here is the call graph for this function:

◆ DrawPolygon()

static void DrawPolygon ( sdot_op o,
int  param 
)
static

Definition at line 189 of file draw.c.

References glCompColor::A, glCompColor::B, drawTessPolygon(), _ViewInfo::fillColor, glCompColor::G, topview::global_z, _xdot_op::kind, sdot_op::layer, LAYER_DIFF, _ViewInfo::LineWidth, sdot_op::op, _ViewInfo::penColor, glCompColor::R, _ViewInfo::selectedNodeColor, set_options(), _ViewInfo::Topview, view, and xd_filled_polygon.

Here is the call graph for this function:

◆ DrawPolyline()

static void DrawPolyline ( sdot_op o,
int  param 
)
static

Definition at line 219 of file draw.c.

References glCompColor::A, glCompColor::B, xdot_polyline::cnt, dx, dy, glCompColor::G, topview::global_z, sdot_op::layer, LAYER_DIFF, _ViewInfo::LineWidth, sdot_op::op, _ViewInfo::penColor, _xdot_op::polyline, xdot_polyline::pts, glCompColor::R, _ViewInfo::selectedNodeColor, set_options(), _ViewInfo::Topview, _xdot_op::u, view, xdot_point::x, xdot_point::y, and xdot_point::z.

Here is the call graph for this function:

◆ EmbedText()

static void EmbedText ( sdot_op o,
int  param 
)
static

◆ GetglCompColor()

static glCompColor GetglCompColor ( char *  color)
static

Definition at line 241 of file draw.c.

References glCompColor::A, glCompColor::B, color(), colorxlate(), glCompColor::G, NULL, _ViewInfo::penColor, glCompColor::R, color_s::RGBA, RGBA_DOUBLE, color_s::u, and view.

Referenced by SetFillColor(), and SetPenColor().

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

◆ InsertImage()

static void InsertImage ( sdot_op o,
int  param 
)
static

Definition at line 287 of file draw.c.

References glCompImage::common, glCompCallBacks::draw, glCompCommon::functions, glCompImageNewFile(), xdot_rect::h, glCompImage::height, _xdot_op::image, sdot_op::img, xdot_image::name, sdot_op::obj, sdot_op::op, xdot_image::pos, _xdot_op::u, xdot_rect::w, glCompImage::width, xdot_rect::x, and xdot_rect::y.

Here is the call graph for this function:

◆ put()

static int put ( void *  buffer,
const char *  s 
)
static

Definition at line 313 of file draw.c.

Referenced by EmbedText().

Here is the caller graph for this function:

◆ set_options()

static void set_options ( int  param)
static

Definition at line 108 of file draw.c.

References glCompMouse::down, dx, dy, get_mode(), glCompMouse::GLfinalPos, glCompMouse::GLinitPos, _ViewInfo::mouse, view, glCompPoint::x, and glCompPoint::y.

Referenced by DrawEllipse(), DrawPolygon(), and DrawPolyline().

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

◆ SetFillColor()

static void SetFillColor ( sdot_op o,
int  param 
)
static

Definition at line 256 of file draw.c.

References _xdot_op::color, _ViewInfo::fillColor, GetglCompColor(), sdot_op::op, _xdot_op::u, and view.

Here is the call graph for this function:

◆ SetFont()

static void SetFont ( sdot_op o,
int  param 
)
static

Definition at line 279 of file draw.c.

References font_op.

◆ SetPenColor()

static void SetPenColor ( sdot_op o,
int  param 
)
static

Definition at line 263 of file draw.c.

References _xdot_op::color, GetglCompColor(), sdot_op::op, _ViewInfo::penColor, _xdot_op::u, and view.

Here is the call graph for this function:

◆ SetStyle()

static void SetStyle ( sdot_op o,
int  param 
)
static

Definition at line 271 of file draw.c.

Variable Documentation

◆ dx

◆ dy

◆ font_op

sdot_op* font_op
static

Definition at line 277 of file draw.c.

Referenced by EmbedText(), and SetFont().

◆ OpFns

drawfunc_t OpFns[]
Initial value:
= {
}
static void DrawBeziers(sdot_op *o, int param)
Definition draw.c:123
static void SetStyle(sdot_op *o, int param)
Definition draw.c:271
static void EmbedText(sdot_op *o, int param)
Definition draw.c:324
static void DrawPolygon(sdot_op *o, int param)
Definition draw.c:189
static void SetFillColor(sdot_op *o, int param)
Definition draw.c:256
static void SetPenColor(sdot_op *o, int param)
Definition draw.c:263
static void InsertImage(sdot_op *o, int param)
Definition draw.c:287
static void SetFont(sdot_op *o, int param)
Definition draw.c:279
static void DrawPolyline(sdot_op *o, int param)
Definition draw.c:219
static void DrawEllipse(sdot_op *o, int param)
Definition draw.c:143
void(* drawfunc_t)(xdot_op *, int)
Definition xdot.h:132

Definition at line 403 of file draw.c.

Referenced by makeXDotSpline(), and parseXdotwithattrs().