• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ ED_region_tag_redraw函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ED_region_tag_redraw函数的典型用法代码示例。如果您正苦于以下问题:C++ ED_region_tag_redraw函数的具体用法?C++ ED_region_tag_redraw怎么用?C++ ED_region_tag_redraw使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ED_region_tag_redraw函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: datadropper_id_sample_pt

/**
 * \brief get the ID from the screen.
 *
 */
static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int my, ID **r_id)
{

	/* we could use some clever */
	wmWindow *win = CTX_wm_window(C);
	ScrArea *sa;

	ScrArea *area_prev = CTX_wm_area(C);
	ARegion *ar_prev = CTX_wm_region(C);

	ddr->name[0] = '\0';

	for (sa = win->screen->areabase.first; sa; sa = sa->next) {
		if (BLI_rcti_isect_pt(&sa->totrct, mx, my)) {
			if (sa->spacetype == SPACE_VIEW3D) {
				ARegion *ar = BKE_area_find_region_type(sa, RGN_TYPE_WINDOW);
				if (ar && BLI_rcti_isect_pt(&ar->winrct, mx, my)) {
					int mval[2] = {mx - ar->winrct.xmin,
					               my - ar->winrct.ymin};
					Base *base;

					CTX_wm_area_set(C, sa);
					CTX_wm_region_set(C, ar);

					/* grr, always draw else we leave stale text */
					ED_region_tag_redraw(ar);

					base = ED_view3d_give_base_under_cursor(C, mval);
					if (base) {
						Object *ob = base->object;
						ID *id = NULL;
						if (ddr->idcode == ID_OB) {
							id = (ID *)ob;
						}
						else if (ob->data) {
							if (GS(((ID *)ob->data)->name) == ddr->idcode) {
								id = (ID *)ob->data;
							}
							else {
								BLI_snprintf(ddr->name, sizeof(ddr->name), "Incompatible, expected a %s",
								             ddr->idcode_name);
							}
						}

						if (id) {
							BLI_snprintf(ddr->name, sizeof(ddr->name), "%s: %s",
							             ddr->idcode_name, id->name + 2);
							*r_id = id;
						}

						break;
					}
				}
			}
		}
	}

	CTX_wm_area_set(C, area_prev);
	CTX_wm_region_set(C, ar_prev);
}
开发者ID:BlueLabelStudio,项目名称:blender,代码行数:64,代码来源:interface_eyedropper.c


示例2: depthdropper_depth_sample_pt

/**
 * \brief get the ID from the screen.
 */
static void depthdropper_depth_sample_pt(
    bContext *C, DepthDropper *ddr, int mx, int my, float *r_depth)
{
  /* we could use some clever */
  bScreen *screen = CTX_wm_screen(C);
  ScrArea *sa = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, mx, my);
  Scene *scene = CTX_data_scene(C);

  ScrArea *area_prev = CTX_wm_area(C);
  ARegion *ar_prev = CTX_wm_region(C);

  ddr->name[0] = '\0';

  if (sa) {
    if (sa->spacetype == SPACE_VIEW3D) {
      ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
      if (ar) {
        struct Depsgraph *depsgraph = CTX_data_depsgraph(C);
        View3D *v3d = sa->spacedata.first;
        RegionView3D *rv3d = ar->regiondata;
        /* weak, we could pass in some reference point */
        const float *view_co = v3d->camera ? v3d->camera->obmat[3] : rv3d->viewinv[3];
        const int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin};
        float co[3];

        CTX_wm_area_set(C, sa);
        CTX_wm_region_set(C, ar);

        /* grr, always draw else we leave stale text */
        ED_region_tag_redraw(ar);

        view3d_operator_needs_opengl(C);

        if (ED_view3d_autodist(depsgraph, ar, v3d, mval, co, true, NULL)) {
          const float mval_center_fl[2] = {(float)ar->winx / 2, (float)ar->winy / 2};
          float co_align[3];

          /* quick way to get view-center aligned point */
          ED_view3d_win_to_3d(v3d, ar, co, mval_center_fl, co_align);

          *r_depth = len_v3v3(view_co, co_align);

          bUnit_AsString2(ddr->name,
                          sizeof(ddr->name),
                          (double)*r_depth,
                          4,
                          B_UNIT_LENGTH,
                          &scene->unit,
                          false);
        }
        else {
          BLI_strncpy(ddr->name, "Nothing under cursor", sizeof(ddr->name));
        }
      }
    }
  }

  CTX_wm_area_set(C, area_prev);
  CTX_wm_region_set(C, ar_prev);
}
开发者ID:dfelinto,项目名称:blender,代码行数:63,代码来源:interface_eyedropper_depth.c


