Rhino C++ API
8.10
|
#include <RhRdkContentUndo.h>
Public Member Functions | |
CRhRdkContentUndo (const class CRhRdkDocument *pRdkDoc) | |
CRhRdkContentUndo (const CRhinoDoc &doc) | |
RDK_DEPRECATED | CRhRdkContentUndo (const wchar_t *wszDesc, INT_PTR reserved=0) |
virtual | ~CRhRdkContentUndo () |
virtual RDK_DEPRECATED bool | AddContent (const CRhRdkContent &newContent) |
virtual bool | AddContent (const CRhRdkContent &newContent, const CRhRdkContent *pParent) override |
virtual bool | DeleteContent (const CRhRdkContentArray &aContent) override |
virtual void | DeleteThis (void) override |
virtual bool | DeleteTopLevelContent (const CRhRdkContentArrayNC &aContent) override |
virtual void * | EVF (const wchar_t *, void *) override |
virtual bool | ModifyContent (const CRhRdkContent &content) override |
bool | PromoteContent (const CRhRdkContent &content) |
virtual bool | TweakContent (const CRhRdkContent &content, const wchar_t *wszParamName, const class CRhRdkVariant &vValueOld) override |
Additional Inherited Members | |
![]() | |
virtual | ~IRhRdkContentUndo () |
This is a stack object that makes it easy for clients to implement content undo. If you use the CRhRdkContentField object for storing your content's variables, you may not need to use this class since the field system takes care of parameter undo automatically. Use this class for handling parameter undo for data that is not stored in fields, or for handling custom content adds and deletes.
RDK_DEPRECATED CRhRdkContentUndo::CRhRdkContentUndo | ( | const wchar_t * | wszDesc, |
INT_PTR | reserved = 0 |
||
) |
This constructor is deprecated in favor of the one below.
wszDesc | is obsolete and not used. You must make sure an undo record is active at the time this object is created. |
CRhRdkContentUndo::CRhRdkContentUndo | ( | const CRhinoDoc & | doc | ) |
Use this constructor if you have a reference to a Rhino document.
CRhRdkContentUndo::CRhRdkContentUndo | ( | const class CRhRdkDocument * | pRdkDoc | ) |
Use this constructor if you have a pointer to an RDK document. The pointer can be null. Undo will only be recorded if the RDK document is not null and is associated with a Rhino document.
|
virtual |
|
virtual |
|
overridevirtual |
Call this after creating a new content but before adding it to the document.
newContent | is the new content being added. |
pParent | is a pointer to the content that will become the parent of the new content, or null if the new content is being added at the top level (i.e., not a child). |
Implements IRhRdkContentUndo.
|
overridevirtual |
Call this before deleting one or more contents. This copies the content hierarchies into the undo object and is therefore somewhat inefficient. If all the contents are top-level, it is better to call DeleteTopLevelContent() instead.
aContent | is an array of pointers to the contents being deleted. |
Implements IRhRdkContentUndo.
|
inlineoverridevirtual |
|
overridevirtual |
Call this before 'deleting' one or more top-level contents. This requires the caller to merely detach the contents from the document and pass ownership of them to this object. It eliminates the need to copy the contents and the need to actually delete them, thus saving time and memory. Although the contents are not actually deleted, the user still perceives them as deleted because they disappear from the UI when detached.
aContent | is an array of pointers to the contents being 'deleted'. If any one of these contents is a child, the function will fail. |
Implements IRhRdkContentUndo.
|
overridevirtual |
Emergency virtual function for future expansion.
Implements IRhRdkContentUndo.
|
overridevirtual |
Call this before modifying a content in a significant way, for example changing a child.
content | is the content being modified. |
Implements IRhRdkContentUndo.
bool CRhRdkContentUndo::PromoteContent | ( | const CRhRdkContent & | content | ) |
Call this before promoting a single content from reference to non-reference.
content | is the content being promoted. |
|
overridevirtual |
Call this before tweaking a single content parameter. It is more efficient than calling ModifyContent() because it only saves and restores the single changed parameter instead of the whole content hierarchy.
content | is the content being tweaked. |
wszParamName | is the name of the parameter being tweaked. |
vValueOld | is the value of the parameter before the tweak is applied. |
Implements IRhRdkContentUndo.