This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Landscape Tool
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Unigine::Vector Class

Header: #include <UnigineVector.h>

A vector container template.

Warning
In UnigineScript, a vector is a sequence container which represents an array of flexible size. See Containers article for the details.

Vector Class

Members


void set ( size_t index, const Type & t ) #

Sets an item with a given index.

Arguments

  • size_t index - Item index.
  • const Type & t - Item to set.

Type & get ( size_t index ) #

Returns an item by a given index.

Arguments

  • size_t index - Item index.

Return value

Item.

const Type & get ( size_t index ) const#

Returns a constant item by a given index.

Arguments

  • size_t index - Item index.

Return value

Item.

Type * get ( ) #

Returns the pointer to the vector.

Return value

Pointer to the vector.

const Type * get ( ) const#

Returns the constant pointer to the vector.

Return value

Constant pointer to the vector.

void allocate ( size_t size ) #

Reserves the exact amount of memory enough to contain the specified number of items.

Arguments

  • size_t size - Exact vector size.
    Notice
    If the specified value is greater than the current vector capacity, the method causes the container to reallocate its storage increasing capacity to the specified value. In all other cases the capacity is not affected.

void append ( const Type & t ) #

Appends an item.

Arguments

  • const Type & t - Item to append.

void append ( size_t pos, const Type & t ) #

Appends an item at a given position.

Arguments

  • size_t pos - Position.
  • const Type & t - Item to append.

void append ( const Vector< Type > & v ) #

Appends a vector.

Arguments

  • const Vector< Type > & v - Vector to append.

void append ( const Type * v, size_t size ) #

Appends a vector with a given size.

Arguments

  • const Type * v - Pointer to the vector to append.
  • size_t size - Vector size.

Iterator back ( ) #

Returns the back iterator.

Return value

Back iterator.

ConstIterator back ( ) const#

Returns the back iterator.

Return value

Back iterator.

Iterator begin ( ) #

Returns the begin iterator.

Return value

Begin iterator.

ConstIterator begin ( ) const#

Returns the begin iterator.

Return value

Begin iterator.

ConstIterator cbegin ( ) const#

Returns the begin iterator.

Return value

Begin iterator.

ReverseIterator rbegin ( ) const#

Returns the begin iterator.

Return value

Begin iterator.

ConstReverseIterator crbegin ( ) const#

Returns the begin iterator.

Return value

Begin iterator.

void clear ( ) #

Clears the vector.

void destroy ( ) #

Destroys the vector.

bool empty ( ) const#

Returns a value indicating if the vector is empty.

Return value

true if the vector is empty; otherwise, false.

Iterator end ( ) #

Returns the end iterator.

Return value

End iterator.

ConstIterator end ( ) const#

Returns the end iterator.

Return value

End iterator.

ConstIterator cend ( ) const#

Returns the end iterator.

Return value

End iterator.

ReverseIterator rend ( ) const#

Returns the end iterator.

Return value

End iterator.

ConstReverseIterator crend ( ) const#

Returns the end iterator.

Return value

End iterator.

Iterator find ( const T & t ) #

Finds an item in the vector.

Arguments

  • const T & t - Item.

Return value

Iterator.

ConstIterator find ( const T & t ) const#

Finds an item in the vector.

Arguments

  • const T & t - Item.

Return value

Const iterator.

int findIndex ( const T & t ) const#

Finds an index of a given item in the vector.

Arguments

  • const T & t - Item.

Return value

Item index.

int leftIndex ( const T & t ) const#

Returns the index of the left neighbor of a given item.

Arguments

  • const T & t - Item.

Return value

Left neighbor index.

Vector< Type > & operator= ( const Vector< Type > & v ) #

Assignment operator for the vector.

Arguments

  • const Vector< Type > & v - Vector.

Type & operator[] ( size_t index ) #

Vector item access.

Arguments

  • size_t index - Item index.

Return value

Vector item.

const Type & operator[] ( size_t index ) const#

Vector item access.

Arguments

  • size_t index - Item index.

Return value

Vector item.

void remove ( ) #

Removes the last item.

void remove ( size_t pos, size_t size ) #

Removes an item(s) at a given position.

Arguments

  • size_t pos - Position.
  • size_t size - Number of items to remove.

void remove ( const Iterator & it ) #

Removes an item indicated by a given iterator.

Arguments

  • const Iterator & it - Iterator.

void removeFast ( size_t pos ) #

Removes an item at a given position.

Arguments

  • size_t pos - Position.

void removeFast ( const Iterator & it ) #

Removes an item indicated by a given iterator.

Arguments

  • const Iterator & it - Iterator.

void reserve ( size_t size ) #

Reserves memory at least enough to contain the specified number of items.

Arguments

  • size_t size - Minimum vector size.
    Notice
    If the specified value is greater than the current vector capacity, the method causes the container to reallocate its storage increasing capacity to the specified value (or greater). In all other cases the capacity is not affected.

void resize ( size_t size ) #

Resizes a vector.

Arguments

  • size_t size - New vector size.

int rightIndex ( const T & t ) const#

Returns the index of the right neighbor of a given item.

Arguments

  • const T & t - Item.

Return value

Right neighbor index.

int size ( ) const#

Returns the size of the vector.

Return value

Vector size.

int space ( ) const#

Returns the capacity of the vector. The value may be greater than the size.

Return value

Vector capacity.

Vector ( ) #

Default constructor. Produces an empty vector.

Vector ( const Vector< Type > & v ) #

Copy constructor.

Arguments

  • const Vector< Type > & v - Vector.

Vector ( const Type & t, size_t size ) #

Constructor. Produces a vector with a specified size and initialization.

Arguments

  • const Type & t - Item value.
  • size_t size - Vector size.

Vector ( const Type * v, size_t size ) #

Copy constructor. Produces a vector with a specified size.

Arguments

  • const Type * v - Vector pointer.
  • size_t size - Vector size.

explicit Vector ( size_t size ) #

Explicit constructor. Produces a vector with specified size.

Arguments

  • size_t size - Vector size.

~Vector ( ) #

Destructor.
Last update: 2022-07-01
Build: ()