Blender V2.61 - r43446
Functions

sketch.c File Reference

#include <string.h>
#include <math.h>
#include <float.h>
#include "MEM_guardedalloc.h"
#include "BLI_blenlib.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BKE_sketch.h"
#include "DNA_userdef_types.h"

Go to the source code of this file.

Functions

void freeSketch (SK_Sketch *sketch)
SK_SketchcreateSketch (void)
void sk_initPoint (SK_Point *pt, SK_DrawData *dd, float *no)
void sk_copyPoint (SK_Point *dst, SK_Point *src)
void sk_allocStrokeBuffer (SK_Stroke *stk)
void sk_freeStroke (SK_Stroke *stk)
SK_Strokesk_createStroke (void)
void sk_shrinkStrokeBuffer (SK_Stroke *stk)
void sk_growStrokeBuffer (SK_Stroke *stk)
void sk_growStrokeBufferN (SK_Stroke *stk, int n)
void sk_replaceStrokePoint (SK_Stroke *stk, SK_Point *pt, int n)
void sk_insertStrokePoint (SK_Stroke *stk, SK_Point *pt, int n)
void sk_appendStrokePoint (SK_Stroke *stk, SK_Point *pt)
void sk_insertStrokePoints (SK_Stroke *stk, SK_Point *pts, int len, int start, int end)
void sk_trimStroke (SK_Stroke *stk, int start, int end)
void sk_straightenStroke (SK_Stroke *stk, int start, int end, float p_start[3], float p_end[3])
void sk_polygonizeStroke (SK_Stroke *stk, int start, int end)
void sk_flattenStroke (SK_Stroke *stk, int start, int end)
void sk_removeStroke (SK_Sketch *sketch, SK_Stroke *stk)
void sk_reverseStroke (SK_Stroke *stk)
void sk_filterStroke (SK_Stroke *stk, int start, int end)
void sk_filterLastContinuousStroke (SK_Stroke *stk)
SK_Pointsk_lastStrokePoint (SK_Stroke *stk)
void sk_endContinuousStroke (SK_Stroke *stk)
void sk_updateNextPoint (SK_Sketch *sketch, SK_Stroke *stk)
int sk_stroke_filtermval (SK_DrawData *dd)
void sk_initDrawData (SK_DrawData *dd, const int mval[2])
void sk_deleteSelectedStrokes (SK_Sketch *sketch)
void sk_selectAllSketch (SK_Sketch *sketch, int mode)

Detailed Description

Definition in file sketch.c.


Function Documentation

SK_Sketch* createSketch ( void  )
void freeSketch ( SK_Sketch sketch)
void sk_allocStrokeBuffer ( SK_Stroke stk)
void sk_appendStrokePoint ( SK_Stroke stk,
SK_Point pt 
)
void sk_copyPoint ( SK_Point dst,
SK_Point src 
)

Definition at line 91 of file sketch.c.

Referenced by sk_reverseStroke().

SK_Stroke* sk_createStroke ( void  )
void sk_deleteSelectedStrokes ( SK_Sketch sketch)
void sk_endContinuousStroke ( SK_Stroke stk)

Definition at line 519 of file sketch.c.

References SK_Stroke::nb_points, SK_Stroke::points, PT_EXACT, and SK_Point::type.

Referenced by sketch_draw_modal().

void sk_filterLastContinuousStroke ( SK_Stroke stk)
void sk_filterStroke ( SK_Stroke stk,
int  start,
int  end 
)
void sk_flattenStroke ( SK_Stroke stk,
int  start,
int  end 
)
void sk_freeStroke ( SK_Stroke stk)

Definition at line 101 of file sketch.c.

References MEM_freeN(), and SK_Stroke::points.

Referenced by freeSketch(), sk_freeGesture(), sk_removeStroke(), and sketch_draw_modal().

void sk_growStrokeBuffer ( SK_Stroke stk)
void sk_growStrokeBufferN ( SK_Stroke stk,
int  n 
)
void sk_initDrawData ( SK_DrawData dd,
const int  mval[2] 
)
void sk_initPoint ( SK_Point pt,
SK_DrawData dd,
float *  no 
)
void sk_insertStrokePoint ( SK_Stroke stk,
SK_Point pt,
int  n 
)
void sk_insertStrokePoints ( SK_Stroke stk,
SK_Point pts,
int  len,
int  start,
int  end 
)

Definition at line 201 of file sketch.c.

References SK_Stroke::nb_points, SK_Stroke::points, size(), and sk_growStrokeBufferN().

Referenced by sk_endOverdraw().

SK_Point* sk_lastStrokePoint ( SK_Stroke stk)
void sk_polygonizeStroke ( SK_Stroke stk,
int  start,
int  end 
)

Definition at line 269 of file sketch.c.

References i, SK_Stroke::nb_points, SK_Stroke::points, PT_EXACT, size(), and SK_Point::type.

Referenced by sk_applyCommandGesture().

void sk_removeStroke ( SK_Sketch sketch,
SK_Stroke stk 
)
void sk_replaceStrokePoint ( SK_Stroke stk,
SK_Point pt,
int  n 
)

Definition at line 174 of file sketch.c.

References SK_Stroke::points.

Referenced by sk_applyTrimGesture().

void sk_reverseStroke ( SK_Stroke stk)
void sk_selectAllSketch ( SK_Sketch sketch,
int  mode 
)
void sk_shrinkStrokeBuffer ( SK_Stroke stk)
void sk_straightenStroke ( SK_Stroke stk,
int  start,
int  end,
float  p_start[3],
float  p_end[3] 
)
int sk_stroke_filtermval ( SK_DrawData dd)

Definition at line 532 of file sketch.c.

References ABS, UserDef::gp_manhattendist, SK_DrawData::mval, SK_DrawData::previous_mval, and U.

Referenced by sk_draw_stroke().

void sk_trimStroke ( SK_Stroke stk,
int  start,
int  end 
)

Definition at line 219 of file sketch.c.

References SK_Stroke::nb_points, SK_Stroke::points, and size().

Referenced by sk_applyTrimGesture().

void sk_updateNextPoint ( SK_Sketch sketch,
SK_Stroke stk 
)