InExcludeData Class Reference

#include <customgui_inexclude.h>

Inheritance diagram for InExcludeData:

Public Member Functions

Bool InsertObject (BaseList2D *pObject, Int32 lFlags)
 
Bool DeleteObject (BaseDocument *doc, BaseList2D *pObject)
 
Bool DeleteObject (Int32 lIndex)
 
Int32 GetObjectIndex (BaseDocument *doc, BaseList2D *pObject) const
 
BaseList2DObjectFromIndex (BaseDocument *doc, Int32 lIndex) const
 
Int32 GetObjectCount () const
 
Int32 GetFlags (Int32 lIndex) const
 
void SetFlags (Int32 lIndex, Int32 lFlags)
 
Int32 GetFlags (BaseDocument *doc, BaseList2D *pObject) const
 
BaseContainerGetData (Int32 lIndex) const
 
BaseContainerGetData (BaseDocument *doc, BaseList2D *pObject) const
 
InclusionTableBuildInclusionTable (BaseDocument *doc, Int32 hierarchy_bit=NOTOK)
 

Private Member Functions

 InExcludeData ()
 
 ~InExcludeData ()
 

Detailed Description

InExclude data type (CUSTOMDATATYPE_INEXCLUDE_LIST).

Note
Has to be created with Alloc() and destroyed with Free().

Example: Accessing include/exclude object list in light object:

GeData data;
if (lightObject->GetParameter(LIGHT_EXCLUSION_MODE, data))
{
if (data.GetInt32()==LIGHT_EXCLUSION_MODE_INCLUDE)
printf("Scene->Mode: Include\n");
else if (data.GetInt32() == LIGHT_EXCLUSION_MODE_EXCLUDE)
printf("Scene->Mode: Exclude\n");
}
if (lightObject->GetParameter(LIGHT_EXCLUSION_LIST, data))
{
if (data.GetType()==CUSTOMDATATYPE_INEXCLUDE_LIST)
{
InExcludeData* inExclude = (InExcludeData*)data.GetCustomDataType(CUSTOMDATATYPE_INEXCLUDE_LIST);
if (inExclude==nullptr)
return;
for (Int32 objIdx=0; objIdx<inExclude->GetObjectCount(); objIdx++)
{
BaseObject* obj = (BaseObject*)inExclude->ObjectFromIndex(nullptr, objIdx);
if (obj)
{
char* name = obj->GetName().GetCStringCopy();
if (name)
{
printf("In/Exclude Object %d: %s\n", objIdx+1, name);
MemFree(name);
}
else
printf("In/Exclude Object %d: <noname>\n", objIdx+1);
}
}
}
}

Constructor & Destructor Documentation

◆ InExcludeData()

InExcludeData ( )
private

◆ ~InExcludeData()

~InExcludeData ( )
private

Member Function Documentation

◆ InsertObject()

Bool InsertObject ( BaseList2D pObject,
Int32  lFlags 
)

Inserts a link to pObject into the list.

Parameters
[in]pObjectThe object to add to the list.
[in]lFlagsA bit field for the initial selection state of pObject.
Returns
true if pObject was successfully inserted into the list, otherwise false.

◆ DeleteObject() [1/2]

Bool DeleteObject ( BaseDocument doc,
BaseList2D pObject 
)

Removes pObject from the list.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]pObjectThe object to remove. The caller owns the pointed object.
Returns
true if pObject was successfully removed from the list, otherwise false.

◆ DeleteObject() [2/2]

Bool DeleteObject ( Int32  lIndex)

Removes the object at index lIndex in the list.

Parameters
[in]lIndexThe object index. 0 <= lIndex < GetObjectCount()
Returns
true if the object at index lIndex was successfully removed from the list, otherwise false.

◆ GetObjectIndex()

Int32 GetObjectIndex ( BaseDocument doc,
BaseList2D pObject 
) const

Gets the index of pObject in the list.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]pObjectThe object to search for. The caller owns the pointed object.
Returns
The object index, or NOTOK if it was not found.

◆ ObjectFromIndex()

BaseList2D* ObjectFromIndex ( BaseDocument doc,
Int32  lIndex 
) const

Gets the object at index lIndex in the list.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]lIndexThe object index. 0 <= lIndex < GetObjectCount()
Returns
The found object, or nullptr. @theOwnsPointed{document,object}

◆ GetObjectCount()

Int32 GetObjectCount ( ) const

Gets the number of object in the inexclude list.

Returns
The object count in the list.

◆ GetFlags() [1/2]

Int32 GetFlags ( Int32  lIndex) const

Gets the flags for the object at index lIndex in the list.

Parameters
[in]lIndexThe object index. 0 <= lIndex < GetObjectCount()
Returns
A bit field for the selection state of the object.

◆ SetFlags()

void SetFlags ( Int32  lIndex,
Int32  lFlags 
)

Sets set flags for the object at index lIndex in the list.

Parameters
[in]lIndexThe object index. 0 <= lIndex < GetObjectCount()
[in]lFlagsA bit field for the selection state of the object.

◆ GetFlags() [2/2]

Int32 GetFlags ( BaseDocument doc,
BaseList2D pObject 
) const

Gets the flags for pObject.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]pObjectThe object to get the flags for. The caller owns the pointed object.
Returns
A bit field for the selection state of the object.

◆ GetData() [1/2]

BaseContainer* GetData ( Int32  lIndex) const

Gets the data container for the object at index lIndex in the list.

Parameters
[in]lIndexThe object index. 0 <= lIndex < GetObjectCount()
Returns
The data container. The inexclude list owns the pointed container.

◆ GetData() [2/2]

BaseContainer* GetData ( BaseDocument doc,
BaseList2D pObject 
) const

Gets the data container for pObject.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]pObjectThe object to get the data for. The caller owns the pointed object.
Returns
The data container. The inexclude list owns the pointed container.

◆ BuildInclusionTable()

InclusionTable* BuildInclusionTable ( BaseDocument doc,
Int32  hierarchy_bit = NOTOK 
)

Builds an inclusion table for a specific bit.

Parameters
[in]docThe document to evaluate the links in. The caller owns the pointed document.
[in]hierarchy_bitThe bit position to generate the table for, starts at 0.
Returns
The built inclusion table, or nullptr. The caller owns the pointed inclusion table.
Warning
The returned inclusion table has to be freed with FreeInclusionTable().
CUSTOMDATATYPE_INEXCLUDE_LIST
#define CUSTOMDATATYPE_INEXCLUDE_LIST
InExclude data type ID.
Definition: customgui_inexclude.h:23
LIGHT_EXCLUSION_MODE_INCLUDE
@ LIGHT_EXCLUSION_MODE_INCLUDE
Definition: olight.h:261
LIGHT_EXCLUSION_MODE
@ LIGHT_EXCLUSION_MODE
Definition: olight.h:260
LIGHT_EXCLUSION_LIST
@ LIGHT_EXCLUSION_LIST
Definition: olight.h:259
cineware::InExcludeData::InExcludeData
InExcludeData()
cineware::MemFree
void MemFree(void *&mem)
Internal.
Definition: default_alien_overloads.h:48
cineware::Int32
int32_t Int32
32 bit signed integer datatype.
Definition: c4d_system.h:186
LIGHT_EXCLUSION_MODE_EXCLUDE
@ LIGHT_EXCLUSION_MODE_EXCLUDE
Definition: olight.h:262