Graphviz 13.0.0~dev.20250607.1528
Loading...
Searching...
No Matches
draw.c File Reference
#include "draw.h"
#include <common/colorprocs.h>
#include "smyrna_utils.h"
#include <glcomp/glutils.h>
#include <math.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdlib.h>
#include <util/unreachable.h>
#include <util/xml.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 (xdot_op *op, int param)
 
static void DrawEllipse (xdot_op *op, int param)
 
static void DrawPolygon (xdot_op *op, int param)
 
static void DrawPolyline (xdot_op *op, int param)
 
static glCompColor GetglCompColor (const char *color)
 
static void SetFillColor (xdot_op *op, int param)
 
static void SetPenColor (xdot_op *op, int param)
 
static void SetFont (xdot_op *op, int param)
 
static void InsertImage (xdot_op *op, int param)
 
static int put (void *buffer, const char *s)
 
static void EmbedText (xdot_op *op, int param)
 
void drawBorders (ViewInfo *vi)
 
void drawCircle (float x, float y, float radius, float zdepth)
 
void draw_selpoly (glCompPoly_t *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_t *  selPoly)

Definition at line 390 of file draw.c.

References glCompMouse::GLpos, last, _ViewInfo::mouse, 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 ( xdot_op op,
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, 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 344 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 361 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 ( xdot_op op,
int  param 
)
static

Definition at line 137 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, _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 ( xdot_op op,
int  param 
)
static

Definition at line 181 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, _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 ( xdot_op op,
int  param 
)
static

Definition at line 209 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, _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()

◆ GetglCompColor()

static glCompColor GetglCompColor ( const char *  color)
static

Definition at line 230 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 ( xdot_op op,
int  param 
)
static

Definition at line 265 of file draw.c.

References glCompImage::base, glCompObj_::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 288 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 ( xdot_op op,
int  param 
)
static

Definition at line 245 of file draw.c.

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

Here is the call graph for this function:

◆ SetFont()

static void SetFont ( xdot_op op,
int  param 
)
static

Definition at line 257 of file draw.c.

References font_op.

◆ SetPenColor()

static void SetPenColor ( xdot_op op,
int  param 
)
static

Definition at line 250 of file draw.c.

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

Here is the call graph for this function:

Variable Documentation

◆ dx

◆ dy

◆ font_op

sdot_op* font_op
static

Definition at line 255 of file draw.c.

Referenced by EmbedText(), and SetFont().

◆ OpFns

drawfunc_t OpFns[]
Initial value:
= {
}
static void SetFont(xdot_op *op, int param)
Definition draw.c:257
static void EmbedText(xdot_op *op, int param)
Definition draw.c:299
static void DrawEllipse(xdot_op *op, int param)
Definition draw.c:137
static void SetPenColor(xdot_op *op, int param)
Definition draw.c:250
static void DrawPolyline(xdot_op *op, int param)
Definition draw.c:209
static void InsertImage(xdot_op *op, int param)
Definition draw.c:265
static void DrawBeziers(xdot_op *op, int param)
Definition draw.c:123
static void DrawPolygon(xdot_op *op, int param)
Definition draw.c:181
static void SetFillColor(xdot_op *op, int param)
Definition draw.c:245
node NULL
Definition grammar.y:180
@ xop_polygon
Definition xdot.h:129
@ xop_font
Definition xdot.h:135
@ xop_image
Definition xdot.h:137
@ xop_bezier
Definition xdot.h:130
@ xop_fill_color
Definition xdot.h:133
@ xop_text
Definition xdot.h:132
@ xop_fontchar
Definition xdot.h:139
@ xop_style
Definition xdot.h:136
@ xop_grad_color
Definition xdot.h:138
@ xop_pen_color
Definition xdot.h:134
@ xop_ellipse
Definition xdot.h:128
@ xop_polyline
Definition xdot.h:131

Definition at line 375 of file draw.c.

Referenced by makeXDotSpline(), and parseXdotwithattrs().