Ovis_Decoration_2D_Square_Create()

Abstract

Creates a 2D square.

Syntax

Ovis_Decoration_2D_Square_Create (center, x_scale, y_scale, color, filled, layer_ptr, destroy_proc, user_state_ptr)
Argument Type Description
center OvisT_2D_Position Center of the square
x_scale double X scale of the square, typically between 0.0 and 1.0
y_scale double Y scale of the square, typically between 0.0 and 1.0
color PrgT_Color Color
filled OvisT_Boolean Indicates fill
layer_ptr OvisT_Layer * Ovis layer
destroy_proc OvisT_Decoration_State_Destroy_Proc Destroys the data associated with the object and deallocates its memory
user_state_ptr void * Optional user-provided state of the decoration

Return Type

OvisT_2D_Square *

The 2D square

ovis_decoration.h

Details

This function creates an Ovis 2D square. It specifies the attributes of the square. The square has an initial transparency of 0, a solid pattern (all bits enabled if the circle is filled), and is not flashing.

The x_scale and y_scale factors are defined in terms of the window width and height. A value of 1.0 means that the square's width or height will be equal to the window width or height. Note that a "square" with equal x_scale and y_scale factors will look like a square only if the 3D rendering window is an actual square.

Example

OvisT_2D_Position					pos;
OvisT_2D_Square					* square;
PrgT_Color					color = prg_color_from_string ("red");

pos.x = pos.y = 0;  /* middle of the screen */
square = Ovis_Decoration_2D_Square_Create (pos, 5, 5, color, OvisC_True,
	OPC_NIL, OPC_NIL, OPC_NIL);

Errors

  • Invalid 2D position <x,y>. 2D position values must be between –128 and 127.
  • Invalid X-scale value (<value>). Scale value must be positive.
  • Invalid Y-scale value (<value>). Scale value must be positive.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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