Ets_View_Update()

Note: Requires OPNET Development Kit

Abstract

Updates the view of a subnet by either refreshing the current view (reinvoking the view’s callbacks) or applying a different view.

Syntax

Ets_View_Update (view_hndl, model_hndl, subnet_hndl)
Argument Type Description
view_hndl EtsT_View_Handle View of interest.
model_hndl EtsT_Model_Handle Model of interest.
subnet_hndl EtsT_Obj_Handle Subnet of interest.

Return Type

EtsT_Compcode

EtsC_Compcode_Success if the operation is successful; EtsC_Compcode_Failure otherwise.

ets_api_view.h

Details

This function must be called after making changes to a view (such as adding or hiding objects) in order to refresh the view and make the changes visible.

Example

#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