My Project
Static Public Member Functions | List of all members
ParaScripting::ParaSelection Class Reference

A pool of currently selected objects. More...

#include <ParaScriptingWorld.h>

Static Public Member Functions

static void RemoveObject (const ParaObject &obj)
 remove a given object in all selections. More...
 
static bool RemoveUIObject (const char *sName)
 remove an UI object from all selection groups. More...
 
static void AddObject (const ParaObject &obj, int nGroupID)
 Add a new object to a given group. More...
 
static bool AddUIObject (const char *sName, int nGroupID)
 Please note that UI object in selection is automatically highlighted using the default highlighting effect. More...
 
static ParaObject GetObject (int nGroupID, int nItemIndex)
 get the nItemIndex object in the nGroupID group. More...
 
static void GetObject_ (ParaObject *pOut, int nGroupID, int nItemIndex)
 this function shall never be called from the scripting interface. More...
 
static int GetItemNumInGroup (int nGroupID)
 get the total number item in the given group. More...
 
static void SelectGroup (int nGroupID, bool bSelect)
 select the entire group. More...
 
static void ClearGroup (int nGroupID)
 Clear a given group so that there are no objects in it. More...
 
static void SetMaxItemNumberInGroup (int nGroupID, int nMaxItemsNumber)
 set the maximum number of objects in the group. More...
 
static int GetMaxItemNumberInGroup (int nGroupID)
 set the maximum number of objects in the group. More...
 

Detailed Description

A pool of currently selected objects.

This is a singleton class. Object may be selected into different groups. Although, there are no limit to group number, better keep it smaller than 16 groups. Selected objected may be displayed or highlighted differently. When objects are deleted from the scene. It will be deleted from the selection automatically.

Member Function Documentation

§ AddObject()

void ParaSelection::AddObject ( const ParaObject obj,
int  nGroupID 
)
static

Add a new object to a given group.

An object may belong to multiple groups.

Parameters
objpointer to the object to add
nGroupIDwhich group the should be added to. by default it is added to group 0. group ID must be smaller than 32.

§ AddUIObject()

bool ParaSelection::AddUIObject ( const char *  sName,
int  nGroupID 
)
static

Please note that UI object in selection is automatically highlighted using the default highlighting effect.

Parameters
sNameUI object name
nGroupIDwhich group the should be added to. by default it is added to group 0.
Returns
true if the object is found and highlighted(selected).

§ ClearGroup()

void ParaSelection::ClearGroup ( int  nGroupID)
static

Clear a given group so that there are no objects in it.

Parameters
nGroupIDID of the group. If ID is -1, all groups will be deleted.

§ GetItemNumInGroup()

int ParaSelection::GetItemNumInGroup ( int  nGroupID)
static

get the total number item in the given group.

This function can be used with GetObject() to iterate through all objects in any group.

Parameters
nGroupIDgroup ID.
Returns

§ GetMaxItemNumberInGroup()

int ParaSelection::GetMaxItemNumberInGroup ( int  nGroupID)
static

set the maximum number of objects in the group.

Parameters
nGroupIDgroup ID,which ID must be smaller than 32.
Returns
the maximum number in the given group

§ GetObject()

ParaObject ParaSelection::GetObject ( int  nGroupID,
int  nItemIndex 
)
static

get the nItemIndex object in the nGroupID group.

Parameters
nGroupIDfrom which group the object is get
nItemIndexthe index of the item to be retrieved.
Returns
selected item is returned

§ GetObject_()

void ParaSelection::GetObject_ ( ParaObject pOut,
int  nGroupID,
int  nItemIndex 
)
static

this function shall never be called from the scripting interface.

this is solely for exporting API. and should not be used from the scripting interface.

§ RemoveObject()

void ParaSelection::RemoveObject ( const ParaObject obj)
static

remove a given object in all selections.

Parameters
objpointer to the object to delete

§ RemoveUIObject()

bool ParaSelection::RemoveUIObject ( const char *  sName)
static

remove an UI object from all selection groups.

Parameters
sNameUI object name
Returns
if if removed

§ SelectGroup()

void ParaSelection::SelectGroup ( int  nGroupID,
bool  bSelect 
)
static

select the entire group.

Parameters
nGroupID
bSelecttrue to select, false to de-select.

§ SetMaxItemNumberInGroup()

void ParaSelection::SetMaxItemNumberInGroup ( int  nGroupID,
int  nMaxItemsNumber 
)
static

set the maximum number of objects in the group.

Parameters
nGroupIDgroup ID group ID must be smaller than 32.
nMaxItemsNumberthe number to set. default value is 1

The documentation for this class was generated from the following files: