[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50166] trunk/blender/source/blender: code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention.

Campbell Barton ideasman42 at gmail.com
Thu Aug 23 20:25:46 CEST 2012


Revision: 50166
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50166
Author:   campbellbarton
Date:     2012-08-23 18:25:45 +0000 (Thu, 23 Aug 2012)
Log Message:
-----------
code cleanup: rename BLI_in_rctf() --> BLI_rctf_isect_pt(), to conform with our naming convention.

Modified Paths:
--------------
    trunk/blender/source/blender/blenfont/intern/blf_glyph.c
    trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
    trunk/blender/source/blender/blenlib/BLI_rect.h
    trunk/blender/source/blender/blenlib/intern/rct.c
    trunk/blender/source/blender/editors/animation/keyframes_edit.c
    trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
    trunk/blender/source/blender/editors/include/UI_view2d.h
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_ops.c
    trunk/blender/source/blender/editors/interface/interface_panel.c
    trunk/blender/source/blender/editors/interface/interface_regions.c
    trunk/blender/source/blender/editors/mask/mask_select.c
    trunk/blender/source/blender/editors/screen/area.c
    trunk/blender/source/blender/editors/screen/screen_edit.c
    trunk/blender/source/blender/editors/screen/screen_ops.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/editors/space_clip/clip_graph_ops.c
    trunk/blender/source/blender/editors/space_clip/tracking_select.c
    trunk/blender/source/blender/editors/space_file/file_ops.c
    trunk/blender/source/blender/editors/space_node/drawnode.c
    trunk/blender/source/blender/editors/space_node/node_draw.c
    trunk/blender/source/blender/editors/space_node/node_edit.c
    trunk/blender/source/blender/editors/space_node/node_relationships.c
    trunk/blender/source/blender/editors/space_node/node_select.c
    trunk/blender/source/blender/editors/space_view3d/view3d_select.c
    trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
    trunk/blender/source/blender/render/intern/source/shadbuf.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/blenfont/intern/blf_glyph.c
===================================================================
--- trunk/blender/source/blender/blenfont/intern/blf_glyph.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/blenfont/intern/blf_glyph.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -437,13 +437,13 @@
 	y2 = y + g->pos_y - g->height;
 
 	if (font->flags & BLF_CLIPPING) {
-		if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
+		if (!BLI_rctf_isect_pt(&font->clip_rec, dx + font->pos[0], y1 + font->pos[1]))
 			return 0;
-		if (!BLI_in_rctf(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1]))
+		if (!BLI_rctf_isect_pt(&font->clip_rec, dx + font->pos[0], y2 + font->pos[1]))
 			return 0;
-		if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1]))
+		if (!BLI_rctf_isect_pt(&font->clip_rec, dx1 + font->pos[0], y2 + font->pos[1]))
 			return 0;
-		if (!BLI_in_rctf(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1]))
+		if (!BLI_rctf_isect_pt(&font->clip_rec, dx1 + font->pos[0], y1 + font->pos[1]))
 			return 0;
 	}
 