示例3: clip_view_ndof_invoke

static int clip_view_ndof_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
{
	if (event->type != NDOF_MOTION)
		return OPERATOR_CANCELLED;
	else {
		SpaceClip *sc = CTX_wm_space_clip(C);
		ARegion *ar = CTX_wm_region(C);
		float pan_vec[3];

		const wmNDOFMotionData *ndof = event->customdata;
		const float speed = NDOF_PIXELS_PER_SECOND;

		WM_event_ndof_pan_get(ndof, pan_vec, true);

		mul_v2_fl(pan_vec, (speed * ndof->dt) / sc->zoom);
		pan_vec[2] *= -ndof->dt;

		sclip_zoom_set_factor(C, 1.0f + pan_vec[2], NULL);
		sc->xof += pan_vec[0];
		sc->yof += pan_vec[1];

		ED_region_tag_redraw(ar);

		return OPERATOR_FINISHED;
	}
}
开发者ID:pawkoz,项目名称:dyplom,代码行数:26,代码来源:clip_ops.c


示例4: face_select_reveal_exec

static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op))
{
	Object *ob = CTX_data_active_object(C);
	paintface_reveal(ob);
	ED_region_tag_redraw(CTX_wm_region(C));
	return OPERATOR_FINISHED;
}
开发者ID:YasirArafath,项目名称:blender-git,代码行数:7,代码来源:paint_utils.c


示例5: snode_bg_viewmove_modal

static int snode_bg_viewmove_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
	SpaceNode *snode = CTX_wm_space_node(C);
	ARegion *ar = CTX_wm_region(C);
	NodeViewMove *nvm = op->customdata;

	switch (event->type) {
		case MOUSEMOVE:

			snode->xof -= (nvm->mvalo[0] - event->mval[0]);
			snode->yof -= (nvm->mvalo[1] - event->mval[1]);
			nvm->mvalo[0] = event->mval[0];
			nvm->mvalo[1] = event->mval[1];

			/* prevent dragging image outside of the window and losing it! */
			CLAMP(snode->xof, nvm->xmin, nvm->xmax);
			CLAMP(snode->yof, nvm->ymin, nvm->ymax);

			ED_region_tag_redraw(ar);
			WM_main_add_notifier(NC_NODE | ND_DISPLAY, NULL);

			break;

		case LEFTMOUSE:
		case MIDDLEMOUSE:
		case RIGHTMOUSE:

			MEM_freeN(nvm);
			op->customdata = NULL;

			return OPERATOR_FINISHED;
	}

	return OPERATOR_RUNNING_MODAL;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:35,代码来源:node_view.c


示例6: view_zoom_modal

static int view_zoom_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
	ViewZoomData *vpd = op->customdata;
	float delta, factor;

	switch (event->type) {
		case MOUSEMOVE:
			delta = event->x - vpd->x + event->y - vpd->y;

			if (U.uiflag & USER_ZOOM_INVERT)
				delta *= -1;

			factor = 1.0f + delta / 300.0f;
			RNA_float_set(op->ptr, "factor", factor);
			sclip_zoom_set(C, vpd->zoom * factor, vpd->location);
			ED_region_tag_redraw(CTX_wm_region(C));
			break;
		default:
			if (event->type == vpd->event_type && event->val == KM_RELEASE) {
				view_zoom_exit(C, op, 0);

				return OPERATOR_FINISHED;
			}
			break;
	}

	return OPERATOR_RUNNING_MODAL;
}
开发者ID:Eibriel,项目名称:kiriblender,代码行数:28,代码来源:clip_ops.c


示例7: face_select_all_exec

static int face_select_all_exec(bContext *C, wmOperator *op)
{
	Object *ob = CTX_data_active_object(C);
	paintface_deselect_all_visible(ob, RNA_enum_get(op->ptr, "action"), true);
	ED_region_tag_redraw(CTX_wm_region(C));
	return OPERATOR_FINISHED;
}
开发者ID:floored,项目名称:blender,代码行数:7,代码来源:paint_utils.c


示例8: dopesheet_view_all_exec

