r3level

r3level

Class

real/objects/r3level.h

Library

r3obj

Description:

Level primitive. This object defines a 'list' attribute which allows children to be linked to the objects of this class.

See Also

real/objects/r3prim.h

Super Class

r3Primitive

R3CLID_PRIMITIVE

JavaScript

r3Level

Class Identifier

R3CLID_LEVEL - 143

Methods

ADDTAIL, ADDHEAD, REMOVE, ENUMCHILDREN, GETSUBBYORDNUM, REGISTERSIMULATIONFU, INSERT, SETPARENT, ENUMTARGETS, SIBLINGCHANGED, HIDECHILDREN, CHILDRENHIDDEN,

Attributes

Sub, Boolean, HasRenderGeometry, Simulation, SubCount, Children, NoAndWire,

Registration

int R3RegisterLevelClass(R3APP *app);

R3LEVM_ADDTAIL

Method

ADDTAIL

Identifier

R3LEVM_ADDTAIL

Param 1:

R3BOOL, don't send childchanged method

Param 3:

R3OBJ*, address of the object to be inserted

JavaScript

obj.ADDTAIL(p1, p3);

Description

Inserts new sub object at the head of the children list

R3LEVM_ADDHEAD

Method

ADDHEAD

Identifier

R3LEVM_ADDHEAD

Param 1:

R3BOOL, don't send childchanged method

Param 3:

R3OBJ*, object to be inserted

JavaScript

obj.ADDHEAD(p1, p3);

Description

Insert given object to the head of the children list

R3LEVM_REMOVE

Method

REMOVE

Identifier

R3LEVM_REMOVE

Param 3:

R3OBJ*, sub object to be removed

JavaScript

obj.REMOVE(p3);

Description

Remove the given children from the children list

R3LEVM_ENUMCHILDREN

Method

ENUMCHILDREN

Identifier

R3LEVM_ENUMCHILDREN

Param 3:

R3TAG*, reserved for future use

JavaScript

obj.ENUMCHILDREN(p3);

Description

Enumerates sub objects (not recursive). If the callback returns a positive value, enumeration continues to the next sub object. If 0 or negative value is returned, enumeration is cancelled and the return value from the callback is returned to the caller.

R3LEVM_GETSUBBYORDNUM

Method

GETSUBBYORDNUM

Identifier

R3LEVM_GETSUBBYORDNUM

Return

R3OBJ*, address of the object or NULL if ordnum is higher than the number of sub objects

Param 3:

R3INT, ordnum of the sub object to be returned

JavaScript

rc = obj.GETSUBBYORDNUM(p3);

Description

Fetch sub object by its ordnum. The first sub object corresponds to the ordnum 0.

R3LEVCM_REGISTERSIMULATIONFU

Method

REGISTERSIMULATIONFU

Identifier

R3LEVCM_REGISTERSIMULATIONFU

Return

R3BOOL, TRUE if succeeded, FALSE otherwise

Param 1:

R3INT, NULL if OBJECTWISE effect, otherwise tag id for the attribute to be hold the cause/affect information.

Param 2:

R3INT, Type of the simulation to be plugged in, see R3SIMTYPE_ codes below

JavaScript

rc = obj.REGISTERSIMULATIONFU(p1, p2, 0);

Description

Add new simulation function for the level class.

R3LEVM_INSERT

Method

INSERT

Identifier

R3LEVM_INSERT

Return

R3BOOL, true of node was found

Param 1:

R3BOOL, don't send childchanged method

Param 2:

R3OBJ*, previous object

Param 3:

R3OBJ*, object to be inserted

JavaScript

rc = obj.INSERT(p1, p2, p3);

Description

Insert new object after the given node

R3LEVCM_SETPARENT

Method

SETPARENT

Identifier

R3LEVCM_SETPARENT

Param 1:

R3OBJ*, old parent

Param 2:

R3OBJ*, new parent

Param 3:

R3OBJ*, child whose parent is to be changed.

JavaScript

obj.SETPARENT(p1, p2, p3);

Description

callback method for R3PRIMCA_SetParentXxx.

R3LEVM_ENUMTARGETS

Method

ENUMTARGETS

Identifier

R3LEVM_ENUMTARGETS

Param 1:

R3OBJ*, constructor object

Param 2:

R3INT, constructor method

Param 3:

R3INT, callback data

JavaScript

