Rhino C++ API  8.6
Public Member Functions | Protected Member Functions | Friends | List of all members
CRhRdkContentFields Class Reference

#include <RhRdkContentField.h>

Public Member Functions

 CRhRdkContentFields (const CRhRdkContent &c)
 
virtual ~CRhRdkContentFields ()
 
virtual bool AddValuesToParamBlock (IRhRdkParamBlock &paramBlock, int sectionId, const wchar_t *wszExtraRequirementSet=nullptr) const
 
void BeginCreateDynamicFields (bool bAutomatic)
 
virtual CRhRdkContentContent (void) const
 
virtual int Count (void) const
 
bool CreateDynamicField (const wchar_t *wszInternalName, const wchar_t *wszLocalName, const wchar_t *wszEnglishName, const CRhRdkVariant &vValue, const CRhRdkVariant &vMinValue=CRhRdkVariant(), const CRhRdkVariant &vMaxValue=CRhRdkVariant(), CRhRdkContentField::Filter setFilter=CRhRdkContentField::Filter::All, CRhRdkContentField::Filter getFilter=CRhRdkContentField::Filter::All, int sectionId=0, INT_PTR reserved=0)
 
void EndCreateDynamicFields (void)
 
virtual void * EVF (const wchar_t *, void *)
 
virtual CRhRdkContentFieldField (int iIndex) const
 
virtual CRhRdkContentFieldFindField (const wchar_t *wszInternalName) const
 
ON__UINT32 GetFieldValueCRC (const CRhRdkContent::CRenderCRCFlags &rcrcFlags, CRhRdkContentField::Filter filter) const
 
virtual bool GetValuesFromParamBlock (const IRhRdkParamBlock &paramBlock, int sectionId)
 
virtual RDK_DEPRECATED bool GetValuesFromParamBlock (const IRhRdkParamBlock &paramBlock, int sectionId, CRhRdkContent::eChangeContext cc)
 
virtual bool GetValuesFromSection (const IRhRdk_XMLSection &section, CRhRdkContentField::Filter filter)
 
virtual RDK_DEPRECATED bool GetValuesFromSection (const IRhRdk_XMLSection &section, CRhRdkContentField::Filter filter, CRhRdkContent::eChangeContext cc)
 
CRhRdkContentFieldsoperator= (const CRhRdkContentFields &f)
 
virtual bool SetValuesToSection (IRhRdk_XMLSection &section, CRhRdkContentField::Filter filter) const
 

Protected Member Functions

virtual void Add (CRhRdkContentField *pField)
 
void Initialize (void)
 
virtual void Remove (CRhRdkContentField *pField)
 
virtual void Uninitialize (void)
 

Friends

class CRhRdkContent
 
class CRhRdkContentField
 

Detailed Description

A collection of fields. This object is created by the content when its Fields() method is called.

Constructor & Destructor Documentation

◆ CRhRdkContentFields()

CRhRdkContentFields::CRhRdkContentFields ( const CRhRdkContent c)

◆ ~CRhRdkContentFields()

virtual CRhRdkContentFields::~CRhRdkContentFields ( )
virtual

Member Function Documentation

◆ Add()

virtual void CRhRdkContentFields::Add ( CRhRdkContentField pField)
protectedvirtual

Add a field. Called automatically by the field constructor.

◆ AddValuesToParamBlock()

virtual bool CRhRdkContentFields::AddValuesToParamBlock ( IRhRdkParamBlock paramBlock,
int  sectionId,
const wchar_t *  wszExtraRequirementSet = nullptr 
) const
virtual

Add values to a param block from fields with the same internal name.

◆ BeginCreateDynamicFields()

void CRhRdkContentFields::BeginCreateDynamicFields ( bool  bAutomatic)

Automatic Dynamic Field support.

Dynamic fields are typically created in the override of CRhRdkContent::Initialize() and they are therefore created automatically whenever the content is created. However, some advanced users require the fields to be created in response to some user action which occurs much later than Initialize(). This creates the problem that the fields do not exist by default and therefore cannot be loaded when the document is loaded. These methods are provided to solve that problem by making it possible to automatically create the dynamic fields on loading if they don't already exist. Dynamic fields that have this auto-create-on-load behavior are referred to as automatic dynamic fields.

Note
Dynamic fields that do not require the advanced automatic feature can still be created by using these methods (recommended), or they can be created manually (legacy usage). You must call this before creating any dynamic fields. Calls to this method are counted; you must call EndCreateDynamicFields() once for every call to BeginCreateDynamicFields().
Parameters
bAutomaticspecifies if the dynamic fields are automatic. If so, they will be created automatically during loading of the document.

◆ Content()

virtual CRhRdkContent& CRhRdkContentFields::Content ( void  ) const
virtual
Returns
The content that this field collection belongs to.

◆ Count()

virtual int CRhRdkContentFields::Count ( void  ) const
virtual
Returns
The number of fields in the collection.

◆ CreateDynamicField()

bool CRhRdkContentFields::CreateDynamicField ( const wchar_t *  wszInternalName,
const wchar_t *  wszLocalName,
const wchar_t *  wszEnglishName,
const CRhRdkVariant vValue,
const CRhRdkVariant vMinValue = CRhRdkVariant(),
const CRhRdkVariant vMaxValue = CRhRdkVariant(),
CRhRdkContentField::Filter  setFilter = CRhRdkContentField::Filter::All,
CRhRdkContentField::Filter  getFilter = CRhRdkContentField::Filter::All,
int  sectionId = 0,
INT_PTR  reserved = 0 
)

Create a dynamic field with an initial value and min and max limits.

Parameters
wszInternalNameis the internal name of the field. Not localized.
wszLocalNameis the localized user-friendly name of the field.
wszEnglishNameis the English user-friendly name of the field.
vValueis the initial value of the field.
vMinValueis the minimum value of the field. Must be the same type as vValue.
vMaxValueis the maximum value of the field. Must be the same type as vValue.
setFilteris a filter for use during CRhRdkContentFields::SetValuesToSection(). The field is skipped if setFilter does not match at least one item in the call's filter.
getFilteris a filter for use during CRhRdkContentFields::GetValuesFromSection(). The field is skipped if getFilter does not match at least one item in the call's filter.
sectionIdis used for filtering fields between sections. Zero if not needed.
reservedis reserved for future use. Must be zero.

◆ EndCreateDynamicFields()

void CRhRdkContentFields::EndCreateDynamicFields ( void  )

You must call this after creating dynamic fields. Calls to this method are counted; you must call BeginCreateDynamicFields() once for every call to EndCreateDynamicFields().

◆ EVF()

virtual void* CRhRdkContentFields::EVF ( const wchar_t *  ,
void *   
)
virtual

Emergency virtual function for future expansion.

◆ Field()

virtual CRhRdkContentField* CRhRdkContentFields::Field ( int  iIndex) const
virtual

Get a field in the collection.

Parameters
iIndexis the index of the field. This must be 0 <= iIndex < Count().
Returns
The field at the required position or nullptr if the index is out of range.

◆ FindField()

virtual CRhRdkContentField* CRhRdkContentFields::FindField ( const wchar_t *  wszInternalName) const
virtual
Returns
A field in the collection found by its internal name.
Parameters
wszInternalNameis the name of the field to find.
Returns
The field with the specified name, or nullptr if the field does not exist.

◆ GetFieldValueCRC()

ON__UINT32 CRhRdkContentFields::GetFieldValueCRC ( const CRhRdkContent::CRenderCRCFlags rcrcFlags,
CRhRdkContentField::Filter  filter 
) const

Calculate the CRC of all fields that match a filter.

Parameters
filteris a filter to control which fields are considered.
Returns
The CRC. virtual

◆ GetValuesFromParamBlock() [1/2]

virtual bool CRhRdkContentFields::GetValuesFromParamBlock ( const IRhRdkParamBlock paramBlock,
int  sectionId 
)
virtual

Get values from a param block into fields with the same internal name.

◆ GetValuesFromParamBlock() [2/2]

virtual RDK_DEPRECATED bool CRhRdkContentFields::GetValuesFromParamBlock ( const IRhRdkParamBlock paramBlock,
int  sectionId,
CRhRdkContent::eChangeContext  cc 
)
virtual

This method is deprecated in favor of the one below.

◆ GetValuesFromSection() [1/2]

virtual bool CRhRdkContentFields::GetValuesFromSection ( const IRhRdk_XMLSection section,
CRhRdkContentField::Filter  filter 
)
virtual

Get values from a section into fields with the same internal name.

Parameters
sectionis the section to read values from.
filteris a filter to control which fields are modified.
Returns
true if at least one field was actually changed, else false.

◆ GetValuesFromSection() [2/2]

virtual RDK_DEPRECATED bool CRhRdkContentFields::GetValuesFromSection ( const IRhRdk_XMLSection section,
CRhRdkContentField::Filter  filter,
CRhRdkContent::eChangeContext  cc 
)
virtual

This method is deprecated in favor of the one below.

◆ Initialize()

void CRhRdkContentFields::Initialize ( void  )
protected

◆ operator=()

CRhRdkContentFields& CRhRdkContentFields::operator= ( const CRhRdkContentFields f)

◆ Remove()

virtual void CRhRdkContentFields::Remove ( CRhRdkContentField pField)
protectedvirtual

Remove a field. Called automatically by the field destructor.

◆ SetValuesToSection()

virtual bool CRhRdkContentFields::SetValuesToSection ( IRhRdk_XMLSection section,
CRhRdkContentField::Filter  filter 
) const
virtual

Set values into a section from fields with the same internal name.

Parameters
sectionis the section to write values to.
filteris a filter to control which fields are transferred to the section.
Returns
true. The return value is for future use only.

◆ Uninitialize()

virtual void CRhRdkContentFields::Uninitialize ( void  )
protectedvirtual

Friends And Related Function Documentation

◆ CRhRdkContent

friend class CRhRdkContent
friend

◆ CRhRdkContentField

friend class CRhRdkContentField
friend