Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

node_draw.c File Reference

#include <math.h>
#include <stdio.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "DNA_node_types.h"
#include "DNA_lamp_types.h"
#include "DNA_material_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "DNA_space_types.h"
#include "DNA_screen_types.h"
#include "DNA_world_types.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_threads.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_main.h"
#include "BKE_node.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_node.h"
#include "ED_gpencil.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "RNA_access.h"
#include "NOD_composite.h"
#include "NOD_shader.h"
#include "intern/node_util.h"
#include "node_intern.h"

Go to the source code of this file.

Classes

struct  NodeUpdateCalldata

Defines

#define NODE_GROUP_FRAME   120

Typedefs

typedef struct NodeUpdateCalldata NodeUpdateCalldata

Functions

void ui_dropshadow (rctf *rct, float radius, float aspect, int select)
void ED_node_tree_update (SpaceNode *snode, Scene *scene)
void ED_node_changed_update (ID *id, bNode *node)
static int has_nodetree (bNodeTree *ntree, bNodeTree *lookup)
static void node_generic_update_cb (void *calldata, ID *owner_id, bNodeTree *ntree)
void ED_node_generic_update (Main *bmain, bNodeTree *ntree, bNode *node)
static void do_node_internal_buttons (bContext *C, void *node_v, int event)
static void node_scaling_widget (int color_id, float aspect, float xmin, float ymin, float xmax, float ymax)
static void node_uiblocks_init (const bContext *C, bNodeTree *ntree)
static void node_update_basis (const bContext *C, bNodeTree *ntree, bNode *node)
static void node_update_hidden (bNode *node)
void node_update_default (const bContext *C, bNodeTree *ntree, bNode *node)
static int node_get_colorid (bNode *node)
static void node_draw_mute_line (View2D *v2d, SpaceNode *snode, bNode *node)
static void node_circle_draw (float x, float y, float size, char *col)
void node_socket_circle_draw (bNodeTree *UNUSED(ntree), bNodeSocket *sock, float size)
static void node_draw_preview (bNodePreview *preview, rctf *prv)
static void node_toggle_button_cb (struct bContext *C, void *node_argv, void *op_argv)
static void node_draw_basis (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
static void node_draw_hidden (const bContext *C, ARegion *ar, SpaceNode *snode, bNode *node)
void node_draw_default (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
static void node_update (const bContext *C, bNodeTree *ntree, bNode *node)
void node_update_nodetree (const bContext *C, bNodeTree *ntree, float offsetx, float offsety)
static void node_draw (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node)
void node_draw_nodetree (const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree)
void drawnodespace (const bContext *C, ARegion *ar, View2D *v2d)

Detailed Description

Definition in file node_draw.c.


Define Documentation

#define NODE_GROUP_FRAME   120

Definition at line 81 of file node_draw.c.


Typedef Documentation


Function Documentation

static void do_node_internal_buttons ( bContext C,
void *  node_v,
int  event 
) [static]

Definition at line 168 of file node_draw.c.

References B_NODE_EXEC, CTX_wm_space_node(), ED_node_changed_update(), and SpaceNode::id.

Referenced by node_uiblocks_init().

void drawnodespace ( const bContext C,
ARegion ar,
View2D v2d 
)
void ED_node_changed_update ( ID id,
bNode node 
)
void ED_node_generic_update ( Main bmain,
bNodeTree ntree,
bNode node 
)
void ED_node_tree_update ( SpaceNode snode,
Scene scene 
)

Definition at line 87 of file node_draw.c.

References bNodeTree::id, SpaceNode::nodetree, snode_set_context(), and ID::us.

Referenced by new_node_tree_exec().

static int has_nodetree ( bNodeTree ntree,
bNodeTree lookup 
) [static]
static void node_circle_draw ( float  x,
float  y,
float  size,
char *  col 
) [static]

Definition at line 467 of file node_draw.c.

References co, and si.

Referenced by node_socket_circle_draw().

static void node_draw ( const bContext C,
ARegion ar,
SpaceNode snode,
bNodeTree ntree,
bNode node 
) [static]

Definition at line 901 of file node_draw.c.

References bNodeType::drawfunc, and bNode::typeinfo.

Referenced by node_draw_nodetree().

static void node_draw_basis ( const bContext C,
ARegion ar,
SpaceNode snode,
bNodeTree ntree,
bNode node 
) [static]

Definition at line 577 of file node_draw.c.

References SpaceNode::aspect, B_REDR, BASIS_RAD, BLI_lock_thread(), BLI_rctf_is_empty(), BLI_strncpy(), BLI_unlock_thread(), bNode::block, bNodeSocketType::buttonfunc, View2D::cur, ListBase::first, bNodeSocket::flag, bNodeType::flag, bNode::flag, bNode::id, bNode::inputs, LABEL, bNodeSocket::link, LOCK_PREVIEW, bNodeSocket::locx, bNodeSocket::locy, bNodeSocket::name, bNodeSocket::next, NODE_ACTIVE, node_draw_mute_line(), node_draw_preview(), NODE_DY, NODE_DYS, node_get_colorid(), NODE_GROUP, NODE_MUTED, NODE_PREVIEW, node_scaling_widget(), node_socket_circle_draw(), NODE_SOCKSIZE, node_toggle_button_cb(), nodeLabel(), nodeShaderSynchronizeID(), nodeSocketIsHidden(), NTREE_SHADER, ntreeGetSocketType(), NULL, bNode::outputs, bNode::preview, bNode::prvr, bNodePreview::rect, RNA_NodeSocket, RNA_pointer_create(), SELECT, SOCK_HIDE_VALUE, TH_NODE, TH_REDALERT, TH_TEXT, TH_TEXT_HI, TOGBUT, bNode::totr, SpaceNode::treetype, bNodeSocket::type, bNode::type, bNode::typeinfo, UI_CNR_BOTTOM_LEFT, UI_CNR_TOP_LEFT, UI_CNR_TOP_RIGHT, UI_DrawTriIcon(), ui_dropshadow(), UI_EMBOSS, UI_EMBOSSN, UI_GetStringWidth(), UI_ThemeClearColor(), UI_ThemeColor(), UI_ThemeColor4(), UI_ThemeColorBlend(), UI_ThemeColorBlendShade(), UI_ThemeColorShade(), UI_ThemeColorShadeAlpha(), UI_UNIT_X, UI_UNIT_Y, uiBlockSetEmboss(), uiButSetFunc(), uiDefBut(), uiDefIconBut(), uiDrawBlock(), uiDrawBox(), uiEndBlock(), uiRoundBox(), uiSetRoundBox(), ARegion::v2d, bNode::width, rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.

Referenced by node_draw_default().

void node_draw_default ( const bContext C,
ARegion ar,
SpaceNode snode,
bNodeTree ntree,
bNode node 
)

Definition at line 871 of file node_draw.c.

References bNode::flag, node_draw_basis(), node_draw_hidden(), and NODE_HIDDEN.

Referenced by ED_init_node_butfuncs(), and node_draw_group().

static void node_draw_hidden ( const bContext C,
ARegion ar,
SpaceNode snode,
bNode node 
) [static]
static void node_draw_mute_line ( View2D v2d,
SpaceNode snode,
bNode node 
) [static]
void node_draw_nodetree ( const bContext C,
ARegion ar,
SpaceNode snode,
bNodeTree ntree 
)
static void node_draw_preview ( bNodePreview preview,
rctf prv 
) [static]
static void node_generic_update_cb ( void *  calldata,
ID owner_id,
bNodeTree ntree 
) [static]
static int node_get_colorid ( bNode node) [static]
static void node_scaling_widget ( int  color_id,
float  aspect,
float  xmin,
float  ymin,
float  xmax,
float  ymax 
) [static]

Definition at line 178 of file node_draw.c.

References fdrawline(), and UI_ThemeColorShade().

Referenced by node_draw_basis().

void node_socket_circle_draw ( bNodeTree UNUSEDntree,
bNodeSocket sock,
float  size 
)
static void node_toggle_button_cb ( struct bContext C,
void *  node_argv,
void *  op_argv 
) [static]
static void node_uiblocks_init ( const bContext C,
bNodeTree ntree 
) [static]
static void node_update ( const bContext C,
bNodeTree ntree,
bNode node 
) [static]

Definition at line 879 of file node_draw.c.

References bNodeType::drawupdatefunc, and bNode::typeinfo.

Referenced by node_update_nodetree().

static void node_update_basis ( const bContext C,
bNodeTree ntree,
bNode node 
) [static]
void node_update_default ( const bContext C,
bNodeTree ntree,
bNode node 
)
static void node_update_hidden ( bNode node) [static]
void node_update_nodetree ( const bContext C,
bNodeTree ntree,
float  offsetx,
float  offsety 
)
void ui_dropshadow ( rctf rct,
float  radius,
float  aspect,
int  select 
)