Rhino C++ API  8.13
Public Member Functions | Protected Member Functions | List of all members
IRhRdkContentUndo Class Referenceabstract

#include <RhRdkContentUndo.h>

Inheritance diagram for IRhRdkContentUndo:
CRhRdkContentUndo

Public Member Functions

virtual bool AddContent (const CRhRdkContent &c, const CRhRdkContent *pParent)=0
 
virtual bool DeleteContent (const CRhRdkContentArray &aContent)=0
 
virtual void DeleteThis (void)=0
 
virtual bool DeleteTopLevelContent (const CRhRdkContentArrayNC &aContent)=0
 
virtual void * EVF (const wchar_t *, void *)=0
 
virtual bool ModifyContent (const CRhRdkContent &c)=0
 
virtual bool TweakContent (const CRhRdkContent &c, const wchar_t *wszParamName, const class CRhRdkVariant &vValueOld)=0
 

Protected Member Functions

virtual ~IRhRdkContentUndo ()
 

Constructor & Destructor Documentation

◆ ~IRhRdkContentUndo()

virtual IRhRdkContentUndo::~IRhRdkContentUndo ( )
inlineprotectedvirtual

Member Function Documentation

◆ AddContent()

virtual bool IRhRdkContentUndo::AddContent ( const CRhRdkContent c,
const CRhRdkContent pParent 
)
pure virtual

Call this after creating a new content but before attaching it to a document.

Parameters
cis the new content being added.
pParentis 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).
Returns
true if successful, else false.

Implemented in CRhRdkContentUndo.

◆ DeleteContent()

virtual bool IRhRdkContentUndo::DeleteContent ( const CRhRdkContentArray aContent)
pure virtual

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.

Parameters
aContentis an array of pointers to the contents being deleted.

Implemented in CRhRdkContentUndo.

◆ DeleteThis()

virtual void IRhRdkContentUndo::DeleteThis ( void  )
pure virtual

This method is implemented as

delete this;

Implemented in CRhRdkContentUndo.

◆ DeleteTopLevelContent()

virtual bool IRhRdkContentUndo::DeleteTopLevelContent ( const CRhRdkContentArrayNC aContent)
pure virtual

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. Because the contents are not actually deleted at all, the user still perceives them as deleted because they disappear from the UI when detached.

Parameters
aContentis an array of pointers to the contents being 'deleted'. If any one of these contents is a child, the function will fail.

Implemented in CRhRdkContentUndo.

◆ EVF()

virtual void* IRhRdkContentUndo::EVF ( const wchar_t *  ,
void *   
)
pure virtual

Call this before promoting a single content from reference to non-reference.

Parameters
cis the content being promoted. Emergency virtual function for future expansion. "PromoteContent" is supported.

Implemented in CRhRdkContentUndo.

◆ ModifyContent()

virtual bool IRhRdkContentUndo::ModifyContent ( const CRhRdkContent c)
pure virtual

Call this before modifying a content in a significant way, for example changing a child.

Note
If you are just changing a simple parameter such as color, you should call TweakContent() instead.
Parameters
cis the content being modified.

Implemented in CRhRdkContentUndo.

◆ TweakContent()

virtual bool IRhRdkContentUndo::TweakContent ( const CRhRdkContent c,
const wchar_t *  wszParamName,
const class CRhRdkVariant vValueOld 
)
pure virtual

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.

Parameters
cis the content being tweaked.
wszParamNameis the name of the parameter being tweaked.
vValueOldis the value of the parameter before the tweak is applied.

Implemented in CRhRdkContentUndo.