Rhino C++ API  8.7
Public Member Functions | List of all members
CRhRdkContentFactory Class Referenceabstract

#include <RhRdkContentFactory.h>

Inheritance diagram for CRhRdkContentFactory:
CRhRdkExtension CRhRdkObject CRhRdkEnvironmentFactory CRhRdkMaterialFactory CRhRdkTextureFactory

Public Member Functions

 CRhRdkContentFactory ()
virtual ~CRhRdkContentFactory ()
virtual ON_wString ContentInternalName (void) const
virtual UUID ContentTypeId (void) const
virtual IRhRdkContentUIAgent * ContentUIAgent (void) const
virtual void * EVF (const wchar_t *wszFunc, void *pvData) override
virtual bool Initialize (void)
virtual UUID InterfaceId (void) const final override
virtual bool IsBuiltIn (void) const
virtual bool IsElevated (void) const
virtual bool IsKind (CRhRdkContent::Kinds kind) const
virtual CRhRdkContent::Kinds Kind (void) const =0
CRhRdkContentNewContent (bool bAutoGlobalRegister) const
virtual CRhRdkContentNewContent (void) const =0
virtual UUID PlugInId (void) const override
virtual void RebuildCache (void)
virtual UUID RenderEngineId (void) const
virtual void SetContentUIAgent (IRhRdkContentUIAgent *pAgent)
- Public Member Functions inherited from CRhRdkExtension
 CRhRdkExtension ()
virtual ~CRhRdkExtension ()
bool Unregister (void)
- 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 a factory for producing a certain type of content. You must create and implement a subclass for each content type that your renderer supports.

Content factories are RDK extensions. You usually add new content factories to the system when you are called on your implementation of CRhRdkPlugIn::RegisterExtensions(). If necessary, you can also add new factories later by calling RhRdkAddExtension(). Factories so added can be found again later by calling RhRdkContentFactories() which returns an IRhRdkContentFactories interface.

When you add a factory to the factory collection, a set of tests are performed on the factory before it is allowed to be added. The factory is only added if the following succeeds:

If these tests succeed, RDK takes ownership of the factory object and sends the OnFactoryAdded event. Otherwise, the factory is considered bad and is deleted.

Constructor & Destructor Documentation

◆ CRhRdkContentFactory()

CRhRdkContentFactory::CRhRdkContentFactory ( )

◆ ~CRhRdkContentFactory()

virtual CRhRdkContentFactory::~CRhRdkContentFactory ( )

Member Function Documentation

◆ ContentInternalName()

virtual ON_wString CRhRdkContentFactory::ContentInternalName ( void  ) const
The internal name of the content that this factory produces.

◆ ContentTypeId()

virtual UUID CRhRdkContentFactory::ContentTypeId ( void  ) const
The type id of the content that this factory produces.

◆ ContentUIAgent()

virtual IRhRdkContentUIAgent* CRhRdkContentFactory::ContentUIAgent ( void  ) const

◆ EVF()

virtual void* CRhRdkContentFactory::EVF ( const wchar_t *  wszFunc,
void *  pvData 

Emergency virtual function for future expansion.

Reimplemented from CRhRdkObject.

Reimplemented in CRhRdkTextureFactory.

◆ Initialize()

virtual bool CRhRdkContentFactory::Initialize ( void  )

Called by RDK to initialize the factory. If you override this method, please be sure to call the base class.

true if successful, else false.

◆ InterfaceId()

virtual UUID CRhRdkContentFactory::InterfaceId ( void  ) const

Returns the unique interface id of this extension.

Implements CRhRdkExtension.

◆ IsBuiltIn()

virtual bool CRhRdkContentFactory::IsBuiltIn ( void  ) const

◆ IsElevated()

virtual bool CRhRdkContentFactory::IsElevated ( void  ) const

If there are more than 5 types in the drop-down 'Type' list, the types are not listed and can only be accessed from the 'More Types...' option. 'Elevated' types will always appear in the list, even if there are more than 5. You should only elevate a few of your most commonly-used types.

See also
true if the content type that this factory produces is 'elevated'.

◆ IsKind()

virtual bool CRhRdkContentFactory::IsKind ( CRhRdkContent::Kinds  kind) const
true if the kind of content produced by this factory matches the input.

◆ Kind()

virtual CRhRdkContent::Kinds CRhRdkContentFactory::Kind ( void  ) const
pure virtual
The kind of content that this factory produces.

Implemented in CRhRdkTextureFactory, CRhRdkEnvironmentFactory, and CRhRdkMaterialFactory.

◆ NewContent() [1/2]

CRhRdkContent* CRhRdkContentFactory::NewContent ( bool  bAutoGlobalRegister) const

◆ NewContent() [2/2]

virtual CRhRdkContent* CRhRdkContentFactory::NewContent ( void  ) const
pure virtual

Create a new content.

This should be implemented simply as
return new CMyContent(...);
No further initialization or operations should be performed on the new content.
A pointer to a new instance of the content that this factory produces.

Implemented in CRhRdkTextureFactory, CRhRdkEnvironmentFactory, and CRhRdkMaterialFactory.

◆ PlugInId()

virtual UUID CRhRdkContentFactory::PlugInId ( void  ) const
The plug-in id of the plug-in that created this factory.

Implements CRhRdkExtension.

◆ RebuildCache()

virtual void CRhRdkContentFactory::RebuildCache ( void  )

Rebuild the factory cache. This forces a refresh of cached data such as the factory name.

◆ RenderEngineId()

virtual UUID CRhRdkContentFactory::RenderEngineId ( void  ) const
The render engine id of the content that this factory produces.

◆ SetContentUIAgent()

virtual void CRhRdkContentFactory::SetContentUIAgent ( IRhRdkContentUIAgent *  pAgent)