Rhino C++ API
8.13
|
#include <RhRdkContentField.h>
Classes | |
class | CChangeInfo |
Public Types | |
enum | : unsigned int { conv_none = 0x0000, conv_percentile = 0x0001, conv_one_minus = 0x0002, conv_radians = 0x0004 } |
typedef Filter | eFilter |
enum | Filter : unsigned int { None = 0x00, Serialization = 0x01, Harvesting = 0x02, Rendering = 0x04, All = 0xFF } |
Public Member Functions | |
CRhRdkContentField (CRhRdkContent &c, const wchar_t *wszInternalName, const wchar_t *wszFriendlyName, eFilter setFilter=All, eFilter getFilter=All, INT_PTR reserved=0) | |
CRhRdkContentField (CRhRdkContent &c, const wchar_t *wszInternalName, const wchar_t *wszLocalName, const wchar_t *wszEnglishName, Filter setFilter=All, Filter getFilter=All, int sectionId=0, bool bDynamic=false, INT_PTR reserved=0) | |
virtual | ~CRhRdkContentField () |
const void * | AsBuffer (size_t &sizeOut) const |
void * | AsPointer (void) const |
virtual CRhRdkContent & | Content (void) const |
virtual UINT | Conversion (void) const |
virtual CRhRdkVariant | ConvertFromDisplay (const CRhRdkVariant &v) const |
virtual CRhRdkVariant | ConvertToDisplay (const CRhRdkVariant &v) const |
virtual ON_wString | EnglishName (void) const |
virtual void * | EVF (const wchar_t *, void *) |
virtual RDK_DEPRECATED ON_wString | FriendlyName (void) const |
virtual Filter | GetFilter (void) const |
virtual bool | GetLimits (CRhRdkVariant &vMin, CRhRdkVariant &vMax) const |
virtual void | GetValueFromSection (const IRhRdk_XMLSection §ion) |
void | Initialize (const CRhRdkVariant &v) |
virtual ON_wString | InternalName (void) const |
bool | IsDynamic (void) const |
bool | IsHiddenInAutoUI (void) const |
virtual ON_wString | LocalName (void) const |
virtual CRhRdkContentField * | MakeCopy (CRhRdkContent &) const |
operator bool (void) const | |
operator const wchar_t * (void) const | |
operator CRhRdkColor (void) const | |
operator CRhRdkVariant (void) const | |
operator double (void) const | |
operator float (void) const | |
operator int (void) const | |
operator ON_2dVector (void) const | |
operator ON_3dVector (void) const | |
operator ON_4dPoint (void) const | |
operator ON_Color (void) const | |
operator ON_Xform (void) const | |
operator time_t (void) const | |
operator UUID (void) const | |
bool | operator!= (const CRhRdkContentField &v) const |
bool | operator< (const CRhRdkContentField &v) const |
const CRhRdkContentField & | operator= (bool b) |
const CRhRdkContentField & | operator= (const char *sz) |
const CRhRdkContentField & | operator= (const CRhRdkContentField &f) |
const CRhRdkContentField & | operator= (const CRhRdkVariant &v) |
const CRhRdkContentField & | operator= (const ON_2dVector &v) |
const CRhRdkContentField & | operator= (const ON_3dVector &v) |
const CRhRdkContentField & | operator= (const ON_4dPoint &p) |
const CRhRdkContentField & | operator= (const ON_Color &c) |
const CRhRdkContentField & | operator= (const ON_Xform &xform) |
const CRhRdkContentField & | operator= (const time_t &time) |
const CRhRdkContentField & | operator= (const UUID &uuid) |
const CRhRdkContentField & | operator= (const wchar_t *wsz) |
const CRhRdkContentField & | operator= (double d) |
const CRhRdkContentField & | operator= (float f) |
const CRhRdkContentField & | operator= (int i) |
const CRhRdkContentField & | operator= (void *p) |
bool | operator== (const CRhRdkContentField &v) const |
bool | operator> (const CRhRdkContentField &v) const |
virtual int | SectionId (void) const |
virtual void | SetConversion (UINT uFlags) |
virtual Filter | SetFilter (void) const |
void | SetIsHiddenInAutoUI (bool bHidden) |
virtual bool | SetLimits (const CRhRdkVariant &vMin, const CRhRdkVariant &vMax) |
virtual bool | SetValue (const CRhRdkVariant &vNewValue) |
virtual RDK_DEPRECATED bool | SetValue (const CRhRdkVariant &vNewValue, CRhRdkContent::eChangeContext cc) |
virtual void | SetValueToSection (IRhRdk_XMLSection §ion) const |
virtual ON_wString | UndoString (void) const |
virtual const CRhRdkVariant & | Value (void) const |
Protected Member Functions | |
CImpl & | Impl (void) const |
CRhRdkContentField * | NewField (CRhRdkContent &c) const |
Friends | |
class | CRhRdkContentFields |
class | CRhRdkDynamicContentFieldManager |
RDK content fields are essentially smart variants which have an internal name and local name and English name along with the usual variant data. By using fields to store your content's data items instead of using plain bools, floats and so on, you get automatic parameter undo support, support for transferring to and from IRhRdk_XMLSection and a few other features that should reduce the amount of work involved in implementing your content.
If you want to use fields to store your content's data items, you must make sure it overrides BitFlags() and sets the bfFields flag.
typedef Filter CRhRdkContentField::eFilter |
This constructor is deprecated in favor of the one below.
enum CRhRdkContentField::Filter : unsigned int |
CRhRdkContentField::CRhRdkContentField | ( | CRhRdkContent & | c, |
const wchar_t * | wszInternalName, | ||
const wchar_t * | wszFriendlyName, | ||
eFilter | setFilter = All , |
||
eFilter | getFilter = All , |
||
INT_PTR | reserved = 0 |
||
) |
CRhRdkContentField::CRhRdkContentField | ( | CRhRdkContent & | c, |
const wchar_t * | wszInternalName, | ||
const wchar_t * | wszLocalName, | ||
const wchar_t * | wszEnglishName, | ||
Filter | setFilter = All , |
||
Filter | getFilter = All , |
||
int | sectionId = 0 , |
||
bool | bDynamic = false , |
||
INT_PTR | reserved = 0 |
||
) |
Fields are always constructed the same way. After construction they are null and must be initialized to a type/value before use by using an assignment operator or the Initialize() method.
c | is the content that the field belongs to. |
wszInternalName | is the internal name of the field. Not localized. |
wszLocalName | is the localized user-friendly name of the field. |
wszEnglishName | is the English user-friendly name of the field. |
setFilter | is 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. |
getFilter | is 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. |
sectionId | is used for filtering fields between sections. Zero if not needed. |
bDynamic | indicates that this field is dynamic. |
reserved | is reserved for future use. Must be zero. |
|
virtual |
const void* CRhRdkContentField::AsBuffer | ( | size_t & | sizeOut | ) | const |
Retrieve the value as a buffer.
void* CRhRdkContentField::AsPointer | ( | void | ) | const |
Retrieve the value as a pointer.
|
virtual |
|
virtual |
Get the conversion that describes how the field should be displayed.
|
virtual |
Converts to a field value from a display value using the conversion.
|
virtual |
Converts from a field value to a display value using the conversion.
|
virtual |
|
virtual |
Emergency virtual function for future expansion.
Reimplemented in CRhRdkSolarContentField, CRhRdkFilenameContentField, CRhRdkTexturedContentField, and CRhRdkDynamicContentField.
|
virtual |
|
virtual |
The 'get filter' is a filter for use during CRhRdkContentFields::GetValuesFromSection(). The field is skipped if this filter does not match at least one item in the call's filter.
|
virtual |
Get the limits that the field value should be within.
vMin | accepts the minimum value. |
vMax | accepts the maximum value. |
|
virtual |
Get a value from a section into the field if the value, as specified by the field's internal name, is in the section. Does not create an undo record or call CRhRdkContent::Changed().
|
protected |
void CRhRdkContentField::Initialize | ( | const CRhRdkVariant & | v | ) |
Initialize the field's variant directly from a variant.
|
virtual |
bool CRhRdkContentField::IsDynamic | ( | void | ) | const |
Fields are traditionally static and embedded in the content as member variables. Static fields are created when the content is created and deleted when the content is deleted; they are owned by the content. Static fields are expected to exist when the content is created and they can load themselves from XML. Dynamic fields on the other hand do not exist until they are loaded, either from XML or by some other means (e.g., a content I/O plug-in), or until they are added by an override of Initialize(). Dynamic fields are owned by the CRhRdkContentFields collection.
bool CRhRdkContentField::IsHiddenInAutoUI | ( | void | ) | const |
When fields are used by the automatic UI, they can be hidden from it by calling SetIsHidden(). This method returns the hidden state for when the field is used in the automatic UI.
|
virtual |
|
virtual |
Return an exact copy of this field, with the same value and type.
Reimplemented in CRhRdkTexturedContentField, and CRhRdkDynamicContentField.
|
protected |
CRhRdkContentField::operator bool | ( | void | ) | const |
Retrieve the value as a boolean.
CRhRdkContentField::operator const wchar_t * | ( | void | ) | const |
Retrieve the value as a wide string.
CRhRdkContentField::operator CRhRdkColor | ( | void | ) | const |
Retrieve the value as a CRhRdkColor.
CRhRdkContentField::operator CRhRdkVariant | ( | void | ) | const |
Get the value of the field.
CRhRdkContentField::operator double | ( | void | ) | const |
Retrieve the value as a double.
CRhRdkContentField::operator float | ( | void | ) | const |
Retrieve the value as a float.
CRhRdkContentField::operator int | ( | void | ) | const |
Retrieve the value as an integer.
CRhRdkContentField::operator ON_2dVector | ( | void | ) | const |
Retrieve the value as a 2 dimensional vector.
CRhRdkContentField::operator ON_3dVector | ( | void | ) | const |
Retrieve the value as a 3 dimensional vector.
CRhRdkContentField::operator ON_4dPoint | ( | void | ) | const |
Retrieve the value as a 4 dimensional point..
CRhRdkContentField::operator ON_Xform | ( | void | ) | const |
Retrieve the value as a matrix.
CRhRdkContentField::operator time_t | ( | void | ) | const |
Retrieve the value as a time. Null or varying returns zero time.
CRhRdkContentField::operator UUID | ( | void | ) | const |
Retrieve the value as a UUID.
bool CRhRdkContentField::operator!= | ( | const CRhRdkContentField & | v | ) | const |
Inequality check.
bool CRhRdkContentField::operator< | ( | const CRhRdkContentField & | v | ) | const |
Less-than check.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | bool | b | ) |
Assign from a boolean.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const char * | sz | ) |
Assign from a string.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const CRhRdkContentField & | f | ) |
Copy the field value. The type must be null or the same as the type of 'f'.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const CRhRdkVariant & | v | ) |
Assign from another variant.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const ON_2dVector & | v | ) |
Assign from a 2 dimensional vector.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const ON_3dVector & | v | ) |
Assign from a 3 dimensional vector.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const ON_4dPoint & | p | ) |
Assign from a 4 dimensional point.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const ON_Color & | c | ) |
Assign from a color.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const ON_Xform & | xform | ) |
Assign from a matrix.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const time_t & | time | ) |
Assign from a time.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const UUID & | uuid | ) |
Assign from a UUID.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | const wchar_t * | wsz | ) |
Assign from a wide string.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | double | d | ) |
Assign from a double.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | float | f | ) |
Assign from a float.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | int | i | ) |
Assign from an integer.
const CRhRdkContentField& CRhRdkContentField::operator= | ( | void * | p | ) |
Assign from a pointer. The field treats the pointer as an opaque 32-bit value.
bool CRhRdkContentField::operator== | ( | const CRhRdkContentField & | v | ) | const |
Equality check.
bool CRhRdkContentField::operator> | ( | const CRhRdkContentField & | v | ) | const |
Greater-than check.
|
virtual |
Get the automatic UI section id for this field.
|
virtual |
Set the conversion that describes how the field should be displayed.
|
virtual |
The 'set filter' is a filter for use during CRhRdkContentFields::SetValuesToSection(). The field is skipped if this filter does not match at least one item in the call's filter.
void CRhRdkContentField::SetIsHiddenInAutoUI | ( | bool | bHidden | ) |
When fields are used by the automatic UI, they can be hidden from it by calling this method.
|
virtual |
Set the limits that the field value should be within.
vMin | is the minimum value. |
vMax | is the maximum value. |
|
virtual |
Set the value of the field. If the value changes, this may create an undo record and it will call CRhRdkContent::Changed() and return true. Otherwise it will return false.
vNewValue | is the value to set into the field. |
|
virtual |
This method is deprecated in favor of the one below.
|
virtual |
Set a value into a section using the field's internal name.
Reimplemented in CRhRdkFilenameContentField.
|
virtual |
|
virtual |
Reimplemented in CRhRdkFilenameContentField.
|
friend |
|
friend |