Graphviz 13.0.0~dev.20241220.2304
Loading...
Searching...
No Matches
draw.c File Reference
#include "draw.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 <util/unreachable.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 (const 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_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 413 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 ( 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 367 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 384 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 142 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 188 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 218 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()

◆ GetglCompColor()

static glCompColor GetglCompColor ( const char *  color)
static

Definition at line 240 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 285 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 311 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 254 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 277 of file draw.c.

References font_op.

◆ SetPenColor()

static void SetPenColor ( sdot_op o,
int  param 
)
static

Definition at line 261 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 269 of file draw.c.

Variable Documentation

◆ dx

◆ dy

◆ font_op

sdot_op* font_op
static

Definition at line 275 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:269
static void EmbedText(sdot_op *o, int param)
Definition draw.c:322
static void DrawPolygon(sdot_op *o, int param)
Definition draw.c:188
static void SetFillColor(sdot_op *o, int param)
Definition draw.c:254
static void SetPenColor(sdot_op *o, int param)
Definition draw.c:261
static void InsertImage(sdot_op *o, int param)
Definition draw.c:285
static void SetFont(sdot_op *o, int param)
Definition draw.c:277
static void DrawPolyline(sdot_op *o, int param)
Definition draw.c:218
static void DrawEllipse(sdot_op *o, int param)
Definition draw.c:142
void(* drawfunc_t)(xdot_op *, int)
Definition xdot.h:132

Definition at line 400 of file draw.c.

Referenced by makeXDotSpline(), and parseXdotwithattrs().