LightWrap++
AC++wrapperfortheLightWave3DSDK
lwpp::LWItemTracker Class Reference

This class tracks the IDs of LW items, especially related to the LWItemFuncs callbacks. More...

#include <item.h>

List of all members.

Public Member Functions

 LWItemTracker (void)
 ~LWItemTracker (void)
void changeID (const LWItemID *idlist)
 should be used for LWs changeID callback.
void refresh ()
 Refresh the list of IDs created from the tracked Items.
void trackItem (LWItem *item)
 Add an item to track.
void trackItem (LWItem &item)
void unTrackItem (LWItem &item)
void unTrackItem (LWItem *item)
const LWItemID * useItems ()
 Should be used for LWs useItems callback.

Detailed Description

This class tracks the IDs of LW items, especially related to the LWItemFuncs callbacks.

LW Callbacks served:

  • idlist = useItems( instance )

Returns an array of items this instance depends on. If your plug-in's behavior is based on the parameters of other items (such as the positions of objects), you'll want to be re-evaluated after those parameters change, and you use this function to inform Layout of that. The array is terminated by LWITEM_NULL. The function can return NULL if the instance doesn't use any items. It can also return LWITEM_ALL to indicate that it wants to be evaluated after any change occurs.

  • changeID( instance, idlist )

Notification about a change in item IDs. This function is called if the IDs of items are going to change for any reason. The null-terminated item array passed to this function is of the form "old-1, new-1, old-2, new-2, ..." where the old ID is the value that is changing and the new ID is its new value. Clients should be careful to renumber each item only once. The changeID callback may also be called when an item's data, such as the geometry of an object, has changed, and when called for this reason, the old and new item IDs will be the same.

Todo:
Actually implement this class This is how it is supposed to work:
  • Items to be tracked are added to the class using TrackItem()...
  • This allows the class to dynamically create a use items list
  • changeIDs are passed on to the tracked objects if needed

Constructor & Destructor Documentation

lwpp::LWItemTracker::LWItemTracker ( void  )
inline
lwpp::LWItemTracker::~LWItemTracker ( void  )

Member Function Documentation

void lwpp::LWItemTracker::changeID ( const LWItemID *  idlist)

should be used for LWs changeID callback.

void lwpp::LWItemTracker::refresh ( )

Refresh the list of IDs created from the tracked Items.

void lwpp::LWItemTracker::trackItem ( LWItem item)

Add an item to track.

Note:
, the item must persist for the duration of this class, at least for as long as Refresh may be called
void lwpp::LWItemTracker::trackItem ( LWItem item)
void lwpp::LWItemTracker::unTrackItem ( LWItem item)
void lwpp::LWItemTracker::unTrackItem ( LWItem item)
const LWItemID * lwpp::LWItemTracker::useItems ( )

Should be used for LWs useItems callback.


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