Modified: trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/blenkernel/intern/mask_rasterize.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -1196,7 +1196,7 @@
 
 BLI_INLINE unsigned int layer_bucket_index_from_xy(MaskRasterLayer *layer, const float xy[2])
 {
-	BLI_assert(BLI_in_rctf_v(&layer->bounds, xy));
+	BLI_assert(BLI_rctf_isect_pt_v(&layer->bounds, xy));
 
 	return ( (unsigned int)((xy[0] - layer->bounds.xmin) * layer->buckets_xy_scalar[0])) +
 	       (((unsigned int)((xy[1] - layer->bounds.ymin) * layer->buckets_xy_scalar[1])) * layer->buckets_x);
@@ -1233,7 +1233,7 @@
 float BKE_maskrasterize_handle_sample(MaskRasterHandle *mr_handle, const float xy[2])
 {
 	/* can't do this because some layers may invert */
-	/* if (BLI_in_rctf_v(&mr_handle->bounds, xy)) */
+	/* if (BLI_rctf_isect_pt_v(&mr_handle->bounds, xy)) */
 
 	const unsigned int layers_tot = mr_handle->layers_tot;
 	unsigned int i;
@@ -1246,7 +1246,7 @@
 		float value_layer;
 
 		/* also used as signal for unused layer (when render is disabled) */
-		if (layer->alpha != 0.0f && BLI_in_rctf_v(&layer->bounds, xy)) {
+		if (layer->alpha != 0.0f && BLI_rctf_isect_pt_v(&layer->bounds, xy)) {
 			value_layer = 1.0f - layer_bucket_depth_from_xy(layer, xy);
 
 			switch (layer->falloff) {

Modified: trunk/blender/source/blender/blenlib/BLI_rect.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_rect.h	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/blenlib/BLI_rect.h	2012-08-23 18:25:45 UTC (rev 50166)
@@ -57,16 +57,16 @@
 //void BLI_rcti_interp(struct rctf *rect, struct rctf *rect_a, struct rctf *rect_b, float fac);
 int  BLI_rctf_compare(const struct rctf *rect_a, const struct rctf *rect_b, const float limit);
 int  BLI_rcti_compare(const struct rcti *rect_a, const struct rcti *rect_b);
-int  BLI_in_rcti(const struct rcti *rect, const int x, const int y);
-int  BLI_in_rcti_v(const struct rcti *rect, const int xy[2]);
-int  BLI_in_rctf(const struct rctf *rect, const float x, const float y);
-int  BLI_in_rctf_v(const struct rctf *rect, const float xy[2]);
+int  BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest);
+int  BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest);
+int  BLI_rcti_isect_pt(const struct rcti *rect, const int x, const int y);
+int  BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2]);
+int  BLI_rctf_isect_pt(const struct rctf *rect, const float x, const float y);
+int  BLI_rctf_isect_pt_v(const struct rctf *rect, const float xy[2]);
 int  BLI_rcti_isect_segment(const struct rcti *rect, const int s1[2], const int s2[2]);
 #if 0 /* NOT NEEDED YET */
 int  BLI_rctf_isect_segment(struct rcti *rect, int s1[2], int s2[2]);
 #endif
-int  BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest);
-int  BLI_rcti_isect(const struct rcti *src1, const struct rcti *src2, struct rcti *dest);
 void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
 void BLI_rcti_union(struct rcti *rcti1, const struct rcti *rcti2);
 void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
@@ -88,4 +88,4 @@
 }
 #endif
 
-#endif
+#endif  /* __BLI_RECT_H__ */

Modified: trunk/blender/source/blender/blenlib/intern/rct.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/rct.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/blenlib/intern/rct.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -58,7 +58,7 @@
 	return ((rect->xmax <= rect->xmin) || (rect->ymax <= rect->ymin));
 }
 