static int dopesheet_view_all_exec(bContext *C, wmOperator *UNUSED(op))
{
	SpaceClip *sc = CTX_wm_space_clip(C);
	ARegion *ar = CTX_wm_region(C);
	View2D *v2d = &ar->v2d;
	MovieClip *clip = ED_space_clip_get_clip(sc);
	MovieTracking *tracking = &clip->tracking;
	MovieTrackingDopesheet *dopesheet = &tracking->dopesheet;
	MovieTrackingDopesheetChannel *channel;
	int frame_min = INT_MAX, frame_max = INT_MIN;

	for (channel = dopesheet->channels.first; channel; channel = channel->next) {
		frame_min = min_ii(frame_min, channel->segments[0]);
		frame_max = max_ii(frame_max, channel->segments[channel->tot_segment]);
	}

	if (frame_min < frame_max) {
		float extra;

		v2d->cur.xmin = frame_min;
		v2d->cur.xmax = frame_max;

		/* we need an extra "buffer" factor on either side so that the endpoints are visible */
		extra = 0.01f * BLI_rctf_size_x(&v2d->cur);
		v2d->cur.xmin -= extra;
		v2d->cur.xmax += extra;

		ED_region_tag_redraw(ar);
	}


	return OPERATOR_FINISHED;
}
开发者ID:Walid-Shouman,项目名称:Blender,代码行数:33,代码来源:clip_dopesheet_ops.c


示例9: face_select_hide_exec

static int face_select_hide_exec(bContext *C, wmOperator *op)
{
	const bool unselected = RNA_boolean_get(op->ptr, "unselected");
	Object *ob = CTX_data_active_object(C);
	paintface_hide(ob, unselected);
	ED_region_tag_redraw(CTX_wm_region(C));
	return OPERATOR_FINISHED;
}
开发者ID:sftd,项目名称:blender,代码行数:8,代码来源:paint_utils.c


示例10: paint_select_linked_pick_invoke

static int paint_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
	const bool select = !RNA_boolean_get(op->ptr, "deselect");
	view3d_operator_needs_opengl(C);
	paintface_select_linked(C, CTX_data_active_object(C), event->mval, select);
	ED_region_tag_redraw(CTX_wm_region(C));
	return OPERATOR_FINISHED;
}
开发者ID:sftd,项目名称:blender,代码行数:8,代码来源:paint_utils.c


示例11: wm_tag_redraw_overlay

void wm_tag_redraw_overlay(wmWindow *win, ARegion *ar)
{
	/* for draw triple gestures, paint cursors don't need region redraw */
	if (ar && win) {
		if (wm_automatic_draw_method(win) != USER_DRAW_TRIPLE)
			ED_region_tag_redraw(ar);
		win->screen->do_draw_paintcursor = true;
	}
}
开发者ID:linkedinyou,项目名称:blender-git,代码行数:9,代码来源:wm_draw.c


示例12: do_item_rename

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
static void do_item_rename(ARegion *ar, LiveDbTreeElement *te, ReportList *reports)
{
    if (TE_GET_TYPE(te->item->type) != MAT_LDB_TREE_ITEM_TYPE_MATERIAL)
        BKE_report(reports, RPT_WARNING, "Can edit only the material names.");
    else {
        *te->flag |= TE_TEXTBUT;
        ED_region_tag_redraw(ar);
    }
} /* do_item_rename() */
开发者ID:mistajuliax,项目名称:OctaneBlender,代码行数:10,代码来源:mat_livedb_edit.c


示例13: datadropper_id_sample_pt

/**
 * \brief get the ID from the screen.
 */
static void datadropper_id_sample_pt(bContext *C, DataDropper *ddr, int mx, int my, ID **r_id)
{
  /* we could use some clever */
  bScreen *screen = CTX_wm_screen(C);
  ScrArea *sa = BKE_screen_find_area_xy(screen, -1, mx, my);

  ScrArea *area_prev = CTX_wm_area(C);
  ARegion *ar_prev = CTX_wm_region(C);

  ddr->name[0] = '\0';

  if (sa) {
    if (sa->spacetype == SPACE_VIEW3D) {
      ARegion *ar = BKE_area_find_region_xy(sa, RGN_TYPE_WINDOW, mx, my);
      if (ar) {
        const int mval[2] = {mx - ar->winrct.xmin, my - ar->winrct.ymin};
        Base *base;

        CTX_wm_area_set(C, sa);
        CTX_wm_region_set(C, ar);

        /* grr, always draw else we leave stale text */
        ED_region_tag_redraw(ar);

        base = ED_view3d_give_base_under_cursor(C, mval);
        if (base) {
          Object *ob = base->object;
          ID *id = NULL;
          if (ddr->idcode == ID_OB) {
            id = (ID *)ob;
          }
          else if (ob->data) {
            if (GS(((ID *)ob->data)->name) == ddr->idcode) {
              id = (ID *)ob->data;
            }
            else {
              BLI_snprintf(
                  ddr->name, sizeof(ddr->name), "Incompatible, expected a %s", ddr->idcode_name);
            }
          }

          PointerRNA idptr;
          RNA_id_pointer_create(id, &idptr);

          if (id && RNA_property_pointer_poll(&ddr->ptr, ddr->prop, &idptr)) {
            BLI_snprintf(ddr->name, sizeof(ddr->name), "%s: %s", ddr->idcode_name, id->name + 2);
            *r_id = id;
          }
        }
      }
    }
  }

  CTX_wm_area_set(C, area_prev);
  CTX_wm_region_set(C, ar_prev);
}
开发者ID:dfelinto,项目名称:blender,代码行数:59,代码来源:interface_eyedropper_datablock.c