obj.ENUMTARGETS(p1, p2, p3);

Description

Enumerate target objects for the given constructor.

R3LEVM_SIBLINGCHANGED

Method

SIBLINGCHANGED

Identifier

R3LEVM_SIBLINGCHANGED

JavaScript

obj.SIBLINGCHANGED();

Description

Internal methods for average map related use

R3LEVM_HIDECHILDREN

Method

HIDECHILDREN

Identifier

R3LEVM_HIDECHILDREN

Param 3:

R3BOOL, if true chilren are hidden, otherwise shown

JavaScript

obj.HIDECHILDREN(p3);

Description

Hide/Show child objects

R3LEVM_CHILDRENHIDDEN

Method

CHILDRENHIDDEN

Identifier

R3LEVM_CHILDRENHIDDEN

JavaScript

obj.CHILDRENHIDDEN();

Description

Return Hide/Show state

Simulation functions. The first one is for the R3SIMTYPE_OBJECTWISE. The second is for the PAIRWISE and PAIRWISEASYMM types.

Sub

Attribute

Sub

Identifier

R3LEVA_Sub

JavaScript type

r3List

C type

R3LIST*

Description

address of the children list, READ ONLY

Syntax


value = jsobj.GetSub();


R3LIST* value;
R3GetAttrs(r3obj, R3LEVA_Sub, &value, R3TAG_END);

Boolean

Attribute

Boolean

Identifier

R3LEVA_Boolean

JavaScript type

Integer

C type

R3INT

Description

see boolean types below

Syntax


jsobj.SetBoolean(value);
value = jsobj.GetBoolean();


R3INT value = ...;
R3SetAttrs(r3obj, R3LEVA_Boolean, value, R3TAG_END);
R3INT value;
R3GetAttrs(r3obj, R3LEVA_Boolean, &value, R3TAG_END);

HasRenderGeometry

Attribute

HasRenderGeometry

Identifier

R3LEVA_HasRenderGeometry

JavaScript type

Integer

C type

int

Description

Used by R3PRIMM_BEGINRENDER. Return true if child class renders something visible

Syntax


value = jsobj.GetHasRenderGeometry();


int value;
R3GetAttrs(r3obj, R3LEVA_HasRenderGeometry, &value, R3TAG_END);

Simulation

Attribute

Simulation

Identifier

R3LEVA_Simulation

JavaScript type

Boolean

C type

R3BOOL

Description

set true to activate simulation

Syntax


jsobj.SetSimulation(value);
value = jsobj.GetSimulation();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3LEVA_Simulation, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3LEVA_Simulation, &value, R3TAG_END);

SubCount

Attribute

SubCount

Identifier

R3LEVA_SubCount

JavaScript type

Integer

C type

R3INT

Description

number of children, read only

Syntax


value = jsobj.GetSubCount();


R3INT value;
R3GetAttrs(r3obj, R3LEVA_SubCount, &value, R3TAG_END);

Children

Attribute

Children

Identifier

R3LEVA_Children

JavaScript type

Object

C type

R3OBJ*

Description

indexed attribute for fetching child objects

Syntax


value = jsobj.GetChildren(index);


R3OBJ* value;
R3GetAttrs(r3obj, R3LEVA_Children, &value, R3TAG_END);

NoAndWire

Attribute

NoAndWire

Identifier

R3LEVA_NoAndWire

JavaScript type

Boolean

C type

R3BOOL

Description

do not compute boolean wire

Syntax


jsobj.SetNoAndWire(value);
value = jsobj.GetNoAndWire();


R3BOOL value = ...;
R3SetAttrs(r3obj, R3LEVA_NoAndWire, value, R3TAG_END);
R3BOOL value;
R3GetAttrs(r3obj, R3LEVA_NoAndWire, &value, R3TAG_END);

Simulation values for the simulation specific tag

R3SIT_INACTIVE
R3SIT_BOTH
R3SIT_SUBJECT
R3SIT_OBJECT

Simulation types for the REGISTERSIMULATIONFUNC method

R3SIMTYPE_OBJECTWISE
R3SIMTYPE_PAIRWISE
R3SIMTYPE_PAIRWISEASYMM

Values for _Boolean tag

R3BOOL_OR
R3BOOL_AND
R3BOOL_BRT
R3BOOL_MAP

Registry function

Tags

Tags

R3LEVA_OrdNum