#include <notetrck.h>
Public Member Functions |
|
DefNoteTrack () | |
DefNoteTrack (DefNoteTrack &n) | |
DefNoteTrack & | operator= (DefNoteTrack &track) |
CoreExport void | HoldTrack () |
Class_ID | ClassID () |
Retrieves a constant that uniquely
identifies the plugin class. |
|
int | NumKeys () |
TimeValue | GetKeyTime (int index) |
CoreExport void | MapKeys (TimeMap *map, DWORD flags) |
CoreExport void | DeleteKeys (DWORD flags) |
CoreExport void | CloneSelectedKeys (BOOL offset) |
CoreExport void | DeleteTime (Interval iv, DWORD flags) |
CoreExport void | ReverseTime (Interval iv, DWORD flags) |
CoreExport void | ScaleTime (Interval iv, float s) |
CoreExport void | InsertTime (TimeValue ins, TimeValue amount) |
CoreExport void | AddNewKey (TimeValue t, DWORD flags) |
CoreExport int | GetSelKeyCoords (TimeValue &t, float &val, DWORD flags) |
CoreExport void | SetSelKeyCoords (TimeValue t, float val, DWORD flags) |
CoreExport int | GetTrackVSpace (int lineHeight) |
CoreExport BOOL | CanCopyTrack (Interval iv, DWORD flags) |
CoreExport BOOL | CanPasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags) |
CoreExport TrackClipObject * | CopyTrack (Interval iv, DWORD flags) |
CoreExport void | PasteTrack (TrackClipObject *cobj, Interval iv, DWORD flags) |
CoreExport Interval | GetTimeRange (DWORD flags) |
CoreExport int | HitTestTrack (TrackHitTab &hits, Rect &rcHit, Rect &rcTrack, float zoom, int scroll, DWORD flags) |
CoreExport int | PaintTrack (ParamDimensionBase *dim, HDC hdc, Rect &rcTrack, Rect &rcPaint, float zoom, int scroll, DWORD flags) |
CoreExport void | SelectKeys (TrackHitTab &sel, DWORD flags) |
CoreExport void | SelectKeyByIndex (int i, BOOL sel) |
CoreExport int | NumSelKeys () |
CoreExport void | FlagKey (TrackHitRecord hit) |
CoreExport int | GetFlagKeyIndex () |
CoreExport BOOL | IsAnimated () |
CoreExport void | EditTrackParams (TimeValue t, ParamDimensionBase *dim, MCHAR *pname, HWND hParent, IObjParam *ip, DWORD flags) |
CoreExport int | TrackParamsType () |
CoreExport BOOL | SupportTimeOperations () |
CoreExport IOResult | Save (ISave *isave) |
Called for saving data. |
|
CoreExport IOResult | Load (ILoad *iload) |
Called for loading data. |
|
CoreExport void | DeleteThis () |
Deletes an instance of this class. |
|
RefResult | NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, PartID &partID, RefMessage message) |
Receives and responds to messages. |
|
CoreExport RefTargetHandle | Clone (RemapDir &remap) |
This method is used by 3ds Max to clone an
object. |
|
Public Attributes |
|
NoteKeyTab | keys |
DefNoteTrack | ( | ) | [inline] |
{}
DefNoteTrack | ( | DefNoteTrack & | n | ) | [inline] |
DefNoteTrack& operator= | ( | DefNoteTrack & | track | ) | [inline] |
CoreExport void HoldTrack | ( | ) |
Class_ID ClassID | ( | ) | [inline, virtual] |
Retrieves a constant that uniquely identifies the plugin class.
This method must return the unique ID for the plugin class. If two ClassIDs conflict, the system will only load the first conflicting one it finds. A program (gencid.exe) is provided to generate unique class id values.
Reimplemented from Animatable.
{return Class_ID(NOTETRACK_CLASS_ID,0);}
int NumKeys | ( | ) | [inline, virtual] |
Reimplemented from Animatable.
TimeValue GetKeyTime | ( | int | index | ) | [inline, virtual] |
index | Specifies the key whose time should be returned. |
Reimplemented from Animatable.
{return keys[index]->time;}
CoreExport void MapKeys | ( | TimeMap * | map, |
DWORD | flags | ||
) | [virtual] |
map | Point to instance of Class TimeMap. |
flags | The flags indicate the keys to operate on. One or more of the
following values: TRACK_DOSEL Selected keys only. TRACK_DOALL All the keys, ignore their selection state. TRACK_SLIDEUNSEL Slide unselected keys to the right. Keys are slid by the amount the last key was transformed. TRACK_RIGHTTOLEFT Enumerate right to left. If TRACK_SLIDEUNSEL is set, keys will slide to the left. TRACK_DOSUBANIMS Sub-Animatables keys as well. TRACK_DOCHILDNODES Child Nodes keys as well TRACK_MAPRANGE The range, if not locked to first and last key, should be mapped as well. |
INTERP_CONT_TEMPLATE void InterpControl<INTERP_CONT_PARAMS>::MapKeys(TimeMap *map,DWORD flags ) { int n = keys.Count(); BOOL changed = FALSE; if (!n) goto doneMapKeys; HoldTrack(); if (flags&TRACK_DOALL) { for (int i = 0; i < n; i++) { if (keys[i].TimeLocked()) continue; keys[i].time = map->map(keys[i].time); changed = TRUE; } } else if (flags&TRACK_DOSEL) { BOOL slide = flags&TRACK_SLIDEUNSEL; TimeValue delta = 0, prev; int start, end, inc; if (flags&TRACK_RIGHTTOLEFT) { start = n-1; end = -1; inc = -1; } else { start = 0; end = n; inc = 1; } for (int i = start; i != end; i += inc) { if (keys[i].TimeLocked()) continue; if (keys[i].TestKFlag(KEY_SELECTED)) { prev = keys[i].time; keys[i].time = map->map(keys[i].time); delta = keys[i].time - prev; changed = TRUE; } else if (slide) { keys[i].time += delta; } } } if (flags&TRACK_MAPRANGE && keys.TestTFlag(RANGE_UNLOCKED)) { TimeValue t0 = map->map(keys.range.Start()); TimeValue t1 = map->map(keys.range.End()); keys.range.Set(t0,t1); } if (changed) { keys.KeysChanged(); ivalid.SetEmpty(); NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); } doneMapKeys: Animatable::MapKeys(map,flags); }
Reimplemented from Animatable.
CoreExport void DeleteKeys | ( | DWORD | flags | ) | [virtual] |
flags | One or more of the following values: TRACK_DOSEL Delete selected keys only. TRACK_DOALL Delete all keys (ignore selection state). TRACK_SLIDEUNSEL Slide unselected keys to the right. TRACK_RIGHTTOLEFT Enumerate right to left. If TRACK_SLIDEUNSEL is set, keys will slide to the left. |
Reimplemented from Animatable.
CoreExport void CloneSelectedKeys | ( | BOOL | offset | ) | [virtual] |
offset | If TRUE, set the new key time to be centered between the original key and the next key. |
Reimplemented from Animatable.
CoreExport void DeleteTime | ( | Interval | iv, |
DWORD | flags | ||
) | [virtual] |
iv | The interval of time to delete. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. TIME_NOSLIDE Delete any keys in the interval but don't actually remove the block of time. |
Reimplemented from Animatable.
CoreExport void ReverseTime | ( | Interval | iv, |
DWORD | flags | ||
) | [virtual] |
iv | The interval of time over which to reverse the data. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. |
INTERP_CONT_TEMPLATE void InterpControl<INTERP_CONT_PARAMS>::ReverseTime( Interval iv, DWORD flags ) { Interval test = TestInterval(iv,flags); int n = keys.Count(); HoldTrack(); for ( int i = 0; i < n; i++ ) { if (keys[i].TimeLocked()) continue; if ( test.InInterval(keys[i].time) ) { TimeValue delta = keys[i].time - iv.Start(); keys[i].time = iv.End()-delta; } } keys.KeysChanged(); keys.CheckForDups(); ivalid.SetEmpty(); NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); }
Reimplemented from Animatable.
CoreExport void ScaleTime | ( | Interval | iv, |
float | s | ||
) | [virtual] |
iv | The interval of time to scale. The origin of the scale is at iv.Start(). |
s | The scale factor for the time. |
INTERP_CONT_TEMPLATE void InterpControl<INTERP_CONT_PARAMS>::ScaleTime( Interval iv, float s) { int n = keys.Count(); TimeValue delta = int(s*float(iv.End()-iv.Start())) + iv.Start() - iv.End(); HoldTrack(); for ( int i = 0; i < n; i++ ) { if (keys[i].TimeLocked()) continue; if ( iv.InInterval(keys[i].time) ) { keys[i].time = int(s*float(keys[i].time - iv.Start())) + iv.Start(); } else if (keys[i].time > iv.End()) { keys[i].time += delta; } } keys.KeysChanged(); ivalid.SetEmpty(); NotifyDependents(FOREVER, PART_ALL, REFMSG_CHANGE); }
Reimplemented from Animatable.
CoreExport void InsertTime | ( | TimeValue | ins, |
TimeValue | amount | ||
) | [virtual] |
ins | The time to begin the insertion. |
amount | The amount of time to insert. |
Reimplemented from Animatable.
CoreExport void AddNewKey | ( | TimeValue | t, |
DWORD | flags | ||
) | [virtual] |
t | The time to add the key. |
flags | One or more of the following values: ADDKEY_SELECT Select the new key and deselect any other selected keys. ADDKEY_INTERP If TRUE then initialize the new key to the interpolated value at that time. If FALSE, initialize the key to the value of the previous key. |
Reimplemented from Animatable.
CoreExport int GetSelKeyCoords | ( | TimeValue & | t, |
float & | val, | ||
DWORD | flags | ||
) | [virtual] |
t | The time of the selected keys is returned here (if appropriate). |
val | The value of the selected keys is returned here (if appropriate). |
flags | One of the following values: KEYCOORDS_TIMEONLY Only the time t needs to be updated. KEYCOORDS_VALUEONLY Only the value val needs to be updated. |
Reimplemented from Animatable.
CoreExport void SetSelKeyCoords | ( | TimeValue | t, |
float | val, | ||
DWORD | flags | ||
) | [virtual] |
t | The time to set for the selected keys (if the flags indicate this is needed). |
val | The value to set for the selected keys (if the flags indicate this is needed). |
flags | One of the following values: KEYCOORDS_TIMEONLY Only the time needs to be updated. KEYCOORDS_VALUEONLY Only the value needs to be updated. |
Reimplemented from Animatable.
CoreExport int GetTrackVSpace | ( | int | lineHeight | ) | [inline, virtual] |
lineHeight | The height of a single line in pixels. |
Reimplemented from Animatable.
{return 1;}
CoreExport BOOL CanCopyTrack | ( | Interval | iv, |
DWORD | flags | ||
) | [inline, virtual] |
iv | The interval of time that would be copied. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. |
Reimplemented from Animatable.
{return 1;}
CoreExport BOOL CanPasteTrack | ( | TrackClipObject * | cobj, |
Interval | iv, | ||
DWORD | flags | ||
) | [inline, virtual] |
cobj | The clipboard object that would be pasted. The item should look at the SuperClassID and Class_ID of the creator of the clip object to determine if it is a suitable object to paste. See Class TrackClipObject. |
iv | The interval of time that would be pasted. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. |
Reimplemented from Animatable.
CoreExport TrackClipObject* CopyTrack | ( | Interval | iv, |
DWORD | flags | ||
) | [virtual] |
iv | The interval of time over which to copy the track data. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. |
Reimplemented from Animatable.
CoreExport void PasteTrack | ( | TrackClipObject * | cobj, |
Interval | iv, | ||
DWORD | flags | ||
) | [virtual] |
cobj | The data to paste. |
iv | The interval of time to paste. |
flags | One or more of the following values: TIME_INCLEFT Include the left endpoint. TIME_INCRIGHT Include the right endpoint. |
Reimplemented from Animatable.
CoreExport Interval GetTimeRange | ( | DWORD | flags | ) | [virtual] |
flags | One or more of the following values: TIMERANGE_SELONLY The bounding interval of selected keys only. TIMERANGE_ALL Whatever the channel's time range is - usually the bounding interval of all keys. TIMERANGE_CHILDNODES The node's time range should include its child nodes. TIMERANGE_CHILDANIMS A animatable's child anim ranges should be included. |
Reimplemented from Animatable.
CoreExport int HitTestTrack | ( | TrackHitTab & | hits, |
Rect & | rcHit, | ||
Rect & | rcTrack, | ||
float | zoom, | ||
int | scroll, | ||
DWORD | flags | ||
) | [virtual] |
hits | The table of TrackHitRecords to update. Each key that lies within the hit rectangle (is hit) should be added to this table. It is up to the plug-in to define a scheme that allows it to identify its hits using the data members of Class TrackHitRecord. Also see Class Tab for methods to add to the table. |
rcHit | This is the region that was selected for hit testing. This may be a small rectangle about the mouse pick point, or a larger rectangle if the user selected by window. |
rcTrack | This is the entire rectangular region of the track. |
zoom | The is the time zoom factor. |
scroll | This is the time scroll factor. |
flags | One or more of the following value: HITTRACK_SELONLY Selected only. HITTRACK_UNSELONLY Unselected only. HITTRACK_ABORTONHIT Abort hit testing on first hit. HITCURVE_TESTTANGENTS Hit test curve tangents. |
Reimplemented from Animatable.
CoreExport int PaintTrack | ( | ParamDimensionBase * | dim, |
HDC | hdc, | ||
Rect & | rcTrack, | ||
Rect & | rcPaint, | ||
float | zoom, | ||
int | scroll, | ||
DWORD | flags | ||
) | [virtual] |
dim | The dimension for the parameter of this track. |
hdc | The handle of the device context. |
rcTrack | The entire rectangle of the inside of the track. |
rcPaint | This is the rectangular region that needs to be repainted - the invalid region. |
zoom | The time zoom factor. |
scroll | The time scroll factor. |
flags | One or more of the following values which are filters for
controllers with more than one curve: DISPLAY_XCURVE DISPLAY_YCURVE |
Reimplemented from Animatable.
CoreExport void SelectKeys | ( | TrackHitTab & | sel, |
DWORD | flags | ||
) | [virtual] |
sel | The table of track hit records. See Class TrackHitRecord and Class
Tab. Note the following: typedef
Tab<TrackHitRecord>
TrackHitTab; |
flags | Either SELKEYS_SELECT, SELKEYS_DESELECT, or a
combination of SELKEYS_CLEARKEYS and
SELKEYS_CLEARCURVE will be specified. One or more of the following values: SELKEYS_SELECT The keys should be selected. SELKEYS_DESELECT The keys should be deselected. SELKEYS_CLEARKEYS All keys should be deselected. SELKEYS_CLEARCURVE All keys on the function curve should be deselected. SELKEYS_FCURVE Indicates that we are operating on the keys of a function curve, and not of a track. |
Reimplemented from Animatable.
CoreExport void SelectKeyByIndex | ( | int | i, |
BOOL | sel | ||
) | [virtual] |
i | The key to select or deselect. |
sel | TRUE to select the key; FALSE to deselect it. |
Reimplemented from Animatable.
CoreExport int NumSelKeys | ( | ) | [virtual] |
Reimplemented from Animatable.
CoreExport void FlagKey | ( | TrackHitRecord | hit | ) | [virtual] |
hit | The hit record that the controller gave the Track View in the first place to identify the hit. Thus this is enough information to identify the key. See Class TrackHitRecord. |
INTERP_CONT_TEMPLATE void InterpControl<INTERP_CONT_PARAMS>::FlagKey(TrackHitRecord hit) { int n = keys.Count(); for ( int i = 0; i < n; i++ ) { keys[i].ClearKFlag(KEY_FLAGGED); } assert(hit.hit>=0&&hit.hit<(DWORD)n); keys[hit.hit].SetKFlag(KEY_FLAGGED); }
Reimplemented from Animatable.
CoreExport int GetFlagKeyIndex | ( | ) | [virtual] |
INTERP_CONT_TEMPLATE int InterpControl<INTERP_CONT_PARAMS>::GetFlagKeyIndex() { int n = keys.Count(); for ( int i = 0; i < n; i++ ) { if (keys[i].TestKFlag(KEY_FLAGGED)) { return i; } } return -1; }
Reimplemented from Animatable.
CoreExport BOOL IsAnimated | ( | ) | [inline, virtual] |
Reimplemented from Animatable.
{return TRUE;}
CoreExport void EditTrackParams | ( | TimeValue | t, |
ParamDimensionBase * | dim, | ||
MCHAR * | pname, | ||
HWND | hParent, | ||
IObjParam * | ip, | ||
DWORD | flags | ||
) | [virtual] |
t | This time represents the horizontal position of where the user right clicked to bring up the modal edit track parameters dialog. See the flags below for when this parameter is valid. |
dim | The parameter dimension. See Class ParamDimensionBase. |
pname | The name of the parameter as given by the client. |
hParent | This is the parent window that should be used to create any dialogs. |
ip | An interface pointer available for calling functions in 3ds Max. |
flags | One or more of the following values: EDITTRACK_FCURVE The user is in the function curve editor. EDITTRACK_TRACK The user is in one of the track views. EDITTRACK_SCENE The user is editing a path in the scene. EDITTRACK_BUTTON The user invoked by choosing the properties button. In this case the time parameter is NOT valid. EDITTRACK_MOUSE The user invoked by right clicking with the mouse. In this case the time parameter is valid. |
Reimplemented from Animatable.
CoreExport int TrackParamsType | ( | ) | [inline, virtual] |
Reimplemented from Animatable.
{return TRACKPARAMS_KEY;}
CoreExport BOOL SupportTimeOperations | ( | ) | [inline, virtual] |
Reimplemented from Animatable.
{return TRUE;}
Called for saving data.
Called by the system to allow the plugin to save its data.
isave | - This pointer may be used to call methods to write data to disk. See the section on Loading and Saving for an overview of the load/save process. |
Reimplemented from ReferenceMaker.
Called for loading data.
Called by the system to allow the plug-in to load its data. See the section on Loading and Saving for an overview of the load - save process.
iload | - This interface pointer may be used to call methods to read data from disk. |
Reimplemented from ReferenceMaker.
CoreExport void DeleteThis | ( | ) | [virtual] |
Deletes an instance of this class.
3ds Max calls this method when it needs to delete a plugin object (an instance of a class derived from Animatable). Similarly, plugins that need to delete instances of an Animatable or a class directly derived from it via an Animatable pointer, should call this method instead of calling directly operator delete. Following these rules will ensure that the same memory manager is used to allocate and deallocate the object. The default implementation of this method deletes the object. Plugin instances that never need to be deleted from the heap can overwrite this method to do nothing.
Reimplemented from Animatable.
RefResult NotifyRefChanged | ( | Interval | changeInt, |
RefTargetHandle | hTarget, | ||
PartID & | partID, | ||
RefMessage | message | ||
) | [inline, virtual] |
Receives and responds to messages.
A plugin which makes references must implement a method to receive and respond to messages broadcast by its dependents. This is done by implementing NotifyRefChanged(). The plugin developer usually implements this method as a switch statement where each case is one of the messages the plugin needs to respond to. The Method StdNotifyRefChanged calls this, which can change the partID to new value. If it doesn't depend on the particular message& partID, it should return REF_DONTCARE.
changeInt | - This is the interval of time over which the message is active. Currently, all plug-ins will receive FOREVER for this interval. |
hTarget | - This is the handle of the reference target the message was sent by. The reference maker uses this handle to know specifically which reference target sent the message. |
partID | - This contains information specific to the message passed in. Some messages don't use the partID at all. See the section List of Reference Messages for more information about the meaning of the partID for some common messages. |
message | - The message parameters passed into this method is the specific message which needs to be handled. |
Implements ReferenceMaker.
{return REF_SUCCEED;}
CoreExport RefTargetHandle Clone | ( | RemapDir & | remap | ) | [virtual] |
This method is used by 3ds Max to clone an object.
class MyDerivedPlugin : public MyBasePlugin { const int MY_REFERENCE = 1; ReferenceTarget* Clone(RemapDir& remap) { ReferenceTarget* result = new MyDerivedPlugin(); BaseClone(this, result, remap); return result; } void BaseClone(ReferenceTarget* from, ReferenceTarget* to, RemapDir& remap) { if (!to || !from || from == to) return; MyBasePlugin::BaseClone(from, to, remap); to->ReplaceReference(MY_REFERENCE, remap->CloneRef(from->GetReference(MY_REFERENCE))); } };
This method should not be directly called by plug-ins. Instead, either RemapDir::CloneRef() or CloneRefHierachy() should be used to perform cloning. These methods ensure that the mapping from the original object to the clone is added to the RemapDir used for cloning, which may be used during backpatch operations
remap | - A RemapDir instance used for remapping references during a Clone. |
Reimplemented from ReferenceTarget.