示例14: vertex_color_set_exec

static int vertex_color_set_exec(bContext *C, wmOperator *UNUSED(op))
{
	Scene *scene = CTX_data_scene(C);
	Object *obact = CTX_data_active_object(C);
	unsigned int paintcol = vpaint_get_current_col(scene->toolsettings->vpaint);
	vpaint_fill(obact, paintcol);
	
	ED_region_tag_redraw(CTX_wm_region(C)); // XXX - should redraw all 3D views
	return OPERATOR_FINISHED;
}
开发者ID:vanangamudi,项目名称:blender-main,代码行数:10,代码来源:paint_ops.c


示例15: center_current_frame_exec

static int center_current_frame_exec(bContext *C, wmOperator *UNUSED(op))
{
	Scene *scene = CTX_data_scene(C);
	ARegion *ar = CTX_wm_region(C);

	ED_clip_graph_center_current_frame(scene, ar);

	ED_region_tag_redraw(ar);

	return OPERATOR_FINISHED;
}
开发者ID:Bforartists,项目名称:Bforartists,代码行数:11,代码来源:clip_graph_ops.c


示例16: paintface_mouse_select

bool paintface_mouse_select(
    struct bContext *C, Object *ob, const int mval[2], bool extend, bool deselect, bool toggle)
{
  Mesh *me;
  MPoly *mpoly_sel;
  uint index;

  /* Get the face under the cursor */
  me = BKE_mesh_from_object(ob);

  if (!ED_mesh_pick_face(C, ob, mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) {
    return false;
  }

  if (index >= me->totpoly) {
    return false;
  }

  mpoly_sel = me->mpoly + index;
  if (mpoly_sel->flag & ME_HIDE) {
    return false;
  }

  /* clear flags */
  if (!extend && !deselect && !toggle) {
    paintface_deselect_all_visible(C, ob, SEL_DESELECT, false);
  }

  me->act_face = (int)index;

  if (extend) {
    mpoly_sel->flag |= ME_FACE_SEL;
  }
  else if (deselect) {
    mpoly_sel->flag &= ~ME_FACE_SEL;
  }
  else if (toggle) {
    if (mpoly_sel->flag & ME_FACE_SEL) {
      mpoly_sel->flag &= ~ME_FACE_SEL;
    }
    else {
      mpoly_sel->flag |= ME_FACE_SEL;
    }
  }
  else {
    mpoly_sel->flag |= ME_FACE_SEL;
  }

  /* image window redraw */

  paintface_flush_flags(C, ob, SELECT);
  ED_region_tag_redraw(CTX_wm_region(C));  // XXX - should redraw all 3D views
  return true;
}
开发者ID:dfelinto,项目名称:blender,代码行数:54,代码来源:editface.c


示例17: mat_livedb_scroll_page_down_exec

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
static int mat_livedb_scroll_page_down_exec(bContext *C, wmOperator *op)
{
    ARegion *ar = CTX_wm_region(C);
    int     dy  = -BLI_rcti_size_y(&ar->v2d.mask);

    ar->v2d.cur.ymin += dy;
    ar->v2d.cur.ymax += dy;
    
    ED_region_tag_redraw(ar);
    
    return OPERATOR_FINISHED;
} /* mat_livedb_scroll_page_down_exec() */
开发者ID:mistajuliax,项目名称:OctaneBlender,代码行数:13,代码来源:mat_livedb_edit.c


示例18: mat_livedb_show_one_level_exec

/* /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// */
static int mat_livedb_show_one_level_exec(bContext *C, wmOperator *op)
{
    SpaceLDB    *slivedb    = CTX_wm_space_mat_livedb(C);
    ARegion     *ar         = CTX_wm_region(C);
    int         level       = mat_livedb_has_one_flag(slivedb, &slivedb->tree, TE_CLOSED, 1);

    if (level) mat_livedb_openclose_level(slivedb, &slivedb->tree, 1, level, 1);
    
    ED_region_tag_redraw(ar);
    
    return OPERATOR_FINISHED;
} /* mat_livedb_show_one_level_exec() */
开发者ID:mistajuliax,项目名称:OctaneBlender,代码行数:13,代码来源:mat_livedb_edit.c



注:本文中的ED_region_tag_redraw函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ED_space_clip_get_clip函数代码示例发布时间:2022-05-30
下一篇:
C++ ED_object_context函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap