Rhino C++ API  8.5
Public Member Functions | Protected Member Functions | List of all members
IRhRdkContents Class Referenceabstract

#include <IRhRdkContents.h>

Public Member Functions

virtual bool Attach (CRhRdkContent &c)=0
 
virtual IRhRdkContentsBeginChange (RhRdkChangeContext cc) const =0
 
virtual RDK_DEPRECATED bool Change (const CRhRdkContent &oldContent, CRhRdkContent &newContent, bool bPreserve=true)=0
 
virtual CRhRdkContentDetach (const CRhRdkContent &c)=0
 
virtual bool EndChange (void)=0
 
virtual void * EVF (const wchar_t *wszFunc, void *pvData)=0
 
virtual void Find (const CRhRdkContentKindList &kinds, const wchar_t *wszName, bool bCaseSensitive, bool bRecurse, OUT CRhRdkContentArray &aContent) const =0
 
virtual const CRhRdkContentFind (const UUID &uuidInstance) const =0
 
virtual const CRhRdkContentFindSimilar (const CRhRdkContent &c) const =0
 
virtual bool IsFilteredOut (const CRhRdkContent &c) const =0
 
virtual class IRhRdkContentIteratorNewIterator (const CRhRdkContentKindList &kinds, unsigned int it_Flags) const =0
 
bool Replace (const CRhRdkContent &oldContent, CRhRdkContent &newContent, bool bPreserve=true)
 
bool SelectContent (const CRhRdkInstanceIdArray &aInstance, bool bAppendToSelection) const
 
virtual void UpdateDocumentTables (void) const =0
 

Protected Member Functions

virtual ~IRhRdkContents ()
 

Detailed Description

This is the interface to document contents.

Constructor & Destructor Documentation

◆ ~IRhRdkContents()

virtual IRhRdkContents::~IRhRdkContents ( )
inlineprotectedvirtual

Member Function Documentation

◆ Attach()

virtual bool IRhRdkContents::Attach ( CRhRdkContent c)
pure virtual

Attach a content to the associated document.

Parameters
cis the content to attach. If successful, ownership of the content will be transferred to the document.
Note
If the content is a child or already attached to this or another document, the method will fail.
Returns
true if successful, else false.

◆ BeginChange()

virtual IRhRdkContents& IRhRdkContents::BeginChange ( RhRdkChangeContext  cc) const
pure virtual

Call this method to get a non-const object upon which you can call non-const methods. Calls to this method are counted; you must call EndChange() once for every call to BeginChange(). Please do not use const_cast or any other means of circumventing this requirement.

◆ Change()

virtual RDK_DEPRECATED bool IRhRdkContents::Change ( const CRhRdkContent oldContent,
CRhRdkContent newContent,
bool  bPreserve = true 
)
pure virtual

Replace a content in the document. Deprecated in favor of Replace().

◆ Detach()

virtual CRhRdkContent* IRhRdkContents::Detach ( const CRhRdkContent c)
pure virtual

Detach a content from the document.

Parameters
cis the content to detach. If successful, ownership of the content will be transferred to the caller.
Note
If the content is a child or not attached to this document, the method will fail.
Returns
A pointer to the detached content if successful, else null.

◆ EndChange()

virtual bool IRhRdkContents::EndChange ( void  )
pure virtual

◆ EVF()

virtual void* IRhRdkContents::EVF ( const wchar_t *  wszFunc,
void *  pvData 
)
pure virtual

Emergency virtual function for future expansion.

◆ Find() [1/2]

virtual void IRhRdkContents::Find ( const CRhRdkContentKindList kinds,
const wchar_t *  wszName,
bool  bCaseSensitive,
bool  bRecurse,
OUT CRhRdkContentArray aContent 
) const
pure virtual

Searches for contents with a particular instance name.

Parameters
kindsspecifies which top-level content kinds should be searched.
wszNameis the name to search for.
bCaseSensitivespecifies if the name check is case-sensitive or not.
bRecursespecifies if children of top-level contents should be searched.
aContentaccepts all the contents that satisfy the search. If you want to modify these contents you will need to call BeginChange() to get a non-const reference.
See also
BeginChange()

◆ Find() [2/2]

virtual const CRhRdkContent* IRhRdkContents::Find ( const UUID &  uuidInstance) const
pure virtual

Find a content by its instance id. All document-registered contents (including children) will be checked.

Parameters
uuidInstanceis the instance id of the content to find.
Returns
A const pointer to the content or null if not found. If you want to modify the content you will need to call BeginChange() to get a non-const reference.
See also
BeginChange()

◆ FindSimilar()

virtual const CRhRdkContent* IRhRdkContents::FindSimilar ( const CRhRdkContent c) const
pure virtual

Searches for a content with the same name and appearance as another content.

Note
The name check is case-insensitive. The 'appearance' is the render CRC of the content.
Parameters
cis the content to match against.
Returns
A pointer to a similar content if found, else null.

◆ IsFilteredOut()

virtual bool IRhRdkContents::IsFilteredOut ( const CRhRdkContent c) const
pure virtual
Returns
true if content is filtered out according to document filter settings.

◆ NewIterator()

virtual class IRhRdkContentIterator* IRhRdkContents::NewIterator ( const CRhRdkContentKindList kinds,
unsigned int  it_Flags 
) const
pure virtual

Get a new content iterator. The caller shall delete the iterator after use.

Parameters
kindsspecifies the content kinds to return.
it_Flagsspecifies flags (see CRhRdkDocument::NewContentIterator).

◆ Replace()

bool IRhRdkContents::Replace ( const CRhRdkContent oldContent,
CRhRdkContent newContent,
bool  bPreserve = true 
)

Replace a content in the document.

Parameters
oldContentis the content to detach and delete.
newContentis the content to attach in place of oldContent. If successful, the old content will be deleted and ownership of the new content will be transferred to the document.
bPreservedetermines whether or not the instance id and notes are preserved. If true, the instance id of the old content is preserved in the new content. This means that any objects or layers that were referencing the old content will reference the new content. The same applies to the ground plane. The content's notes are also preserved. TODO: The name preserving is currently being reconsidered. [ANDY]
Note
The old content can be top-level or a child.
If the old content is not attached to this document, the method will fail.
If the new content is a child already attached to this or another document, the method will fail.
Returns
true if successful, else false.

◆ SelectContent()

bool IRhRdkContents::SelectContent ( const CRhRdkInstanceIdArray aInstance,
bool  bAppendToSelection 
) const

Selects contents in all capable editors that are displaying those contents on behalf of the document.

Parameters
aInstanceis the array of instance-ids of contents to select.
bAppendToSelectionspecifies if the selection should be replaced (false) or modified (true).
Returns
true if successful, else false.

◆ UpdateDocumentTables()

virtual void IRhRdkContents::UpdateDocumentTables ( void  ) const
pure virtual

Calls UpdateDocumentTables() on all of the contents.