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

BKE_sketch.h File Reference

Go to the source code of this file.

Classes

struct  SK_Point
struct  SK_Stroke
struct  SK_Overdraw
struct  SK_DrawData
struct  SK_Intersection
struct  SK_Sketch
struct  SK_Gesture

Defines

#define SK_OVERDRAW_LIMIT   5
#define SK_Stroke_BUFFER_INIT_SIZE   20

Typedefs

typedef enum SK_PType SK_PType
typedef enum SK_PMode SK_PMode
typedef struct SK_Point SK_Point
typedef struct SK_Stroke SK_Stroke
typedef struct SK_Overdraw SK_Overdraw
typedef struct SK_DrawData SK_DrawData
typedef struct SK_Intersection SK_Intersection
typedef struct SK_Sketch SK_Sketch
typedef struct SK_Gesture SK_Gesture

Enumerations

enum  SK_PType { PT_CONTINUOUS, PT_EXACT }
enum  SK_PMode { PT_SNAP, PT_PROJECT }

Functions

void freeSketch (SK_Sketch *sketch)
SK_SketchcreateSketch (void)
void sk_removeStroke (SK_Sketch *sketch, SK_Stroke *stk)
void sk_freeStroke (SK_Stroke *stk)
SK_Strokesk_createStroke (void)
SK_Pointsk_lastStrokePoint (SK_Stroke *stk)
void sk_allocStrokeBuffer (SK_Stroke *stk)
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_reverseStroke (SK_Stroke *stk)
void sk_filterLastContinuousStroke (SK_Stroke *stk)
void sk_filterStroke (SK_Stroke *stk, int start, int end)
void sk_initPoint (SK_Point *pt, SK_DrawData *dd, float *no)
void sk_copyPoint (SK_Point *dst, SK_Point *src)
int sk_stroke_filtermval (SK_DrawData *dd)
void sk_endContinuousStroke (SK_Stroke *stk)
void sk_updateNextPoint (SK_Sketch *sketch, SK_Stroke *stk)
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 BKE_sketch.h.


Define Documentation

#define SK_OVERDRAW_LIMIT   5

Definition at line 61 of file BKE_sketch.h.

Referenced by sk_hasOverdraw(), and sk_updateOverdraw().

#define SK_Stroke_BUFFER_INIT_SIZE   20

Definition at line 70 of file BKE_sketch.h.

Referenced by sk_createStroke().


Typedef Documentation

typedef struct SK_DrawData SK_DrawData
typedef struct SK_Gesture SK_Gesture
typedef struct SK_Overdraw SK_Overdraw
typedef enum SK_PMode SK_PMode
typedef struct SK_Point SK_Point
typedef enum SK_PType SK_PType
typedef struct SK_Sketch SK_Sketch
typedef struct SK_Stroke SK_Stroke

Enumeration Type Documentation

enum SK_PMode
Enumerator:
PT_SNAP 
PT_PROJECT 

Definition at line 35 of file BKE_sketch.h.

enum SK_PType
Enumerator:
PT_CONTINUOUS 
PT_EXACT 

Definition at line 29 of file BKE_sketch.h.


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 
)