Rhino C++ API  8.6
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 ( )
virtual

Member Function Documentation

◆ ContentInternalName()

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

◆ ContentTypeId()

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

◆ ContentUIAgent()

virtual IRhRdkContentUIAgent* CRhRdkContentFactory::ContentUIAgent ( void  ) const
virtual

◆ EVF()

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

Emergency virtual function for future expansion.

Reimplemented from CRhRdkObject.

Reimplemented in CRhRdkTextureFactory.

◆ Initialize()

virtual bool CRhRdkContentFactory::Initialize ( void  )
virtual

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

Returns
true if successful, else false.

◆ InterfaceId()

virtual UUID CRhRdkContentFactory::InterfaceId ( void  ) const
finaloverridevirtual

Returns the unique interface id of this extension.

Implements CRhRdkExtension.

◆ IsBuiltIn()

virtual bool CRhRdkContentFactory::IsBuiltIn ( void  ) const
inlinevirtual

◆ IsElevated()

virtual bool CRhRdkContentFactory::IsElevated ( void  ) const
virtual

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
CRhRdkRenderPlugIn::UiContentTypes.
Returns
true if the content type that this factory produces is 'elevated'.

◆ IsKind()

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

◆ Kind()

virtual CRhRdkContent::Kinds CRhRdkContentFactory::Kind ( void  ) const
pure virtual
Returns
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.

Note
This should be implemented simply as
return new CMyContent(...);
No further initialization or operations should be performed on the new content.
Returns
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
overridevirtual
Returns
The plug-in id of the plug-in that created this factory.

Implements CRhRdkExtension.

◆ RebuildCache()

virtual void CRhRdkContentFactory::RebuildCache ( void  )
virtual

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

◆ RenderEngineId()

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

◆ SetContentUIAgent()

virtual void CRhRdkContentFactory::SetContentUIAgent ( IRhRdkContentUIAgent *  pAgent)
virtual