Ets_View_Update()

注意: 需要 OPNET Development Kit

摘要

更新子网的视图:可以刷新当前视图(重新调用视图的回调),也可以应用另一个视图。

语法

Ets_View_Update (view_hndl, model_hndl, subnet_hndl)
参数 类型 说明
view_hndl EtsT_View_Handle 目标视图。
model_hndl EtsT_Model_Handle 目标模型。
subnet_hndl EtsT_Obj_Handle 目标子网。

返回类型

EtsT_Compcode

操作成功时返回 EtsC_Compcode_Success,否则返回 EtsC_Compcode_Failure。

头文件

ets_api_view.h

详情

在对视图做出更改(例如添加或隐藏对象)之后,必须调用此函数来刷新视图,使更改可见。

示例

#include <ets_api.h>
#include <ets_api_view.h>
#include <ets_api_view_logical.h>

EXTERN_C_BEGIN
DLLEXPORT void
create_annotation ()
{
	EtsT_View_Handle   view_handle;
	EtsT_Compcode      result;
	EtsT_Obj_Handle    subnet_handle;
	EtsT_Obj_Handle    obj_handle;

	// Points going from New York to London, to Tokyo and to Syndey
	EtsT_View_Point point_array[] =
		{{-76.8,38.8},{-.8,51.6},{140.,35.6},{152.,-30.4}};

	// Get the current subnet handle
	subnet_handle =
		Ets_Topo_Top_Get (Ets_Model_Current_Get (EtsC_Model_Nt));

	// Create an annotation line
	obj_handle = Ets_Obj_Create (EtsC_Obj_Type_Annot_Line);

	// Install annotation line into the current subnet
	Ets_Obj_Install (subnet_handle, &obj_handle);

	// Obtain a handle to the current view
	view_handle =
		Ets_View_Current_Get (Ets_Model_Current_Get (EtsC_Model_Nt), subnet_handle);

	// Set the bend points on the annotation line
	result = Ets_View_Annot_Line_Points_Set (view_handle, obj_handle,
		sizeof (point_array)/sizeof (EtsT_View_Point), point_array);

	// Update the view to reapply the view's filters and refresh the display
	result = Ets_View_Update (view_handle, Ets_Model_Current_Get (EtsC_Model_Nt),
		subnet_handle);
}
EXTERN_C_END

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com