Rhino C++ API  8.5
Public Types | Public Member Functions | List of all members
CRhRdkContentIOPlugInEx Class Referenceabstract

#include <RhRdkContentIOPlugIn.h>

Inheritance diagram for CRhRdkContentIOPlugInEx:
CRhRdkContentIOPlugIn CRhRdkExtension CRhRdkObject

Public Types

enum  : unsigned int { LoadMultiple_Normal = 0x00, LoadMultiple_Preload = 0x01 }
 

Public Member Functions

 CRhRdkContentIOPlugInEx ()
 
virtual ~CRhRdkContentIOPlugInEx ()
 
virtual bool CanLoadMultiple (void) const =0
 
virtual UUID InterfaceId (void) const override final
 
virtual bool LoadMultiple (const CRhinoDoc *pDoc, const ON_ClassArray< ON_wString > &aFullPath, CRhRdkContent::Kinds kind, unsigned int flags, void *pReserved) const =0
 
virtual void ReportContentAndFile (CRhRdkContent &c, const wchar_t *wszFullPath, unsigned int flags, void *pReserved) const
 
virtual void ReportDeferredContentAndFile (CRhRdkContent &c, const wchar_t *wszFullPath, unsigned int flags, void *pReserved) const
 
void SetReport (class CRhRdkContentIOLoadMultipleReport *) const
 
- Public Member Functions inherited from CRhRdkContentIOPlugIn
virtual bool CanLoad (void) const =0
 
virtual bool CanSave (void) const =0
 
virtual const wchar_t * Description (void) const =0
 
virtual void * EVF (const wchar_t *, void *) override
 
virtual const wchar_t * FileExtension (void) const =0
 
virtual const RDK_DEPRECATED wchar_t * Kind (void) const
 
virtual CRhRdkContentLoad (const CRhinoDoc *pDoc, const wchar_t *wszFullPath, CRhRdkContent::Kinds kind) const =0
 
virtual UUID RdkPlugInId (void) const =0
 
virtual bool Save (const wchar_t *wszFullPath, const CRhRdkContent &content, const IRhRdkPreviewSceneServer *pSceneServer) const =0
 
virtual CRhRdkContentKindList SupportedKinds (void) const =0
 
- Public Member Functions inherited from CRhRdkExtension
 CRhRdkExtension ()
 
virtual ~CRhRdkExtension ()
 
virtual UUID PlugInId (void) const =0
 
- Public Member Functions inherited from CRhRdkObject
 CRhRdkObject ()
 
virtual ~CRhRdkObject ()
 
void operator delete (void *buf)
 
void operator delete[] (void *buf)
 
void * operator new (size_t size)
 
void * operator new[] (size_t size)
 

Additional Inherited Members

- Static Public Member Functions inherited from CRhRdkObject
static void CheckMemory (void)
 
static void PopulateDebuggingInfo (void)
 

Detailed Description

This class is an extension of CRhRdkContentIOPlugIn. It adds support for loading multiple contents from a file.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : unsigned int
Enumerator
LoadMultiple_Normal 
LoadMultiple_Preload 

Constructor & Destructor Documentation

◆ CRhRdkContentIOPlugInEx()

CRhRdkContentIOPlugInEx::CRhRdkContentIOPlugInEx ( )

◆ ~CRhRdkContentIOPlugInEx()

virtual CRhRdkContentIOPlugInEx::~CRhRdkContentIOPlugInEx ( )
virtual

Member Function Documentation

◆ CanLoadMultiple()

virtual bool CRhRdkContentIOPlugInEx::CanLoadMultiple ( void  ) const
pure virtual
Returns
true if the plug-in is capable of loading multiple contents.

◆ InterfaceId()

virtual UUID CRhRdkContentIOPlugInEx::InterfaceId ( void  ) const
finaloverridevirtual

Returns the unique interface id of this extension.

Reimplemented from CRhRdkContentIOPlugIn.

◆ LoadMultiple()

virtual bool CRhRdkContentIOPlugInEx::LoadMultiple ( const CRhinoDoc pDoc,
const ON_ClassArray< ON_wString > &  aFullPath,
CRhRdkContent::Kinds  kind,
unsigned int  flags,
void *  pReserved 
) const
pure virtual

Create any number of new contents and load them from a custom content file.

Parameters
pDocis a pointer to a Rhino document. May be nullptr.
aFullPathis a list of full paths of files to load from. Each file can contain any number of contents.
kindis only used by I/O plug-ins that support multiple kinds. It tells the plug-in which content kind to create. If the plug-in only supports a single content kind, it can ignore this parameter.
flagsis a set of flags from the enum above.
Note
The contents are not actually attached to any document, they are just loaded. The pDoc parameter is only used for unpacking embedded files, if necessary.
After loading each content from a file, you should call ReportContentAndFile() to report the content and the file it was loaded from. However, during file drag and drop, the LoadMultiple_Preload flag is specified, and if your loading process is time-consuming or displays a dialog, then for each file, you must create a 'deferred' content instead of loading any real contents. A deferred content is a lightweight content of the same kind which is fast to create. It represents all the contents that will eventually be loaded from the file. This is needed because during drag and drop, the contents are created when the drag enters a window. On dropping, any deferred contents will be properly loaded by calling LoadMultiple() again for each individual file extension that was dragged. In this case, instead of calling ReportContentAndFile() you must call ReportDeferredContentAndFile().
Returns
true if all contents loaded successfully, false if any one failed.

◆ ReportContentAndFile()

virtual void CRhRdkContentIOPlugInEx::ReportContentAndFile ( CRhRdkContent c,
const wchar_t *  wszFullPath,
unsigned int  flags,
void *  pReserved 
) const
virtual

This is called from your implementation of LoadMultiple() to add a content and the file it was loaded from when the LoadMultiple_Preload flag is not set.

See also
CRhRdkContentIOPlugInEx::LoadMultiple() for an explanation of this method's use.
Parameters
cis the content that was loaded.
wszFullPathis the full path to the file that 'c' was loaded from.
flagsis reserved for future use; you should pass zero.
pReservedis reserved for future use; you should pass nullptr.

◆ ReportDeferredContentAndFile()

virtual void CRhRdkContentIOPlugInEx::ReportDeferredContentAndFile ( CRhRdkContent c,
const wchar_t *  wszFullPath,
unsigned int  flags,
void *  pReserved 
) const
virtual

This is called from your implementation of LoadMultiple() to add a 'deferred' content and the file it will be loaded from, when the LoadMultiple_Preload flag is set.

See also
CRhRdkContentIOPlugInEx::LoadMultiple() for an explanation of this method's use.
Parameters
cis the deferred content.
wszFullPathis the full path to the file that 'c' will be loaded from.
flagsis reserved for future use; you should pass zero.
pReservedis reserved for future use; you should pass nullptr.

◆ SetReport()

void CRhRdkContentIOPlugInEx::SetReport ( class CRhRdkContentIOLoadMultipleReport *  ) const