-int BLI_in_rcti(const rcti *rect, const int x, const int y)
+int BLI_rcti_isect_pt(const rcti *rect, const int x, const int y)
 {
 	if (x < rect->xmin) return 0;
 	if (x > rect->xmax) return 0;
@@ -74,7 +74,7 @@
  *
  * \return True if \a rect is empty.
  */
-int BLI_in_rcti_v(const rcti *rect, const int xy[2])
+int BLI_rcti_isect_pt_v(const rcti *rect, const int xy[2])
 {
 	if (xy[0] < rect->xmin) return 0;
 	if (xy[0] > rect->xmax) return 0;
@@ -83,7 +83,7 @@
 	return 1;
 }
 
-int BLI_in_rctf(const rctf *rect, const float x, const float y)
+int BLI_rctf_isect_pt(const rctf *rect, const float x, const float y)
 {
 	if (x < rect->xmin) return 0;
 	if (x > rect->xmax) return 0;
@@ -92,7 +92,7 @@
 	return 1;
 }
 
-int BLI_in_rctf_v(const rctf *rect, const float xy[2])
+int BLI_rctf_isect_pt_v(const rctf *rect, const float xy[2])
 {
 	if (xy[0] < rect->xmin) return 0;
 	if (xy[0] > rect->xmax) return 0;
@@ -124,7 +124,7 @@
 	if (s1[1] > rect->ymax && s2[1] > rect->ymax) return 0;
 
 	/* if either points intersect then we definetly intersect */
-	if (BLI_in_rcti_v(rect, s1) || BLI_in_rcti_v(rect, s2)) {
+	if (BLI_rcti_isect_pt_v(rect, s1) || BLI_rcti_isect_pt_v(rect, s2)) {
 		return 1;
 	}
 	else {

Modified: trunk/blender/source/blender/editors/animation/keyframes_edit.c
===================================================================
--- trunk/blender/source/blender/editors/animation/keyframes_edit.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/editors/animation/keyframes_edit.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -505,7 +505,7 @@
 	if (ked->data) {
 		short ok = 0;
 		
-		#define KEY_CHECK_OK(_index) BLI_in_rctf_v(ked->data, bezt->vec[_index])
+		#define KEY_CHECK_OK(_index) BLI_rctf_isect_pt_v(ked->data, bezt->vec[_index])
 		KEYFRAME_OK_CHECKS(KEY_CHECK_OK);
 		#undef KEY_CHECK_OK
 		

Modified: trunk/blender/source/blender/editors/gpencil/gpencil_paint.c
===================================================================
--- trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/editors/gpencil/gpencil_paint.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -825,7 +825,7 @@
 		}
 		
 		/* do boundbox check first */
-		if (BLI_in_rcti(rect, x0, y0)) {
+		if (BLI_rcti_isect_pt(rect, x0, y0)) {
 			/* only check if point is inside */
 			if ( ((x0 - mval[0]) * (x0 - mval[0]) + (y0 - mval[1]) * (y0 - mval[1])) <= rad * rad) {
 				/* free stroke */
@@ -874,7 +874,7 @@
 			}
 			
 			/* check that point segment of the boundbox of the eraser stroke */
-			if (BLI_in_rcti(rect, x0, y0) || BLI_in_rcti(rect, x1, y1)) {
+			if (BLI_rcti_isect_pt(rect, x0, y0) || BLI_rcti_isect_pt(rect, x1, y1)) {
 				/* check if point segment of stroke had anything to do with
 				 * eraser region  (either within stroke painted, or on its lines)
 				 *  - this assumes that linewidth is irrelevant

Modified: trunk/blender/source/blender/editors/include/UI_view2d.h
===================================================================
--- trunk/blender/source/blender/editors/include/UI_view2d.h	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/editors/include/UI_view2d.h	2012-08-23 18:25:45 UTC (rev 50166)
@@ -120,8 +120,8 @@
 /* Macros:								*/
 
 /* test if mouse in a scrollbar (assume that scroller availability has been tested) */
-#define IN_2D_VERT_SCROLL(v2d, co)   (BLI_in_rcti_v(&v2d->vert, co))
-#define IN_2D_HORIZ_SCROLL(v2d, co)  (BLI_in_rcti_v(&v2d->hor,  co))
+#define IN_2D_VERT_SCROLL(v2d, co)   (BLI_rcti_isect_pt_v(&v2d->vert, co))
+#define IN_2D_HORIZ_SCROLL(v2d, co)  (BLI_rcti_isect_pt_v(&v2d->hor,  co))
 
 /* ------------------------------------------ */
 /* Type definitions:                          */

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-08-23 17:37:04 UTC (rev 50165)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2012-08-23 18:25:45 UTC (rev 50166)
@@ -698,7 +698,7 @@
 		rect.xmax -= delta / 2;
 	}
 	
-	return BLI_in_rcti(&rect, x, y);
+	return BLI_rcti_isect_pt(&rect, x, y);
 }
 
 static int ui_but_start_drag(bContext *C, uiBut *but, uiHandleButtonData *data, wmEvent *event)
@@ -4918,7 +4918,7 @@
 
 static int ui_but_contains_pt(uiBut *but, int mx, int my)
 {
-	return BLI_in_rctf(&but->rect, mx, my);
+	return BLI_rctf_isect_pt(&but->rect, mx, my);
 }
 
 static uiBut *ui_but_find_activated(ARegion *ar)
@@ -4994,7 +4994,7 @@
 	uiBlock *block;
 	
 	/* check if the mouse is in the region */
-	if (!BLI_in_rcti(&ar->winrct, x, y)) {
+	if (!BLI_rcti_isect_pt(&ar->winrct, x, y)) {
 		for (block = ar->uiblocks.first; block; block = block->next)
 			block->auto_open = FALSE;
 		
@@ -5033,7 +5033,7 @@
 		}
 		
 		/* check if in the rect */
-		if (!BLI_in_rcti(&mask_rct, mx, my)) 
+		if (!BLI_rcti_isect_pt(&mask_rct, mx, my)) 
 			return 0;
 	}
 	
@@ -5086,7 +5086,7 @@
 		/* CLIP_EVENTS prevents the event from reaching other blocks */
 		if (block->flag & UI_BLOCK_CLIP_EVENTS) {
 			/* check if mouse is inside block */
-			if (BLI_in_rctf(&block->rect, mx, my)) {
+			if (BLI_rctf_isect_pt(&block->rect, mx, my)) {
 				break;
 			}
 		}
@@ -6100,7 +6100,7 @@
 	ui_window_to_block(ar, block, &mx, &my);
 
 	/* check if mouse is inside block */

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list