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

#include <IRhRdkSkylight.h>

Public Member Functions

virtual bool Attach (CRhRdkContent &c)=0
 
virtual IRhRdkContentsBeginChange (RhRdkChangeContext cc) const =0
 
virtual 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
 
virtual void UpdateDocumentTables (void) const =0
 

Protected Member Functions

virtual ~IRhRdkContents ()
 

Detailed Description

This is the interface to document contents.

TODO: move this to a new file.

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 bool IRhRdkContents::Change ( const CRhRdkContent oldContent,
CRhRdkContent newContent,
bool  bPreserve = true 
)
pure virtual

Change 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.

◆ 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
true if successful, else false.

◆ 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.
aContentOutaccepts 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).

◆ UpdateDocumentTables()

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

Calls UpdateDocumentTables() on all of the contents.