This reference page is linked to from the following overview topics: New Classes and Methods.
#include <Mergeable.h>
Description: This class allows referenceTargets that are not INodes to be mergeable through the File->Merge command.
The referenceTarget that you want to be mergeable must derive from Mergeable. You just then need to override GetMergeableRef, GetMergeableRefName, and PostMerge.
Code Example to make the Brightness/Contrast effect mergeable.
You would derive your class from the Mergeable
Then make sure you return the Mergeable Interface from GetInterface when it is asked
void* BriteConEffect::GetInterface(ULONG id) { switch(id) { case MERGEABLE_INTERFACE : return (Mergeable *) this; break; default: return Effect::GetInterface(id); break; } }
Next just need to implement GetMergeableRef and GetMergeableRefName which return the data needed to do the merge
ReferenceTarget* BriteConEffect::GetMergeableRef() { return this; } TSTR BriteConEffect::GetMergeableRefName() { return GetName(); }
Finally you just need to implement PostMerge where you do your work to hook back up your reference after the merge
void BriteConEffect::PostMerge() { GetCOREInterface()->AddEffect(this); }
Public Member Functions |
|
CoreExport | Mergeable () |
virtual CoreExport | ~Mergeable () |
virtual
CoreExport ReferenceTarget * |
GetMergeableRef ()=0 |
This needs to be implemented to return the
ReferenceTarget that will be mergeable. |
|
virtual CoreExport TSTR | GetMergeableRefName ()=0 |
This returns the name that you want to
appear in the merge list box. |
|
virtual CoreExport void | PostMerge ()=0 |
This is called after the reference has been
merged. |
|
virtual CoreExport bool | SaveForMerge () |
This is called before saving. |
|
virtual CoreExport bool | MakeMergeNameUnique () |
The name returned from
GetMergeableRefName() will be made unique in the merge list
box, unless this is implemented to return false. |
CoreExport Mergeable | ( | ) |
virtual CoreExport ~Mergeable | ( | ) | [virtual] |
virtual CoreExport ReferenceTarget* GetMergeableRef | ( | ) | [pure virtual] |
This needs to be implemented to return the ReferenceTarget that will be mergeable.
This is the ReferenceTarget that is derived from Mergeable. If it does not derive from Mergeable, PostMerge will not be called on it after merging.
virtual CoreExport TSTR GetMergeableRefName | ( | ) | [pure virtual] |
This returns the name that you want to appear in the merge list box.
virtual CoreExport void PostMerge | ( | ) | [pure virtual] |
This is called after the reference has been merged.
At this point it needs to be attached to something otherwise it will be lost. For instance if this was an effect it would have to be attached to scene graphs effects list.
virtual CoreExport bool SaveForMerge | ( | ) | [inline, virtual] |
This is called before saving.
If you are in a state where you don't need to be saved, then return false. Otherwise by default this returns true.
{return true;}
virtual CoreExport bool MakeMergeNameUnique | ( | ) | [inline, virtual] |
The name returned from GetMergeableRefName() will be made unique in the merge list box, unless this is implemented to return false.
{return true;}